#include <autotoolsast.h>

Public Types | |
enum | NodeType { ProjectAST, AssignmentAST, TargetAST, MakefileConditionalAST, NewLineAST, CommentAST } |
Public Member Functions | |
AST (NodeType nodeType) | |
virtual void | addChildAST (AST *node) |
virtual void | writeBack (TQString &buffer) |
virtual NodeType | nodeType () const |
void | setDepth (int depth) |
int | depth () const |
virtual TQString | indentation () |
bool | hasChildren () const |
TQValueList< AST * > | children () const |
Protected Attributes | |
NodeType | m_nodeType |
TQValueList< AST * > | m_children |
Detailed Description
AST node.
This is the base class. Objects of this type are not created by the parser.
Each AST node holds the list of its children which are always deleted in the destructor. This way, it's possible call delete for only root AST node and others will be deleted automatically.
Each AST node also knows how to write the information back into .pro file.
Definition at line 46 of file autotoolsast.h.
Member Enumeration Documentation
◆ NodeType
Type of AST node.
Definition at line 50 of file autotoolsast.h.
Constructor & Destructor Documentation
◆ AST()
|
inline |
Constructs AST with given node type.
Definition at line 60 of file autotoolsast.h.
Member Function Documentation
◆ addChildAST()
|
virtual |
Adds child AST node to this node.
Despite this function is virtual, reimplementations should call it to make automatic destruction of AST tree possible.
Reimplemented in AutoTools::ProjectAST.
Definition at line 38 of file autotoolsast.cpp.
◆ children()
TQValueList< AST * > AutoTools::AST::children | ( | ) | const |
Get the children of this ast.
- Returns
- the list of this ast's childre
Definition at line 66 of file autotoolsast.cpp.
◆ depth()
|
inline |
- Returns
- The depth of the node in AST.
Definition at line 83 of file autotoolsast.h.
◆ hasChildren()
bool AutoTools::AST::hasChildren | ( | ) | const |
- Returns
- true if this AST has children
Definition at line 61 of file autotoolsast.cpp.
◆ indentation()
|
virtual |
- Returns
- The indentation string based on node depth.
Definition at line 53 of file autotoolsast.cpp.
◆ nodeType()
|
inlinevirtual |
- Returns
- The type of the node.
Definition at line 77 of file autotoolsast.h.
◆ setDepth()
|
inline |
Sets the depth of the node in AST.
Definition at line 80 of file autotoolsast.h.
◆ writeBack()
|
virtual |
Writes information stored in the AST into the buffer
.
This is a default implementation which iterates over child nodes and calls writeBack for each child node.
Reimplemented in AutoTools::CommentAST, AutoTools::NewLineAST, AutoTools::AssignmentAST, and AutoTools::ProjectAST.
Definition at line 43 of file autotoolsast.cpp.
The documentation for this class was generated from the following files: