language/codegen
KDevelop::AstChangeSet< AstNode > Class Template Reference
A set of changes to an AST. More...
#include <astchangeset.h>
Public Member Functions | |
| AstChangeSet (const AstNode *topNode=0) | |
| virtual | ~AstChangeSet () |
| AstNodeRef< AstNode > * | copyNode (AstNode *source) |
| AstNodeRef< AstNode > * | registerNewNode (AstNode *node) |
| AstNodeRef< AstNode > * | registerNewRef (AstNodeRef< AstNode > *ref) |
Detailed Description
template<typename AstNode>
class KDevelop::AstChangeSet< AstNode >
A set of changes to an AST.
This class holds a set of all changes to an AST.
Definition at line 178 of file astchangeset.h.
Constructor & Destructor Documentation
| KDevelop::AstChangeSet< AstNode >::AstChangeSet | ( | const AstNode * | topNode = 0 |
) | [inline] |
Constructor.
- Parameters:
-
topNode the top node of the read-only Ast to modify, or set to null if creating a new Ast from scratch.
Definition at line 187 of file astchangeset.h.
| virtual KDevelop::AstChangeSet< AstNode >::~AstChangeSet | ( | ) | [inline, virtual] |
Destructor, deletes all nodes owned by this change set.
Definition at line 195 of file astchangeset.h.
Member Function Documentation
| AstNodeRef<AstNode>* KDevelop::AstChangeSet< AstNode >::copyNode | ( | AstNode * | source | ) | [inline] |
Copy an existing node (whether from the Ast or from the change set).
You may then modify this reference, and the modifications will be applied to the node when the change set is finalised.
- Returns:
- a copy of source, which you may modify directly.
Definition at line 235 of file astchangeset.h.
| AstNodeRef<AstNode>* KDevelop::AstChangeSet< AstNode >::registerNewNode | ( | AstNode * | node | ) | [inline] |
Register a new node that you have created to insert at some point in this Ast.
You may modify this node directly. The change set takes ownership, so that the new node will be deleted when the change set is no longer needed.
- Returns:
- the new node that has been registered.
Definition at line 207 of file astchangeset.h.
| AstNodeRef<AstNode>* KDevelop::AstChangeSet< AstNode >::registerNewRef | ( | AstNodeRef< AstNode > * | ref | ) | [inline] |
Create a blank reference to a node.
The change set takes ownership, so that the new node will be deleted when the change set is no longer needed.
- Returns:
- the new node reference
Definition at line 222 of file astchangeset.h.
The documentation for this class was generated from the following file:
KDE 4.4 API Reference