|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The ParseTree class presents for the node of parse tree. This may be a token node, Leaf, or may be a nonterminal node, NonLeaf.
Leaf
,
NonLeaf
Method Summary | |
void |
accept(ParseTreeVisitor visitor)
Accepts a ParseTreeVisitor object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern. |
void |
childrenAccept(ParseTreeVisitor visitor)
Accepts a ParseTreeVisitor object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern. |
boolean |
eq(ParseTree p)
Tests if this parse-tree-node's value equals to the specified ptree-node's. |
boolean |
equals(ParseTree p)
Tests if this parse-tree-node's value equals to the specified ptree-node's. |
int |
getObjectID()
Returns the Identifier Number of this object |
ParseTree |
makeCopy()
Makes a new copy of this nonleaf-node as a ptree-node. |
ParseTree |
makeRecursiveCopy()
Makes a new copy (another object) of this nonleaf-node recursively. |
void |
replace(ParseTree replacement)
|
String |
toFlattenString()
Generates the string expression from this node. |
String |
toString()
Generates string which presents for this parse-tree |
void |
writeCode()
Deprecated. |
Method Detail |
public void replace(ParseTree replacement) throws ParseTreeException
ParseTreeException
public ParseTree makeRecursiveCopy()
public ParseTree makeCopy()
public boolean equals(ParseTree p)
public boolean eq(ParseTree p)
public String toString()
toString
in class Object
public void writeCode()
public String toFlattenString()
This method is useful to embed ptree objects as a string literal in source code.
public int getObjectID()
public void accept(ParseTreeVisitor visitor) throws ParseTreeException
ParseTreeVisitor
object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern.
This invoke an appropriate visit()
method on the
accepted visitor.
visitor
- a visitor
ParseTreeException
public void childrenAccept(ParseTreeVisitor visitor) throws ParseTreeException
ParseTreeVisitor
object as the role of a
Visitor in the Visitor pattern, as the role of an Element in the
Visitor pattern.
This invoke an appropriate visit()
method on each
child ParseTree
object with this visitor.
visitor
- a visitor
ParseTreeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |