ANTLR Support Libraries 2.7.1+
|
Go to the documentation of this file. 1 #ifndef INC_BaseAST_hpp__
2 #define INC_BaseAST_hpp__
16 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
37 virtual const char* typeName(
void )
const = 0;
40 virtual RefAST clone(
void )
const = 0;
43 virtual bool equals(
RefAST t)
const;
48 virtual bool equalsList(
RefAST t)
const;
52 virtual bool equalsListPartial(
RefAST t)
const;
57 virtual bool equalsTree(
RefAST t)
const;
62 virtual bool equalsTreePartial(
RefAST t)
const;
97 virtual size_t getNumberOfChildren()
const;
130 down =
static_cast<BaseAST*
>(
static_cast<AST*
>(c));
136 right =
static_cast<BaseAST*
>(
static_cast<AST*
>(n));
149 #ifdef ANTLR_SUPPORT_XML
186 return ((getType() == t->
getType()) && (getText() == t->
getText()));
189 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
193 #endif //INC_BaseAST_hpp__
virtual RefAST getNextSibling() const
Get the next sibling in line after this one.
Definition: BaseAST.hpp:105
virtual void addChild(RefAST c)
Add a node to the end of the child list for this node.
Definition: BaseAST.hpp:77
Definition: BaseAST.hpp:23
BaseAST()
Definition: BaseAST.hpp:25
virtual RefAST getFirstChild() const
Get the first child of this node; null if no children.
Definition: BaseAST.hpp:100
virtual ~BaseAST()
Definition: BaseAST.hpp:32
virtual std ::string getText() const =0
Get the token text for this node.
BaseAST(const BaseAST &other)
Definition: BaseAST.hpp:28
RefBaseAST down
Definition: BaseAST.hpp:172
RefBaseAST right
Definition: BaseAST.hpp:173
virtual bool equals(RefAST t) const
Is node t equal to this in terms of token type and text?
Definition: BaseAST.hpp:182
virtual void setType(int type)
Set the token type for this node.
Definition: BaseAST.hpp:145
virtual std ::string getText() const
Get the token text for this node.
Definition: BaseAST.hpp:111
virtual int getType() const
Get the token type for this node.
Definition: BaseAST.hpp:116
virtual int getType() const =0
Get the token type for this node.
virtual std ::string toString() const
Return string representation for the AST.
Definition: BaseAST.hpp:163
RefAST nullAST
Definition: BaseAST.cpp:271
virtual void setText(const std ::string &txt)
Set the token text for this node.
Definition: BaseAST.hpp:140
virtual void removeChildren()
Remove all children.
Definition: BaseAST.hpp:122
virtual void setFirstChild(RefAST c)
Set the first child of a node.
Definition: BaseAST.hpp:128
virtual void setNextSibling(RefAST n)
Set the next sibling after this one.
Definition: BaseAST.hpp:134
#define ANTLR_API
Definition: config.hpp:22
Definition: ANTLRException.hpp:15
#define ANTLR_USE_NAMESPACE(_x_)
Definition: config.hpp:18
ASTRefCount< AST > RefAST
Definition: ASTRefCount.hpp:92
ASTRefCount< BaseAST > RefBaseAST
Definition: BaseAST.hpp:20