2014-02-11 01:47:39 +00:00
|
|
|
|
package mycompiler;
|
|
|
|
|
|
2014-02-11 15:30:38 +00:00
|
|
|
|
import java.util.Vector;
|
|
|
|
|
|
2014-02-12 01:12:12 +00:00
|
|
|
|
public abstract class SyntaxTreeNode {
|
|
|
|
|
|
|
|
|
|
private SyntaxTreeNode parent;
|
2014-02-11 01:47:39 +00:00
|
|
|
|
|
2014-02-11 15:30:38 +00:00
|
|
|
|
/**
|
|
|
|
|
* Wird nach dem Parsen aufgerufen.
|
|
|
|
|
* Erf<EFBFBD>llt folgenden Aufgaben:
|
|
|
|
|
* 1. F<EFBFBD>llt fehlende Typangaben mit TPHs auf.
|
|
|
|
|
* 2. Verkn<EFBFBD>pft die Knoten des Syntaxbaums. (setzt Parent)
|
|
|
|
|
*
|
|
|
|
|
*/
|
2014-02-12 01:12:12 +00:00
|
|
|
|
public void parserPostProcessing(SyntaxTreeNode parent) {
|
|
|
|
|
this.parent = parent;
|
|
|
|
|
for(SyntaxTreeNode node : this.getChildren())node.parserPostProcessing(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SyntaxTreeNode getParent() {
|
|
|
|
|
return this.parent;
|
|
|
|
|
}
|
2014-02-11 15:30:38 +00:00
|
|
|
|
|
2014-02-12 01:12:12 +00:00
|
|
|
|
public Vector<SyntaxTreeNode> getChildren(){
|
|
|
|
|
return new Vector<SyntaxTreeNode>();
|
|
|
|
|
}
|
2014-02-11 01:47:39 +00:00
|
|
|
|
}
|