00001 #ifndef INC_CommonAST_hpp__ 00002 #define INC_CommonAST_hpp__ 00003 00004 /* ANTLR Translator Generator 00005 * Project led by Terence Parr at http://www.jGuru.com 00006 * Software rights: http://www.antlr.org/license.html 00007 * 00008 * $Id: CommonAST.hpp,v 1.1 2004/10/08 16:27:34 dfisher Exp $ 00009 */ 00010 00011 #include <antlr/config.hpp> 00012 #include <antlr/BaseAST.hpp> 00013 00014 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE 00015 namespace antlr { 00016 #endif 00017 00018 class ANTLR_API CommonAST : public BaseAST { 00019 public: 00020 CommonAST(); 00021 CommonAST( RefToken t ); 00022 CommonAST( const CommonAST& other ); 00023 00024 virtual ~CommonAST(); 00025 00026 virtual const char* typeName( void ) const; 00028 virtual RefAST clone( void ) const; 00029 00030 virtual ANTLR_USE_NAMESPACE(std)string getText() const; 00031 virtual int getType() const; 00032 00033 virtual void initialize( int t, const ANTLR_USE_NAMESPACE(std)string& txt ); 00034 virtual void initialize( RefAST t ); 00035 virtual void initialize( RefToken t ); 00036 #ifdef ANTLR_SUPPORT_XML 00037 virtual void initialize( ANTLR_USE_NAMESPACE(std)istream& in ); 00038 #endif 00039 00040 virtual void setText( const ANTLR_USE_NAMESPACE(std)string& txt ); 00041 virtual void setType( int type ); 00042 00043 static RefAST factory(); 00044 00045 static const char* const TYPE_NAME; 00046 protected: 00047 int ttype; 00048 ANTLR_USE_NAMESPACE(std)string text; 00049 }; 00050 00051 typedef ASTRefCount<CommonAST> RefCommonAST; 00052 00053 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE 00054 } 00055 #endif 00056 00057 #endif //INC_CommonAST_hpp__