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