~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/java/JavaStoreWalker.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef INC_JavaStoreWalker_hpp_
2
 
#define INC_JavaStoreWalker_hpp_
3
 
 
4
 
#line 3 "java.store.g"
5
 
 
6
 
        #include <codemodel.h>
7
 
        #include "JavaAST.hpp"
8
 
 
9
 
        #include <qstring.h>
10
 
        #include <qstringlist.h>
11
 
        #include <qvaluestack.h>
12
 
        #include <qfileinfo.h>
13
 
 
14
 
#line 15 "JavaStoreWalker.hpp"
15
 
#include <antlr/config.hpp>
16
 
#include "JavaStoreWalkerTokenTypes.hpp"
17
 
/* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalker.hpp"$ */
18
 
#include <antlr/TreeParser.hpp>
19
 
 
20
 
#line 13 "java.store.g"
21
 
 
22
 
        #include <codemodel.h>
23
 
 
24
 
        #include <kdebug.h>
25
 
 
26
 
#line 27 "JavaStoreWalker.hpp"
27
 
/** Java 1.2 AST Recognizer Grammar
28
 
 *
29
 
 * Author:
30
 
 *      Terence Parr    parrt@magelang.com
31
 
 *
32
 
 * Version tracking now done with following ID:
33
 
 *
34
 
 * $Id: JavaStoreWalker.hpp 626096 2007-01-22 06:35:06Z okellogg $
35
 
 *
36
 
 * This grammar is in the PUBLIC DOMAIN
37
 
 *
38
 
 * BUGS
39
 
 */
40
 
class CUSTOM_API JavaStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public JavaStoreWalkerTokenTypes
41
 
{
42
 
#line 43 "java.store.g"
43
 
 
44
 
private:
45
 
        QStringList m_currentScope;
46
 
        CodeModel* m_model;
47
 
        FileDom m_file;
48
 
        QValueStack<ClassDom> m_currentClass;
49
 
        int m_currentAccess;
50
 
        int m_anon;
51
 
        ANTLR_USE_NAMESPACE(antlr)JavaASTFactory ast_factory;
52
 
 
53
 
public:
54
 
        void setCodeModel( CodeModel* model )
55
 
        {
56
 
                m_model = model;
57
 
        }
58
 
 
59
 
        void setFile( FileDom file )
60
 
        {
61
 
                m_file = file;
62
 
        }
63
 
 
64
 
        void init()
65
 
        {
66
 
                m_currentScope.clear();
67
 
                m_currentAccess = CodeModelItem::Public;
68
 
                m_anon = 0;
69
 
 
70
 
                initializeASTFactory (ast_factory);
71
 
                setASTFactory (&ast_factory);
72
 
        }
73
 
#line 44 "JavaStoreWalker.hpp"
74
 
public:
75
 
        JavaStoreWalker();
76
 
        static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
77
 
        int getNumTokens() const
78
 
        {
79
 
                return JavaStoreWalker::NUM_TOKENS;
80
 
        }
81
 
        const char* getTokenName( int type ) const
82
 
        {
83
 
                if( type > getNumTokens() ) return 0;
84
 
                return JavaStoreWalker::tokenNames[type];
85
 
        }
86
 
        const char* const* getTokenNames() const
87
 
        {
88
 
                return JavaStoreWalker::tokenNames;
89
 
        }
90
 
        public: void compilationUnit(RefJavaAST _t);
91
 
        public:  QString  packageDefinition(RefJavaAST _t);
92
 
        public:  QString  importDefinition(RefJavaAST _t);
93
 
        public: void typeDefinition(RefJavaAST _t);
94
 
        public:  QString  identifier(RefJavaAST _t);
95
 
        public:  QString  identifierStar(RefJavaAST _t);
96
 
        public:  QStringList  modifiers(RefJavaAST _t);
97
 
        public:  QStringList  extendsClause(RefJavaAST _t);
98
 
        public:  QStringList  implementsClause(RefJavaAST _t);
99
 
        public: void objBlock(RefJavaAST _t,
100
 
                 ClassDom klass 
101
 
        );
102
 
        public: void interfaceBlock(RefJavaAST _t,
103
 
                 ClassDom klass 
104
 
        );
105
 
        public:  QString  typeSpec(RefJavaAST _t);
106
 
        public:  QString  typeSpecArray(RefJavaAST _t);
107
 
        public:  QString  type(RefJavaAST _t);
108
 
        public: void builtInType(RefJavaAST _t);
109
 
        public: void modifier(RefJavaAST _t);
110
 
        public:  FunctionDom  methodDecl(RefJavaAST _t);
111
 
        public:  VariableDom  variableDef(RefJavaAST _t);
112
 
        public:  FunctionDom  ctorDef(RefJavaAST _t);
113
 
        public:  FunctionDom  methodDef(RefJavaAST _t);
114
 
        public: void slist(RefJavaAST _t);
115
 
        public: void methodHead(RefJavaAST _t,
116
 
                 FunctionDom meth 
117
 
        );
118
 
        public: void variableDeclarator(RefJavaAST _t,
119
 
                 VariableDom attr 
120
 
        );
121
 
        public: void varInitializer(RefJavaAST _t);
122
 
        public:  ArgumentDom  parameterDef(RefJavaAST _t);
123
 
        public: void objectinitializer(RefJavaAST _t);
124
 
        public: void initializer(RefJavaAST _t);
125
 
        public: void expression(RefJavaAST _t);
126
 
        public: void arrayInitializer(RefJavaAST _t);
127
 
        public: void throwsClause(RefJavaAST _t);
128
 
        public: void stat(RefJavaAST _t);
129
 
        public: void elist(RefJavaAST _t);
130
 
        public: void caseGroup(RefJavaAST _t);
131
 
        public: void tryBlock(RefJavaAST _t);
132
 
        public: void handler(RefJavaAST _t);
133
 
        public: void expr(RefJavaAST _t);
134
 
        public: void primaryExpression(RefJavaAST _t);
135
 
        public: void arrayIndex(RefJavaAST _t);
136
 
        public: void newExpression(RefJavaAST _t);
137
 
        public: void constant(RefJavaAST _t);
138
 
        public: void newArrayDeclarator(RefJavaAST _t);
139
 
public:
140
 
        ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
141
 
        {
142
 
                return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST);
143
 
        }
144
 
        
145
 
protected:
146
 
        RefJavaAST returnAST;
147
 
        RefJavaAST _retTree;
148
 
private:
149
 
        static const char* tokenNames[];
150
 
#ifndef NO_STATIC_CONSTS
151
 
        static const int NUM_TOKENS = 153;
152
 
#else
153
 
        enum {
154
 
                NUM_TOKENS = 153
155
 
        };
156
 
#endif
157
 
        
158
 
        static const unsigned long _tokenSet_0_data_[];
159
 
        static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
160
 
        static const unsigned long _tokenSet_1_data_[];
161
 
        static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
162
 
};
163
 
 
164
 
#endif /*INC_JavaStoreWalker_hpp_*/