1#ifndef INC_CommonAST_hpp__
2#define INC_CommonAST_hpp__
11#include <antlr/config.hpp>
12#include <antlr/BaseAST.hpp>
14#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
22 , ttype( Token::INVALID_TYPE )
29 , ttype( t->getType() )
30 , text( t->getText() )
47 return CommonAST::TYPE_NAME;
57 virtual ANTLR_USE_NAMESPACE(std)
string getText()
const
66 virtual void initialize(
int t,
const ANTLR_USE_NAMESPACE(std)
string& txt )
72 virtual void initialize(
RefAST t )
77 virtual void initialize( RefToken t )
79 setType(t->getType());
80 setText(t->getText());
83#ifdef ANTLR_SUPPORT_XML
84 virtual void initialize( ANTLR_USE_NAMESPACE(std)istream& in );
87 virtual void setText(
const ANTLR_USE_NAMESPACE(std)
string& txt )
98 static const char*
const TYPE_NAME;
101 ANTLR_USE_NAMESPACE(std)
string text;
104typedef ASTRefCount<CommonAST> RefCommonAST;
106#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
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.
virtual const char * typeName(void) const
Return the class name.
virtual int getType() const
Get the token type for this node.
virtual RefAST clone(void) const
Clone this AST node.
virtual void initialize(int t, const std ::string &txt)
Various initialization routines.
virtual void setText(const std ::string &txt)
Set the token text for this node.
virtual void setType(int type)
Set the token type for this node.
virtual std::string getText() const
Get the token text for this node.