PascalStoreWalker.hpp
Go to the documentation of this file.00001 #ifndef INC_PascalStoreWalker_hpp_ 00002 #define INC_PascalStoreWalker_hpp_ 00003 00004 #line 20 "pascal.tree.g" 00005 00006 #include <codemodel.h> 00007 #include "PascalAST.hpp" 00008 00009 #include <qstring.h> 00010 #include <qstringlist.h> 00011 #include <qfileinfo.h> 00012 00013 #line 14 "PascalStoreWalker.hpp" 00014 #include <antlr/config.hpp> 00015 #include "PascalStoreWalkerTokenTypes.hpp" 00016 /* $ANTLR 2.7.2: "pascal.tree.g" -> "PascalStoreWalker.hpp"$ */ 00017 #include <antlr/TreeParser.hpp> 00018 00019 #line 29 "pascal.tree.g" 00020 00021 #include <codemodel.h> 00022 #include <kdebug.h> 00023 00024 #line 25 "PascalStoreWalker.hpp" 00025 class PascalStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public PascalStoreWalkerTokenTypes 00026 { 00027 #line 47 "pascal.tree.g" 00028 00029 private: 00030 QString m_fileName; 00031 QStringList m_currentScope; 00032 int m_currentAccess; 00033 int m_anon; 00034 CodeModel* m_model; 00035 00036 public: 00037 void setCodeModel( CodeModel* model ) { m_model = model; } 00038 CodeModel* codeModel() { return m_model; } 00039 const CodeModel* codeModel() const { return m_model; } 00040 00041 QString fileName() const { return m_fileName; } 00042 void setFileName( const QString& fileName ) { m_fileName = fileName; } 00043 00044 void init(){ 00045 m_currentScope.clear(); 00046 m_currentAccess = CodeModelItem::Public; 00047 m_anon = 0; 00048 } 00049 00050 void wipeout() { m_model->wipeout(); } 00051 #line 29 "PascalStoreWalker.hpp" 00052 public: 00053 PascalStoreWalker(); 00054 void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory ); 00055 int getNumTokens() const 00056 { 00057 return PascalStoreWalker::NUM_TOKENS; 00058 } 00059 const char* getTokenName( int type ) const 00060 { 00061 if( type > getNumTokens() ) return 0; 00062 return PascalStoreWalker::tokenNames[type]; 00063 } 00064 public: void program(RefPascalAST _t); 00065 public: void programHeading(RefPascalAST _t); 00066 public: void block(RefPascalAST _t); 00067 public: void identifierList(RefPascalAST _t); 00068 public: void identifier(RefPascalAST _t); 00069 public: void labelDeclarationPart(RefPascalAST _t); 00070 public: void constantDefinitionPart(RefPascalAST _t); 00071 public: void typeDefinitionPart(RefPascalAST _t); 00072 public: void variableDeclarationPart(RefPascalAST _t); 00073 public: void procedureAndFunctionDeclarationPart(RefPascalAST _t); 00074 public: void usesUnitsPart(RefPascalAST _t); 00075 public: void compoundStatement(RefPascalAST _t); 00076 public: void label(RefPascalAST _t); 00077 public: void constantDefinition(RefPascalAST _t); 00078 public: void constant(RefPascalAST _t); 00079 public: void string(RefPascalAST _t); 00080 public: void typeDefinition(RefPascalAST _t); 00081 public: void type(RefPascalAST _t); 00082 public: void formalParameterList(RefPascalAST _t); 00083 public: void resultType(RefPascalAST _t); 00084 public: void typeIdentifier(RefPascalAST _t); 00085 public: void structuredType(RefPascalAST _t); 00086 public: void unpackedStructuredType(RefPascalAST _t); 00087 public: void arrayType(RefPascalAST _t); 00088 public: void recordType(RefPascalAST _t); 00089 public: void setType(RefPascalAST _t); 00090 public: void fileType(RefPascalAST _t); 00091 public: void typeList(RefPascalAST _t); 00092 public: void fieldList(RefPascalAST _t); 00093 public: void fixedPart(RefPascalAST _t); 00094 public: void variantPart(RefPascalAST _t); 00095 public: void recordSection(RefPascalAST _t); 00096 public: void tag(RefPascalAST _t); 00097 public: void variant(RefPascalAST _t); 00098 public: void constList(RefPascalAST _t); 00099 public: void variableDeclaration(RefPascalAST _t); 00100 public: void procedureOrFunctionDeclaration(RefPascalAST _t); 00101 public: void procedureDeclaration(RefPascalAST _t); 00102 public: void functionDeclaration(RefPascalAST _t); 00103 public: void formalParameterSection(RefPascalAST _t); 00104 public: void parameterGroup(RefPascalAST _t); 00105 public: void statement(RefPascalAST _t); 00106 public: void unlabelledStatement(RefPascalAST _t); 00107 public: void simpleStatement(RefPascalAST _t); 00108 public: void structuredStatement(RefPascalAST _t); 00109 public: void assignmentStatement(RefPascalAST _t); 00110 public: void procedureStatement(RefPascalAST _t); 00111 public: void gotoStatement(RefPascalAST _t); 00112 public: void variable(RefPascalAST _t); 00113 public: void expression(RefPascalAST _t); 00114 public: void functionDesignator(RefPascalAST _t); 00115 public: void set(RefPascalAST _t); 00116 public: void parameterList(RefPascalAST _t); 00117 public: void actualParameter(RefPascalAST _t); 00118 public: void element(RefPascalAST _t); 00119 public: void conditionalStatement(RefPascalAST _t); 00120 public: void repetetiveStatement(RefPascalAST _t); 00121 public: void withStatement(RefPascalAST _t); 00122 public: void statements(RefPascalAST _t); 00123 public: void ifStatement(RefPascalAST _t); 00124 public: void caseStatement(RefPascalAST _t); 00125 public: void caseListElement(RefPascalAST _t); 00126 public: void whileStatement(RefPascalAST _t); 00127 public: void repeatStatement(RefPascalAST _t); 00128 public: void forStatement(RefPascalAST _t); 00129 public: void forList(RefPascalAST _t); 00130 public: void initialValue(RefPascalAST _t); 00131 public: void finalValue(RefPascalAST _t); 00132 public: void recordVariableList(RefPascalAST _t); 00133 public: 00134 RefPascalAST getAST(); 00135 00136 protected: 00137 RefPascalAST returnAST; 00138 RefPascalAST _retTree; 00139 private: 00140 static const char* tokenNames[]; 00141 #ifndef NO_STATIC_CONSTS 00142 static const int NUM_TOKENS = 190; 00143 #else 00144 enum { 00145 NUM_TOKENS = 190 00146 }; 00147 #endif 00148 00149 static const unsigned long _tokenSet_0_data_[]; 00150 static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0; 00151 static const unsigned long _tokenSet_1_data_[]; 00152 static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1; 00153 static const unsigned long _tokenSet_2_data_[]; 00154 static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_2; 00155 static const unsigned long _tokenSet_3_data_[]; 00156 static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_3; 00157 static const unsigned long _tokenSet_4_data_[]; 00158 static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_4; 00159 static const unsigned long _tokenSet_5_data_[]; 00160 static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_5; 00161 static const unsigned long _tokenSet_6_data_[]; 00162 static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_6; 00163 }; 00164 00165 #endif /*INC_PascalStoreWalker_hpp_*/