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__ Definition: ANTLRException.hpp:15
virtual void addChild(RefAST c)
Add a node to the end of the child list for this node.
Definition: BaseAST.hpp:77
virtual std ::string getText() const
Get the token text for this node.
Definition: BaseAST.hpp:111
virtual void setText(const std ::string &txt)
Set the token text for this node.
Definition: BaseAST.hpp:140
virtual int getType() const =0
Get the token type for this node.
BaseAST()
Definition: BaseAST.hpp:25
Definition: BaseAST.hpp:23
#define ANTLR_API
Definition: config.hpp:22
virtual void setNextSibling(RefAST n)
Set the next sibling after this one.
Definition: BaseAST.hpp:134
RefBaseAST down
Definition: BaseAST.hpp:172
virtual std ::string toString() const
Return string representation for the AST.
Definition: BaseAST.hpp:163
virtual void removeChildren()
Remove all children.
Definition: BaseAST.hpp:122
virtual RefAST getNextSibling() const
Get the next sibling in line after this one.
Definition: BaseAST.hpp:105
virtual std ::string getText() const =0
Get the token text for this node.
RefAST nullAST
Definition: BaseAST.cpp:271
virtual bool equals(RefAST t) const
Is node t equal to this in terms of token type and text?
Definition: BaseAST.hpp:182
ASTRefCount< AST > RefAST
Definition: ASTRefCount.hpp:92
RefBaseAST right
Definition: BaseAST.hpp:173
ASTRefCount< BaseAST > RefBaseAST
Definition: BaseAST.hpp:20
BaseAST(const BaseAST &other)
Definition: BaseAST.hpp:28
virtual void setFirstChild(RefAST c)
Set the first child of a node.
Definition: BaseAST.hpp:128
virtual RefAST getFirstChild() const
Get the first child of this node; null if no children.
Definition: BaseAST.hpp:100
#define ANTLR_USE_NAMESPACE(_x_)
Definition: config.hpp:18
virtual void setType(int type)
Set the token type for this node.
Definition: BaseAST.hpp:145
virtual int getType() const
Get the token type for this node.
Definition: BaseAST.hpp:116
virtual ~BaseAST()
Definition: BaseAST.hpp:32