summaryrefslogtreecommitdiffstats
path: root/languages/java/JavaStoreWalker.hpp
blob: ed43efcc20db0ddf32dad06fcf2a4275e3d8d41f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#ifndef INC_JavaStoreWalker_hpp_
#define INC_JavaStoreWalker_hpp_

#line 3 "java.store.g"

	#include <codemodel.h>
	#include "JavaAST.hpp"

	#include <qstring.h>
	#include <qstringlist.h>
	#include <qvaluestack.h>
        #include <qfileinfo.h>

#line 15 "JavaStoreWalker.hpp"
#include <antlr/config.hpp>
#include "JavaStoreWalkerTokenTypes.hpp"
/* $ANTLR 2.7.7 (20061129): "java.store.g" -> "JavaStoreWalker.hpp"$ */
#include <antlr/TreeParser.hpp>

#line 13 "java.store.g"

	#include <codemodel.h>

	#include <kdebug.h>

#line 27 "JavaStoreWalker.hpp"
/** Java 1.2 AST Recognizer Grammar
 *
 * Author:
 *	Terence Parr	parrt@magelang.com
 *
 * Version tracking now done with following ID:
 *
 * $Id$
 *
 * This grammar is in the PUBLIC DOMAIN
 *
 * BUGS
 */
class CUSTOM_API JavaStoreWalker : public ANTLR_USE_NAMESPACE(antlr)TreeParser, public JavaStoreWalkerTokenTypes
{
#line 43 "java.store.g"

private:
	QStringList m_currentScope;
	CodeModel* m_model;
	FileDom m_file;
	QValueStack<ClassDom> m_currentClass;
	int m_currentAccess;
	int m_anon;
        ANTLR_USE_NAMESPACE(antlr)JavaASTFactory ast_factory;

public:
	void setCodeModel( CodeModel* model )
	{
		m_model = model;
	}

	void setFile( FileDom file )
	{
		m_file = file;
	}

	void init()
	{
		m_currentScope.clear();
		m_currentAccess = CodeModelItem::Public;
		m_anon = 0;

        	initializeASTFactory (ast_factory);
        	setASTFactory (&ast_factory);
	}
#line 44 "JavaStoreWalker.hpp"
public:
	JavaStoreWalker();
	static void initializeASTFactory( ANTLR_USE_NAMESPACE(antlr)ASTFactory& factory );
	int getNumTokens() const
	{
		return JavaStoreWalker::NUM_TOKENS;
	}
	const char* getTokenName( int type ) const
	{
		if( type > getNumTokens() ) return 0;
		return JavaStoreWalker::tokenNames[type];
	}
	const char* const* getTokenNames() const
	{
		return JavaStoreWalker::tokenNames;
	}
	public: void compilationUnit(RefJavaAST _t);
	public:  QString  packageDefinition(RefJavaAST _t);
	public:  QString  importDefinition(RefJavaAST _t);
	public: void typeDefinition(RefJavaAST _t);
	public:  QString  identifier(RefJavaAST _t);
	public:  QString  identifierStar(RefJavaAST _t);
	public:  QStringList  modifiers(RefJavaAST _t);
	public:  QStringList  extendsClause(RefJavaAST _t);
	public:  QStringList  implementsClause(RefJavaAST _t);
	public: void objBlock(RefJavaAST _t,
		 ClassDom klass 
	);
	public: void interfaceBlock(RefJavaAST _t,
		 ClassDom klass 
	);
	public:  QString  typeSpec(RefJavaAST _t);
	public:  QString  typeSpecArray(RefJavaAST _t);
	public:  QString  type(RefJavaAST _t);
	public: void builtInType(RefJavaAST _t);
	public: void modifier(RefJavaAST _t);
	public:  FunctionDom  methodDecl(RefJavaAST _t);
	public:  VariableDom  variableDef(RefJavaAST _t);
	public:  FunctionDom  ctorDef(RefJavaAST _t);
	public:  FunctionDom  methodDef(RefJavaAST _t);
	public: void slist(RefJavaAST _t);
	public: void methodHead(RefJavaAST _t,
		 FunctionDom meth 
	);
	public: void variableDeclarator(RefJavaAST _t,
		 VariableDom attr 
	);
	public: void varInitializer(RefJavaAST _t);
	public:  ArgumentDom  parameterDef(RefJavaAST _t);
	public: void objectinitializer(RefJavaAST _t);
	public: void initializer(RefJavaAST _t);
	public: void expression(RefJavaAST _t);
	public: void arrayInitializer(RefJavaAST _t);
	public: void throwsClause(RefJavaAST _t);
	public: void stat(RefJavaAST _t);
	public: void elist(RefJavaAST _t);
	public: void caseGroup(RefJavaAST _t);
	public: void tryBlock(RefJavaAST _t);
	public: void handler(RefJavaAST _t);
	public: void expr(RefJavaAST _t);
	public: void primaryExpression(RefJavaAST _t);
	public: void arrayIndex(RefJavaAST _t);
	public: void newExpression(RefJavaAST _t);
	public: void constant(RefJavaAST _t);
	public: void newArrayDeclarator(RefJavaAST _t);
public:
	ANTLR_USE_NAMESPACE(antlr)RefAST getAST()
	{
		return ANTLR_USE_NAMESPACE(antlr)RefAST(returnAST);
	}
	
protected:
	RefJavaAST returnAST;
	RefJavaAST _retTree;
private:
	static const char* tokenNames[];
#ifndef NO_STATIC_CONSTS
	static const int NUM_TOKENS = 153;
#else
	enum {
		NUM_TOKENS = 153
	};
#endif
	
	static const unsigned long _tokenSet_0_data_[];
	static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_0;
	static const unsigned long _tokenSet_1_data_[];
	static const ANTLR_USE_NAMESPACE(antlr)BitSet _tokenSet_1;
};

#endif /*INC_JavaStoreWalker_hpp_*/