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


Public Types | |
typedef std::auto_ptr< AST > | Node |
enum | { Type = NodeType_Generic } |
Public Member Functions | |
AST () | |
AST (const AST &other) | |
virtual | ~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 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 |
AST () | |
virtual | ~AST () |
int | nodeType () const |
void | setNodeType (int nodeType) |
AST * | parent () |
void | setParent (AST *parent) |
void | setStartPosition (int line, int col) |
void | getStartPosition (int *line, int *col) const |
void | setEndPosition (int line, int col) |
void | getEndPosition (int *line, int *col) const |
QPtrList< AST > | children () |
void | appendChild (AST *child) |
void | removeChild (AST *child) |
virtual QString | text () const |
void | setSlice (const Slice &slice) |
void | setSlice (const QString &text, int position, int length) |
void | setText (const QString &text) |
Private Member Functions | |
AST (RefAST other) | |
AST & | operator= (const AST &other) |
AST & | operator= (RefAST other) |
AST (const AST &source) | |
void | operator= (const AST &source) |
Private Attributes | |
ASTRef * | ref |
int | m_nodeType |
AST * | m_parent |
int | m_startLine |
int | m_startColumn |
int | m_endLine |
int | m_endColumn |
Slice | m_slice |
QPtrList< AST > | m_children |
Friends | |
struct | ASTRef |
Member Typedef Documentation
|
Member Enumeration Documentation
|
|
Constructor & Destructor Documentation
|
Definition at line 25 of file AST.hpp. References ref. |
|
Definition at line 26 of file AST.hpp. References ref. |
|
|
|
|
|
|
|
|
|
|
Member Function Documentation
|
Add a node to the end of the child list for this node.
Implemented in ASTNULLType, and BaseAST. |
|
Definition at line 189 of file ast.cpp. References m_children. Referenced by setParent(). |
|
Definition at line 235 of file ast.h. Referenced by findNodeAt(). |
|
Clone this AST node.
Implemented in ASTNULLType, BaseAST, CommonAST, and CommonASTWithHiddenTokens. |
|
Is node t equal to this in terms of token type and text?
Implemented in ASTNULLType, and BaseAST. |
|
Is t an exact structural and equals() match of this tree. The 'this' reference is considered the start of a sibling list. Implemented in ASTNULLType, and BaseAST. |
|
Is 't' a subtree of this list? The siblings of the root are NOT ignored.
Implemented in ASTNULLType, and BaseAST. |
|
Is tree rooted at 'this' equal to 't'? The siblings of 'this' are ignored.
Implemented in ASTNULLType, and BaseAST. |
|
Is 't' a subtree of the tree rooted at 'this'? The siblings of 'this' are ignored.
Implemented in ASTNULLType, and 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 ASTNULLType, and 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 ASTNULLType, and BaseAST. |
|
|
Get the first child of this node; null if no children.
Implemented in ASTNULLType, and BaseAST. |
|
Get the next sibling in line after this one.
Implemented in ASTNULLType, and BaseAST. |
|
|
Get the token text for this node.
Implemented in ASTNULLType, BaseAST, and CommonAST. Referenced by BaseAST::equals(). |
|
Get the token type for this node.
Implemented in ASTNULLType, BaseAST, and CommonAST. Referenced by BaseAST::equals(). |
|
Implemented in ASTNULLType, CommonAST, and CommonASTWithHiddenTokens. |
|
Implemented in ASTNULLType, CommonAST, and CommonASTWithHiddenTokens. |
|
Various initialization routines. Used by several factories to initialize an AST element. Implemented in ASTNULLType, CommonAST, and CommonASTWithHiddenTokens. |
|
|
|
|
|
|
|
|
Definition at line 225 of file ast.h. Referenced by CppCodeCompletion::functionDefinition(), CppSupportPart::MakeMemberHelper(), scopeOfNode(), and CppSupportPart::slotNeedTextHint(). |
|
Definition at line 194 of file ast.cpp. References m_children. Referenced by setParent(). |
|
Definition at line 158 of file ast.cpp. References m_endColumn, and m_endLine. |
|
Set the first child of a node.
Implemented in ASTNULLType, and BaseAST. |
|
Set the next sibling after this one.
Implemented in ASTNULLType, and BaseAST. |
|
|
|
Definition at line 173 of file ast.cpp. References appendChild(), m_parent, and removeChild(). |
|
Definition at line 246 of file ast.h. References Slice::source. |
|
|
|
Definition at line 143 of file ast.cpp. References m_startColumn, and m_startLine. |
|
Definition at line 253 of file ast.h. References text(). |
|
Set the token text for this node.
Implemented in ASTNULLType, BaseAST, and CommonAST. |
|
Set the token type for this node.
Implemented in ASTNULLType, BaseAST, and CommonAST. |
|
|
Return this AST node as a string.
Implemented in ASTNULLType, and BaseAST. |
|
Print out a child-sibling tree in LISP notation.
Implemented in ASTNULLType, and BaseAST. |
|
Implemented in ASTNULLType, and BaseAST. |
|
Return the type name for this AST node. (for XML output).
Implemented in ASTNULLType, BaseAST, CommonAST, CommonASTWithHiddenTokens, and UsingAST. |
Friends And Related Function Documentation
|
|
Member Data Documentation
|
Definition at line 263 of file ast.h. Referenced by appendChild(), and removeChild(). |
|
Definition at line 260 of file ast.h. Referenced by setEndPosition(). |
|
Definition at line 260 of file ast.h. Referenced by setEndPosition(). |
|
|
|
Definition at line 258 of file ast.h. Referenced by setParent(). |
|
|
|
Definition at line 259 of file ast.h. Referenced by setStartPosition(). |
|
Definition at line 259 of file ast.h. Referenced by setStartPosition(). |
|
Definition at line 132 of file AST.hpp. Referenced by AST(), ASTRef::ASTRef(), and ASTRef::getRef(). |
The documentation for this class was generated from the following files: