ExpressionRecognizer.java

biz/hammurapi/eval/ExpressionRecognizer.java

Violations

Inspector Message Severity Location
Java Inspector 039 Avoid "for", "do", "while", "if" and "if ... else" statements with empty bodies 1 702:22
Java Inspector 048 Copyrights information should be present in each file. 1
Java Inspector 037 Avoid using "public static final" array fields 2 1039:9
Java Inspector 049 Use a Collection instead of arrays Object[] 2 1039:9
Java Inspector 062 Unnecessary cast or instanceof. 2 173:34
Java Inspector 062 Unnecessary cast or instanceof. 2 192:47
Java Inspector 062 Unnecessary cast or instanceof. 2 203:47
Java Inspector 062 Unnecessary cast or instanceof. 2 221:47
Java Inspector 062 Unnecessary cast or instanceof. 2 251:59
Java Inspector 062 Unnecessary cast or instanceof. 2 324:67
Java Inspector 062 Unnecessary cast or instanceof. 2 369:56
Java Inspector 062 Unnecessary cast or instanceof. 2 372:88
Java Inspector 062 Unnecessary cast or instanceof. 2 380:48
Java Inspector 062 Unnecessary cast or instanceof. 2 418:54
Java Inspector 062 Unnecessary cast or instanceof. 2 421:86
Java Inspector 062 Unnecessary cast or instanceof. 2 429:46
Java Inspector 062 Unnecessary cast or instanceof. 2 513:41
Java Inspector 062 Unnecessary cast or instanceof. 2 528:49
Java Inspector 062 Unnecessary cast or instanceof. 2 540:49
Java Inspector 062 Unnecessary cast or instanceof. 2 549:49
Java Inspector 062 Unnecessary cast or instanceof. 2 558:49
Java Inspector 062 Unnecessary cast or instanceof. 2 567:49
Java Inspector 062 Unnecessary cast or instanceof. 2 608:47
Java Inspector 062 Unnecessary cast or instanceof. 2 623:31
Java Inspector 062 Unnecessary cast or instanceof. 2 709:36
Java Inspector 062 Unnecessary cast or instanceof. 2 726:40
Java Inspector 062 Unnecessary cast or instanceof. 2 735:40
Java Inspector 062 Unnecessary cast or instanceof. 2 744:40
Java Inspector 062 Unnecessary cast or instanceof. 2 753:40
Java Inspector 062 Unnecessary cast or instanceof. 2 762:40
Java Inspector 062 Unnecessary cast or instanceof. 2 771:40
Java Inspector 062 Unnecessary cast or instanceof. 2 805:46
Java Inspector 062 Unnecessary cast or instanceof. 2 806:46
Java Inspector 062 Unnecessary cast or instanceof. 2 812:38
Java Inspector 062 Unnecessary cast or instanceof. 2 827:49
Java Inspector 062 Unnecessary cast or instanceof. 2 832:49
Java Inspector 062 Unnecessary cast or instanceof. 2 870:34
Java Inspector 062 Unnecessary cast or instanceof. 2 887:43
Java Inspector 062 Unnecessary cast or instanceof. 2 896:43
Java Inspector 062 Unnecessary cast or instanceof. 2 905:43
Java Inspector 062 Unnecessary cast or instanceof. 2 914:43
Java Inspector 062 Unnecessary cast or instanceof. 2 923:43
Java Inspector 062 Unnecessary cast or instanceof. 2 932:43
Java Inspector 062 Unnecessary cast or instanceof. 2 941:43
Java Inspector 062 Unnecessary cast or instanceof. 2 950:43
Java Inspector 062 Unnecessary cast or instanceof. 2 972:36
Java Inspector 062 Unnecessary cast or instanceof. 2 986:36
Java Inspector 062 Unnecessary cast or instanceof. 2 1008:50
Java Inspector 062 Unnecessary cast or instanceof. 2 1034:42
Java Inspector 070-A Cyclomatic complexity is too high: 13, maximum allowed is 12 2 232:9
Java Inspector 070-A Cyclomatic complexity is too high: 15, maximum allowed is 12 2 631:9
Java Inspector 082 Parenthesis are redundant. 2 267:29
Java Inspector 082 Parenthesis are redundant. 2 267:48
Java Inspector 082 Parenthesis are redundant. 2 267:67
Java Inspector 082 Parenthesis are redundant. 2 283:37
Java Inspector 082 Parenthesis are redundant. 2 283:38
Java Inspector 082 Parenthesis are redundant. 2 283:57
Java Inspector 082 Parenthesis are redundant. 2 283:76
Java Inspector 082 Parenthesis are redundant. 2 315:42
Java Inspector 082 Parenthesis are redundant. 2 351:29
Java Inspector 082 Parenthesis are redundant. 2 372:110
Java Inspector 082 Parenthesis are redundant. 2 400:29
Java Inspector 082 Parenthesis are redundant. 2 421:108
Java Inspector 082 Parenthesis are redundant. 2 648:29
Java Inspector 082 Parenthesis are redundant. 2 648:45
Java Inspector 082 Parenthesis are redundant. 2 648:63
Java Inspector 082 Parenthesis are redundant. 2 665:21
Java Inspector 082 Parenthesis are redundant. 2 679:26
Java Inspector 082 Parenthesis are redundant. 2 679:45
Java Inspector 082 Parenthesis are redundant. 2 679:64
Java Inspector 082 Parenthesis are redundant. 2 684:37
Java Inspector 082 Parenthesis are redundant. 2 684:56
Java Inspector 082 Parenthesis are redundant. 2 684:75
Java Inspector 082 Parenthesis are redundant. 2 702:26
Java Inspector 082 Parenthesis are redundant. 2 702:57
Java Inspector 082 Parenthesis are redundant. 2 702:88
Java Inspector 082 Parenthesis are redundant. 2 793:29
Java Inspector 082 Parenthesis are redundant. 2 806:68
Java Inspector 082 Parenthesis are redundant. 2 824:21
Java Inspector 082 Parenthesis are redundant. 2 824:40
Java Inspector 082 Parenthesis are redundant. 2 829:26
Java Inspector 082 Parenthesis are redundant. 2 829:45
Java Inspector 082 Parenthesis are redundant. 2 854:29
Java Inspector 082 Parenthesis are redundant. 2 1018:29
Java Inspector 089 Javadoc for type definiton shall have @author tag 2 132:1
Java Inspector 089 Undocumented constructor 2 135:1
Java Inspector 089 Undocumented constructor 2 142:1
Java Inspector 089 Undocumented constructor 2 146:1
Java Inspector 089 Undocumented constructor 2 153:1
Java Inspector 089 Undocumented constructor 2 157:1
Java Inspector 089 Undocumented method 2 164:9
Java Inspector 089 Undocumented method 2 177:9
Java Inspector 089 Undocumented method 2 232:9
Java Inspector 089 Undocumented method 2 335:9
Java Inspector 089 Undocumented method 2 384:9
Java Inspector 089 Undocumented method 2 433:9
Java Inspector 089 Undocumented method 2 517:9
Java Inspector 089 Undocumented method 2 578:9
Java Inspector 089 Undocumented exception RecognitionException 2 631:9
Java Inspector 089 Undocumented exception TokenStreamException 2 631:9
Java Inspector 089 Undocumented method 2 713:9
Java Inspector 089 Undocumented method 2 782:9
Java Inspector 089 Undocumented method 2 816:9
Java Inspector 089 Undocumented method 2 841:9
Java Inspector 089 Undocumented method 2 874:9
Java Inspector 089 Undocumented method 2 961:9
Java Inspector 089 Undocumented method 2 997:9
Java Inspector 089 Undocumented field 2 1039:9
Java Inspector 089 Undocumented method 2 1088:9
Java Inspector 089 Undocumented field 2 1096:9
Java Inspector 089 Undocumented field 2 1101:9
Java Inspector 089 Undocumented field 2 1106:9
Java Inspector 089 Undocumented field 2 1111:9
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 168:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 181:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 186:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 197:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 236:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 238:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 240:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 245:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 284:41
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 341:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 343:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 390:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 392:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 437:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 439:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 441:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 451:33
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 455:33
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 521:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 545:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 554:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 563:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 582:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 635:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 637:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 639:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 641:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 649:33
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 653:33
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 681:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 717:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 722:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 731:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 740:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 749:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 758:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 767:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 786:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 822:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 845:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 847:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 855:33
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 859:33
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 878:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 883:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 892:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 901:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 910:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 919:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 928:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 937:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 946:25
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 965:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1003:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1005:17
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1039:9
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1092:9
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1096:9
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1097:9
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1101:9
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1102:9
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1106:9
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1107:9
Java Inspector 005 Classes, interfaces, methods, and variables should be named according to Sun's naming conventions. 3 1111:9
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 143:17
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 154:14
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 158:15
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 158:15
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 267:52
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 267:72
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 267:100
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 283:61
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 283:80
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 372:124
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 421:122
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 648:49
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 648:86
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 679:49
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 679:87
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 684:60
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 684:98
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 702:80
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 702:111
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 806:82
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 824:44
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 829:50
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 829:78
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 1093:33
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 1098:33
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 1103:33
Java Inspector 025 Avoid hardwired numeric literals. Allowed literals: [1, -1, 0] 3 1108:33
Java Inspector 026 Avoid hardwired string literals. Allowed literals: [] 3 372:155
Java Inspector 026 Avoid hardwired string literals. Allowed literals: [] 3 421:153
Java Inspector 026 Avoid hardwired string literals. Allowed literals: [] 3 609:71
Java Inspector 026 Avoid hardwired string literals. Allowed literals: [] 3 806:114
Java Inspector 046 Empty statements 3 702:117
Java Inspector 051 It is good practice to call in any case super() in a constructor. 3 142:1
Java Inspector 051 It is good practice to call in any case super() in a constructor. 3 153:1
Java Inspector 090 Unnecessary else part in if. The main part terminates control flow (return, break, throw, or continue). 3 695:41

Source code

1// $ANTLR 2.7.5 (20050128): "expression.g" -> "ExpressionRecognizer.java"$

2
3package biz.hammurapi.eval;
4
5import antlr.TokenBuffer;
6import antlr.TokenStreamException;
7import antlr.TokenStreamIOException;
8import antlr.ANTLRException;
9import antlr.LLkParser;
10import antlr.Token;
11import antlr.TokenStream;
12import antlr.RecognitionException;
13import antlr.NoViableAltException;
14import antlr.MismatchedTokenException;
15import antlr.SemanticException;
16import antlr.ParserSharedInputState;
17import antlr.collections.impl.BitSet;
18import antlr.collections.AST;
19import java.util.Hashtable;
20import antlr.ASTFactory;
21import antlr.ASTPair;
22import antlr.collections.impl.ASTArray;
23
24/** Java 1.3 Recognizer
25 *
26 * Run 'java Main [-showtree] directory-full-of-java-files'
27 *
28 * [The -showtree option pops up a Swing frame that shows
29 * the AST constructed from the parser.]
30 *
31 * Run 'java Main <directory full of java files>'
32 *
33 * Contributing authors:
34 * John Mitchell johnm@non.net
35 * Terence Parr parrt@magelang.com
36 * John Lilley jlilley@empathy.com
37 * Scott Stanchfield thetick@magelang.com
38 * Markus Mohnen mohnen@informatik.rwth-aachen.de
39 * Peter Williams pete.williams@sun.com
40 * Allan Jacobs Allan.Jacobs@eng.sun.com
41 * Steve Messick messick@redhills.com
42 * John Pybus john@pybus.org
43 *
44 * Version 1.00 December 9, 1997 -- initial release
45 * Version 1.01 December 10, 1997
46 * fixed bug in octal def (0..7 not 0..8)
47 * Version 1.10 August 1998 (parrt)
48 * added tree construction
49 * fixed definition of WS,comments for mac,pc,unix newlines
50 * added unary plus
51 * Version 1.11 (Nov 20, 1998)
52 * Added "shutup" option to turn off last ambig warning.
53 * Fixed inner class def to allow named class defs as statements
54 * synchronized requires compound not simple statement
55 * add [] after builtInType DOT class in primaryExpression
56 * "const" is reserved but not valid..removed from modifiers
57 * Version 1.12 (Feb 2, 1999)
58 * Changed LITERAL_xxx to xxx in tree grammar.
59 * Updated java.g to use tokens {...} now for 2.6.0 (new feature).
60 *
61 * Version 1.13 (Apr 23, 1999)
62 * Didn't have (stat)? for else clause in tree parser.
63 * Didn't gen ASTs for interface extends. Updated tree parser too.
64 * Updated to 2.6.0.
65 * Version 1.14 (Jun 20, 1999)
66 * Allowed final/abstract on local classes.
67 * Removed local interfaces from methods
68 * Put instanceof precedence where it belongs...in relationalExpr
69 * It also had expr not type as arg; fixed it.
70 * Missing ! on SEMI in classBlock
71 * fixed: (expr) + "string" was parsed incorrectly (+ as unary plus).
72 * fixed: didn't like Object[].class in parser or tree parser
73 * Version 1.15 (Jun 26, 1999)
74 * Screwed up rule with instanceof in it. :( Fixed.
75 * Tree parser didn't like (expr).something; fixed.
76 * Allowed multiple inheritance in tree grammar. oops.
77 * Version 1.16 (August 22, 1999)
78 * Extending an interface built a wacky tree: had extra EXTENDS.
79 * Tree grammar didn't allow multiple superinterfaces.
80 * Tree grammar didn't allow empty var initializer: {}
81 * Version 1.17 (October 12, 1999)
82 * ESC lexer rule allowed 399 max not 377 max.
83 * java.tree.g didn't handle the expression of synchronized
84 * statements.
85 * Version 1.18 (August 12, 2001)
86 * Terence updated to Java 2 Version 1.3 by
87 * observing/combining work of Allan Jacobs and Steve
88 * Messick. Handles 1.3 src. Summary:
89 * o primary didn't include boolean.class kind of thing
90 * o constructor calls parsed explicitly now:
91 * see explicitConstructorInvocation
92 * o add strictfp modifier
93 * o missing objBlock after new expression in tree grammar
94 * o merged local class definition alternatives, moved after declaration
95 * o fixed problem with ClassName.super.field
96 * o reordered some alternatives to make things more efficient
97 * o long and double constants were not differentiated from int/float
98 * o whitespace rule was inefficient: matched only one char
99 * o add an examples directory with some nasty 1.3 cases
100 * o made Main.java use buffered IO and a Reader for Unicode support
101 * o supports UNICODE?
102 * Using Unicode charVocabulay makes code file big, but only
103 * in the bitsets at the end. I need to make ANTLR generate
104 * unicode bitsets more efficiently.
105 * Version 1.19 (April 25, 2002)
106 * Terence added in nice fixes by John Pybus concerning floating
107 * constants and problems with super() calls. John did a nice
108 * reorg of the primary/postfix expression stuff to read better
109 * and makes f.g.super() parse properly (it was METHOD_CALL not
110 * a SUPER_CTOR_CALL). Also:
111 *
112 * o "finally" clause was a root...made it a child of "try"
113 * o Added stuff for asserts too for Java 1.4, but *commented out*
114 * as it is not backward compatible.
115 *
116 * Version 1.20 (October 27, 2002)
117 *
118 * Terence ended up reorging John Pybus' stuff to
119 * remove some nondeterminisms and some syntactic predicates.
120 * Note that the grammar is stricter now; e.g., this(...) must
121 * be the first statement.
122 *
123 * Trinary ?: operator wasn't working as array name:
124 * (isBig ? bigDigits : digits)[i];
125 *
126 * Checked parser/tree parser on source for
127 * Resin-2.0.5, jive-2.1.1, jdk 1.3.1, Lucene, antlr 2.7.2a4,
128 * and the 110k-line jGuru server source.
129 *
130 * This grammar is in the PUBLIC DOMAIN
131 */
132public class ExpressionRecognizer extends antlr.LLkParser implements ExpressionTokenTypes
133 {
134
135protected ExpressionRecognizer(TokenBuffer tokenBuf, int k) {
136 super(tokenBuf,k);
137 tokenNames = _tokenNames;
138 buildTokenTypeASTClassMap();
139 astFactory = new ASTFactory(getTokenTypeToASTClassMap());
140}
141
142public ExpressionRecognizer(TokenBuffer tokenBuf) {
143 this(tokenBuf,3);
144}
145
146protected ExpressionRecognizer(TokenStream lexer, int k) {
147 super(lexer,k);
148 tokenNames = _tokenNames;
149 buildTokenTypeASTClassMap();
150 astFactory = new ASTFactory(getTokenTypeToASTClassMap());
151}
152
153public ExpressionRecognizer(TokenStream lexer) {
154 this(lexer,3);
155}
156
157public ExpressionRecognizer(ParserSharedInputState state) {
158 super(state,3);
159 tokenNames = _tokenNames;
160 buildTokenTypeASTClassMap();
161 astFactory = new ASTFactory(getTokenTypeToASTClassMap());
162}
163
164 public final void expression() throws RecognitionException, TokenStreamException {
165
166 returnAST = null;
167 ASTPair currentAST = new ASTPair();
168 AST expression_AST = null;
169
170 unaryExpression();
171 astFactory.addASTChild(currentAST, returnAST);
172 match(Token.EOF_TYPE);
173 expression_AST = (AST)currentAST.root;
174 returnAST = expression_AST;
175 }
176
177 public final void unaryExpression() throws RecognitionException, TokenStreamException {
178
179 returnAST = null;
180 ASTPair currentAST = new ASTPair();
181 AST unaryExpression_AST = null;
182
183 switch ( LA(1)) {
184 case MINUS:
185 {
186 AST tmp2_AST = null;
187 tmp2_AST = astFactory.create(LT(1));
188 astFactory.makeASTRoot(currentAST, tmp2_AST);
189 match(MINUS);
190 unaryExpression();
191 astFactory.addASTChild(currentAST, returnAST);
192 unaryExpression_AST = (AST)currentAST.root;
193 break;
194 }
195 case PLUS:
196 {
197 AST tmp3_AST = null;
198 tmp3_AST = astFactory.create(LT(1));
199 astFactory.makeASTRoot(currentAST, tmp3_AST);
200 match(PLUS);
201 unaryExpression();
202 astFactory.addASTChild(currentAST, returnAST);
203 unaryExpression_AST = (AST)currentAST.root;
204 break;
205 }
206 case LNOT:
207 case LPAREN:
208 case IDENT:
209 case LITERAL_true:
210 case LITERAL_false:
211 case LITERAL_null:
212 case NUM_INT:
213 case CHAR_LITERAL:
214 case STRING_LITERAL:
215 case NUM_FLOAT:
216 case NUM_LONG:
217 case NUM_DOUBLE:
218 {
219 unaryExpressionNotPlusMinus();
220 astFactory.addASTChild(currentAST, returnAST);
221 unaryExpression_AST = (AST)currentAST.root;
222 break;
223 }
224 default:
225 {
226 throw new NoViableAltException(LT(1), getFilename());
227 }
228 }
229 returnAST = unaryExpression_AST;
230 }
231
232 public final void unaryExpressionNotPlusMinus() throws RecognitionException, TokenStreamException {
233
234 returnAST = null;
235 ASTPair currentAST = new ASTPair();
236 AST unaryExpressionNotPlusMinus_AST = null;
237 Token lpb = null;
238 AST lpb_AST = null;
239 Token lp = null;
240 AST lp_AST = null;
241
242 switch ( LA(1)) {
243 case LNOT:
244 {
245 AST tmp4_AST = null;
246 tmp4_AST = astFactory.create(LT(1));
247 astFactory.makeASTRoot(currentAST, tmp4_AST);
248 match(LNOT);
249 unaryExpression();
250 astFactory.addASTChild(currentAST, returnAST);
251 unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
252 break;
253 }
254 case LPAREN:
255 case IDENT:
256 case LITERAL_true:
257 case LITERAL_false:
258 case LITERAL_null:
259 case NUM_INT:
260 case CHAR_LITERAL:
261 case STRING_LITERAL:
262 case NUM_FLOAT:
263 case NUM_LONG:
264 case NUM_DOUBLE:
265 {
266 {
267 if ((LA(1)==LPAREN) && (LA(2)==LPAREN) && ((LA(3) >= LITERAL_boolean && LA(3) <= LITERAL_double))) {
268 lpb = LT(1);
269 lpb_AST = astFactory.create(lpb);
270 astFactory.makeASTRoot(currentAST, lpb_AST);
271 match(LPAREN);
272 if ( inputState.guessing==0 ) {
273 lpb_AST.setType(TYPECAST);
274 }
275 builtInTypeSpecification(true);
276 astFactory.addASTChild(currentAST, returnAST);
277 match(RPAREN);
278 unaryExpression();
279 astFactory.addASTChild(currentAST, returnAST);
280 }
281 else {
282 boolean synPredMatched6 = false;
283 if (((LA(1)==LPAREN) && (LA(2)==LPAREN) && (LA(3)==IDENT))) {
284 int _m6 = mark();
285 synPredMatched6 = true;
286 inputState.guessing++;
287 try {
288 {
289 match(LPAREN);
290 classTypeSpecification(true);
291 match(RPAREN);
292 unaryExpressionNotPlusMinus();
293 }
294 }
295 catch (RecognitionException pe) {
296 synPredMatched6 = false;
297 }
298 rewind(_m6);
299 inputState.guessing--;
300 }
301 if ( synPredMatched6 ) {
302 lp = LT(1);
303 lp_AST = astFactory.create(lp);
304 astFactory.makeASTRoot(currentAST, lp_AST);
305 match(LPAREN);
306 if ( inputState.guessing==0 ) {
307 lp_AST.setType(TYPECAST);
308 }
309 classTypeSpecification(true);
310 astFactory.addASTChild(currentAST, returnAST);
311 match(RPAREN);
312 unaryExpressionNotPlusMinus();
313 astFactory.addASTChild(currentAST, returnAST);
314 }
315 else if ((_tokenSet_0.member(LA(1)))) {
316 postfixExpression();
317 astFactory.addASTChild(currentAST, returnAST);
318 }
319 else {
320 throw new NoViableAltException(LT(1), getFilename());
321 }
322 }
323 }
324 unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
325 break;
326 }
327 default:
328 {
329 throw new NoViableAltException(LT(1), getFilename());
330 }
331 }
332 returnAST = unaryExpressionNotPlusMinus_AST;
333 }
334
335 public final void builtInTypeSpecification(
336 boolean addImagNode
337 ) throws RecognitionException, TokenStreamException {
338
339 returnAST = null;
340 ASTPair currentAST = new ASTPair();
341 AST builtInTypeSpecification_AST = null;
342 Token lb = null;
343 AST lb_AST = null;
344
345 match(LPAREN);
346 builtInType();
347 astFactory.addASTChild(currentAST, returnAST);
348 {
349 _loop31:
350 do {
351 if ((LA(1)==LBRACK)) {
352 lb = LT(1);
353 lb_AST = astFactory.create(lb);
354 astFactory.makeASTRoot(currentAST, lb_AST);
355 match(LBRACK);
356 if ( inputState.guessing==0 ) {
357 lb_AST.setType(ARRAY_DECLARATOR);
358 }
359 match(RBRACK);
360 }
361 else {
362 break _loop31;
363 }
364
365 } while (true);
366 }
367 match(RPAREN);
368 if ( inputState.guessing==0 ) {
369 builtInTypeSpecification_AST = (AST)currentAST.root;
370
371 if ( addImagNode ) {
372 builtInTypeSpecification_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(TYPE,"TYPE")).add(builtInTypeSpecification_AST));
373 }
374
375 currentAST.root = builtInTypeSpecification_AST;
376 currentAST.child = builtInTypeSpecification_AST!=null &&builtInTypeSpecification_AST.getFirstChild()!=null ?
377 builtInTypeSpecification_AST.getFirstChild() : builtInTypeSpecification_AST;
378 currentAST.advanceChildToEnd();
379 }
380 builtInTypeSpecification_AST = (AST)currentAST.root;
381 returnAST = builtInTypeSpecification_AST;
382 }
383
384 public final void classTypeSpecification(
385 boolean addImagNode
386 ) throws RecognitionException, TokenStreamException {
387
388 returnAST = null;
389 ASTPair currentAST = new ASTPair();
390 AST classTypeSpecification_AST = null;
391 Token lb = null;
392 AST lb_AST = null;
393
394 match(LPAREN);
395 identifier();
396 astFactory.addASTChild(currentAST, returnAST);
397 {
398 _loop28:
399 do {
400 if ((LA(1)==LBRACK)) {
401 lb = LT(1);
402 lb_AST = astFactory.create(lb);
403 astFactory.makeASTRoot(currentAST, lb_AST);
404 match(LBRACK);
405 if ( inputState.guessing==0 ) {
406 lb_AST.setType(ARRAY_DECLARATOR);
407 }
408 match(RBRACK);
409 }
410 else {
411 break _loop28;
412 }
413
414 } while (true);
415 }
416 match(RPAREN);
417 if ( inputState.guessing==0 ) {
418 classTypeSpecification_AST = (AST)currentAST.root;
419
420 if ( addImagNode ) {
421 classTypeSpecification_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(TYPE,"TYPE")).add(classTypeSpecification_AST));
422 }
423
424 currentAST.root = classTypeSpecification_AST;
425 currentAST.child = classTypeSpecification_AST!=null &&classTypeSpecification_AST.getFirstChild()!=null ?
426 classTypeSpecification_AST.getFirstChild() : classTypeSpecification_AST;
427 currentAST.advanceChildToEnd();
428 }
429 classTypeSpecification_AST = (AST)currentAST.root;
430 returnAST = classTypeSpecification_AST;
431 }
432
433 public final void postfixExpression() throws RecognitionException, TokenStreamException {
434
435 returnAST = null;
436 ASTPair currentAST = new ASTPair();
437 AST postfixExpression_AST = null;
438 Token lp = null;
439 AST lp_AST = null;
440 Token lb = null;
441 AST lb_AST = null;
442
443 primaryExpression();
444 astFactory.addASTChild(currentAST, returnAST);
445 {
446 _loop10:
447 do {
448 switch ( LA(1)) {
449 case DOT:
450 {
451 AST tmp13_AST = null;
452 tmp13_AST = astFactory.create(LT(1));
453 astFactory.makeASTRoot(currentAST, tmp13_AST);
454 match(DOT);
455 AST tmp14_AST = null;
456 tmp14_AST = astFactory.create(LT(1));
457 astFactory.addASTChild(currentAST, tmp14_AST);
458 match(IDENT);
459 {
460 switch ( LA(1)) {
461 case LPAREN:
462 {
463 lp = LT(1);
464 lp_AST = astFactory.create(lp);
465 astFactory.makeASTRoot(currentAST, lp_AST);
466 match(LPAREN);
467 if ( inputState.guessing==0 ) {
468 lp_AST.setType(METHOD_CALL);
469 }
470 argList();
471 astFactory.addASTChild(currentAST, returnAST);
472 match(RPAREN);
473 break;
474 }
475 case EOF:
476 case RPAREN:
477 case DOT:
478 case LBRACK:
479 case RBRACK:
480 case COMMA:
481 {
482 break;
483 }
484 default:
485 {
486 throw new NoViableAltException(LT(1), getFilename());
487 }
488 }
489 }
490 break;
491 }
492 case LBRACK:
493 {
494 lb = LT(1);
495 lb_AST = astFactory.create(lb);
496 astFactory.makeASTRoot(currentAST, lb_AST);
497 match(LBRACK);
498 if ( inputState.guessing==0 ) {
499 lb_AST.setType(INDEX_OP);
500 }
501 postfixExpression();
502 astFactory.addASTChild(currentAST, returnAST);
503 match(RBRACK);
504 break;
505 }
506 default:
507 {
508 break _loop10;
509 }
510 }
511 } while (true);
512 }
513 postfixExpression_AST = (AST)currentAST.root;
514 returnAST = postfixExpression_AST;
515 }
516
517 public final void primaryExpression() throws RecognitionException, TokenStreamException {
518
519 returnAST = null;
520 ASTPair currentAST = new ASTPair();
521 AST primaryExpression_AST = null;
522
523 switch ( LA(1)) {
524 case IDENT:
525 {
526 identPrimary();
527 astFactory.addASTChild(currentAST, returnAST);
528 primaryExpression_AST = (AST)currentAST.root;
529 break;
530 }
531 case NUM_INT:
532 case CHAR_LITERAL:
533 case STRING_LITERAL:
534 case NUM_FLOAT:
535 case NUM_LONG:
536 case NUM_DOUBLE:
537 {
538 constant();
539 astFactory.addASTChild(currentAST, returnAST);
540 primaryExpression_AST = (AST)currentAST.root;
541 break;
542 }
543 case LITERAL_true:
544 {
545 AST tmp17_AST = null;
546 tmp17_AST = astFactory.create(LT(1));
547 astFactory.addASTChild(currentAST, tmp17_AST);
548 match(LITERAL_true);
549 primaryExpression_AST = (AST)currentAST.root;
550 break;
551 }
552 case LITERAL_false:
553 {
554 AST tmp18_AST = null;
555 tmp18_AST = astFactory.create(LT(1));
556 astFactory.addASTChild(currentAST, tmp18_AST);
557 match(LITERAL_false);
558 primaryExpression_AST = (AST)currentAST.root;
559 break;
560 }
561 case LITERAL_null:
562 {
563 AST tmp19_AST = null;
564 tmp19_AST = astFactory.create(LT(1));
565 astFactory.addASTChild(currentAST, tmp19_AST);
566 match(LITERAL_null);
567 primaryExpression_AST = (AST)currentAST.root;
568 break;
569 }
570 default:
571 {
572 throw new NoViableAltException(LT(1), getFilename());
573 }
574 }
575 returnAST = primaryExpression_AST;
576 }
577
578 public final void argList() throws RecognitionException, TokenStreamException {
579
580 returnAST = null;
581 ASTPair currentAST = new ASTPair();
582 AST argList_AST = null;
583
584 {
585 switch ( LA(1)) {
586 case MINUS:
587 case PLUS:
588 case LNOT:
589 case LPAREN:
590 case IDENT:
591 case LITERAL_true:
592 case LITERAL_false:
593 case LITERAL_null:
594 case NUM_INT:
595 case CHAR_LITERAL:
596 case STRING_LITERAL:
597 case NUM_FLOAT:
598 case NUM_LONG:
599 case NUM_DOUBLE:
600 {
601 expressionList();
602 astFactory.addASTChild(currentAST, returnAST);
603 break;
604 }
605 case RPAREN:
606 {
607 if ( inputState.guessing==0 ) {
608 argList_AST = (AST)currentAST.root;
609 argList_AST = astFactory.create(ELIST,"ELIST");
610 currentAST.root = argList_AST;
611 currentAST.child = argList_AST!=null &&argList_AST.getFirstChild()!=null ?
612 argList_AST.getFirstChild() : argList_AST;
613 currentAST.advanceChildToEnd();
614 }
615 break;
616 }
617 default:
618 {
619 throw new NoViableAltException(LT(1), getFilename());
620 }
621 }
622 }
623 argList_AST = (AST)currentAST.root;
624 returnAST = argList_AST;
625 }
626
627/** Match a, a.b.c refs, a.b.c(...) refs, a.b.c[], a.b.c[].class,
628 * and a.b.c.class refs. Also this(...) and super(...). Match
629 * this or super.
630 */
631 public final void identPrimary() throws RecognitionException, TokenStreamException {
632
633 returnAST = null;
634 ASTPair currentAST = new ASTPair();
635 AST identPrimary_AST = null;
636 Token lp = null;
637 AST lp_AST = null;
638 Token lbc = null;
639 AST lbc_AST = null;
640
641 AST tmp20_AST = null;
642 tmp20_AST = astFactory.create(LT(1));
643 astFactory.addASTChild(currentAST, tmp20_AST);
644 match(IDENT);
645 {
646 _loop14:
647 do {
648 if ((LA(1)==DOT) && (LA(2)==IDENT) && (_tokenSet_1.member(LA(3)))) {
649 AST tmp21_AST = null;
650 tmp21_AST = astFactory.create(LT(1));
651 astFactory.makeASTRoot(currentAST, tmp21_AST);
652 match(DOT);
653 AST tmp22_AST = null;
654 tmp22_AST = astFactory.create(LT(1));
655 astFactory.addASTChild(currentAST, tmp22_AST);
656 match(IDENT);
657 }
658 else {
659 break _loop14;
660 }
661
662 } while (true);
663 }
664 {
665 if ((LA(1)==LPAREN)) {
666 {
667 lp = LT(1);
668 lp_AST = astFactory.create(lp);
669 astFactory.makeASTRoot(currentAST, lp_AST);
670 match(LPAREN);
671 if ( inputState.guessing==0 ) {
672 lp_AST.setType(METHOD_CALL);
673 }
674 argList();
675 astFactory.addASTChild(currentAST, returnAST);
676 match(RPAREN);
677 }
678 }
679 else if ((LA(1)==LBRACK) && (LA(2)==RBRACK) && (_tokenSet_2.member(LA(3)))) {
680 {
681 int _cnt18=0;
682 _loop18:
683 do {
684 if ((LA(1)==LBRACK) && (LA(2)==RBRACK) && (_tokenSet_2.member(LA(3)))) {
685 lbc = LT(1);
686 lbc_AST = astFactory.create(lbc);
687 astFactory.makeASTRoot(currentAST, lbc_AST);
688 match(LBRACK);
689 if ( inputState.guessing==0 ) {
690 lbc_AST.setType(ARRAY_DECLARATOR);
691 }
692 match(RBRACK);
693 }
694 else {
695 if ( _cnt18>=1 ) { break _loop18; } else {throw new NoViableAltException(LT(1), getFilename());}
696 }
697
698 _cnt18++;
699 } while (true);
700 }
701 }
702 else if ((_tokenSet_2.member(LA(1))) && (_tokenSet_3.member(LA(2))) && (_tokenSet_3.member(LA(3)))) {
703 }
704 else {
705 throw new NoViableAltException(LT(1), getFilename());
706 }
707
708 }
709 identPrimary_AST = (AST)currentAST.root;
710 returnAST = identPrimary_AST;
711 }
712
713 public final void constant() throws RecognitionException, TokenStreamException {
714
715 returnAST = null;
716 ASTPair currentAST = new ASTPair();
717 AST constant_AST = null;
718
719 switch ( LA(1)) {
720 case NUM_INT:
721 {
722 AST tmp25_AST = null;
723 tmp25_AST = astFactory.create(LT(1));
724 astFactory.addASTChild(currentAST, tmp25_AST);
725 match(NUM_INT);
726 constant_AST = (AST)currentAST.root;
727 break;
728 }
729 case CHAR_LITERAL:
730 {
731 AST tmp26_AST = null;
732 tmp26_AST = astFactory.create(LT(1));
733 astFactory.addASTChild(currentAST, tmp26_AST);
734 match(CHAR_LITERAL);
735 constant_AST = (AST)currentAST.root;
736 break;
737 }
738 case STRING_LITERAL:
739 {
740 AST tmp27_AST = null;
741 tmp27_AST = astFactory.create(LT(1));
742 astFactory.addASTChild(currentAST, tmp27_AST);
743 match(STRING_LITERAL);
744 constant_AST = (AST)currentAST.root;
745 break;
746 }
747 case NUM_FLOAT:
748 {
749 AST tmp28_AST = null;
750 tmp28_AST = astFactory.create(LT(1));
751 astFactory.addASTChild(currentAST, tmp28_AST);
752 match(NUM_FLOAT);
753 constant_AST = (AST)currentAST.root;
754 break;
755 }
756 case NUM_LONG:
757 {
758 AST tmp29_AST = null;
759 tmp29_AST = astFactory.create(LT(1));
760 astFactory.addASTChild(currentAST, tmp29_AST);
761 match(NUM_LONG);
762 constant_AST = (AST)currentAST.root;
763 break;
764 }
765 case NUM_DOUBLE:
766 {
767 AST tmp30_AST = null;
768 tmp30_AST = astFactory.create(LT(1));
769 astFactory.addASTChild(currentAST, tmp30_AST);
770 match(NUM_DOUBLE);
771 constant_AST = (AST)currentAST.root;
772 break;
773 }
774 default:
775 {
776 throw new NoViableAltException(LT(1), getFilename());
777 }
778 }
779 returnAST = constant_AST;
780 }
781
782 public final void expressionList() throws RecognitionException, TokenStreamException {
783
784 returnAST = null;
785 ASTPair currentAST = new ASTPair();
786 AST expressionList_AST = null;
787
788 unaryExpression();
789 astFactory.addASTChild(currentAST, returnAST);
790 {
791 _loop23:
792 do {
793 if ((LA(1)==COMMA)) {
794 match(COMMA);
795 unaryExpression();
796 astFactory.addASTChild(currentAST, returnAST);
797 }
798 else {
799 break _loop23;
800 }
801
802 } while (true);
803 }
804 if ( inputState.guessing==0 ) {
805 expressionList_AST = (AST)currentAST.root;
806 expressionList_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(ELIST,"ELIST")).add(expressionList_AST));
807 currentAST.root = expressionList_AST;
808 currentAST.child = expressionList_AST!=null &&expressionList_AST.getFirstChild()!=null ?
809 expressionList_AST.getFirstChild() : expressionList_AST;
810 currentAST.advanceChildToEnd();
811 }
812 expressionList_AST = (AST)currentAST.root;
813 returnAST = expressionList_AST;
814 }
815
816 public final void typeSpecification(
817 boolean addImagNode
818 ) throws RecognitionException, TokenStreamException {
819
820 returnAST = null;
821 ASTPair currentAST = new ASTPair();
822 AST typeSpecification_AST = null;
823
824 if ((LA(1)==LPAREN) && (LA(2)==IDENT)) {
825 classTypeSpecification(addImagNode);
826 astFactory.addASTChild(currentAST, returnAST);
827 typeSpecification_AST = (AST)currentAST.root;
828 }
829 else if ((LA(1)==LPAREN) && ((LA(2) >= LITERAL_boolean && LA(2) <= LITERAL_double))) {
830 builtInTypeSpecification(addImagNode);
831 astFactory.addASTChild(currentAST, returnAST);
832 typeSpecification_AST = (AST)currentAST.root;
833 }
834 else {
835 throw new NoViableAltException(LT(1), getFilename());
836 }
837
838 returnAST = typeSpecification_AST;
839 }
840
841 public final void identifier() throws RecognitionException, TokenStreamException {
842
843 returnAST = null;
844 ASTPair currentAST = new ASTPair();
845 AST identifier_AST = null;
846
847 AST tmp32_AST = null;
848 tmp32_AST = astFactory.create(LT(1));
849 astFactory.addASTChild(currentAST, tmp32_AST);
850 match(IDENT);
851 {
852 _loop36:
853 do {
854 if ((LA(1)==DOT)) {
855 AST tmp33_AST = null;
856 tmp33_AST = astFactory.create(LT(1));
857 astFactory.makeASTRoot(currentAST, tmp33_AST);
858 match(DOT);
859 AST tmp34_AST = null;
860 tmp34_AST = astFactory.create(LT(1));
861 astFactory.addASTChild(currentAST, tmp34_AST);
862 match(IDENT);
863 }
864 else {
865 break _loop36;
866 }
867
868 } while (true);
869 }
870 identifier_AST = (AST)currentAST.root;
871 returnAST = identifier_AST;
872 }
873
874 public final void builtInType() throws RecognitionException, TokenStreamException {
875
876 returnAST = null;
877 ASTPair currentAST = new ASTPair();
878 AST builtInType_AST = null;
879
880 switch ( LA(1)) {
881 case LITERAL_boolean:
882 {
883 AST tmp35_AST = null;
884 tmp35_AST = astFactory.create(LT(1));
885 astFactory.addASTChild(currentAST, tmp35_AST);
886 match(LITERAL_boolean);
887 builtInType_AST = (AST)currentAST.root;
888 break;
889 }
890 case LITERAL_byte:
891 {
892 AST tmp36_AST = null;
893 tmp36_AST = astFactory.create(LT(1));
894 astFactory.addASTChild(currentAST, tmp36_AST);
895 match(LITERAL_byte);
896 builtInType_AST = (AST)currentAST.root;
897 break;
898 }
899 case LITERAL_char:
900 {
901 AST tmp37_AST = null;
902 tmp37_AST = astFactory.create(LT(1));
903 astFactory.addASTChild(currentAST, tmp37_AST);
904 match(LITERAL_char);
905 builtInType_AST = (AST)currentAST.root;
906 break;
907 }
908 case LITERAL_short:
909 {
910 AST tmp38_AST = null;
911 tmp38_AST = astFactory.create(LT(1));
912 astFactory.addASTChild(currentAST, tmp38_AST);
913 match(LITERAL_short);
914 builtInType_AST = (AST)currentAST.root;
915 break;
916 }
917 case LITERAL_int:
918 {
919 AST tmp39_AST = null;
920 tmp39_AST = astFactory.create(LT(1));
921 astFactory.addASTChild(currentAST, tmp39_AST);
922 match(LITERAL_int);
923 builtInType_AST = (AST)currentAST.root;
924 break;
925 }
926 case LITERAL_float:
927 {
928 AST tmp40_AST = null;
929 tmp40_AST = astFactory.create(LT(1));
930 astFactory.addASTChild(currentAST, tmp40_AST);
931 match(LITERAL_float);
932 builtInType_AST = (AST)currentAST.root;
933 break;
934 }
935 case LITERAL_long:
936 {
937 AST tmp41_AST = null;
938 tmp41_AST = astFactory.create(LT(1));
939 astFactory.addASTChild(currentAST, tmp41_AST);
940 match(LITERAL_long);
941 builtInType_AST = (AST)currentAST.root;
942 break;
943 }
944 case LITERAL_double:
945 {
946 AST tmp42_AST = null;
947 tmp42_AST = astFactory.create(LT(1));
948 astFactory.addASTChild(currentAST, tmp42_AST);
949 match(LITERAL_double);
950 builtInType_AST = (AST)currentAST.root;
951 break;
952 }
953 default:
954 {
955 throw new NoViableAltException(LT(1), getFilename());
956 }
957 }
958 returnAST = builtInType_AST;
959 }
960
961 public final void type() throws RecognitionException, TokenStreamException {
962
963 returnAST = null;
964 ASTPair currentAST = new ASTPair();
965 AST type_AST = null;
966
967 switch ( LA(1)) {
968 case IDENT:
969 {
970 identifier();
971 astFactory.addASTChild(currentAST, returnAST);
972 type_AST = (AST)currentAST.root;
973 break;
974 }
975 case LITERAL_boolean:
976 case LITERAL_byte:
977 case LITERAL_char:
978 case LITERAL_short:
979 case LITERAL_int:
980 case LITERAL_float:
981 case LITERAL_long:
982 case LITERAL_double:
983 {
984 builtInType();
985 astFactory.addASTChild(currentAST, returnAST);
986 type_AST = (AST)currentAST.root;
987 break;
988 }
989 default:
990 {
991 throw new NoViableAltException(LT(1), getFilename());
992 }
993 }
994 returnAST = type_AST;
995 }
996
997 public final void declaratorBrackets(
998 AST typ
999 ) throws RecognitionException, TokenStreamException {
1000
1001 returnAST = null;
1002 ASTPair currentAST = new ASTPair();
1003 AST declaratorBrackets_AST = null;
1004 Token lb = null;
1005 AST lb_AST = null;
1006
1007 if ( inputState.guessing==0 ) {
1008 declaratorBrackets_AST = (AST)currentAST.root;
1009 declaratorBrackets_AST=typ;
1010 currentAST.root = declaratorBrackets_AST;
1011 currentAST.child = declaratorBrackets_AST!=null &&declaratorBrackets_AST.getFirstChild()!=null ?
1012 declaratorBrackets_AST.getFirstChild() : declaratorBrackets_AST;
1013 currentAST.advanceChildToEnd();
1014 }
1015 {
1016 _loop39:
1017 do {
1018 if ((LA(1)==LBRACK)) {
1019 lb = LT(1);
1020 lb_AST = astFactory.create(lb);
1021 astFactory.makeASTRoot(currentAST, lb_AST);
1022 match(LBRACK);
1023 if ( inputState.guessing==0 ) {
1024 lb_AST.setType(ARRAY_DECLARATOR);
1025 }
1026 match(RBRACK);
1027 }
1028 else {
1029 break _loop39;
1030 }
1031
1032 } while (true);
1033 }
1034 declaratorBrackets_AST = (AST)currentAST.root;
1035 returnAST = declaratorBrackets_AST;
1036 }
1037
1038
1039 public static final String[] _tokenNames = {
1040 "<0>",
1041 "EOF",
1042 "<2>",
1043 "NULL_TREE_LOOKAHEAD",
1044 "PARAMETERS",
1045 "PARAMETER_DEF",
1046 "TYPE",
1047 "ARRAY_DECLARATOR",
1048 "TYPECAST",
1049 "METHOD_CALL",
1050 "INDEX_OP",
1051 "ELIST",
1052 "MINUS",
1053 "PLUS",
1054 "LNOT",
1055 "LPAREN",
1056 "RPAREN",
1057 "DOT",
1058 "IDENT",
1059 "LBRACK",
1060 "RBRACK",
1061 "\"true\"",
1062 "\"false\"",
1063 "\"null\"",
1064 "COMMA",
1065 "NUM_INT",
1066 "CHAR_LITERAL",
1067 "STRING_LITERAL",
1068 "NUM_FLOAT",
1069 "NUM_LONG",
1070 "NUM_DOUBLE",
1071 "\"boolean\"",
1072 "\"byte\"",
1073 "\"char\"",
1074 "\"short\"",
1075 "\"int\"",
1076 "\"float\"",
1077 "\"long\"",
1078 "\"double\"",
1079 "COLON",
1080 "WS",
1081 "ESC",
1082 "HEX_DIGIT",
1083 "VOCAB",
1084 "EXPONENT",
1085 "FLOAT_SUFFIX"
1086 };
1087
1088 protected void buildTokenTypeASTClassMap() {
1089 tokenTypeToASTClassMap=null;
1090 };
1091
1092 private static final long[] mk_tokenSet_0() {
1093 long[] data = { 2128871424L, 0L};
1094 return data;
1095 }
1096 public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
1097 private static final long[] mk_tokenSet_1() {
1098 long[] data = { 18579458L, 0L};
1099 return data;
1100 }
1101 public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
1102 private static final long[] mk_tokenSet_2() {
1103 long[] data = { 18546690L, 0L};
1104 return data;
1105 }
1106 public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
1107 private static final long[] mk_tokenSet_3() {
1108 long[] data = { 2147479554L, 0L};
1109 return data;
1110 }
1111 public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
1112
1113 }
1114