BaseAST Class Reference
#include <BaseAST.hpp>
Inheritance diagram for BaseAST:

Public Member Functions | |
BaseAST () | |
BaseAST (const BaseAST &other) | |
virtual | ~BaseAST () |
virtual const char * | typeName (void) const |
Return the class name. | |
virtual RefAST | clone (void) const |
Clone this AST node. | |
virtual bool | equals (RefAST t) const |
Is node t equal to this in terms of token type and text? | |
virtual bool | equalsList (RefAST t) const |
Is t an exact structural and equals() match of this tree. | |
virtual bool | equalsListPartial (RefAST t) const |
Is 't' a subtree of this list? The siblings of the root are NOT ignored. | |
virtual bool | equalsTree (RefAST t) const |
Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored. | |
virtual bool | equalsTreePartial (RefAST t) const |
Is 't' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored. | |
virtual std::vector< RefAST > | findAll (RefAST t) |
Walk the tree looking for all exact subtree matches. | |
virtual std::vector< RefAST > | findAllPartial (RefAST t) |
Walk the tree looking for all subtrees. | |
virtual void | addChild (RefAST c) |
Add a node to the end of the child list for this node. | |
virtual RefAST | getFirstChild () const |
Get the first child of this node; null if no children. | |
virtual RefAST | getNextSibling () const |
Get the next sibling in line after this one. | |
virtual std::string | getText () const |
Get the token text for this node. | |
virtual int | getType () const |
Get the token type for this node. | |
virtual void | removeChildren () |
Remove all children. | |
virtual void | setFirstChild (RefAST c) |
Set the first child of a node. | |
void | setNextSibling (RefAST n) |
Set the next sibling after this one. | |
virtual void | setText (const std::string &txt) |
Set the token text for this node. | |
virtual void | setType (int type) |
Set the token type for this node. | |
virtual std::string | toString () const |
Return string representation for the AST. | |
virtual std::string | toStringList () const |
Print out a child sibling tree in LISP notation. | |
virtual std::string | toStringTree () const |
Protected Attributes | |
RefBaseAST | down |
RefBaseAST | right |
Private Member Functions | |
void | doWorkForFindAll (std::vector< RefAST > &v, RefAST target, bool partialMatch) |
Constructor & Destructor Documentation
|
Definition at line 23 of file BaseAST.cpp. |
|
Definition at line 31 of file BaseAST.cpp. |
|
Definition at line 27 of file BaseAST.cpp. |
Member Function Documentation
|
Add a node to the end of the child list for this node.
Implements AST. Definition at line 47 of file BaseAST.cpp. References addChild(), and down. Referenced by addChild(). |
|
Clone this AST node.
Implements AST. Reimplemented in CommonAST, and CommonASTWithHiddenTokens. Definition at line 41 of file BaseAST.cpp. |
|
Definition at line 64 of file BaseAST.cpp. References doWorkForFindAll(), and RefBaseAST. Referenced by doWorkForFindAll(). |
|
Is node t equal to this in terms of token type and text?
Implements AST. Definition at line 147 of file BaseAST.hpp. Referenced by equalsTree(), and equalsTreePartial(). |
|
Is t an exact structural and equals() match of this tree. The 'this' reference is considered the start of a sibling list. Implements AST. Definition at line 87 of file BaseAST.cpp. References equalsList(). Referenced by equalsList(). |
|
Is 't' a subtree of this list? The siblings of the root are NOT ignored.
Implements AST. Definition at line 120 of file BaseAST.cpp. References equalsListPartial(). Referenced by equalsListPartial(). |
|
Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.
Implements AST. Definition at line 150 of file BaseAST.cpp. References equals(), equalsTree(), and getFirstChild(). Referenced by equalsTree(). |
|
Is 't' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored.
Implements AST. Definition at line 170 of file BaseAST.cpp. References equals(), equalsTreePartial(), and getFirstChild(). Referenced by equalsTreePartial(). |
|
Walk the tree looking for all exact subtree matches. Return an ASTEnumerator that lets the caller walk the list of subtree roots found herein. Implements AST. Definition at line 191 of file BaseAST.cpp. References ANTLR_USE_NAMESPACE. |
|
Walk the tree looking for all subtrees. Return an ASTEnumerator that lets the caller walk the list of subtree roots found herein. Implements AST. Definition at line 207 of file BaseAST.cpp. References ANTLR_USE_NAMESPACE. |
|
Get the first child of this node; null if no children.
Implements AST. Definition at line 71 of file BaseAST.hpp. References RefAST. Referenced by equalsTree(), and equalsTreePartial(). |
|
Get the next sibling in line after this one.
Implements AST. Definition at line 76 of file BaseAST.hpp. References RefAST. |
|
Get the token text for this node.
Implements AST. Reimplemented in CommonAST. Definition at line 82 of file BaseAST.hpp. |
|
Get the token type for this node.
Implements AST. Reimplemented in CommonAST. Definition at line 87 of file BaseAST.hpp. |
|
Remove all children.
Definition at line 93 of file BaseAST.hpp. References nullAST. |
|
Set the first child of a node.
Implements AST. Definition at line 99 of file BaseAST.hpp. |
|
Set the next sibling after this one.
Implements AST. Definition at line 105 of file BaseAST.hpp. |
|
Set the token text for this node.
Implements AST. Reimplemented in CommonAST. Definition at line 218 of file BaseAST.cpp. References setText(). Referenced by setText(). |
|
Set the token type for this node.
Implements AST. Reimplemented in CommonAST. Definition at line 222 of file BaseAST.cpp. References setType(). Referenced by setType(). |
|
Return string representation for the AST.
Implements AST. Definition at line 226 of file BaseAST.cpp. |
|
Print out a child sibling tree in LISP notation.
Implements AST. Definition at line 231 of file BaseAST.cpp. References ANTLR_USE_NAMESPACE. |
|
Implements AST. Definition at line 254 of file BaseAST.cpp. References ANTLR_USE_NAMESPACE. |
|
Return the class name.
Implements AST. Reimplemented in CommonAST, and CommonASTWithHiddenTokens. Definition at line 36 of file BaseAST.cpp. |
Member Data Documentation
|
Definition at line 137 of file BaseAST.hpp. Referenced by addChild(). |
|
Definition at line 138 of file BaseAST.hpp. |
The documentation for this class was generated from the following files:
- lib/antlr/antlr/BaseAST.hpp
- lib/antlr/src/BaseAST.cpp