Pegmatite
|
type of ast member vector. More...
#include <ast.hh>
Public Member Functions | |
ASTContainer () | |
Constructs the container, setting a thread-local value to point to it allowing constructors in fields of the subclass to register themselves in the members vector. | |
virtual void | construct (const InputRange &r, ASTStack &st) |
Asks all members to construct themselves from the stack. More... | |
Public Member Functions inherited from pegmatite::ASTNode | |
ASTNode () | |
Constructs the AST node, with a null parent. | |
ASTNode (const ASTNode &)=delete | |
Copying AST nodes is not supported. | |
virtual | ~ASTNode () |
Destructor does nothing, virtual for subclasses to use. More... | |
ASTNode * | parent () const |
Returns the parent of this AST node, or nullptr if there isn't one (either if this is the root, or if it is still in the stack waiting to be added to the tree). | |
virtual bool | isa (char *x) |
Root implementation of the RTTI-replacement for builds not wishing to use RTTI. More... | |
template<class T > | |
bool | isa () |
Returns true if this object is an instance of T . More... | |
template<class T > | |
T * | get_as () |
Returns a pointer to this object as a pointer to a child class, or nullptr if the cast would be unsafe. More... | |
Friends | |
class | ASTMember |
Additional Inherited Members | |
Protected Member Functions inherited from pegmatite::ASTNode | |
virtual char * | kind () |
Returns the kind of object class. More... | |
Static Protected Member Functions inherited from pegmatite::ASTNode | |
static char * | classKind () |
Returns the unique identifier for this class. | |
type of ast member vector.
The base class for non-leaf AST nodes. Subclasses can have instances of ASTMember
subclasses as fields and will automatically construct them.
|
virtual |
Asks all members to construct themselves from the stack.
The members are asked to construct themselves in reverse order from a node stack (st
).
The input range (r
) is unused, because the leaf nodes have already constructed themselves at this point.
Implements pegmatite::ASTNode.