#include <qmakeast.h>

Public Types | |
enum | NodeType { ProjectAST, AssignmentAST, NewLineAST, CommentAST, IncludeAST, OrOperatorAST } |
Public Member Functions | |
AST (NodeType nodeType) | |
virtual void | addChildAST (AST *node) |
virtual void | removeChildAST (AST *node) |
virtual void | writeBack (TQString &buffer) |
virtual NodeType | nodeType () const |
void | setDepth (int depth) |
int | depth () const |
virtual TQString | indentation () |
Public Attributes | |
TQValueList< AST * > | m_children |
Protected Attributes | |
NodeType | m_nodeType |
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 42 of file qmakeast.h.
Member Enumeration Documentation
◆ NodeType
Type of AST node.
Enumerator | |
---|---|
ProjectAST | Project, scope or function scope. |
AssignmentAST | Variable assignment. |
NewLineAST | Line feed. |
CommentAST | Comment. |
IncludeAST | .pri include. |
Definition at line 45 of file qmakeast.h.
Constructor & Destructor Documentation
◆ AST()
|
inline |
Constructs AST with given node type.
Definition at line 55 of file qmakeast.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.
Definition at line 38 of file qmakeast.cpp.
◆ depth()
|
inline |
- Returns
- The depth of the node in AST.
Definition at line 77 of file qmakeast.h.
◆ indentation()
|
virtual |
- Returns
- The indentation string based on node depth.
Definition at line 60 of file qmakeast.cpp.
◆ nodeType()
|
inlinevirtual |
- Returns
- The type of the node.
Definition at line 72 of file qmakeast.h.
◆ removeChildAST()
|
virtual |
Removes child AST node from this node.
Despite this function is virtual, reimplementations should call it to make automatic destruction of AST tree possible.
Definition at line 43 of file qmakeast.cpp.
◆ setDepth()
|
inline |
Sets the depth of the node in AST.
Definition at line 75 of file qmakeast.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 TQMake::IncludeAST, TQMake::CommentAST, TQMake::NewLineAST, TQMake::AssignmentAST, and TQMake::ProjectAST.
Definition at line 48 of file qmakeast.cpp.
Member Data Documentation
◆ m_children
TQValueList<AST*> TQMake::AST::m_children |
The list of child AST nodes.
Definition at line 82 of file qmakeast.h.
The documentation for this class was generated from the following files: