OpenMD 3.1
Molecular Dynamics in the Open
|
Public Member Functions | |
AST (const AST &) | |
virtual const char * | typeName (void) const =0 |
Return the type name for this AST node. (for XML output) | |
virtual RefAST | clone (void) const =0 |
Clone this AST node. | |
virtual bool | equals (RefAST t) const =0 |
Is node t equal to this in terms of token type and text? | |
virtual bool | equalsList (RefAST t) const =0 |
Is t an exact structural and equals() match of this tree. | |
virtual bool | equalsListPartial (RefAST t) const =0 |
Is 't' a subtree of this list? The siblings of the root are NOT ignored. | |
virtual bool | equalsTree (RefAST t) const =0 |
Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored. | |
virtual bool | equalsTreePartial (RefAST t) const =0 |
Is 't' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored. | |
virtual std ::vector< RefAST > | findAll (RefAST t)=0 |
Walk the tree looking for all exact subtree matches. | |
virtual std ::vector< RefAST > | findAllPartial (RefAST t)=0 |
Walk the tree looking for all subtrees. | |
virtual void | addChild (RefAST c)=0 |
Add a node to the end of the child list for this node. | |
virtual size_t | getNumberOfChildren () const =0 |
Get the number of children. Returns 0 if the node is a leaf. | |
virtual RefAST | getFirstChild () const =0 |
Get the first child of this node; null if no children. | |
virtual RefAST | getNextSibling () const =0 |
Get the next sibling in line after this one. | |
virtual std::string | getText () const =0 |
Get the token text for this node. | |
virtual int | getType () const =0 |
Get the token type for this node. | |
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 |
virtual void | setFirstChild (RefAST c)=0 |
Set the first child of a node. | |
virtual void | setNextSibling (RefAST n)=0 |
Set the next sibling after this one. | |
virtual void | setText (const std ::string &txt)=0 |
Set the token text for this node. | |
virtual void | setType (int type)=0 |
Set the token type for this node. | |
virtual std::string | toString () const =0 |
Return this AST node as a string. | |
virtual std::string | toStringList () const =0 |
Print out a child-sibling tree in LISP notation. | |
virtual std::string | toStringTree () const =0 |
Friends | |
struct | ASTRef |
|
pure virtual |
Add a node to the end of the child list for this node.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Referenced by antlr::ASTFactory::makeASTRoot().
|
pure virtual |
Clone this AST node.
Implemented in antlr::ASTNULLType, antlr::BaseAST, antlr::CommonAST, and antlr::CommonASTWithHiddenTokens.
Referenced by antlr::ASTFactory::dup().
|
pure virtual |
Is node t equal to this in terms of token type and text?
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Referenced by antlr::BaseAST::equalsList(), and antlr::BaseAST::equalsListPartial().
|
pure virtual |
Is t an exact structural and equals() match of this tree.
The 'this' reference is considered the start of a sibling list.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Referenced by antlr::BaseAST::equalsList().
|
pure virtual |
Is 't' a subtree of this list? The siblings of the root are NOT ignored.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Referenced by antlr::BaseAST::equalsListPartial().
|
pure virtual |
Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
|
pure virtual |
Is 't' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Walk the tree looking for all exact subtree matches.
Return a vector of RefAST that lets the caller walk the list of subtree roots found herein.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Walk the tree looking for all subtrees.
Return a vector of RefAST that lets the caller walk the list of subtree roots found herein.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
|
pure virtual |
Get the first child of this node; null if no children.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Referenced by antlr::ASTFactory::dupTree(), antlr::BaseAST::equalsList(), antlr::BaseAST::equalsListPartial(), antlr::BaseAST::equalsTree(), antlr::BaseAST::equalsTreePartial(), and antlr::ASTFactory::make().
|
pure virtual |
Get the next sibling in line after this one.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Referenced by antlr::ASTPair::advanceChildToEnd(), antlr::ASTFactory::dupList(), antlr::BaseAST::equalsList(), antlr::BaseAST::equalsListPartial(), and antlr::ASTFactory::make().
|
pure virtual |
Get the number of children. Returns 0 if the node is a leaf.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
|
pure virtual |
Get the token text for this node.
Implemented in antlr::ASTNULLType, antlr::BaseAST, and antlr::CommonAST.
Referenced by antlr::BaseAST::equals(), and antlr::ASTPair::toString().
|
pure virtual |
Get the token type for this node.
Implemented in antlr::ASTNULLType, antlr::BaseAST, and antlr::CommonAST.
Referenced by antlr::ASTFactory::create(), antlr::BaseAST::equals(), and antlr::TreeParser::match().
|
pure virtual |
Various initialization routines.
Used by several factories to initialize an AST element.
Implemented in antlr::ASTNULLType, antlr::CommonAST, and antlr::CommonASTWithHiddenTokens.
Referenced by antlr::ASTFactory::create(), antlr::ASTFactory::create(), antlr::ASTFactory::create(), and antlr::ASTFactory::create().
|
pure virtual |
Set the first child of a node.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Referenced by antlr::ASTFactory::addASTChild(), antlr::ASTFactory::dupTree(), and antlr::ASTFactory::make().
|
pure virtual |
Set the next sibling after this one.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Referenced by antlr::ASTFactory::addASTChild(), antlr::ASTFactory::dupList(), and antlr::ASTFactory::make().
|
pure virtual |
Set the token text for this node.
Implemented in antlr::ASTNULLType, antlr::BaseAST, and antlr::CommonAST.
|
pure virtual |
Set the token type for this node.
Implemented in antlr::ASTNULLType, antlr::BaseAST, and antlr::CommonAST.
Referenced by antlr::ASTFactory::create().
|
pure virtual |
Return this AST node as a string.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
|
pure virtual |
Print out a child-sibling tree in LISP notation.
Implemented in antlr::ASTNULLType, and antlr::BaseAST.
Referenced by antlr::BaseAST::toStringList().
|
pure virtual |
Return the type name for this AST node. (for XML output)
Implemented in antlr::ASTNULLType, antlr::BaseAST, antlr::CommonAST, and antlr::CommonASTWithHiddenTokens.