OpenMD 3.1
Molecular Dynamics in the Open
|
Public Member Functions | |
BaseAST (const BaseAST &other) | |
virtual const char * | typeName (void) const =0 |
Return the class name. | |
virtual RefAST | clone (void) const =0 |
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 size_t | getNumberOfChildren () const |
Get the number of child nodes of this node (shallow e.g. | |
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. | |
virtual void | setNextSibling (RefAST n) |
Set the next sibling after this one. | |
virtual void | setText (const std ::string &) |
Set the token text for this node. | |
virtual void | setType (int) |
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 |
Public Member Functions inherited from antlr::AST | |
AST (const AST &) | |
virtual void | initialize (int t, const std ::string &txt)=0 |
Various initialization routines. | |
virtual void | initialize (RefAST t)=0 |
virtual void | initialize (RefToken t)=0 |
Protected Attributes | |
RefBaseAST | down |
RefBaseAST | right |
Definition at line 23 of file BaseAST.hpp.
|
inline |
Definition at line 25 of file BaseAST.hpp.
|
inline |
Definition at line 28 of file BaseAST.hpp.
|
inlinevirtual |
Definition at line 32 of file BaseAST.hpp.
|
inlinevirtual |
Add a node to the end of the child list for this node.
Implements antlr::AST.
Definition at line 77 of file BaseAST.hpp.
|
pure virtual |
Clone this AST node.
Implements antlr::AST.
Implemented in antlr::CommonAST, and antlr::CommonASTWithHiddenTokens.
|
inlinevirtual |
Is node t equal to this in terms of token type and text?
Implements antlr::AST.
Definition at line 182 of file BaseAST.hpp.
References antlr::AST::getText(), getText(), antlr::AST::getType(), and getType().
Referenced by equalsTree(), and equalsTreePartial().
|
virtual |
Is t an exact structural and equals() match of this tree.
The 'this' reference is considered the start of a sibling list.
Implements antlr::AST.
Definition at line 60 of file BaseAST.cpp.
References antlr::AST::equals(), antlr::AST::equalsList(), antlr::AST::getFirstChild(), and antlr::AST::getNextSibling().
Referenced by equalsTree().
|
virtual |
Is 't' a subtree of this list? The siblings of the root are NOT ignored.
Is 'sub' a subtree of this list? The siblings of the root are NOT ignored.
Implements antlr::AST.
Definition at line 93 of file BaseAST.cpp.
References antlr::AST::equals(), antlr::AST::equalsListPartial(), antlr::AST::getFirstChild(), and antlr::AST::getNextSibling().
Referenced by equalsTreePartial().
|
virtual |
Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.
Implements antlr::AST.
Definition at line 123 of file BaseAST.cpp.
References equals(), equalsList(), antlr::AST::getFirstChild(), and getFirstChild().
|
virtual |
Is 't' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored.
Is 'sub' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored.
Implements antlr::AST.
Definition at line 143 of file BaseAST.cpp.
References equals(), equalsListPartial(), antlr::AST::getFirstChild(), and getFirstChild().
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 antlr::AST.
Definition at line 164 of file BaseAST.cpp.
Walk the tree looking for all subtrees.
Return an ASTEnumerator that lets the caller walk the list of subtree roots found herein.
Implements antlr::AST.
Definition at line 180 of file BaseAST.cpp.
|
inlinevirtual |
Get the first child of this node; null if no children.
Implements antlr::AST.
Definition at line 100 of file BaseAST.hpp.
Referenced by equalsTree(), equalsTreePartial(), and toStringList().
|
inlinevirtual |
Get the next sibling in line after this one.
Implements antlr::AST.
Definition at line 105 of file BaseAST.hpp.
Referenced by toStringList().
|
virtual |
Get the number of child nodes of this node (shallow e.g.
not of the whole tree it spans).
Implements antlr::AST.
Definition at line 20 of file BaseAST.cpp.
|
inlinevirtual |
Get the token text for this node.
Implements antlr::AST.
Reimplemented in antlr::CommonAST.
Definition at line 111 of file BaseAST.hpp.
Referenced by equals().
|
inlinevirtual |
Get the token type for this node.
Implements antlr::AST.
Reimplemented in antlr::CommonAST.
Definition at line 116 of file BaseAST.hpp.
Referenced by equals().
|
inlinevirtual |
Remove all children.
Definition at line 122 of file BaseAST.hpp.
|
inlinevirtual |
|
inlinevirtual |
Set the next sibling after this one.
Implements antlr::AST.
Definition at line 134 of file BaseAST.hpp.
|
inlinevirtual |
Set the token text for this node.
Implements antlr::AST.
Reimplemented in antlr::CommonAST.
Definition at line 140 of file BaseAST.hpp.
|
inlinevirtual |
Set the token type for this node.
Implements antlr::AST.
Reimplemented in antlr::CommonAST.
Definition at line 145 of file BaseAST.hpp.
|
inlinevirtual |
Return string representation for the AST.
Implements antlr::AST.
Definition at line 163 of file BaseAST.hpp.
Referenced by toStringList().
|
virtual |
Print out a child sibling tree in LISP notation.
Implements antlr::AST.
Definition at line 191 of file BaseAST.cpp.
References getFirstChild(), getNextSibling(), toString(), and antlr::AST::toStringList().
|
virtual |
Implements antlr::AST.
Definition at line 214 of file BaseAST.cpp.
|
pure virtual |
Return the class name.
Implements antlr::AST.
Implemented in antlr::CommonAST, and antlr::CommonASTWithHiddenTokens.
|
protected |
Definition at line 172 of file BaseAST.hpp.
|
protected |
Definition at line 173 of file BaseAST.hpp.