1
2
3 package org.codehaus.groovy.antlr.parser;
4 import org.codehaus.groovy.antlr.*;
5 import java.util.*;
6 import java.io.InputStream;
7 import java.io.Reader;
8 import antlr.InputBuffer;
9 import antlr.LexerSharedInputState;
10
11 import antlr.TokenBuffer;
12 import antlr.TokenStreamException;
13 import antlr.TokenStreamIOException;
14 import antlr.ANTLRException;
15 import antlr.LLkParser;
16 import antlr.Token;
17 import antlr.TokenStream;
18 import antlr.RecognitionException;
19 import antlr.NoViableAltException;
20 import antlr.MismatchedTokenException;
21 import antlr.SemanticException;
22 import antlr.ParserSharedInputState;
23 import antlr.collections.impl.BitSet;
24 import antlr.collections.AST;
25 import java.util.Hashtable;
26 import antlr.ASTFactory;
27 import antlr.ASTPair;
28 import antlr.collections.impl.ASTArray;
29
30 /*** JSR-241 Groovy Recognizer
31 *
32 * Run 'java Main [-showtree] directory-full-of-groovy-files'
33 *
34 * [The -showtree option pops up a Swing frame that shows
35 * the AST constructed from the parser.]
36 *
37 * Contributing authors:
38 * John Mitchell johnm@non.net
39 * Terence Parr parrt@magelang.com
40 * John Lilley jlilley@empathy.com
41 * Scott Stanchfield thetick@magelang.com
42 * Markus Mohnen mohnen@informatik.rwth-aachen.de
43 * Peter Williams pete.williams@sun.com
44 * Allan Jacobs Allan.Jacobs@eng.sun.com
45 * Steve Messick messick@redhills.com
46 * James Strachan jstrachan@protique.com
47 * John Pybus john@pybus.org
48 * John Rose rose00@mac.com
49 * Jeremy Rayner groovy@ross-rayner.com
50 *
51 * Version 1.00 December 9, 1997 -- initial release
52 * Version 1.01 December 10, 1997
53 * fixed bug in octal def (0..7 not 0..8)
54 * Version 1.10 August 1998 (parrt)
55 * added tree construction
56 * fixed definition of WS,comments for mac,pc,unix newlines
57 * added unary plus
58 * Version 1.11 (Nov 20, 1998)
59 * Added "shutup" option to turn off last ambig warning.
60 * Fixed inner class def to allow named class defs as statements
61 * synchronized requires compound not simple statement
62 * add [] after builtInType DOT class in primaryExpression
63 * "const" is reserved but not valid..removed from modifiers
64 * Version 1.12 (Feb 2, 1999)
65 * Changed LITERAL_xxx to xxx in tree grammar.
66 * Updated java.g to use tokens {...} now for 2.6.0 (new feature).
67 *
68 * Version 1.13 (Apr 23, 1999)
69 * Didn't have (stat)? for else clause in tree parser.
70 * Didn't gen ASTs for interface extends. Updated tree parser too.
71 * Updated to 2.6.0.
72 * Version 1.14 (Jun 20, 1999)
73 * Allowed final/abstract on local classes.
74 * Removed local interfaces from methods
75 * Put instanceof precedence where it belongs...in relationalExpr
76 * It also had expr not type as arg; fixed it.
77 * Missing ! on SEMI in classBlock
78 * fixed: (expr) + "string" was parsed incorrectly (+ as unary plus).
79 * fixed: didn't like Object[].class in parser or tree parser
80 * Version 1.15 (Jun 26, 1999)
81 * Screwed up rule with instanceof in it. :( Fixed.
82 * Tree parser didn't like (expr).something; fixed.
83 * Allowed multiple inheritance in tree grammar. oops.
84 * Version 1.16 (August 22, 1999)
85 * Extending an interface built a wacky tree: had extra EXTENDS.
86 * Tree grammar didn't allow multiple superinterfaces.
87 * Tree grammar didn't allow empty var initializer: {}
88 * Version 1.17 (October 12, 1999)
89 * ESC lexer rule allowed 399 max not 377 max.
90 * java.tree.g didn't handle the expression of synchronized
91 * statements.
92 * Version 1.18 (August 12, 2001)
93 * Terence updated to Java 2 Version 1.3 by
94 * observing/combining work of Allan Jacobs and Steve
95 * Messick. Handles 1.3 src. Summary:
96 * o primary didn't include boolean.class kind of thing
97 * o constructor calls parsed explicitly now:
98 * see explicitConstructorInvocation
99 * o add strictfp modifier
100 * o missing objBlock after new expression in tree grammar
101 * o merged local class definition alternatives, moved after declaration
102 * o fixed problem with ClassName.super.field
103 * o reordered some alternatives to make things more efficient
104 * o long and double constants were not differentiated from int/float
105 * o whitespace rule was inefficient: matched only one char
106 * o add an examples directory with some nasty 1.3 cases
107 * o made Main.java use buffered IO and a Reader for Unicode support
108 * o supports UNICODE?
109 * Using Unicode charVocabulay makes code file big, but only
110 * in the bitsets at the end. I need to make ANTLR generate
111 * unicode bitsets more efficiently.
112 * Version 1.19 (April 25, 2002)
113 * Terence added in nice fixes by John Pybus concerning floating
114 * constants and problems with super() calls. John did a nice
115 * reorg of the primary/postfix expression stuff to read better
116 * and makes f.g.super() parse properly (it was METHOD_CALL not
117 * a SUPER_CTOR_CALL). Also:
118 *
119 * o "finally" clause was a root...made it a child of "try"
120 * o Added stuff for asserts too for Java 1.4, but *commented out*
121 * as it is not backward compatible.
122 *
123 * Version 1.20 (October 27, 2002)
124 *
125 * Terence ended up reorging John Pybus' stuff to
126 * remove some nondeterminisms and some syntactic predicates.
127 * Note that the grammar is stricter now; e.g., this(...) must
128 * be the first statement.
129 *
130 * Trinary ?: operator wasn't working as array name:
131 * (isBig ? bigDigits : digits)[i];
132 *
133 * Checked parser/tree parser on source for
134 * Resin-2.0.5, jive-2.1.1, jdk 1.3.1, Lucene, antlr 2.7.2a4,
135 * and the 110k-line jGuru server source.
136 *
137 * Version 1.21 (October 17, 2003)
138 * Fixed lots of problems including:
139 * Ray Waldin: add typeDefinition to interfaceBlock in java.tree.g
140 * He found a problem/fix with floating point that start with 0
141 * Ray also fixed problem that (int.class) was not recognized.
142 * Thorsten van Ellen noticed that \n are allowed incorrectly in strings.
143 * TJP fixed CHAR_LITERAL analogously.
144 *
145 * Version 1.21.2 (March, 2003)
146 * Changes by Matt Quail to support generics (as per JDK1.5/JSR14)
147 * Notes:
148 * o We only allow the "extends" keyword and not the "implements"
149 * keyword, since thats what JSR14 seems to imply.
150 * o Thanks to Monty Zukowski for his help on the antlr-interest
151 * mail list.
152 * o Thanks to Alan Eliasen for testing the grammar over his
153 * Fink source base
154 *
155 * Version 1.22 (July, 2004)
156 * Changes by Michael Studman to support Java 1.5 language extensions
157 * Notes:
158 * o Added support for annotations types
159 * o Finished off Matt Quail's generics enhancements to support bound type arguments
160 * o Added support for new for statement syntax
161 * o Added support for static import syntax
162 * o Added support for enum types
163 * o Tested against JDK 1.5 source base and source base of jdigraph project
164 * o Thanks to Matt Quail for doing the hard part by doing most of the generics work
165 *
166 * Version 1.22.1 (July 28, 2004)
167 * Bug/omission fixes for Java 1.5 language support
168 * o Fixed tree structure bug with classOrInterface - thanks to Pieter Vangorpto for
169 * spotting this
170 * o Fixed bug where incorrect handling of SR and BSR tokens would cause type
171 * parameters to be recognised as type arguments.
172 * o Enabled type parameters on constructors, annotations on enum constants
173 * and package definitions
174 * o Fixed problems when parsing if ((char.class.equals(c))) {} - solution by Matt Quail at Cenqua
175 *
176 * Version 1.22.2 (July 28, 2004)
177 * Slight refactoring of Java 1.5 language support
178 * o Refactored for/"foreach" productions so that original literal "for" literal
179 * is still used but the for sub-clauses vary by token type
180 * o Fixed bug where type parameter was not included in generic constructor's branch of AST
181 *
182 * Version 1.22.3 (August 26, 2004)
183 * Bug fixes as identified by Michael Stahl; clean up of tabs/spaces
184 * and other refactorings
185 * o Fixed typeParameters omission in identPrimary and newStatement
186 * o Replaced GT reconcilliation code with simple semantic predicate
187 * o Adapted enum/assert keyword checking support from Michael Stahl's java15 grammar
188 * o Refactored typeDefinition production and field productions to reduce duplication
189 *
190 * Version 1.22.4 (October 21, 2004)
191 * Small bux fixes
192 * o Added typeArguments to explicitConstructorInvocation, e.g. new <String>MyParameterised()
193 * o Added typeArguments to postfixExpression productions for anonymous inner class super
194 * constructor invocation, e.g. new Outer().<String>super()
195 * o Fixed bug in array declarations identified by Geoff Roy
196 *
197 * Version 1.22.4.g.1
198 * o I have taken java.g for Java1.5 from Michael Studman (1.22.4)
199 * and have applied the groovy.diff from java.g (1.22) by John Rose
200 * back onto the new root (1.22.4) - Jeremy Rayner (Jan 2005)
201 * o for a map of the task see...
202 * http://groovy.javanicus.com/java-g.png
203 *
204 * This grammar is in the PUBLIC DOMAIN
205 */
206 public class GroovyRecognizer extends antlr.LLkParser implements GroovyTokenTypes
207 {
208
209 /*** This factory is the correct way to wire together a Groovy parser and lexer. */
210 public static GroovyRecognizer make(GroovyLexer lexer) {
211 GroovyRecognizer parser = new GroovyRecognizer(lexer.plumb());
212
213 parser.lexer = lexer;
214 lexer.parser = parser;
215 parser.setASTNodeClass("org.codehaus.groovy.antlr.GroovySourceAST");
216 parser.warningList = new ArrayList();
217 return parser;
218 }
219
220 public static GroovyRecognizer make(InputStream in) { return make(new GroovyLexer(in)); }
221 public static GroovyRecognizer make(Reader in) { return make(new GroovyLexer(in)); }
222 public static GroovyRecognizer make(InputBuffer in) { return make(new GroovyLexer(in)); }
223 public static GroovyRecognizer make(LexerSharedInputState in) { return make(new GroovyLexer(in)); }
224
225 private static GroovySourceAST dummyVariableToforceClassLoaderToFindASTClass = new GroovySourceAST();
226
227 List warningList;
228 public List getWarningList() { return warningList; }
229
230 GroovyLexer lexer;
231 public GroovyLexer getLexer() { return lexer; }
232 public void setFilename(String f) { super.setFilename(f); lexer.setFilename(f); }
233 private SourceBuffer sourceBuffer;
234 public void setSourceBuffer(SourceBuffer sourceBuffer) {
235 this.sourceBuffer = sourceBuffer;
236 }
237
238 /*** Create an AST node with the token type and text passed in, but
239 * with the same background information as another supplied Token (e.g. line numbers)
240 * to be used in place of antlr tree construction syntax,
241 * i.e. #[TOKEN,"text"] becomes create(TOKEN,"text",anotherToken)
242 *
243 * todo - change antlr.ASTFactory to do this instead...
244 */
245 public AST create(int type, String txt, Token first, Token last) {
246 AST t = astFactory.create(type,txt);
247 if ( t != null && first != null) {
248
249 t.initialize(first);
250
251 t.initialize(type,txt);
252 }
253
254 if ((t instanceof GroovySourceAST) && last != null) {
255 GroovySourceAST node = (GroovySourceAST)t;
256 node.setLast(last);
257
258
259 }
260 return t;
261 }
262
263
264
265 public static boolean tracing = false;
266 public void traceIn(String rname) throws TokenStreamException {
267 if (!GroovyRecognizer.tracing) return;
268 super.traceIn(rname);
269 }
270 public void traceOut(String rname) throws TokenStreamException {
271 if (!GroovyRecognizer.tracing) return;
272 if (returnAST != null) rname += returnAST.toStringList();
273 super.traceOut(rname);
274 }
275
276
277 public void requireFailed(String problem, String solution) throws SemanticException {
278
279 Token lt = null;
280 try { lt = LT(1); }
281 catch (TokenStreamException ee) { }
282 if (lt == null) lt = Token.badToken;
283 throw new SemanticException(problem + ";\n solution: " + solution,
284 getFilename(), lt.getLine(), lt.getColumn());
285 }
286
287 public void addWarning(String warning, String solution) {
288 Token lt = null;
289 try { lt = LT(1); }
290 catch (TokenStreamException ee) { }
291 if (lt == null) lt = Token.badToken;
292
293 Map row = new HashMap();
294 row.put("warning" ,warning);
295 row.put("solution",solution);
296 row.put("filename",getFilename());
297 row.put("line" ,new Integer(lt.getLine()));
298 row.put("column" ,new Integer(lt.getColumn()));
299
300 warningList.add(row);
301 }
302
303
304 private void require(boolean z, String problem, String solution) throws SemanticException {
305 if (!z) requireFailed(problem, solution);
306 }
307
308
309
310
311 private boolean isUpperCase(Token x) {
312 if (x == null || x.getType() != IDENT) return false;
313 String xtext = x.getText();
314 return (xtext.length() > 0 && Character.isUpperCase(xtext.charAt(0)));
315 }
316
317 private AST currentClass = null;
318
319
320 private boolean isConstructorIdent(Token x) {
321 if (currentClass == null) return false;
322 if (currentClass.getType() != IDENT) return false;
323 String cname = currentClass.getText();
324
325 if (x == null || x.getType() != IDENT) return false;
326 return cname.equals(x.getText());
327 }
328
329
330
331
332 private int sepToken = EOF;
333
334
335
336 private boolean argListHasLabels = false;
337
338
339
340 private AST lastPathExpression = null;
341
342
343
344
345
346
347 private final int LC_STMT = 1, LC_INIT = 2;
348
349 /***
350 * Counts the number of LT seen in the typeArguments production.
351 * It is used in semantic predicates to ensure we have seen
352 * enough closing '>' characters; which actually may have been
353 * either GT, SR or BSR tokens.
354 */
355 private int ltCounter = 0;
356
357
358
359
360
361
362
363
364
365
366
367
368
369 private static final boolean ANTLR_LOOP_EXIT = false;
370
371 protected GroovyRecognizer(TokenBuffer tokenBuf, int k) {
372 super(tokenBuf,k);
373 tokenNames = _tokenNames;
374 buildTokenTypeASTClassMap();
375 astFactory = new ASTFactory(getTokenTypeToASTClassMap());
376 }
377
378 public GroovyRecognizer(TokenBuffer tokenBuf) {
379 this(tokenBuf,3);
380 }
381
382 protected GroovyRecognizer(TokenStream lexer, int k) {
383 super(lexer,k);
384 tokenNames = _tokenNames;
385 buildTokenTypeASTClassMap();
386 astFactory = new ASTFactory(getTokenTypeToASTClassMap());
387 }
388
389 public GroovyRecognizer(TokenStream lexer) {
390 this(lexer,3);
391 }
392
393 public GroovyRecognizer(ParserSharedInputState state) {
394 super(state,3);
395 tokenNames = _tokenNames;
396 buildTokenTypeASTClassMap();
397 astFactory = new ASTFactory(getTokenTypeToASTClassMap());
398 }
399
400 public final void compilationUnit() throws RecognitionException, TokenStreamException {
401
402 returnAST = null;
403 ASTPair currentAST = new ASTPair();
404 AST compilationUnit_AST = null;
405
406 {
407 switch ( LA(1)) {
408 case SH_COMMENT:
409 {
410 match(SH_COMMENT);
411 break;
412 }
413 case EOF:
414 case FINAL:
415 case ABSTRACT:
416 case STRICTFP:
417 case LITERAL_package:/package-summary.html">g> LITERAL_package:
418 case LITERAL_import:
419 case LITERAL_static:
420 case LITERAL_def:
421 case AT:
422 case IDENT:
423 case LBRACK:
424 case LPAREN:
425 case LITERAL_class:
426 case LITERAL_interface:
427 case LITERAL_enum:
428 case LITERAL_super:
429 case LITERAL_void:
430 case LITERAL_boolean:
431 case LITERAL_byte:
432 case LITERAL_char:
433 case LITERAL_short:
434 case LITERAL_int:
435 case LITERAL_float:
436 case LITERAL_long:
437 case LITERAL_double:
438 case LITERAL_any:
439 case STAR:
440 case LITERAL_private:
441 case LITERAL_public:
442 case LITERAL_protected:
443 case LITERAL_transient:
444 case LITERAL_native:
445 case LITERAL_threadsafe:
446 case LITERAL_synchronized:
447 case LITERAL_volatile:
448 case LCURLY:
449 case SEMI:
450 case NLS:
451 case LITERAL_this:
452 case STRING_LITERAL:
453 case LITERAL_if:
454 case LITERAL_while:
455 case LITERAL_with:
456 case LITERAL_switch:
457 case LITERAL_for:
458 case LITERAL_return:
459 case LITERAL_break:
460 case LITERAL_continue:
461 case LITERAL_throw:
462 case LITERAL_assert:
463 case PLUS:
464 case MINUS:
465 case LITERAL_try:
466 case INC:
467 case DEC:
468 case BNOT:
469 case LNOT:
470 case DOLLAR:
471 case STRING_CTOR_START:
472 case LITERAL_new:
473 case LITERAL_true:
474 case LITERAL_false:
475 case LITERAL_null:
476 case NUM_INT:
477 case NUM_FLOAT:
478 case NUM_LONG:
479 case NUM_DOUBLE:
480 case NUM_BIG_INT:
481 case NUM_BIG_DECIMAL:
482 {
483 break;
484 }
485 default:
486 {
487 throw new NoViableAltException(LT(1), getFilename());
488 }
489 }
490 }
491 nls();
492 {
493 boolean synPredMatched5 = false;
494 if (((LA(1)==LITERAL_package||LA(1)==AT) && (LA(2)==IDENT) && (_tokenSet_0.member(LA(3))))) {
495 int _m5 = mark();
496 synPredMatched5 = true;
497 inputState.guessing++;
498 try {
499 {
500 annotationsOpt();
501 match(LITERAL_package);
502 }
503 }
504 catch (RecognitionException pe) {
505 synPredMatched5 = false;
506 }
507 rewind(_m5);
508 inputState.guessing--;
509 }
510 if ( synPredMatched5 ) {
511 packageDefinition();
512 astFactory.addASTChild(currentAST, returnAST);
513 }
514 else if ((_tokenSet_1.member(LA(1))) && (_tokenSet_2.member(LA(2))) && (_tokenSet_3.member(LA(3)))) {
515 {
516 switch ( LA(1)) {
517 case FINAL:
518 case ABSTRACT:
519 case STRICTFP:
520 case LITERAL_import:
521 case LITERAL_static:
522 case LITERAL_def:
523 case AT:
524 case IDENT:
525 case LBRACK:
526 case LPAREN:
527 case LITERAL_class:
528 case LITERAL_interface:
529 case LITERAL_enum:
530 case LITERAL_super:
531 case LITERAL_void:
532 case LITERAL_boolean:
533 case LITERAL_byte:
534 case LITERAL_char:
535 case LITERAL_short:
536 case LITERAL_int:
537 case LITERAL_float:
538 case LITERAL_long:
539 case LITERAL_double:
540 case LITERAL_any:
541 case STAR:
542 case LITERAL_private:
543 case LITERAL_public:
544 case LITERAL_protected:
545 case LITERAL_transient:
546 case LITERAL_native:
547 case LITERAL_threadsafe:
548 case LITERAL_synchronized:
549 case LITERAL_volatile:
550 case LCURLY:
551 case LITERAL_this:
552 case STRING_LITERAL:
553 case LITERAL_if:
554 case LITERAL_while:
555 case LITERAL_with:
556 case LITERAL_switch:
557 case LITERAL_for:
558 case LITERAL_return:
559 case LITERAL_break:
560 case LITERAL_continue:
561 case LITERAL_throw:
562 case LITERAL_assert:
563 case PLUS:
564 case MINUS:
565 case LITERAL_try:
566 case INC:
567 case DEC:
568 case BNOT:
569 case LNOT:
570 case DOLLAR:
571 case STRING_CTOR_START:
572 case LITERAL_new:
573 case LITERAL_true:
574 case LITERAL_false:
575 case LITERAL_null:
576 case NUM_INT:
577 case NUM_FLOAT:
578 case NUM_LONG:
579 case NUM_DOUBLE:
580 case NUM_BIG_INT:
581 case NUM_BIG_DECIMAL:
582 {
583 statement(EOF);
584 astFactory.addASTChild(currentAST, returnAST);
585 break;
586 }
587 case EOF:
588 case SEMI:
589 case NLS:
590 {
591 break;
592 }
593 default:
594 {
595 throw new NoViableAltException(LT(1), getFilename());
596 }
597 }
598 }
599 }
600 else {
601 throw new NoViableAltException(LT(1), getFilename());
602 }
603
604 }
605 {
606 _loop9:
607 do {
608 if ((LA(1)==SEMI||LA(1)==NLS)) {
609 sep();
610 {
611 switch ( LA(1)) {
612 case FINAL:
613 case ABSTRACT:
614 case STRICTFP:
615 case LITERAL_import:
616 case LITERAL_static:
617 case LITERAL_def:
618 case AT:
619 case IDENT:
620 case LBRACK:
621 case LPAREN:
622 case LITERAL_class:
623 case LITERAL_interface:
624 case LITERAL_enum:
625 case LITERAL_super:
626 case LITERAL_void:
627 case LITERAL_boolean:
628 case LITERAL_byte:
629 case LITERAL_char:
630 case LITERAL_short:
631 case LITERAL_int:
632 case LITERAL_float:
633 case LITERAL_long:
634 case LITERAL_double:
635 case LITERAL_any:
636 case STAR:
637 case LITERAL_private:
638 case LITERAL_public:
639 case LITERAL_protected:
640 case LITERAL_transient:
641 case LITERAL_native:
642 case LITERAL_threadsafe:
643 case LITERAL_synchronized:
644 case LITERAL_volatile:
645 case LCURLY:
646 case LITERAL_this:
647 case STRING_LITERAL:
648 case LITERAL_if:
649 case LITERAL_while:
650 case LITERAL_with:
651 case LITERAL_switch:
652 case LITERAL_for:
653 case LITERAL_return:
654 case LITERAL_break:
655 case LITERAL_continue:
656 case LITERAL_throw:
657 case LITERAL_assert:
658 case PLUS:
659 case MINUS:
660 case LITERAL_try:
661 case INC:
662 case DEC:
663 case BNOT:
664 case LNOT:
665 case DOLLAR:
666 case STRING_CTOR_START:
667 case LITERAL_new:
668 case LITERAL_true:
669 case LITERAL_false:
670 case LITERAL_null:
671 case NUM_INT:
672 case NUM_FLOAT:
673 case NUM_LONG:
674 case NUM_DOUBLE:
675 case NUM_BIG_INT:
676 case NUM_BIG_DECIMAL:
677 {
678 statement(sepToken);
679 astFactory.addASTChild(currentAST, returnAST);
680 break;
681 }
682 case EOF:
683 case SEMI:
684 case NLS:
685 {
686 break;
687 }
688 default:
689 {
690 throw new NoViableAltException(LT(1), getFilename());
691 }
692 }
693 }
694 }
695 else {
696 break _loop9;
697 }
698
699 } while (true);
700 }
701 match(Token.EOF_TYPE);
702 compilationUnit_AST = (AST)currentAST.root;
703 returnAST = compilationUnit_AST;
704 }
705
706 /*** Zero or more insignificant newlines, all gobbled up and thrown away. */
707 public final void nls() throws RecognitionException, TokenStreamException {
708
709 returnAST = null;
710 ASTPair currentAST = new ASTPair();
711 AST nls_AST = null;
712
713 {
714 if ((LA(1)==NLS) && (_tokenSet_4.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
715 match(NLS);
716 }
717 else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
718 }
719 else {
720 throw new NoViableAltException(LT(1), getFilename());
721 }
722
723 }
724 returnAST = nls_AST;
725 }
726
727 public final void annotationsOpt() throws RecognitionException, TokenStreamException {
728
729 returnAST = null;
730 ASTPair currentAST = new ASTPair();
731 AST annotationsOpt_AST = null;
732 Token first = LT(1);
733
734 {
735 _loop79:
736 do {
737 if ((LA(1)==AT)) {
738 annotation();
739 astFactory.addASTChild(currentAST, returnAST);
740 nls();
741 }
742 else {
743 break _loop79;
744 }
745
746 } while (true);
747 }
748 if ( inputState.guessing==0 ) {
749 annotationsOpt_AST = (AST)currentAST.root;
750 annotationsOpt_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(ANNOTATIONS,"ANNOTATIONS",first,LT(1))).add(annotationsOpt_AST));
751 currentAST.root = annotationsOpt_AST;
752 currentAST.child = annotationsOpt_AST!=null &&annotationsOpt_AST.getFirstChild()!=null ?
753 annotationsOpt_AST.getFirstChild() : annotationsOpt_AST;
754 currentAST.advanceChildToEnd();
755 }
756 annotationsOpt_AST = (AST)currentAST.root;
757 returnAST = annotationsOpt_AST;
758 }
759
760 public final void packageDefinition() throws RecognitionException, TokenStreamException {/package-summary.html">> final void packageDefinition() throws RecognitionException, TokenStreamException {
761
762 returnAST = null;
763 ASTPair currentAST = new ASTPair();
764 AST packageDefinition_AST = null;
765 Token p = null;
766 AST p_AST = null;
767
768 annotationsOpt();
769 astFactory.addASTChild(currentAST, returnAST);
770 p = LT(1);
771 p_AST = astFactory.create(p);
772 astFactory.makeASTRoot(currentAST, p_AST);
773 match(LITERAL_package);
774 if ( inputState.guessing==0 ) {
775 p_AST.setType(PACKAGE_DEF);
776 }
777 identifier();
778 astFactory.addASTChild(currentAST, returnAST);
779 packageDefinition_AST = (AST)currentAST.root;
780 returnAST = packageDefinition_AST;
781 }
782
783 /*** A statement is an element of a block.
784 * Typical statements are declarations (which are scoped to the block)
785 * and expressions.
786 */
787 public final void statement(
788 int prevToken
789 ) throws RecognitionException, TokenStreamException {
790
791 returnAST = null;
792 ASTPair currentAST = new ASTPair();
793 AST statement_AST = null;
794 AST pfx_AST = null;
795 AST m_AST = null;
796 Token sp = null;
797 AST sp_AST = null;
798
799 switch ( LA(1)) {
800 case LITERAL_if:
801 {
802 AST tmp4_AST = null;
803 tmp4_AST = astFactory.create(LT(1));
804 astFactory.makeASTRoot(currentAST, tmp4_AST);
805 match(LITERAL_if);
806 match(LPAREN);
807 assignmentLessExpression();
808 astFactory.addASTChild(currentAST, returnAST);
809 match(RPAREN);
810 nlsWarn();
811 compatibleBodyStatement();
812 astFactory.addASTChild(currentAST, returnAST);
813 {
814 boolean synPredMatched251 = false;
815 if (((_tokenSet_6.member(LA(1))) && (_tokenSet_7.member(LA(2))) && (_tokenSet_8.member(LA(3))))) {
816 int _m251 = mark();
817 synPredMatched251 = true;
818 inputState.guessing++;
819 try {
820 {
821 {
822 switch ( LA(1)) {
823 case SEMI:
824 case NLS:
825 {
826 sep();
827 break;
828 }
829 case LITERAL_else:
830 {
831 break;
832 }
833 default:
834 {
835 throw new NoViableAltException(LT(1), getFilename());
836 }
837 }
838 }
839 match(LITERAL_else);
840 }
841 }
842 catch (RecognitionException pe) {
843 synPredMatched251 = false;
844 }
845 rewind(_m251);
846 inputState.guessing--;
847 }
848 if ( synPredMatched251 ) {
849 {
850 switch ( LA(1)) {
851 case SEMI:
852 case NLS:
853 {
854 sep();
855 break;
856 }
857 case LITERAL_else:
858 {
859 break;
860 }
861 default:
862 {
863 throw new NoViableAltException(LT(1), getFilename());
864 }
865 }
866 }
867 match(LITERAL_else);
868 nlsWarn();
869 compatibleBodyStatement();
870 astFactory.addASTChild(currentAST, returnAST);
871 }
872 else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
873 }
874 else {
875 throw new NoViableAltException(LT(1), getFilename());
876 }
877
878 }
879 statement_AST = (AST)currentAST.root;
880 break;
881 }
882 case LITERAL_for:
883 {
884 forStatement();
885 astFactory.addASTChild(currentAST, returnAST);
886 statement_AST = (AST)currentAST.root;
887 break;
888 }
889 case LITERAL_while:
890 {
891 AST tmp8_AST = null;
892 tmp8_AST = astFactory.create(LT(1));
893 astFactory.makeASTRoot(currentAST, tmp8_AST);
894 match(LITERAL_while);
895 match(LPAREN);
896 strictContextExpression();
897 astFactory.addASTChild(currentAST, returnAST);
898 match(RPAREN);
899 nlsWarn();
900 compatibleBodyStatement();
901 astFactory.addASTChild(currentAST, returnAST);
902 statement_AST = (AST)currentAST.root;
903 break;
904 }
905 case LITERAL_with:
906 {
907 AST tmp11_AST = null;
908 tmp11_AST = astFactory.create(LT(1));
909 astFactory.makeASTRoot(currentAST, tmp11_AST);
910 match(LITERAL_with);
911 match(LPAREN);
912 strictContextExpression();
913 astFactory.addASTChild(currentAST, returnAST);
914 match(RPAREN);
915 nlsWarn();
916 compoundStatement();
917 astFactory.addASTChild(currentAST, returnAST);
918 statement_AST = (AST)currentAST.root;
919 break;
920 }
921 case STAR:
922 {
923 sp = LT(1);
924 sp_AST = astFactory.create(sp);
925 astFactory.makeASTRoot(currentAST, sp_AST);
926 match(STAR);
927 nls();
928 if ( inputState.guessing==0 ) {
929 sp_AST.setType(SPREAD_ARG);
930 }
931 expressionStatement(EOF);
932 astFactory.addASTChild(currentAST, returnAST);
933 statement_AST = (AST)currentAST.root;
934 break;
935 }
936 case LITERAL_import:
937 {
938 importStatement();
939 astFactory.addASTChild(currentAST, returnAST);
940 statement_AST = (AST)currentAST.root;
941 break;
942 }
943 case LITERAL_switch:
944 {
945 AST tmp14_AST = null;
946 tmp14_AST = astFactory.create(LT(1));
947 astFactory.makeASTRoot(currentAST, tmp14_AST);
948 match(LITERAL_switch);
949 match(LPAREN);
950 strictContextExpression();
951 astFactory.addASTChild(currentAST, returnAST);
952 match(RPAREN);
953 nlsWarn();
954 match(LCURLY);
955 nls();
956 {
957 _loop254:
958 do {
959 if ((LA(1)==LITERAL_default||LA(1)==LITERAL_case)) {
960 casesGroup();
961 astFactory.addASTChild(currentAST, returnAST);
962 }
963 else {
964 break _loop254;
965 }
966
967 } while (true);
968 }
969 match(RCURLY);
970 statement_AST = (AST)currentAST.root;
971 break;
972 }
973 case LITERAL_try:
974 {
975 tryBlock();
976 astFactory.addASTChild(currentAST, returnAST);
977 statement_AST = (AST)currentAST.root;
978 break;
979 }
980 case LITERAL_return:
981 case LITERAL_break:
982 case LITERAL_continue:
983 case LITERAL_throw:
984 case LITERAL_assert:
985 {
986 branchStatement();
987 astFactory.addASTChild(currentAST, returnAST);
988 statement_AST = (AST)currentAST.root;
989 break;
990 }
991 default:
992 boolean synPredMatched242 = false;
993 if (((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2))) && (_tokenSet_14.member(LA(3))))) {
994 int _m242 = mark();
995 synPredMatched242 = true;
996 inputState.guessing++;
997 try {
998 {
999 declarationStart();
1000 }
1001 }
1002 catch (RecognitionException pe) {
1003 synPredMatched242 = false;
1004 }
1005 rewind(_m242);
1006 inputState.guessing--;
1007 }
1008 if ( synPredMatched242 ) {
1009 declaration();
1010 astFactory.addASTChild(currentAST, returnAST);
1011 statement_AST = (AST)currentAST.root;
1012 }
1013 else {
1014 boolean synPredMatched244 = false;
1015 if (((LA(1)==IDENT) && (LA(2)==COLON) && (_tokenSet_15.member(LA(3))))) {
1016 int _m244 = mark();
1017 synPredMatched244 = true;
1018 inputState.guessing++;
1019 try {
1020 {
1021 match(IDENT);
1022 match(COLON);
1023 }
1024 }
1025 catch (RecognitionException pe) {
1026 synPredMatched244 = false;
1027 }
1028 rewind(_m244);
1029 inputState.guessing--;
1030 }
1031 if ( synPredMatched244 ) {
1032 statementLabelPrefix();
1033 pfx_AST = (AST)returnAST;
1034 if ( inputState.guessing==0 ) {
1035 statement_AST = (AST)currentAST.root;
1036 statement_AST = pfx_AST;
1037 currentAST.root = statement_AST;
1038 currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ?
1039 statement_AST.getFirstChild() : statement_AST;
1040 currentAST.advanceChildToEnd();
1041 }
1042 {
1043 boolean synPredMatched247 = false;
1044 if (((LA(1)==LCURLY) && (_tokenSet_16.member(LA(2))) && (_tokenSet_8.member(LA(3))))) {
1045 int _m247 = mark();
1046 synPredMatched247 = true;
1047 inputState.guessing++;
1048 try {
1049 {
1050 match(LCURLY);
1051 }
1052 }
1053 catch (RecognitionException pe) {
1054 synPredMatched247 = false;
1055 }
1056 rewind(_m247);
1057 inputState.guessing--;
1058 }
1059 if ( synPredMatched247 ) {
1060 openOrClosableBlock();
1061 astFactory.addASTChild(currentAST, returnAST);
1062 }
1063 else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_18.member(LA(3)))) {
1064 statement(COLON);
1065 astFactory.addASTChild(currentAST, returnAST);
1066 }
1067 else {
1068 throw new NoViableAltException(LT(1), getFilename());
1069 }
1070
1071 }
1072 statement_AST = (AST)currentAST.root;
1073 }
1074 else if ((_tokenSet_19.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
1075 expressionStatement(prevToken);
1076 astFactory.addASTChild(currentAST, returnAST);
1077 statement_AST = (AST)currentAST.root;
1078 }
1079 else if ((_tokenSet_21.member(LA(1))) && (_tokenSet_22.member(LA(2))) && (_tokenSet_23.member(LA(3)))) {
1080 modifiersOpt();
1081 m_AST = (AST)returnAST;
1082 typeDefinitionInternal(m_AST);
1083 astFactory.addASTChild(currentAST, returnAST);
1084 statement_AST = (AST)currentAST.root;
1085 }
1086 else if ((LA(1)==LITERAL_synchronized) && (LA(2)==LPAREN)) {
1087 AST tmp19_AST = null;
1088 tmp19_AST = astFactory.create(LT(1));
1089 astFactory.makeASTRoot(currentAST, tmp19_AST);
1090 match(LITERAL_synchronized);
1091 match(LPAREN);
1092 strictContextExpression();
1093 astFactory.addASTChild(currentAST, returnAST);
1094 match(RPAREN);
1095 nlsWarn();
1096 compoundStatement();
1097 astFactory.addASTChild(currentAST, returnAST);
1098 statement_AST = (AST)currentAST.root;
1099 }
1100 else {
1101 throw new NoViableAltException(LT(1), getFilename());
1102 }
1103 }}
1104 returnAST = statement_AST;
1105 }
1106
1107 /*** A statement separator is either a semicolon or a significant newline.
1108 * Any number of additional (insignificant) newlines may accompany it.
1109 */
1110 public final void sep() throws RecognitionException, TokenStreamException {
1111
1112 returnAST = null;
1113 ASTPair currentAST = new ASTPair();
1114 AST sep_AST = null;
1115
1116 switch ( LA(1)) {
1117 case SEMI:
1118 {
1119 match(SEMI);
1120 {
1121 _loop475:
1122 do {
1123 if ((LA(1)==NLS) && (_tokenSet_24.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
1124 match(NLS);
1125 }
1126 else {
1127 break _loop475;
1128 }
1129
1130 } while (true);
1131 }
1132 if ( inputState.guessing==0 ) {
1133 sepToken = SEMI;
1134 }
1135 break;
1136 }
1137 case NLS:
1138 {
1139 match(NLS);
1140 if ( inputState.guessing==0 ) {
1141 sepToken = NLS;
1142 }
1143 {
1144 _loop479:
1145 do {
1146 if ((LA(1)==SEMI) && (_tokenSet_24.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
1147 match(SEMI);
1148 {
1149 _loop478:
1150 do {
1151 if ((LA(1)==NLS) && (_tokenSet_24.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
1152 match(NLS);
1153 }
1154 else {
1155 break _loop478;
1156 }
1157
1158 } while (true);
1159 }
1160 if ( inputState.guessing==0 ) {
1161 sepToken = SEMI;
1162 }
1163 }
1164 else {
1165 break _loop479;
1166 }
1167
1168 } while (true);
1169 }
1170 break;
1171 }
1172 default:
1173 {
1174 throw new NoViableAltException(LT(1), getFilename());
1175 }
1176 }
1177 returnAST = sep_AST;
1178 }
1179
1180 /*** A Groovy script or simple expression. Can be anything legal inside {...}. */
1181 public final void snippetUnit() throws RecognitionException, TokenStreamException {
1182
1183 returnAST = null;
1184 ASTPair currentAST = new ASTPair();
1185 AST snippetUnit_AST = null;
1186
1187 nls();
1188 blockBody(EOF);
1189 astFactory.addASTChild(currentAST, returnAST);
1190 snippetUnit_AST = (AST)currentAST.root;
1191 returnAST = snippetUnit_AST;
1192 }
1193
1194 /*** A block body is a parade of zero or more statements or expressions. */
1195 public final void blockBody(
1196 int prevToken
1197 ) throws RecognitionException, TokenStreamException {
1198
1199 returnAST = null;
1200 ASTPair currentAST = new ASTPair();
1201 AST blockBody_AST = null;
1202
1203 {
1204 switch ( LA(1)) {
1205 case FINAL:
1206 case ABSTRACT:
1207 case STRICTFP:
1208 case LITERAL_import:
1209 case LITERAL_static:
1210 case LITERAL_def:
1211 case AT:
1212 case IDENT:
1213 case LBRACK:
1214 case LPAREN:
1215 case LITERAL_class:
1216 case LITERAL_interface:
1217 case LITERAL_enum:
1218 case LITERAL_super:
1219 case LITERAL_void:
1220 case LITERAL_boolean:
1221 case LITERAL_byte:
1222 case LITERAL_char:
1223 case LITERAL_short:
1224 case LITERAL_int:
1225 case LITERAL_float:
1226 case LITERAL_long:
1227 case LITERAL_double:
1228 case LITERAL_any:
1229 case STAR:
1230 case LITERAL_private:
1231 case LITERAL_public:
1232 case LITERAL_protected:
1233 case LITERAL_transient:
1234 case LITERAL_native:
1235 case LITERAL_threadsafe:
1236 case LITERAL_synchronized:
1237 case LITERAL_volatile:
1238 case LCURLY:
1239 case LITERAL_this:
1240 case STRING_LITERAL:
1241 case LITERAL_if:
1242 case LITERAL_while:
1243 case LITERAL_with:
1244 case LITERAL_switch:
1245 case LITERAL_for:
1246 case LITERAL_return:
1247 case LITERAL_break:
1248 case LITERAL_continue:
1249 case LITERAL_throw:
1250 case LITERAL_assert:
1251 case PLUS:
1252 case MINUS:
1253 case LITERAL_try:
1254 case INC:
1255 case DEC:
1256 case BNOT:
1257 case LNOT:
1258 case DOLLAR:
1259 case STRING_CTOR_START:
1260 case LITERAL_new:
1261 case LITERAL_true:
1262 case LITERAL_false:
1263 case LITERAL_null:
1264 case NUM_INT:
1265 case NUM_FLOAT:
1266 case NUM_LONG:
1267 case NUM_DOUBLE:
1268 case NUM_BIG_INT:
1269 case NUM_BIG_DECIMAL:
1270 {
1271 statement(prevToken);
1272 astFactory.addASTChild(currentAST, returnAST);
1273 break;
1274 }
1275 case EOF:
1276 case RCURLY:
1277 case SEMI:
1278 case NLS:
1279 {
1280 break;
1281 }
1282 default:
1283 {
1284 throw new NoViableAltException(LT(1), getFilename());
1285 }
1286 }
1287 }
1288 {
1289 _loop236:
1290 do {
1291 if ((LA(1)==SEMI||LA(1)==NLS)) {
1292 sep();
1293 {
1294 switch ( LA(1)) {
1295 case FINAL:
1296 case ABSTRACT:
1297 case STRICTFP:
1298 case LITERAL_import:
1299 case LITERAL_static:
1300 case LITERAL_def:
1301 case AT:
1302 case IDENT:
1303 case LBRACK:
1304 case LPAREN:
1305 case LITERAL_class:
1306 case LITERAL_interface:
1307 case LITERAL_enum:
1308 case LITERAL_super:
1309 case LITERAL_void:
1310 case LITERAL_boolean:
1311 case LITERAL_byte:
1312 case LITERAL_char:
1313 case LITERAL_short:
1314 case LITERAL_int:
1315 case LITERAL_float:
1316 case LITERAL_long:
1317 case LITERAL_double:
1318 case LITERAL_any:
1319 case STAR:
1320 case LITERAL_private:
1321 case LITERAL_public:
1322 case LITERAL_protected:
1323 case LITERAL_transient:
1324 case LITERAL_native:
1325 case LITERAL_threadsafe:
1326 case LITERAL_synchronized:
1327 case LITERAL_volatile:
1328 case LCURLY:
1329 case LITERAL_this:
1330 case STRING_LITERAL:
1331 case LITERAL_if:
1332 case LITERAL_while:
1333 case LITERAL_with:
1334 case LITERAL_switch:
1335 case LITERAL_for:
1336 case LITERAL_return:
1337 case LITERAL_break:
1338 case LITERAL_continue:
1339 case LITERAL_throw:
1340 case LITERAL_assert:
1341 case PLUS:
1342 case MINUS:
1343 case LITERAL_try:
1344 case INC:
1345 case DEC:
1346 case BNOT:
1347 case LNOT:
1348 case DOLLAR:
1349 case STRING_CTOR_START:
1350 case LITERAL_new:
1351 case LITERAL_true:
1352 case LITERAL_false:
1353 case LITERAL_null:
1354 case NUM_INT:
1355 case NUM_FLOAT:
1356 case NUM_LONG:
1357 case NUM_DOUBLE:
1358 case NUM_BIG_INT:
1359 case NUM_BIG_DECIMAL:
1360 {
1361 statement(sepToken);
1362 astFactory.addASTChild(currentAST, returnAST);
1363 break;
1364 }
1365 case EOF:
1366 case RCURLY:
1367 case SEMI:
1368 case NLS:
1369 {
1370 break;
1371 }
1372 default:
1373 {
1374 throw new NoViableAltException(LT(1), getFilename());
1375 }
1376 }
1377 }
1378 }
1379 else {
1380 break _loop236;
1381 }
1382
1383 } while (true);
1384 }
1385 blockBody_AST = (AST)currentAST.root;
1386 returnAST = blockBody_AST;
1387 }
1388
1389 public final void identifier() throws RecognitionException, TokenStreamException {
1390
1391 returnAST = null;
1392 ASTPair currentAST = new ASTPair();
1393 AST identifier_AST = null;
1394
1395 AST tmp27_AST = null;
1396 tmp27_AST = astFactory.create(LT(1));
1397 astFactory.addASTChild(currentAST, tmp27_AST);
1398 match(IDENT);
1399 {
1400 _loop62:
1401 do {
1402 if ((LA(1)==DOT)) {
1403 AST tmp28_AST = null;
1404 tmp28_AST = astFactory.create(LT(1));
1405 astFactory.makeASTRoot(currentAST, tmp28_AST);
1406 match(DOT);
1407 nls();
1408 AST tmp29_AST = null;
1409 tmp29_AST = astFactory.create(LT(1));
1410 astFactory.addASTChild(currentAST, tmp29_AST);
1411 match(IDENT);
1412 }
1413 else {
1414 break _loop62;
1415 }
1416
1417 } while (true);
1418 }
1419 identifier_AST = (AST)currentAST.root;
1420 returnAST = identifier_AST;
1421 }
1422
1423 public final void importStatement() throws RecognitionException, TokenStreamException {
1424
1425 returnAST = null;
1426 ASTPair currentAST = new ASTPair();
1427 AST importStatement_AST = null;
1428 Token i = null;
1429 AST i_AST = null;
1430 boolean isStatic = false;
1431
1432 i = LT(1);
1433 i_AST = astFactory.create(i);
1434 astFactory.makeASTRoot(currentAST, i_AST);
1435 match(LITERAL_import);
1436 if ( inputState.guessing==0 ) {
1437 i_AST.setType(IMPORT);
1438 }
1439 {
1440 switch ( LA(1)) {
1441 case LITERAL_static:
1442 {
1443 match(LITERAL_static);
1444 if ( inputState.guessing==0 ) {
1445 i_AST.setType(STATIC_IMPORT);
1446 }
1447 break;
1448 }
1449 case IDENT:
1450 {
1451 break;
1452 }
1453 default:
1454 {
1455 throw new NoViableAltException(LT(1), getFilename());
1456 }
1457 }
1458 }
1459 identifierStar();
1460 astFactory.addASTChild(currentAST, returnAST);
1461 importStatement_AST = (AST)currentAST.root;
1462 returnAST = importStatement_AST;
1463 }
1464
1465 public final void identifierStar() throws RecognitionException, TokenStreamException {
1466
1467 returnAST = null;
1468 ASTPair currentAST = new ASTPair();
1469 AST identifierStar_AST = null;
1470
1471 AST tmp31_AST = null;
1472 tmp31_AST = astFactory.create(LT(1));
1473 astFactory.addASTChild(currentAST, tmp31_AST);
1474 match(IDENT);
1475 {
1476 _loop65:
1477 do {
1478 if ((LA(1)==DOT) && (LA(2)==IDENT||LA(2)==NLS) && (_tokenSet_25.member(LA(3)))) {
1479 AST tmp32_AST = null;
1480 tmp32_AST = astFactory.create(LT(1));
1481 astFactory.makeASTRoot(currentAST, tmp32_AST);
1482 match(DOT);
1483 nls();
1484 AST tmp33_AST = null;
1485 tmp33_AST = astFactory.create(LT(1));
1486 astFactory.addASTChild(currentAST, tmp33_AST);
1487 match(IDENT);
1488 }
1489 else {
1490 break _loop65;
1491 }
1492
1493 } while (true);
1494 }
1495 {
1496 switch ( LA(1)) {
1497 case DOT:
1498 {
1499 AST tmp34_AST = null;
1500 tmp34_AST = astFactory.create(LT(1));
1501 astFactory.makeASTRoot(currentAST, tmp34_AST);
1502 match(DOT);
1503 nls();
1504 AST tmp35_AST = null;
1505 tmp35_AST = astFactory.create(LT(1));
1506 astFactory.addASTChild(currentAST, tmp35_AST);
1507 match(STAR);
1508 break;
1509 }
1510 case LITERAL_as:
1511 {
1512 AST tmp36_AST = null;
1513 tmp36_AST = astFactory.create(LT(1));
1514 astFactory.makeASTRoot(currentAST, tmp36_AST);
1515 match(LITERAL_as);
1516 nls();
1517 AST tmp37_AST = null;
1518 tmp37_AST = astFactory.create(LT(1));
1519 astFactory.addASTChild(currentAST, tmp37_AST);
1520 match(IDENT);
1521 break;
1522 }
1523 case EOF:
1524 case RCURLY:
1525 case SEMI:
1526 case NLS:
1527 case LITERAL_default:
1528 case LITERAL_else:
1529 case LITERAL_case:
1530 {
1531 break;
1532 }
1533 default:
1534 {
1535 throw new NoViableAltException(LT(1), getFilename());
1536 }
1537 }
1538 }
1539 identifierStar_AST = (AST)currentAST.root;
1540 returnAST = identifierStar_AST;
1541 }
1542
1543 protected final void typeDefinitionInternal(
1544 AST mods
1545 ) throws RecognitionException, TokenStreamException {
1546
1547 returnAST = null;
1548 ASTPair currentAST = new ASTPair();
1549 AST typeDefinitionInternal_AST = null;
1550 AST cd_AST = null;
1551 AST id_AST = null;
1552 AST ed_AST = null;
1553 AST ad_AST = null;
1554
1555 switch ( LA(1)) {
1556 case LITERAL_class:
1557 {
1558 classDefinition(mods);
1559 cd_AST = (AST)returnAST;
1560 astFactory.addASTChild(currentAST, returnAST);
1561 if ( inputState.guessing==0 ) {
1562 typeDefinitionInternal_AST = (AST)currentAST.root;
1563 typeDefinitionInternal_AST = cd_AST;
1564 currentAST.root = typeDefinitionInternal_AST;
1565 currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ?
1566 typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST;
1567 currentAST.advanceChildToEnd();
1568 }
1569 typeDefinitionInternal_AST = (AST)currentAST.root;
1570 break;
1571 }
1572 case LITERAL_interface:
1573 {
1574 interfaceDefinition(mods);
1575 id_AST = (AST)returnAST;
1576 astFactory.addASTChild(currentAST, returnAST);
1577 if ( inputState.guessing==0 ) {
1578 typeDefinitionInternal_AST = (AST)currentAST.root;
1579 typeDefinitionInternal_AST = id_AST;
1580 currentAST.root = typeDefinitionInternal_AST;
1581 currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ?
1582 typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST;
1583 currentAST.advanceChildToEnd();
1584 }
1585 typeDefinitionInternal_AST = (AST)currentAST.root;
1586 break;
1587 }
1588 case LITERAL_enum:
1589 {
1590 enumDefinition(mods);
1591 ed_AST = (AST)returnAST;
1592 astFactory.addASTChild(currentAST, returnAST);
1593 if ( inputState.guessing==0 ) {
1594 typeDefinitionInternal_AST = (AST)currentAST.root;
1595 typeDefinitionInternal_AST = ed_AST;
1596 currentAST.root = typeDefinitionInternal_AST;
1597 currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ?
1598 typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST;
1599 currentAST.advanceChildToEnd();
1600 }
1601 typeDefinitionInternal_AST = (AST)currentAST.root;
1602 break;
1603 }
1604 case AT:
1605 {
1606 annotationDefinition(mods);
1607 ad_AST = (AST)returnAST;
1608 astFactory.addASTChild(currentAST, returnAST);
1609 if ( inputState.guessing==0 ) {
1610 typeDefinitionInternal_AST = (AST)currentAST.root;
1611 typeDefinitionInternal_AST = ad_AST;
1612 currentAST.root = typeDefinitionInternal_AST;
1613 currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ?
1614 typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST;
1615 currentAST.advanceChildToEnd();
1616 }
1617 typeDefinitionInternal_AST = (AST)currentAST.root;
1618 break;
1619 }
1620 default:
1621 {
1622 throw new NoViableAltException(LT(1), getFilename());
1623 }
1624 }
1625 returnAST = typeDefinitionInternal_AST;
1626 }
1627
1628 public final void classDefinition(
1629 AST modifiers
1630 ) throws RecognitionException, TokenStreamException {
1631
1632 returnAST = null;
1633 ASTPair currentAST = new ASTPair();
1634 AST classDefinition_AST = null;
1635 AST tp_AST = null;
1636 AST sc_AST = null;
1637 AST ic_AST = null;
1638 AST cb_AST = null;
1639 Token first = LT(1);AST prevCurrentClass = currentClass;
1640
1641 match(LITERAL_class);
1642 AST tmp39_AST = null;
1643 tmp39_AST = astFactory.create(LT(1));
1644 match(IDENT);
1645 nls();
1646 if ( inputState.guessing==0 ) {
1647 currentClass = tmp39_AST;
1648 }
1649 {
1650 switch ( LA(1)) {
1651 case LT:
1652 {
1653 typeParameters();
1654 tp_AST = (AST)returnAST;
1655 break;
1656 }
1657 case LITERAL_extends:
1658 case LCURLY:
1659 case LITERAL_implements:
1660 {
1661 break;
1662 }
1663 default:
1664 {
1665 throw new NoViableAltException(LT(1), getFilename());
1666 }
1667 }
1668 }
1669 superClassClause();
1670 sc_AST = (AST)returnAST;
1671 implementsClause();
1672 ic_AST = (AST)returnAST;
1673 classBlock();
1674 cb_AST = (AST)returnAST;
1675 if ( inputState.guessing==0 ) {
1676 classDefinition_AST = (AST)currentAST.root;
1677 classDefinition_AST = (AST)astFactory.make( (new ASTArray(7)).add(create(CLASS_DEF,"CLASS_DEF",first,LT(1))).add(modifiers).add(tmp39_AST).add(tp_AST).add(sc_AST).add(ic_AST).add(cb_AST));
1678 currentAST.root = classDefinition_AST;
1679 currentAST.child = classDefinition_AST!=null &&classDefinition_AST.getFirstChild()!=null ?
1680 classDefinition_AST.getFirstChild() : classDefinition_AST;
1681 currentAST.advanceChildToEnd();
1682 }
1683 if ( inputState.guessing==0 ) {
1684 currentClass = prevCurrentClass;
1685 }
1686 returnAST = classDefinition_AST;
1687 }
1688
1689 public final void interfaceDefinition(
1690 AST modifiers
1691 ) throws RecognitionException, TokenStreamException {
1692
1693 returnAST = null;
1694 ASTPair currentAST = new ASTPair();
1695 AST interfaceDefinition_AST = null;
1696 AST tp_AST = null;
1697 AST ie_AST = null;
1698 AST ib_AST = null;
1699 Token first = LT(1);
1700
1701 match(LITERAL_interface);
1702 AST tmp41_AST = null;
1703 tmp41_AST = astFactory.create(LT(1));
1704 match(IDENT);
1705 nls();
1706 {
1707 switch ( LA(1)) {
1708 case LT:
1709 {
1710 typeParameters();
1711 tp_AST = (AST)returnAST;
1712 break;
1713 }
1714 case LITERAL_extends:
1715 case LCURLY:
1716 {
1717 break;
1718 }
1719 default:
1720 {
1721 throw new NoViableAltException(LT(1), getFilename());
1722 }
1723 }
1724 }
1725 interfaceExtends();
1726 ie_AST = (AST)returnAST;
1727 interfaceBlock();
1728 ib_AST = (AST)returnAST;
1729 if ( inputState.guessing==0 ) {
1730 interfaceDefinition_AST = (AST)currentAST.root;
1731 interfaceDefinition_AST = (AST)astFactory.make( (new ASTArray(6)).add(create(INTERFACE_DEF,"INTERFACE_DEF",first,LT(1))).add(modifiers).add(tmp41_AST).add(tp_AST).add(ie_AST).add(ib_AST));
1732 currentAST.root = interfaceDefinition_AST;
1733 currentAST.child = interfaceDefinition_AST!=null &&interfaceDefinition_AST.getFirstChild()!=null ?
1734 interfaceDefinition_AST.getFirstChild() : interfaceDefinition_AST;
1735 currentAST.advanceChildToEnd();
1736 }
1737 returnAST = interfaceDefinition_AST;
1738 }
1739
1740 public final void enumDefinition(
1741 AST modifiers
1742 ) throws RecognitionException, TokenStreamException {
1743
1744 returnAST = null;
1745 ASTPair currentAST = new ASTPair();
1746 AST enumDefinition_AST = null;
1747 AST ic_AST = null;
1748 AST eb_AST = null;
1749 Token first = LT(1);
1750
1751 match(LITERAL_enum);
1752 AST tmp43_AST = null;
1753 tmp43_AST = astFactory.create(LT(1));
1754 match(IDENT);
1755 implementsClause();
1756 ic_AST = (AST)returnAST;
1757 enumBlock();
1758 eb_AST = (AST)returnAST;
1759 if ( inputState.guessing==0 ) {
1760 enumDefinition_AST = (AST)currentAST.root;
1761 enumDefinition_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(ENUM_DEF,"ENUM_DEF",first,LT(1))).add(modifiers).add(tmp43_AST).add(ic_AST).add(eb_AST));
1762 currentAST.root = enumDefinition_AST;
1763 currentAST.child = enumDefinition_AST!=null &&enumDefinition_AST.getFirstChild()!=null ?
1764 enumDefinition_AST.getFirstChild() : enumDefinition_AST;
1765 currentAST.advanceChildToEnd();
1766 }
1767 returnAST = enumDefinition_AST;
1768 }
1769
1770 public final void annotationDefinition(
1771 AST modifiers
1772 ) throws RecognitionException, TokenStreamException {
1773
1774 returnAST = null;
1775 ASTPair currentAST = new ASTPair();
1776 AST annotationDefinition_AST = null;
1777 AST ab_AST = null;
1778 Token first = LT(1);
1779
1780 AST tmp44_AST = null;
1781 tmp44_AST = astFactory.create(LT(1));
1782 match(AT);
1783 match(LITERAL_interface);
1784 AST tmp46_AST = null;
1785 tmp46_AST = astFactory.create(LT(1));
1786 match(IDENT);
1787 annotationBlock();
1788 ab_AST = (AST)returnAST;
1789 if ( inputState.guessing==0 ) {
1790 annotationDefinition_AST = (AST)currentAST.root;
1791 annotationDefinition_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(ANNOTATION_DEF,"ANNOTATION_DEF",first,LT(1))).add(modifiers).add(tmp46_AST).add(ab_AST));
1792 currentAST.root = annotationDefinition_AST;
1793 currentAST.child = annotationDefinition_AST!=null &&annotationDefinition_AST.getFirstChild()!=null ?
1794 annotationDefinition_AST.getFirstChild() : annotationDefinition_AST;
1795 currentAST.advanceChildToEnd();
1796 }
1797 returnAST = annotationDefinition_AST;
1798 }
1799
1800 /*** A declaration is the creation of a reference or primitive-type variable,
1801 * or (if arguments are present) of a method.
1802 * Generically, this is called a 'variable' definition, even in the case of a class field or method.
1803 * It may start with the modifiers and/or a declaration keyword "def".
1804 * It may also start with the modifiers and a capitalized type name.
1805 * <p>
1806 * AST effect: Create a separate Type/Var tree for each var in the var list.
1807 * Must be guarded, as in (declarationStart) => declaration.
1808 */
1809 public final void declaration() throws RecognitionException, TokenStreamException {
1810
1811 returnAST = null;
1812 ASTPair currentAST = new ASTPair();
1813 AST declaration_AST = null;
1814 AST m_AST = null;
1815 AST t_AST = null;
1816 AST v_AST = null;
1817 AST t2_AST = null;
1818 AST v2_AST = null;
1819
1820 switch ( LA(1)) {
1821 case FINAL:
1822 case ABSTRACT:
1823 case STRICTFP:
1824 case LITERAL_static:
1825 case LITERAL_def:
1826 case AT:
1827 case LITERAL_private:
1828 case LITERAL_public:
1829 case LITERAL_protected:
1830 case LITERAL_transient:
1831 case LITERAL_native:
1832 case LITERAL_threadsafe:
1833 case LITERAL_synchronized:
1834 case LITERAL_volatile:
1835 {
1836 modifiers();
1837 m_AST = (AST)returnAST;
1838 {
1839 if ((_tokenSet_26.member(LA(1))) && (_tokenSet_27.member(LA(2)))) {
1840 typeSpec(false);
1841 t_AST = (AST)returnAST;
1842 }
1843 else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (_tokenSet_28.member(LA(2)))) {
1844 }
1845 else {
1846 throw new NoViableAltException(LT(1), getFilename());
1847 }
1848
1849 }
1850 variableDefinitions(m_AST, t_AST);
1851 v_AST = (AST)returnAST;
1852 if ( inputState.guessing==0 ) {
1853 declaration_AST = (AST)currentAST.root;
1854 declaration_AST = v_AST;
1855 currentAST.root = declaration_AST;
1856 currentAST.child = declaration_AST!=null &&declaration_AST.getFirstChild()!=null ?
1857 declaration_AST.getFirstChild() : declaration_AST;
1858 currentAST.advanceChildToEnd();
1859 }
1860 break;
1861 }
1862 case IDENT:
1863 case LITERAL_void:
1864 case LITERAL_boolean:
1865 case LITERAL_byte:
1866 case LITERAL_char:
1867 case LITERAL_short:
1868 case LITERAL_int:
1869 case LITERAL_float:
1870 case LITERAL_long:
1871 case LITERAL_double:
1872 case LITERAL_any:
1873 {
1874 typeSpec(false);
1875 t2_AST = (AST)returnAST;
1876 variableDefinitions(null,t2_AST);
1877 v2_AST = (AST)returnAST;
1878 if ( inputState.guessing==0 ) {
1879 declaration_AST = (AST)currentAST.root;
1880 declaration_AST = v2_AST;
1881 currentAST.root = declaration_AST;
1882 currentAST.child = declaration_AST!=null &&declaration_AST.getFirstChild()!=null ?
1883 declaration_AST.getFirstChild() : declaration_AST;
1884 currentAST.advanceChildToEnd();
1885 }
1886 break;
1887 }
1888 default:
1889 {
1890 throw new NoViableAltException(LT(1), getFilename());
1891 }
1892 }
1893 returnAST = declaration_AST;
1894 }
1895
1896 /*** A list of one or more modifier, annotation, or "def". */
1897 public final void modifiers() throws RecognitionException, TokenStreamException {
1898
1899 returnAST = null;
1900 ASTPair currentAST = new ASTPair();
1901 AST modifiers_AST = null;
1902 Token first = LT(1);
1903
1904 modifiersInternal();
1905 astFactory.addASTChild(currentAST, returnAST);
1906 if ( inputState.guessing==0 ) {
1907 modifiers_AST = (AST)currentAST.root;
1908 modifiers_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(MODIFIERS,"MODIFIERS",first,LT(1))).add(modifiers_AST));
1909 currentAST.root = modifiers_AST;
1910 currentAST.child = modifiers_AST!=null &&modifiers_AST.getFirstChild()!=null ?
1911 modifiers_AST.getFirstChild() : modifiers_AST;
1912 currentAST.advanceChildToEnd();
1913 }
1914 modifiers_AST = (AST)currentAST.root;
1915 returnAST = modifiers_AST;
1916 }
1917
1918 public final void typeSpec(
1919 boolean addImagNode
1920 ) throws RecognitionException, TokenStreamException {
1921
1922 returnAST = null;
1923 ASTPair currentAST = new ASTPair();
1924 AST typeSpec_AST = null;
1925
1926 switch ( LA(1)) {
1927 case IDENT:
1928 {
1929 classTypeSpec(addImagNode);
1930 astFactory.addASTChild(currentAST, returnAST);
1931 typeSpec_AST = (AST)currentAST.root;
1932 break;
1933 }
1934 case LITERAL_void:
1935 case LITERAL_boolean:
1936 case LITERAL_byte:
1937 case LITERAL_char:
1938 case LITERAL_short:
1939 case LITERAL_int:
1940 case LITERAL_float:
1941 case LITERAL_long:
1942 case LITERAL_double:
1943 case LITERAL_any:
1944 {
1945 builtInTypeSpec(addImagNode);
1946 astFactory.addASTChild(currentAST, returnAST);
1947 typeSpec_AST = (AST)currentAST.root;
1948 break;
1949 }
1950 default:
1951 {
1952 throw new NoViableAltException(LT(1), getFilename());
1953 }
1954 }
1955 returnAST = typeSpec_AST;
1956 }
1957
1958 /*** The tail of a declaration.
1959 * Either v1, v2, ... (with possible initializers) or else m(args){body}.
1960 * The two arguments are the modifier list (if any) and the declaration head (if any).
1961 * The declaration head is the variable type, or (for a method) the return type.
1962 * If it is missing, then the variable type is taken from its initializer (if there is one).
1963 * Otherwise, the variable type defaults to 'any'.
1964 * DECIDE: Method return types default to the type of the method body, as an expression.
1965 */
1966 public final void variableDefinitions(
1967 AST mods, AST t
1968 ) throws RecognitionException, TokenStreamException {
1969
1970 returnAST = null;
1971 ASTPair currentAST = new ASTPair();
1972 AST variableDefinitions_AST = null;
1973 Token id = null;
1974 AST id_AST = null;
1975 Token qid = null;
1976 AST qid_AST = null;
1977 AST param_AST = null;
1978 AST tc_AST = null;
1979 AST mb_AST = null;
1980 Token first = LT(1);
1981
1982 if ((LA(1)==IDENT) && (_tokenSet_29.member(LA(2)))) {
1983 variableDeclarator(getASTFactory().dupTree(mods),
1984 getASTFactory().dupTree(t));
1985 astFactory.addASTChild(currentAST, returnAST);
1986 {
1987 _loop190:
1988 do {
1989 if ((LA(1)==COMMA)) {
1990 match(COMMA);
1991 nls();
1992 variableDeclarator(getASTFactory().dupTree(mods),
1993 getASTFactory().dupTree(t));
1994 astFactory.addASTChild(currentAST, returnAST);
1995 }
1996 else {
1997 break _loop190;
1998 }
1999
2000 } while (true);
2001 }
2002 variableDefinitions_AST = (AST)currentAST.root;
2003 }
2004 else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (LA(2)==LPAREN)) {
2005 {
2006 switch ( LA(1)) {
2007 case IDENT:
2008 {
2009 id = LT(1);
2010 id_AST = astFactory.create(id);
2011 astFactory.addASTChild(currentAST, id_AST);
2012 match(IDENT);
2013 break;
2014 }
2015 case STRING_LITERAL:
2016 {
2017 qid = LT(1);
2018 qid_AST = astFactory.create(qid);
2019 astFactory.addASTChild(currentAST, qid_AST);
2020 match(STRING_LITERAL);
2021 if ( inputState.guessing==0 ) {
2022 qid_AST.setType(IDENT);
2023 }
2024 break;
2025 }
2026 default:
2027 {
2028 throw new NoViableAltException(LT(1), getFilename());
2029 }
2030 }
2031 }
2032 match(LPAREN);
2033 parameterDeclarationList();
2034 param_AST = (AST)returnAST;
2035 match(RPAREN);
2036 {
2037 boolean synPredMatched194 = false;
2038 if (((LA(1)==NLS||LA(1)==LITERAL_throws) && (_tokenSet_30.member(LA(2))) && (_tokenSet_31.member(LA(3))))) {
2039 int _m194 = mark();
2040 synPredMatched194 = true;
2041 inputState.guessing++;
2042 try {
2043 {
2044 nls();
2045 match(LITERAL_throws);
2046 }
2047 }
2048 catch (RecognitionException pe) {
2049 synPredMatched194 = false;
2050 }
2051 rewind(_m194);
2052 inputState.guessing--;
2053 }
2054 if ( synPredMatched194 ) {
2055 throwsClause();
2056 tc_AST = (AST)returnAST;
2057 }
2058 else if ((_tokenSet_32.member(LA(1))) && (_tokenSet_10.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
2059 }
2060 else {
2061 throw new NoViableAltException(LT(1), getFilename());
2062 }
2063
2064 }
2065 {
2066 boolean synPredMatched197 = false;
2067 if (((LA(1)==LCURLY||LA(1)==NLS) && (_tokenSet_33.member(LA(2))) && (_tokenSet_8.member(LA(3))))) {
2068 int _m197 = mark();
2069 synPredMatched197 = true;
2070 inputState.guessing++;
2071 try {
2072 {
2073 nls();
2074 match(LCURLY);
2075 }
2076 }
2077 catch (RecognitionException pe) {
2078 synPredMatched197 = false;
2079 }
2080 rewind(_m197);
2081 inputState.guessing--;
2082 }
2083 if ( synPredMatched197 ) {
2084 {
2085 nlsWarn();
2086 openBlock();
2087 mb_AST = (AST)returnAST;
2088 }
2089 }
2090 else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
2091 }
2092 else {
2093 throw new NoViableAltException(LT(1), getFilename());
2094 }
2095
2096 }
2097 if ( inputState.guessing==0 ) {
2098 variableDefinitions_AST = (AST)currentAST.root;
2099 if (qid_AST != null) id_AST = qid_AST;
2100 variableDefinitions_AST =
2101 (AST)astFactory.make( (new ASTArray(7)).add(create(METHOD_DEF,"METHOD_DEF",first,LT(1))).add(mods).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t))).add(id_AST).add(param_AST).add(tc_AST).add(mb_AST));
2102
2103 currentAST.root = variableDefinitions_AST;
2104 currentAST.child = variableDefinitions_AST!=null &&variableDefinitions_AST.getFirstChild()!=null ?
2105 variableDefinitions_AST.getFirstChild() : variableDefinitions_AST;
2106 currentAST.advanceChildToEnd();
2107 }
2108 variableDefinitions_AST = (AST)currentAST.root;
2109 }
2110 else {
2111 throw new NoViableAltException(LT(1), getFilename());
2112 }
2113
2114 returnAST = variableDefinitions_AST;
2115 }
2116
2117 /*** A declaration with one declarator and no initialization, like a parameterDeclaration.
2118 * Used to parse loops like <code>for (int x in y)</code> (up to the <code>in</code> keyword).
2119 */
2120 public final void singleDeclarationNoInit() throws RecognitionException, TokenStreamException {
2121
2122 returnAST = null;
2123 ASTPair currentAST = new ASTPair();
2124 AST singleDeclarationNoInit_AST = null;
2125 AST m_AST = null;
2126 AST t_AST = null;
2127 AST v_AST = null;
2128 AST t2_AST = null;
2129 AST v2_AST = null;
2130
2131 switch ( LA(1)) {
2132 case FINAL:
2133 case ABSTRACT:
2134 case STRICTFP:
2135 case LITERAL_static:
2136 case LITERAL_def:
2137 case AT:
2138 case LITERAL_private:
2139 case LITERAL_public:
2140 case LITERAL_protected:
2141 case LITERAL_transient:
2142 case LITERAL_native:
2143 case LITERAL_threadsafe:
2144 case LITERAL_synchronized:
2145 case LITERAL_volatile:
2146 {
2147 modifiers();
2148 m_AST = (AST)returnAST;
2149 {
2150 if ((_tokenSet_26.member(LA(1))) && (_tokenSet_34.member(LA(2)))) {
2151 typeSpec(false);
2152 t_AST = (AST)returnAST;
2153 }
2154 else if ((LA(1)==IDENT) && (_tokenSet_35.member(LA(2)))) {
2155 }
2156 else {
2157 throw new NoViableAltException(LT(1), getFilename());
2158 }
2159
2160 }
2161 singleVariable(m_AST, t_AST);
2162 v_AST = (AST)returnAST;
2163 if ( inputState.guessing==0 ) {
2164 singleDeclarationNoInit_AST = (AST)currentAST.root;
2165 singleDeclarationNoInit_AST = v_AST;
2166 currentAST.root = singleDeclarationNoInit_AST;
2167 currentAST.child = singleDeclarationNoInit_AST!=null &&singleDeclarationNoInit_AST.getFirstChild()!=null ?
2168 singleDeclarationNoInit_AST.getFirstChild() : singleDeclarationNoInit_AST;
2169 currentAST.advanceChildToEnd();
2170 }
2171 break;
2172 }
2173 case IDENT:
2174 case LITERAL_void:
2175 case LITERAL_boolean:
2176 case LITERAL_byte:
2177 case LITERAL_char:
2178 case LITERAL_short:
2179 case LITERAL_int:
2180 case LITERAL_float:
2181 case LITERAL_long:
2182 case LITERAL_double:
2183 case LITERAL_any:
2184 {
2185 typeSpec(false);
2186 t2_AST = (AST)returnAST;
2187 singleVariable(null,t2_AST);
2188 v2_AST = (AST)returnAST;
2189 if ( inputState.guessing==0 ) {
2190 singleDeclarationNoInit_AST = (AST)currentAST.root;
2191 singleDeclarationNoInit_AST = v2_AST;
2192 currentAST.root = singleDeclarationNoInit_AST;
2193 currentAST.child = singleDeclarationNoInit_AST!=null &&singleDeclarationNoInit_AST.getFirstChild()!=null ?
2194 singleDeclarationNoInit_AST.getFirstChild() : singleDeclarationNoInit_AST;
2195 currentAST.advanceChildToEnd();
2196 }
2197 break;
2198 }
2199 default:
2200 {
2201 throw new NoViableAltException(LT(1), getFilename());
2202 }
2203 }
2204 returnAST = singleDeclarationNoInit_AST;
2205 }
2206
2207 /*** Used in cases where a declaration cannot have commas, or ends with the "in" operator instead of '='. */
2208 public final void singleVariable(
2209 AST mods, AST t
2210 ) throws RecognitionException, TokenStreamException {
2211
2212 returnAST = null;
2213 ASTPair currentAST = new ASTPair();
2214 AST singleVariable_AST = null;
2215 AST id_AST = null;
2216 Token first = LT(1);
2217
2218 variableName();
2219 id_AST = (AST)returnAST;
2220 if ( inputState.guessing==0 ) {
2221 singleVariable_AST = (AST)currentAST.root;
2222 singleVariable_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(VARIABLE_DEF,"VARIABLE_DEF",first,LT(1))).add(mods).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t))).add(id_AST));
2223 currentAST.root = singleVariable_AST;
2224 currentAST.child = singleVariable_AST!=null &&singleVariable_AST.getFirstChild()!=null ?
2225 singleVariable_AST.getFirstChild() : singleVariable_AST;
2226 currentAST.advanceChildToEnd();
2227 }
2228 returnAST = singleVariable_AST;
2229 }
2230
2231 /*** A declaration with one declarator and optional initialization, like a parameterDeclaration.
2232 * Used to parse declarations used for both binding and effect, in places like argument
2233 * lists and <code>while</code> statements.
2234 */
2235 public final void singleDeclaration() throws RecognitionException, TokenStreamException {
2236
2237 returnAST = null;
2238 ASTPair currentAST = new ASTPair();
2239 AST singleDeclaration_AST = null;
2240 AST sd_AST = null;
2241
2242 singleDeclarationNoInit();
2243 sd_AST = (AST)returnAST;
2244 if ( inputState.guessing==0 ) {
2245 singleDeclaration_AST = (AST)currentAST.root;
2246 singleDeclaration_AST = sd_AST;
2247 currentAST.root = singleDeclaration_AST;
2248 currentAST.child = singleDeclaration_AST!=null &&singleDeclaration_AST.getFirstChild()!=null ?
2249 singleDeclaration_AST.getFirstChild() : singleDeclaration_AST;
2250 currentAST.advanceChildToEnd();
2251 }
2252 {
2253 switch ( LA(1)) {
2254 case ASSIGN:
2255 {
2256 varInitializer();
2257 astFactory.addASTChild(currentAST, returnAST);
2258 break;
2259 }
2260 case RBRACK:
2261 case COMMA:
2262 case RPAREN:
2263 case SEMI:
2264 {
2265 break;
2266 }
2267 default:
2268 {
2269 throw new NoViableAltException(LT(1), getFilename());
2270 }
2271 }
2272 }
2273 singleDeclaration_AST = (AST)currentAST.root;
2274 returnAST = singleDeclaration_AST;
2275 }
2276
2277 /*** An assignment operator '=' followed by an expression. (Never empty.) */
2278 public final void varInitializer() throws RecognitionException, TokenStreamException {
2279
2280 returnAST = null;
2281 ASTPair currentAST = new ASTPair();
2282 AST varInitializer_AST = null;
2283
2284 AST tmp50_AST = null;
2285 tmp50_AST = astFactory.create(LT(1));
2286 astFactory.makeASTRoot(currentAST, tmp50_AST);
2287 match(ASSIGN);
2288 nls();
2289 expression(LC_INIT);
2290 astFactory.addASTChild(currentAST, returnAST);
2291 varInitializer_AST = (AST)currentAST.root;
2292 returnAST = varInitializer_AST;
2293 }
2294
2295 /*** Used only as a lookahead predicate, before diving in and parsing a declaration.
2296 * A declaration can be unambiguously introduced with "def", an annotation or a modifier token like "final".
2297 * It may also be introduced by a simple identifier whose first character is an uppercase letter,
2298 * as in {String x}. A declaration can also be introduced with a built in type like 'int' or 'void'.
2299 * Brackets (array and generic) are allowed, as in {List[] x} or {int[][] y}.
2300 * Anything else is parsed as a statement of some sort (expression or command).
2301 * <p>
2302 * (In the absence of explicit method-call parens, we assume a capitalized name is a type name.
2303 * Yes, this is a little hacky. Alternatives are to complicate the declaration or command
2304 * syntaxes, or to have the parser query the symbol table. Parse-time queries are evil.
2305 * And we want both {String x} and {println x}. So we need a syntactic razor-edge to slip
2306 * between 'println' and 'String'.)
2307 *
2308 * *TODO* The declarationStart production needs to be strengthened to recognize
2309 * things like {List<String> foo}.
2310 * Right now it only knows how to skip square brackets after the type, not
2311 * angle brackets.
2312 * This probably turns out to be tricky because of >> vs. > >. If so,
2313 * just put a TODO comment in.
2314 */
2315 public final void declarationStart() throws RecognitionException, TokenStreamException {
2316
2317 returnAST = null;
2318 ASTPair currentAST = new ASTPair();
2319 AST declarationStart_AST = null;
2320
2321 switch ( LA(1)) {
2322 case LITERAL_def:
2323 {
2324 match(LITERAL_def);
2325 break;
2326 }
2327 case FINAL:
2328 case ABSTRACT:
2329 case STRICTFP:
2330 case LITERAL_static:
2331 case LITERAL_private:
2332 case LITERAL_public:
2333 case LITERAL_protected:
2334 case LITERAL_transient:
2335 case LITERAL_native:
2336 case LITERAL_threadsafe:
2337 case LITERAL_synchronized:
2338 case LITERAL_volatile:
2339 {
2340 modifier();
2341 break;
2342 }
2343 case AT:
2344 {
2345 AST tmp52_AST = null;
2346 tmp52_AST = astFactory.create(LT(1));
2347 match(AT);
2348 AST tmp53_AST = null;
2349 tmp53_AST = astFactory.create(LT(1));
2350 match(IDENT);
2351 break;
2352 }
2353 case IDENT:
2354 case LITERAL_void:
2355 case LITERAL_boolean:
2356 case LITERAL_byte:
2357 case LITERAL_char:
2358 case LITERAL_short:
2359 case LITERAL_int:
2360 case LITERAL_float:
2361 case LITERAL_long:
2362 case LITERAL_double:
2363 case LITERAL_any:
2364 {
2365 {
2366 if ((LA(1)==IDENT) && (LA(2)==IDENT||LA(2)==LBRACK)) {
2367 upperCaseIdent();
2368 }
2369 else if (((LA(1) >= LITERAL_void && LA(1) <= LITERAL_any))) {
2370 builtInType();
2371 }
2372 else if ((LA(1)==IDENT) && (LA(2)==DOT)) {
2373 qualifiedTypeName();
2374 }
2375 else {
2376 throw new NoViableAltException(LT(1), getFilename());
2377 }
2378
2379 }
2380 {
2381 _loop24:
2382 do {
2383 if ((LA(1)==LBRACK)) {
2384 AST tmp54_AST = null;
2385 tmp54_AST = astFactory.create(LT(1));
2386 match(LBRACK);
2387 balancedTokens();
2388 AST tmp55_AST = null;
2389 tmp55_AST = astFactory.create(LT(1));
2390 match(RBRACK);
2391 }
2392 else {
2393 break _loop24;
2394 }
2395
2396 } while (true);
2397 }
2398 AST tmp56_AST = null;
2399 tmp56_AST = astFactory.create(LT(1));
2400 match(IDENT);
2401 break;
2402 }
2403 default:
2404 {
2405 throw new NoViableAltException(LT(1), getFilename());
2406 }
2407 }
2408 returnAST = declarationStart_AST;
2409 }
2410
2411 public final void modifier() throws RecognitionException, TokenStreamException {
2412
2413 returnAST = null;
2414 ASTPair currentAST = new ASTPair();
2415 AST modifier_AST = null;
2416
2417 switch ( LA(1)) {
2418 case LITERAL_private:
2419 {
2420 AST tmp57_AST = null;
2421 tmp57_AST = astFactory.create(LT(1));
2422 astFactory.addASTChild(currentAST, tmp57_AST);
2423 match(LITERAL_private);
2424 modifier_AST = (AST)currentAST.root;
2425 break;
2426 }
2427 case LITERAL_public:
2428 {
2429 AST tmp58_AST = null;
2430 tmp58_AST = astFactory.create(LT(1));
2431 astFactory.addASTChild(currentAST, tmp58_AST);
2432 match(LITERAL_public);
2433 modifier_AST = (AST)currentAST.root;
2434 break;
2435 }
2436 case LITERAL_protected:
2437 {
2438 AST tmp59_AST = null;
2439 tmp59_AST = astFactory.create(LT(1));
2440 astFactory.addASTChild(currentAST, tmp59_AST);
2441 match(LITERAL_protected);
2442 modifier_AST = (AST)currentAST.root;
2443 break;
2444 }
2445 case LITERAL_static:
2446 {
2447 AST tmp60_AST = null;
2448 tmp60_AST = astFactory.create(LT(1));
2449 astFactory.addASTChild(currentAST, tmp60_AST);
2450 match(LITERAL_static);
2451 modifier_AST = (AST)currentAST.root;
2452 break;
2453 }
2454 case LITERAL_transient:
2455 {
2456 AST tmp61_AST = null;
2457 tmp61_AST = astFactory.create(LT(1));
2458 astFactory.addASTChild(currentAST, tmp61_AST);
2459 match(LITERAL_transient);
2460 modifier_AST = (AST)currentAST.root;
2461 break;
2462 }
2463 case FINAL:
2464 {
2465 AST tmp62_AST = null;
2466 tmp62_AST = astFactory.create(LT(1));
2467 astFactory.addASTChild(currentAST, tmp62_AST);
2468 match(FINAL);
2469 modifier_AST = (AST)currentAST.root;
2470 break;
2471 }
2472 case ABSTRACT:
2473 {
2474 AST tmp63_AST = null;
2475 tmp63_AST = astFactory.create(LT(1));
2476 astFactory.addASTChild(currentAST, tmp63_AST);
2477 match(ABSTRACT);
2478 modifier_AST = (AST)currentAST.root;
2479 break;
2480 }
2481 case LITERAL_native:
2482 {
2483 AST tmp64_AST = null;
2484 tmp64_AST = astFactory.create(LT(1));
2485 astFactory.addASTChild(currentAST, tmp64_AST);
2486 match(LITERAL_native);
2487 modifier_AST = (AST)currentAST.root;
2488 break;
2489 }
2490 case LITERAL_threadsafe:
2491 {
2492 AST tmp65_AST = null;
2493 tmp65_AST = astFactory.create(LT(1));
2494 astFactory.addASTChild(currentAST, tmp65_AST);
2495 match(LITERAL_threadsafe);
2496 modifier_AST = (AST)currentAST.root;
2497 break;
2498 }
2499 case LITERAL_synchronized:
2500 {
2501 AST tmp66_AST = null;
2502 tmp66_AST = astFactory.create(LT(1));
2503 astFactory.addASTChild(currentAST, tmp66_AST);
2504 match(LITERAL_synchronized);
2505 modifier_AST = (AST)currentAST.root;
2506 break;
2507 }
2508 case LITERAL_volatile:
2509 {
2510 AST tmp67_AST = null;
2511 tmp67_AST = astFactory.create(LT(1));
2512 astFactory.addASTChild(currentAST, tmp67_AST);
2513 match(LITERAL_volatile);
2514 modifier_AST = (AST)currentAST.root;
2515 break;
2516 }
2517 case STRICTFP:
2518 {
2519 AST tmp68_AST = null;
2520 tmp68_AST = astFactory.create(LT(1));
2521 astFactory.addASTChild(currentAST, tmp68_AST);
2522 match(STRICTFP);
2523 modifier_AST = (AST)currentAST.root;
2524 break;
2525 }
2526 default:
2527 {
2528 throw new NoViableAltException(LT(1), getFilename());
2529 }
2530 }
2531 returnAST = modifier_AST;
2532 }
2533
2534 /*** An IDENT token whose spelling is required to start with an uppercase letter.
2535 * In the case of a simple statement {UpperID name} the identifier is taken to be a type name, not a command name.
2536 */
2537 public final void upperCaseIdent() throws RecognitionException, TokenStreamException {
2538
2539 returnAST = null;
2540 ASTPair currentAST = new ASTPair();
2541 AST upperCaseIdent_AST = null;
2542
2543 if (!(isUpperCase(LT(1))))
2544 throw new SemanticException("isUpperCase(LT(1))");
2545 AST tmp69_AST = null;
2546 tmp69_AST = astFactory.create(LT(1));
2547 astFactory.addASTChild(currentAST, tmp69_AST);
2548 match(IDENT);
2549 upperCaseIdent_AST = (AST)currentAST.root;
2550 returnAST = upperCaseIdent_AST;
2551 }
2552
2553 public final void builtInType() throws RecognitionException, TokenStreamException {
2554
2555 returnAST = null;
2556 ASTPair currentAST = new ASTPair();
2557 AST builtInType_AST = null;
2558
2559 switch ( LA(1)) {
2560 case LITERAL_void:
2561 {
2562 AST tmp70_AST = null;
2563 tmp70_AST = astFactory.create(LT(1));
2564 astFactory.addASTChild(currentAST, tmp70_AST);
2565 match(LITERAL_void);
2566 builtInType_AST = (AST)currentAST.root;
2567 break;
2568 }
2569 case LITERAL_boolean:
2570 {
2571 AST tmp71_AST = null;
2572 tmp71_AST = astFactory.create(LT(1));
2573 astFactory.addASTChild(currentAST, tmp71_AST);
2574 match(LITERAL_boolean);
2575 builtInType_AST = (AST)currentAST.root;
2576 break;
2577 }
2578 case LITERAL_byte:
2579 {
2580 AST tmp72_AST = null;
2581 tmp72_AST = astFactory.create(LT(1));
2582 astFactory.addASTChild(currentAST, tmp72_AST);
2583 match(LITERAL_byte);
2584 builtInType_AST = (AST)currentAST.root;
2585 break;
2586 }
2587 case LITERAL_char:
2588 {
2589 AST tmp73_AST = null;
2590 tmp73_AST = astFactory.create(LT(1));
2591 astFactory.addASTChild(currentAST, tmp73_AST);
2592 match(LITERAL_char);
2593 builtInType_AST = (AST)currentAST.root;
2594 break;
2595 }
2596 case LITERAL_short:
2597 {
2598 AST tmp74_AST = null;
2599 tmp74_AST = astFactory.create(LT(1));
2600 astFactory.addASTChild(currentAST, tmp74_AST);
2601 match(LITERAL_short);
2602 builtInType_AST = (AST)currentAST.root;
2603 break;
2604 }
2605 case LITERAL_int:
2606 {
2607 AST tmp75_AST = null;
2608 tmp75_AST = astFactory.create(LT(1));
2609 astFactory.addASTChild(currentAST, tmp75_AST);
2610 match(LITERAL_int);
2611 builtInType_AST = (AST)currentAST.root;
2612 break;
2613 }
2614 case LITERAL_float:
2615 {
2616 AST tmp76_AST = null;
2617 tmp76_AST = astFactory.create(LT(1));
2618 astFactory.addASTChild(currentAST, tmp76_AST);
2619 match(LITERAL_float);
2620 builtInType_AST = (AST)currentAST.root;
2621 break;
2622 }
2623 case LITERAL_long:
2624 {
2625 AST tmp77_AST = null;
2626 tmp77_AST = astFactory.create(LT(1));
2627 astFactory.addASTChild(currentAST, tmp77_AST);
2628 match(LITERAL_long);
2629 builtInType_AST = (AST)currentAST.root;
2630 break;
2631 }
2632 case LITERAL_double:
2633 {
2634 AST tmp78_AST = null;
2635 tmp78_AST = astFactory.create(LT(1));
2636 astFactory.addASTChild(currentAST, tmp78_AST);
2637 match(LITERAL_double);
2638 builtInType_AST = (AST)currentAST.root;
2639 break;
2640 }
2641 case LITERAL_any:
2642 {
2643 AST tmp79_AST = null;
2644 tmp79_AST = astFactory.create(LT(1));
2645 astFactory.addASTChild(currentAST, tmp79_AST);
2646 match(LITERAL_any);
2647 builtInType_AST = (AST)currentAST.root;
2648 break;
2649 }
2650 default:
2651 {
2652 throw new NoViableAltException(LT(1), getFilename());
2653 }
2654 }
2655 returnAST = builtInType_AST;
2656 }
2657
2658 /*** Not yet used - but we could use something like this to look for fully qualified type names
2659 */
2660 public final void qualifiedTypeName() throws RecognitionException, TokenStreamException {
2661
2662 returnAST = null;
2663 ASTPair currentAST = new ASTPair();
2664 AST qualifiedTypeName_AST = null;
2665
2666 AST tmp80_AST = null;
2667 tmp80_AST = astFactory.create(LT(1));
2668 match(IDENT);
2669 {
2670 _loop27:
2671 do {
2672 if ((LA(1)==DOT) && (LA(2)==IDENT) && (LA(3)==DOT)) {
2673 AST tmp81_AST = null;
2674 tmp81_AST = astFactory.create(LT(1));
2675 match(DOT);
2676 AST tmp82_AST = null;
2677 tmp82_AST = astFactory.create(LT(1));
2678 match(IDENT);
2679 }
2680 else {
2681 break _loop27;
2682 }
2683
2684 } while (true);
2685 }
2686 AST tmp83_AST = null;
2687 tmp83_AST = astFactory.create(LT(1));
2688 match(DOT);
2689 upperCaseIdent();
2690 returnAST = qualifiedTypeName_AST;
2691 }
2692
2693 public final void balancedTokens() throws RecognitionException, TokenStreamException {
2694
2695 returnAST = null;
2696 ASTPair currentAST = new ASTPair();
2697 AST balancedTokens_AST = null;
2698
2699 {
2700 _loop472:
2701 do {
2702 if ((_tokenSet_36.member(LA(1)))) {
2703 balancedBrackets();
2704 }
2705 else if ((_tokenSet_37.member(LA(1)))) {
2706 {
2707 match(_tokenSet_37);
2708 }
2709 }
2710 else {
2711 break _loop472;
2712 }
2713
2714 } while (true);
2715 }
2716 returnAST = balancedTokens_AST;
2717 }
2718
2719 /*** Used to look ahead for a constructor
2720 */
2721 public final void constructorStart() throws RecognitionException, TokenStreamException {
2722
2723 returnAST = null;
2724 ASTPair currentAST = new ASTPair();
2725 AST constructorStart_AST = null;
2726 Token id = null;
2727 AST id_AST = null;
2728
2729 modifiersOpt();
2730 id = LT(1);
2731 id_AST = astFactory.create(id);
2732 match(IDENT);
2733 if (!(isConstructorIdent(id)))
2734 throw new SemanticException("isConstructorIdent(id)");
2735 nls();
2736 match(LPAREN);
2737 returnAST = constructorStart_AST;
2738 }
2739
2740 /*** A list of zero or more modifiers, annotations, or "def". */
2741 public final void modifiersOpt() throws RecognitionException, TokenStreamException {
2742
2743 returnAST = null;
2744 ASTPair currentAST = new ASTPair();
2745 AST modifiersOpt_AST = null;
2746 Token first = LT(1);
2747
2748 {
2749 if ((_tokenSet_38.member(LA(1))) && (_tokenSet_39.member(LA(2))) && (_tokenSet_40.member(LA(3)))) {
2750 modifiersInternal();
2751 astFactory.addASTChild(currentAST, returnAST);
2752 }
2753 else if ((_tokenSet_41.member(LA(1))) && (_tokenSet_42.member(LA(2))) && (_tokenSet_43.member(LA(3)))) {
2754 }
2755 else {
2756 throw new NoViableAltException(LT(1), getFilename());
2757 }
2758
2759 }
2760 if ( inputState.guessing==0 ) {
2761 modifiersOpt_AST = (AST)currentAST.root;
2762 modifiersOpt_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(MODIFIERS,"MODIFIERS",first,LT(1))).add(modifiersOpt_AST));
2763 currentAST.root = modifiersOpt_AST;
2764 currentAST.child = modifiersOpt_AST!=null &&modifiersOpt_AST.getFirstChild()!=null ?
2765 modifiersOpt_AST.getFirstChild() : modifiersOpt_AST;
2766 currentAST.advanceChildToEnd();
2767 }
2768 modifiersOpt_AST = (AST)currentAST.root;
2769 returnAST = modifiersOpt_AST;
2770 }
2771
2772 /*** Used only as a lookahead predicate for nested type declarations. */
2773 public final void typeDeclarationStart() throws RecognitionException, TokenStreamException {
2774
2775 returnAST = null;
2776 ASTPair currentAST = new ASTPair();
2777 AST typeDeclarationStart_AST = null;
2778
2779 modifiersOpt();
2780 {
2781 switch ( LA(1)) {
2782 case LITERAL_class:
2783 {
2784 match(LITERAL_class);
2785 break;
2786 }
2787 case LITERAL_interface:
2788 {
2789 match(LITERAL_interface);
2790 break;
2791 }
2792 case LITERAL_enum:
2793 {
2794 match(LITERAL_enum);
2795 break;
2796 }
2797 case AT:
2798 {
2799 AST tmp89_AST = null;
2800 tmp89_AST = astFactory.create(LT(1));
2801 match(AT);
2802 match(LITERAL_interface);
2803 break;
2804 }
2805 default:
2806 {
2807 throw new NoViableAltException(LT(1), getFilename());
2808 }
2809 }
2810 }
2811 returnAST = typeDeclarationStart_AST;
2812 }
2813
2814 public final void classTypeSpec(
2815 boolean addImagNode
2816 ) throws RecognitionException, TokenStreamException {
2817
2818 returnAST = null;
2819 ASTPair currentAST = new ASTPair();
2820 AST classTypeSpec_AST = null;
2821 AST ct_AST = null;
2822 Token first = LT(1);
2823
2824 classOrInterfaceType(false);
2825 ct_AST = (AST)returnAST;
2826 declaratorBrackets(ct_AST);
2827 astFactory.addASTChild(currentAST, returnAST);
2828 if ( inputState.guessing==0 ) {
2829 classTypeSpec_AST = (AST)currentAST.root;
2830
2831 if ( addImagNode ) {
2832 classTypeSpec_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(classTypeSpec_AST));
2833 }
2834
2835 currentAST.root = classTypeSpec_AST;
2836 currentAST.child = classTypeSpec_AST!=null &&classTypeSpec_AST.getFirstChild()!=null ?
2837 classTypeSpec_AST.getFirstChild() : classTypeSpec_AST;
2838 currentAST.advanceChildToEnd();
2839 }
2840 classTypeSpec_AST = (AST)currentAST.root;
2841 returnAST = classTypeSpec_AST;
2842 }
2843
2844 public final void builtInTypeSpec(
2845 boolean addImagNode
2846 ) throws RecognitionException, TokenStreamException {
2847
2848 returnAST = null;
2849 ASTPair currentAST = new ASTPair();
2850 AST builtInTypeSpec_AST = null;
2851 AST bt_AST = null;
2852 Token first = LT(1);
2853
2854 builtInType();
2855 bt_AST = (AST)returnAST;
2856 declaratorBrackets(bt_AST);
2857 astFactory.addASTChild(currentAST, returnAST);
2858 if ( inputState.guessing==0 ) {
2859 builtInTypeSpec_AST = (AST)currentAST.root;
2860
2861 if ( addImagNode ) {
2862 builtInTypeSpec_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(builtInTypeSpec_AST));
2863 }
2864
2865 currentAST.root = builtInTypeSpec_AST;
2866 currentAST.child = builtInTypeSpec_AST!=null &&builtInTypeSpec_AST.getFirstChild()!=null ?
2867 builtInTypeSpec_AST.getFirstChild() : builtInTypeSpec_AST;
2868 currentAST.advanceChildToEnd();
2869 }
2870 builtInTypeSpec_AST = (AST)currentAST.root;
2871 returnAST = builtInTypeSpec_AST;
2872 }
2873
2874 public final void classOrInterfaceType(
2875 boolean addImagNode
2876 ) throws RecognitionException, TokenStreamException {
2877
2878 returnAST = null;
2879 ASTPair currentAST = new ASTPair();
2880 AST classOrInterfaceType_AST = null;
2881 Token first = LT(1);
2882
2883 AST tmp91_AST = null;
2884 tmp91_AST = astFactory.create(LT(1));
2885 astFactory.makeASTRoot(currentAST, tmp91_AST);
2886 match(IDENT);
2887 {
2888 switch ( LA(1)) {
2889 case LT:
2890 {
2891 typeArguments();
2892 astFactory.addASTChild(currentAST, returnAST);
2893 break;
2894 }
2895 case EOF:
2896 case UNUSED_DO:
2897 case LITERAL_def:
2898 case AT:
2899 case IDENT:
2900 case LBRACK:
2901 case RBRACK:
2902 case DOT:
2903 case LPAREN:
2904 case LITERAL_class:
2905 case QUESTION:
2906 case LITERAL_extends:
2907 case LITERAL_super:
2908 case COMMA:
2909 case GT:
2910 case SR:
2911 case BSR:
2912 case LITERAL_void:
2913 case LITERAL_boolean:
2914 case LITERAL_byte:
2915 case LITERAL_char:
2916 case LITERAL_short:
2917 case LITERAL_int:
2918 case LITERAL_float:
2919 case LITERAL_long:
2920 case LITERAL_double:
2921 case LITERAL_any:
2922 case LITERAL_as:
2923 case RPAREN:
2924 case ASSIGN:
2925 case BAND:
2926 case LCURLY:
2927 case RCURLY:
2928 case SEMI:
2929 case NLS:
2930 case LITERAL_default:
2931 case LITERAL_implements:
2932 case LITERAL_this:
2933 case STRING_LITERAL:
2934 case TRIPLE_DOT:
2935 case CLOSABLE_BLOCK_OP:
2936 case COLON:
2937 case LITERAL_if:
2938 case LITERAL_else:
2939 case LITERAL_while:
2940 case LITERAL_switch:
2941 case LITERAL_for:
2942 case LITERAL_in:
2943 case PLUS:
2944 case MINUS:
2945 case LITERAL_case:
2946 case LITERAL_try:
2947 case LITERAL_finally:
2948 case LITERAL_catch:
2949 case PLUS_ASSIGN:
2950 case MINUS_ASSIGN:
2951 case STAR_ASSIGN:
2952 case DIV_ASSIGN:
2953 case MOD_ASSIGN:
2954 case SR_ASSIGN:
2955 case BSR_ASSIGN:
2956 case SL_ASSIGN:
2957 case BAND_ASSIGN:
2958 case BXOR_ASSIGN:
2959 case BOR_ASSIGN:
2960 case STAR_STAR_ASSIGN:
2961 case LOR:
2962 case LAND:
2963 case BOR:
2964 case BXOR:
2965 case REGEX_FIND:
2966 case REGEX_MATCH:
2967 case NOT_EQUAL:
2968 case EQUAL:
2969 case COMPARE_TO:
2970 case INC:
2971 case DEC:
2972 case BNOT:
2973 case LNOT:
2974 case DOLLAR:
2975 case STRING_CTOR_START:
2976 case LITERAL_new:
2977 case LITERAL_true:
2978 case LITERAL_false:
2979 case LITERAL_null:
2980 case NUM_INT:
2981 case NUM_FLOAT:
2982 case NUM_LONG:
2983 case NUM_DOUBLE:
2984 case NUM_BIG_INT:
2985 case NUM_BIG_DECIMAL:
2986 {
2987 break;
2988 }
2989 default:
2990 {
2991 throw new NoViableAltException(LT(1), getFilename());
2992 }
2993 }
2994 }
2995 {
2996 _loop38:
2997 do {
2998 if ((LA(1)==DOT) && (LA(2)==IDENT) && (_tokenSet_44.member(LA(3)))) {
2999 AST tmp92_AST = null;
3000 tmp92_AST = astFactory.create(LT(1));
3001 astFactory.makeASTRoot(currentAST, tmp92_AST);
3002 match(DOT);
3003 AST tmp93_AST = null;
3004 tmp93_AST = astFactory.create(LT(1));
3005 astFactory.addASTChild(currentAST, tmp93_AST);
3006 match(IDENT);
3007 {
3008 switch ( LA(1)) {
3009 case LT:
3010 {
3011 typeArguments();
3012 astFactory.addASTChild(currentAST, returnAST);
3013 break;
3014 }
3015 case EOF:
3016 case UNUSED_DO:
3017 case LITERAL_def:
3018 case AT:
3019 case IDENT:
3020 case LBRACK:
3021 case RBRACK:
3022 case DOT:
3023 case LPAREN:
3024 case LITERAL_class:
3025 case QUESTION:
3026 case LITERAL_extends:
3027 case LITERAL_super:
3028 case COMMA:
3029 case GT:
3030 case SR:
3031 case BSR:
3032 case LITERAL_void:
3033 case LITERAL_boolean:
3034 case LITERAL_byte:
3035 case LITERAL_char:
3036 case LITERAL_short:
3037 case LITERAL_int:
3038 case LITERAL_float:
3039 case LITERAL_long:
3040 case LITERAL_double:
3041 case LITERAL_any:
3042 case LITERAL_as:
3043 case RPAREN:
3044 case ASSIGN:
3045 case BAND:
3046 case LCURLY:
3047 case RCURLY:
3048 case SEMI:
3049 case NLS:
3050 case LITERAL_default:
3051 case LITERAL_implements:
3052 case LITERAL_this:
3053 case STRING_LITERAL:
3054 case TRIPLE_DOT:
3055 case CLOSABLE_BLOCK_OP:
3056 case COLON:
3057 case LITERAL_if:
3058 case LITERAL_else:
3059 case LITERAL_while:
3060 case LITERAL_switch:
3061 case LITERAL_for:
3062 case LITERAL_in:
3063 case PLUS:
3064 case MINUS:
3065 case LITERAL_case:
3066 case LITERAL_try:
3067 case LITERAL_finally:
3068 case LITERAL_catch:
3069 case PLUS_ASSIGN:
3070 case MINUS_ASSIGN:
3071 case STAR_ASSIGN:
3072 case DIV_ASSIGN:
3073 case MOD_ASSIGN:
3074 case SR_ASSIGN:
3075 case BSR_ASSIGN:
3076 case SL_ASSIGN:
3077 case BAND_ASSIGN:
3078 case BXOR_ASSIGN:
3079 case BOR_ASSIGN:
3080 case STAR_STAR_ASSIGN:
3081 case LOR:
3082 case LAND:
3083 case BOR:
3084 case BXOR:
3085 case REGEX_FIND:
3086 case REGEX_MATCH:
3087 case NOT_EQUAL:
3088 case EQUAL:
3089 case COMPARE_TO:
3090 case INC:
3091 case DEC:
3092 case BNOT:
3093 case LNOT:
3094 case DOLLAR:
3095 case STRING_CTOR_START:
3096 case LITERAL_new:
3097 case LITERAL_true:
3098 case LITERAL_false:
3099 case LITERAL_null:
3100 case NUM_INT:
3101 case NUM_FLOAT:
3102 case NUM_LONG:
3103 case NUM_DOUBLE:
3104 case NUM_BIG_INT:
3105 case NUM_BIG_DECIMAL:
3106 {
3107 break;
3108 }
3109 default:
3110 {
3111 throw new NoViableAltException(LT(1), getFilename());
3112 }
3113 }
3114 }
3115 }
3116 else {
3117 break _loop38;
3118 }
3119
3120 } while (true);
3121 }
3122 if ( inputState.guessing==0 ) {
3123 classOrInterfaceType_AST = (AST)currentAST.root;
3124
3125 if ( addImagNode ) {
3126 classOrInterfaceType_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(classOrInterfaceType_AST));
3127 }
3128
3129 currentAST.root = classOrInterfaceType_AST;
3130 currentAST.child = classOrInterfaceType_AST!=null &&classOrInterfaceType_AST.getFirstChild()!=null ?
3131 classOrInterfaceType_AST.getFirstChild() : classOrInterfaceType_AST;
3132 currentAST.advanceChildToEnd();
3133 }
3134 classOrInterfaceType_AST = (AST)currentAST.root;
3135 returnAST = classOrInterfaceType_AST;
3136 }
3137
3138 /*** After some type names, where zero or more empty bracket pairs are allowed.
3139 * We use ARRAY_DECLARATOR to represent this.
3140 * TODO: Is there some more Groovy way to view this in terms of the indexed property syntax?
3141 */
3142 public final void declaratorBrackets(
3143 AST typ
3144 ) throws RecognitionException, TokenStreamException {
3145
3146 returnAST = null;
3147 ASTPair currentAST = new ASTPair();
3148 AST declaratorBrackets_AST = null;
3149 Token lb = null;
3150 AST lb_AST = null;
3151
3152 if ( inputState.guessing==0 ) {
3153 declaratorBrackets_AST = (AST)currentAST.root;
3154 declaratorBrackets_AST=typ;
3155 currentAST.root = declaratorBrackets_AST;
3156 currentAST.child = declaratorBrackets_AST!=null &&declaratorBrackets_AST.getFirstChild()!=null ?
3157 declaratorBrackets_AST.getFirstChild() : declaratorBrackets_AST;
3158 currentAST.advanceChildToEnd();
3159 }
3160 {
3161 _loop209:
3162 do {
3163 if ((LA(1)==LBRACK) && (LA(2)==RBRACK) && (_tokenSet_45.member(LA(3)))) {
3164 lb = LT(1);
3165 lb_AST = astFactory.create(lb);
3166 astFactory.makeASTRoot(currentAST, lb_AST);
3167 match(LBRACK);
3168 if ( inputState.guessing==0 ) {
3169 lb_AST.setType(ARRAY_DECLARATOR);
3170 }
3171 match(RBRACK);
3172 }
3173 else {
3174 break _loop209;
3175 }
3176
3177 } while (true);
3178 }
3179 declaratorBrackets_AST = (AST)currentAST.root;
3180 returnAST = declaratorBrackets_AST;
3181 }
3182
3183 public final void typeArguments() throws RecognitionException, TokenStreamException {
3184
3185 returnAST = null;
3186 ASTPair currentAST = new ASTPair();
3187 AST typeArguments_AST = null;
3188 Token first = LT(1);
3189 int currentLtLevel = 0;
3190
3191 if ( inputState.guessing==0 ) {
3192 currentLtLevel = ltCounter;
3193 }
3194 match(LT);
3195 if ( inputState.guessing==0 ) {
3196 ltCounter++;
3197 }
3198 nls();
3199 typeArgument();
3200 astFactory.addASTChild(currentAST, returnAST);
3201 {
3202 _loop48:
3203 do {
3204 if (((LA(1)==COMMA) && (_tokenSet_46.member(LA(2))) && (_tokenSet_44.member(LA(3))))&&(inputState.guessing !=0 || ltCounter == currentLtLevel + 1)) {
3205 match(COMMA);
3206 nls();
3207 typeArgument();
3208 astFactory.addASTChild(currentAST, returnAST);
3209 }
3210 else {
3211 break _loop48;
3212 }
3213
3214 } while (true);
3215 }
3216 nls();
3217 {
3218 if (((LA(1) >= GT && LA(1) <= BSR)) && (_tokenSet_45.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
3219 typeArgumentsOrParametersEnd();
3220 astFactory.addASTChild(currentAST, returnAST);
3221 }
3222 else if ((_tokenSet_45.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
3223 }
3224 else {
3225 throw new NoViableAltException(LT(1), getFilename());
3226 }
3227
3228 }
3229 if (!((currentLtLevel != 0) || ltCounter == currentLtLevel))
3230 throw new SemanticException("(currentLtLevel != 0) || ltCounter == currentLtLevel");
3231 if ( inputState.guessing==0 ) {
3232 typeArguments_AST = (AST)currentAST.root;
3233 typeArguments_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_ARGUMENTS,"TYPE_ARGUMENTS",first,LT(1))).add(typeArguments_AST));
3234 currentAST.root = typeArguments_AST;
3235 currentAST.child = typeArguments_AST!=null &&typeArguments_AST.getFirstChild()!=null ?
3236 typeArguments_AST.getFirstChild() : typeArguments_AST;
3237 currentAST.advanceChildToEnd();
3238 }
3239 typeArguments_AST = (AST)currentAST.root;
3240 returnAST = typeArguments_AST;
3241 }
3242
3243 public final void typeArgumentSpec() throws RecognitionException, TokenStreamException {
3244
3245 returnAST = null;
3246 ASTPair currentAST = new ASTPair();
3247 AST typeArgumentSpec_AST = null;
3248
3249 switch ( LA(1)) {
3250 case IDENT:
3251 {
3252 classTypeSpec(true);
3253 astFactory.addASTChild(currentAST, returnAST);
3254 typeArgumentSpec_AST = (AST)currentAST.root;
3255 break;
3256 }
3257 case LITERAL_void:
3258 case LITERAL_boolean:
3259 case LITERAL_byte:
3260 case LITERAL_char:
3261 case LITERAL_short:
3262 case LITERAL_int:
3263 case LITERAL_float:
3264 case LITERAL_long:
3265 case LITERAL_double:
3266 case LITERAL_any:
3267 {
3268 builtInTypeArraySpec(true);
3269 astFactory.addASTChild(currentAST, returnAST);
3270 typeArgumentSpec_AST = (AST)currentAST.root;
3271 break;
3272 }
3273 default:
3274 {
3275 throw new NoViableAltException(LT(1), getFilename());
3276 }
3277 }
3278 returnAST = typeArgumentSpec_AST;
3279 }
3280
3281 public final void builtInTypeArraySpec(
3282 boolean addImagNode
3283 ) throws RecognitionException, TokenStreamException {
3284
3285 returnAST = null;
3286 ASTPair currentAST = new ASTPair();
3287 AST builtInTypeArraySpec_AST = null;
3288 AST bt_AST = null;
3289 Token first = LT(1);
3290
3291 builtInType();
3292 bt_AST = (AST)returnAST;
3293 {
3294 boolean synPredMatched56 = false;
3295 if (((_tokenSet_45.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3))))) {
3296 int _m56 = mark();
3297 synPredMatched56 = true;
3298 inputState.guessing++;
3299 try {
3300 {
3301 match(LBRACK);
3302 }
3303 }
3304 catch (RecognitionException pe) {
3305 synPredMatched56 = false;
3306 }
3307 rewind(_m56);
3308 inputState.guessing--;
3309 }
3310 if ( synPredMatched56 ) {
3311 declaratorBrackets(bt_AST);
3312 astFactory.addASTChild(currentAST, returnAST);
3313 }
3314 else if ((_tokenSet_45.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
3315 if ( inputState.guessing==0 ) {
3316 require(false,
3317 "primitive type parameters not allowed here",
3318 "use the corresponding wrapper type, such as Integer for int"
3319 );
3320 }
3321 }
3322 else {
3323 throw new NoViableAltException(LT(1), getFilename());
3324 }
3325
3326 }
3327 if ( inputState.guessing==0 ) {
3328 builtInTypeArraySpec_AST = (AST)currentAST.root;
3329
3330 if ( addImagNode ) {
3331 builtInTypeArraySpec_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(builtInTypeArraySpec_AST));
3332 }
3333
3334 currentAST.root = builtInTypeArraySpec_AST;
3335 currentAST.child = builtInTypeArraySpec_AST!=null &&builtInTypeArraySpec_AST.getFirstChild()!=null ?
3336 builtInTypeArraySpec_AST.getFirstChild() : builtInTypeArraySpec_AST;
3337 currentAST.advanceChildToEnd();
3338 }
3339 builtInTypeArraySpec_AST = (AST)currentAST.root;
3340 returnAST = builtInTypeArraySpec_AST;
3341 }
3342
3343 public final void typeArgument() throws RecognitionException, TokenStreamException {
3344
3345 returnAST = null;
3346 ASTPair currentAST = new ASTPair();
3347 AST typeArgument_AST = null;
3348 Token first = LT(1);
3349
3350 {
3351 switch ( LA(1)) {
3352 case IDENT:
3353 case LITERAL_void:
3354 case LITERAL_boolean:
3355 case LITERAL_byte:
3356 case LITERAL_char:
3357 case LITERAL_short:
3358 case LITERAL_int:
3359 case LITERAL_float:
3360 case LITERAL_long:
3361 case LITERAL_double:
3362 case LITERAL_any:
3363 {
3364 typeArgumentSpec();
3365 astFactory.addASTChild(currentAST, returnAST);
3366 break;
3367 }
3368 case QUESTION:
3369 {
3370 wildcardType();
3371 astFactory.addASTChild(currentAST, returnAST);
3372 break;
3373 }
3374 default:
3375 {
3376 throw new NoViableAltException(LT(1), getFilename());
3377 }
3378 }
3379 }
3380 if ( inputState.guessing==0 ) {
3381 typeArgument_AST = (AST)currentAST.root;
3382 typeArgument_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_ARGUMENT,"TYPE_ARGUMENT",first,LT(1))).add(typeArgument_AST));
3383 currentAST.root = typeArgument_AST;
3384 currentAST.child = typeArgument_AST!=null &&typeArgument_AST.getFirstChild()!=null ?
3385 typeArgument_AST.getFirstChild() : typeArgument_AST;
3386 currentAST.advanceChildToEnd();
3387 }
3388 typeArgument_AST = (AST)currentAST.root;
3389 returnAST = typeArgument_AST;
3390 }
3391
3392 public final void wildcardType() throws RecognitionException, TokenStreamException {
3393
3394 returnAST = null;
3395 ASTPair currentAST = new ASTPair();
3396 AST wildcardType_AST = null;
3397 Token q = null;
3398 AST q_AST = null;
3399
3400 q = LT(1);
3401 q_AST = astFactory.create(q);
3402 astFactory.makeASTRoot(currentAST, q_AST);
3403 match(QUESTION);
3404 if ( inputState.guessing==0 ) {
3405 q_AST.setType(WILDCARD_TYPE);
3406 }
3407 {
3408 boolean synPredMatched45 = false;
3409 if (((LA(1)==LITERAL_extends||LA(1)==LITERAL_super) && (LA(2)==IDENT||LA(2)==NLS) && (_tokenSet_44.member(LA(3))))) {
3410 int _m45 = mark();
3411 synPredMatched45 = true;
3412 inputState.guessing++;
3413 try {
3414 {
3415 switch ( LA(1)) {
3416 case LITERAL_extends:
3417 {
3418 match(LITERAL_extends);
3419 break;
3420 }
3421 case LITERAL_super:
3422 {
3423 match(LITERAL_super);
3424 break;
3425 }
3426 default:
3427 {
3428 throw new NoViableAltException(LT(1), getFilename());
3429 }
3430 }
3431 }
3432 }
3433 catch (RecognitionException pe) {
3434 synPredMatched45 = false;
3435 }
3436 rewind(_m45);
3437 inputState.guessing--;
3438 }
3439 if ( synPredMatched45 ) {
3440 typeArgumentBounds();
3441 astFactory.addASTChild(currentAST, returnAST);
3442 }
3443 else if ((_tokenSet_45.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
3444 }
3445 else {
3446 throw new NoViableAltException(LT(1), getFilename());
3447 }
3448
3449 }
3450 wildcardType_AST = (AST)currentAST.root;
3451 returnAST = wildcardType_AST;
3452 }
3453
3454 public final void typeArgumentBounds() throws RecognitionException, TokenStreamException {
3455
3456 returnAST = null;
3457 ASTPair currentAST = new ASTPair();
3458 AST typeArgumentBounds_AST = null;
3459 Token first = LT(1);boolean isUpperBounds = false;
3460
3461 {
3462 switch ( LA(1)) {
3463 case LITERAL_extends:
3464 {
3465 match(LITERAL_extends);
3466 if ( inputState.guessing==0 ) {
3467 isUpperBounds=true;
3468 }
3469 break;
3470 }
3471 case LITERAL_super:
3472 {
3473 match(LITERAL_super);
3474 break;
3475 }
3476 default:
3477 {
3478 throw new NoViableAltException(LT(1), getFilename());
3479 }
3480 }
3481 }
3482 nls();
3483 classOrInterfaceType(false);
3484 astFactory.addASTChild(currentAST, returnAST);
3485 nls();
3486 if ( inputState.guessing==0 ) {
3487 typeArgumentBounds_AST = (AST)currentAST.root;
3488
3489 if (isUpperBounds)
3490 {
3491 typeArgumentBounds_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_UPPER_BOUNDS,"TYPE_UPPER_BOUNDS",first,LT(1))).add(typeArgumentBounds_AST));
3492 }
3493 else
3494 {
3495 typeArgumentBounds_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_LOWER_BOUNDS,"TYPE_LOWER_BOUNDS",first,LT(1))).add(typeArgumentBounds_AST));
3496 }
3497
3498 currentAST.root = typeArgumentBounds_AST;
3499 currentAST.child = typeArgumentBounds_AST!=null &&typeArgumentBounds_AST.getFirstChild()!=null ?
3500 typeArgumentBounds_AST.getFirstChild() : typeArgumentBounds_AST;
3501 currentAST.advanceChildToEnd();
3502 }
3503 typeArgumentBounds_AST = (AST)currentAST.root;
3504 returnAST = typeArgumentBounds_AST;
3505 }
3506
3507 protected final void typeArgumentsOrParametersEnd() throws RecognitionException, TokenStreamException {
3508
3509 returnAST = null;
3510 ASTPair currentAST = new ASTPair();
3511 AST typeArgumentsOrParametersEnd_AST = null;
3512
3513 switch ( LA(1)) {
3514 case GT:
3515 {
3516 match(GT);
3517 if ( inputState.guessing==0 ) {
3518 ltCounter-=1;
3519 }
3520 nls();
3521 typeArgumentsOrParametersEnd_AST = (AST)currentAST.root;
3522 break;
3523 }
3524 case SR:
3525 {
3526 match(SR);
3527 if ( inputState.guessing==0 ) {
3528 ltCounter-=2;
3529 }
3530 nls();
3531 typeArgumentsOrParametersEnd_AST = (AST)currentAST.root;
3532 break;
3533 }
3534 case BSR:
3535 {
3536 match(BSR);
3537 if ( inputState.guessing==0 ) {
3538 ltCounter-=3;
3539 }
3540 nls();
3541 typeArgumentsOrParametersEnd_AST = (AST)currentAST.root;
3542 break;
3543 }
3544 default:
3545 {
3546 throw new NoViableAltException(LT(1), getFilename());
3547 }
3548 }
3549 returnAST = typeArgumentsOrParametersEnd_AST;
3550 }
3551
3552 public final void type() throws RecognitionException, TokenStreamException {
3553
3554 returnAST = null;
3555 ASTPair currentAST = new ASTPair();
3556 AST type_AST = null;
3557
3558 switch ( LA(1)) {
3559 case IDENT:
3560 {
3561 classOrInterfaceType(false);
3562 astFactory.addASTChild(currentAST, returnAST);
3563 type_AST = (AST)currentAST.root;
3564 break;
3565 }
3566 case LITERAL_void:
3567 case LITERAL_boolean:
3568 case LITERAL_byte:
3569 case LITERAL_char:
3570 case LITERAL_short:
3571 case LITERAL_int:
3572 case LITERAL_float:
3573 case LITERAL_long:
3574 case LITERAL_double:
3575 case LITERAL_any:
3576 {
3577 builtInType();
3578 astFactory.addASTChild(currentAST, returnAST);
3579 type_AST = (AST)currentAST.root;
3580 break;
3581 }
3582 default:
3583 {
3584 throw new NoViableAltException(LT(1), getFilename());
3585 }
3586 }
3587 returnAST = type_AST;
3588 }
3589
3590 public final void modifiersInternal() throws RecognitionException, TokenStreamException {
3591
3592 returnAST = null;
3593 ASTPair currentAST = new ASTPair();
3594 AST modifiersInternal_AST = null;
3595 int seenDef = 0;
3596
3597 {
3598 int _cnt69=0;
3599 _loop69:
3600 do {
3601 if (((LA(1)==LITERAL_def))&&(seenDef++ == 0)) {
3602 match(LITERAL_def);
3603 nls();
3604 }
3605 else if ((_tokenSet_47.member(LA(1)))) {
3606 modifier();
3607 astFactory.addASTChild(currentAST, returnAST);
3608 nls();
3609 }
3610 else if (((LA(1)==AT) && (LA(2)==IDENT) && (_tokenSet_48.member(LA(3))))&&(LA(1)==AT && !LT(2).getText().equals("interface"))) {
3611 annotation();
3612 astFactory.addASTChild(currentAST, returnAST);
3613 nls();
3614 }
3615 else {
3616 if ( _cnt69>=1 ) { break _loop69; } else {throw new NoViableAltException(LT(1), getFilename());}
3617 }
3618
3619 _cnt69++;
3620 } while (true);
3621 }
3622 modifiersInternal_AST = (AST)currentAST.root;
3623 returnAST = modifiersInternal_AST;
3624 }
3625
3626 public final void annotation() throws RecognitionException, TokenStreamException {
3627
3628 returnAST = null;
3629 ASTPair currentAST = new ASTPair();
3630 AST annotation_AST = null;
3631 AST i_AST = null;
3632 AST args_AST = null;
3633 Token first = LT(1);
3634
3635 match(AT);
3636 identifier();
3637 i_AST = (AST)returnAST;
3638 {
3639 switch ( LA(1)) {
3640 case LPAREN:
3641 {
3642 match(LPAREN);
3643 {
3644 switch ( LA(1)) {
3645 case AT:
3646 case IDENT:
3647 case LBRACK:
3648 case LPAREN:
3649 case LITERAL_super:
3650 case LITERAL_void:
3651 case LITERAL_boolean:
3652 case LITERAL_byte:
3653 case LITERAL_char:
3654 case LITERAL_short:
3655 case LITERAL_int:
3656 case LITERAL_float:
3657 case LITERAL_long:
3658 case LITERAL_double:
3659 case LITERAL_any:
3660 case LCURLY:
3661 case LITERAL_this:
3662 case STRING_LITERAL:
3663 case PLUS:
3664 case MINUS:
3665 case INC:
3666 case DEC:
3667 case BNOT:
3668 case LNOT:
3669 case DOLLAR:
3670 case STRING_CTOR_START:
3671 case LITERAL_new:
3672 case LITERAL_true:
3673 case LITERAL_false:
3674 case LITERAL_null:
3675 case NUM_INT:
3676 case NUM_FLOAT:
3677 case NUM_LONG:
3678 case NUM_DOUBLE:
3679 case NUM_BIG_INT:
3680 case NUM_BIG_DECIMAL:
3681 {
3682 annotationArguments();
3683 args_AST = (AST)returnAST;
3684 break;
3685 }
3686 case RPAREN:
3687 {
3688 break;
3689 }
3690 default:
3691 {
3692 throw new NoViableAltException(LT(1), getFilename());
3693 }
3694 }
3695 }
3696 match(RPAREN);
3697 break;
3698 }
3699 case EOF:
3700 case FINAL:
3701 case ABSTRACT:
3702 case STRICTFP:
3703 case LITERAL_package:/package-summary.html">g> LITERAL_package:
3704 case LITERAL_static:
3705 case LITERAL_def:
3706 case AT:
3707 case IDENT:
3708 case RBRACK:
3709 case LITERAL_class:
3710 case LITERAL_interface:
3711 case LITERAL_enum:
3712 case LT:
3713 case COMMA:
3714 case LITERAL_void:
3715 case LITERAL_boolean:
3716 case LITERAL_byte:
3717 case LITERAL_char:
3718 case LITERAL_short:
3719 case LITERAL_int:
3720 case LITERAL_float:
3721 case LITERAL_long:
3722 case LITERAL_double:
3723 case LITERAL_any:
3724 case LITERAL_private:
3725 case LITERAL_public:
3726 case LITERAL_protected:
3727 case LITERAL_transient:
3728 case LITERAL_native:
3729 case LITERAL_threadsafe:
3730 case LITERAL_synchronized:
3731 case LITERAL_volatile:
3732 case RPAREN:
3733 case RCURLY:
3734 case SEMI:
3735 case NLS:
3736 case STRING_LITERAL:
3737 case TRIPLE_DOT:
3738 {
3739 break;
3740 }
3741 default:
3742 {
3743 throw new NoViableAltException(LT(1), getFilename());
3744 }
3745 }
3746 }
3747 if ( inputState.guessing==0 ) {
3748 annotation_AST = (AST)currentAST.root;
3749 annotation_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(ANNOTATION,"ANNOTATION",first,LT(1))).add(i_AST).add(args_AST));
3750 currentAST.root = annotation_AST;
3751 currentAST.child = annotation_AST!=null &&annotation_AST.getFirstChild()!=null ?
3752 annotation_AST.getFirstChild() : annotation_AST;
3753 currentAST.advanceChildToEnd();
3754 }
3755 returnAST = annotation_AST;
3756 }
3757
3758 public final void annotationArguments() throws RecognitionException, TokenStreamException {
3759
3760 returnAST = null;
3761 ASTPair currentAST = new ASTPair();
3762 AST annotationArguments_AST = null;
3763
3764 if ((_tokenSet_49.member(LA(1))) && (_tokenSet_50.member(LA(2)))) {
3765 annotationMemberValueInitializer();
3766 astFactory.addASTChild(currentAST, returnAST);
3767 annotationArguments_AST = (AST)currentAST.root;
3768 }
3769 else if ((LA(1)==IDENT) && (LA(2)==ASSIGN)) {
3770 anntotationMemberValuePairs();
3771 astFactory.addASTChild(currentAST, returnAST);
3772 annotationArguments_AST = (AST)currentAST.root;
3773 }
3774 else {
3775 throw new NoViableAltException(LT(1), getFilename());
3776 }
3777
3778 returnAST = annotationArguments_AST;
3779 }
3780
3781 public final void annotationMemberValueInitializer() throws RecognitionException, TokenStreamException {
3782
3783 returnAST = null;
3784 ASTPair currentAST = new ASTPair();
3785 AST annotationMemberValueInitializer_AST = null;
3786
3787 switch ( LA(1)) {
3788 case IDENT:
3789 case LBRACK:
3790 case LPAREN:
3791 case LITERAL_super:
3792 case LITERAL_void:
3793 case LITERAL_boolean:
3794 case LITERAL_byte:
3795 case LITERAL_char:
3796 case LITERAL_short:
3797 case LITERAL_int:
3798 case LITERAL_float:
3799 case LITERAL_long:
3800 case LITERAL_double:
3801 case LITERAL_any:
3802 case LCURLY:
3803 case LITERAL_this:
3804 case STRING_LITERAL:
3805 case PLUS:
3806 case MINUS:
3807 case INC:
3808 case DEC:
3809 case BNOT:
3810 case LNOT:
3811 case DOLLAR:
3812 case STRING_CTOR_START:
3813 case LITERAL_new:
3814 case LITERAL_true:
3815 case LITERAL_false:
3816 case LITERAL_null:
3817 case NUM_INT:
3818 case NUM_FLOAT:
3819 case NUM_LONG:
3820 case NUM_DOUBLE:
3821 case NUM_BIG_INT:
3822 case NUM_BIG_DECIMAL:
3823 {
3824 conditionalExpression(0);
3825 astFactory.addASTChild(currentAST, returnAST);
3826 annotationMemberValueInitializer_AST = (AST)currentAST.root;
3827 break;
3828 }
3829 case AT:
3830 {
3831 annotation();
3832 astFactory.addASTChild(currentAST, returnAST);
3833 annotationMemberValueInitializer_AST = (AST)currentAST.root;
3834 break;
3835 }
3836 default:
3837 {
3838 throw new NoViableAltException(LT(1), getFilename());
3839 }
3840 }
3841 returnAST = annotationMemberValueInitializer_AST;
3842 }
3843
3844 public final void anntotationMemberValuePairs() throws RecognitionException, TokenStreamException {
3845
3846 returnAST = null;
3847 ASTPair currentAST = new ASTPair();
3848 AST anntotationMemberValuePairs_AST = null;
3849
3850 annotationMemberValuePair();
3851 astFactory.addASTChild(currentAST, returnAST);
3852 {
3853 _loop83:
3854 do {
3855 if ((LA(1)==COMMA)) {
3856 match(COMMA);
3857 nls();
3858 annotationMemberValuePair();
3859 astFactory.addASTChild(currentAST, returnAST);
3860 }
3861 else {
3862 break _loop83;
3863 }
3864
3865 } while (true);
3866 }
3867 anntotationMemberValuePairs_AST = (AST)currentAST.root;
3868 returnAST = anntotationMemberValuePairs_AST;
3869 }
3870
3871 public final void annotationMemberValuePair() throws RecognitionException, TokenStreamException {
3872
3873 returnAST = null;
3874 ASTPair currentAST = new ASTPair();
3875 AST annotationMemberValuePair_AST = null;
3876 Token i = null;
3877 AST i_AST = null;
3878 AST v_AST = null;
3879 Token first = LT(1);
3880
3881 i = LT(1);
3882 i_AST = astFactory.create(i);
3883 match(IDENT);
3884 match(ASSIGN);
3885 nls();
3886 annotationMemberValueInitializer();
3887 v_AST = (AST)returnAST;
3888 if ( inputState.guessing==0 ) {
3889 annotationMemberValuePair_AST = (AST)currentAST.root;
3890 annotationMemberValuePair_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(ANNOTATION_MEMBER_VALUE_PAIR,"ANNOTATION_MEMBER_VALUE_PAIR",first,LT(1))).add(i_AST).add(v_AST));
3891 currentAST.root = annotationMemberValuePair_AST;
3892 currentAST.child = annotationMemberValuePair_AST!=null &&annotationMemberValuePair_AST.getFirstChild()!=null ?
3893 annotationMemberValuePair_AST.getFirstChild() : annotationMemberValuePair_AST;
3894 currentAST.advanceChildToEnd();
3895 }
3896 returnAST = annotationMemberValuePair_AST;
3897 }
3898
3899 public final void conditionalExpression(
3900 int lc_stmt
3901 ) throws RecognitionException, TokenStreamException {
3902
3903 returnAST = null;
3904 ASTPair currentAST = new ASTPair();
3905 AST conditionalExpression_AST = null;
3906
3907 logicalOrExpression(lc_stmt);
3908 astFactory.addASTChild(currentAST, returnAST);
3909 {
3910 switch ( LA(1)) {
3911 case QUESTION:
3912 {
3913 AST tmp108_AST = null;
3914 tmp108_AST = astFactory.create(LT(1));
3915 astFactory.makeASTRoot(currentAST, tmp108_AST);
3916 match(QUESTION);
3917 nls();
3918 assignmentExpression(0);
3919 astFactory.addASTChild(currentAST, returnAST);
3920 match(COLON);
3921 nls();
3922 conditionalExpression(0);
3923 astFactory.addASTChild(currentAST, returnAST);
3924 break;
3925 }
3926 case EOF:
3927 case IDENT:
3928 case LBRACK:
3929 case RBRACK:
3930 case LPAREN:
3931 case LITERAL_super:
3932 case COMMA:
3933 case LITERAL_void:
3934 case LITERAL_boolean:
3935 case LITERAL_byte:
3936 case LITERAL_char:
3937 case LITERAL_short:
3938 case LITERAL_int:
3939 case LITERAL_float:
3940 case LITERAL_long:
3941 case LITERAL_double:
3942 case LITERAL_any:
3943 case RPAREN:
3944 case ASSIGN:
3945 case LCURLY:
3946 case RCURLY:
3947 case SEMI:
3948 case NLS:
3949 case LITERAL_default:
3950 case LITERAL_this:
3951 case STRING_LITERAL:
3952 case CLOSABLE_BLOCK_OP:
3953 case COLON:
3954 case LITERAL_else:
3955 case PLUS:
3956 case MINUS:
3957 case LITERAL_case:
3958 case PLUS_ASSIGN:
3959 case MINUS_ASSIGN:
3960 case STAR_ASSIGN:
3961 case DIV_ASSIGN:
3962 case MOD_ASSIGN:
3963 case SR_ASSIGN:
3964 case BSR_ASSIGN:
3965 case SL_ASSIGN:
3966 case BAND_ASSIGN:
3967 case BXOR_ASSIGN:
3968 case BOR_ASSIGN:
3969 case STAR_STAR_ASSIGN:
3970 case INC:
3971 case DEC:
3972 case BNOT:
3973 case LNOT:
3974 case DOLLAR:
3975 case STRING_CTOR_START:
3976 case LITERAL_new:
3977 case LITERAL_true:
3978 case LITERAL_false:
3979 case LITERAL_null:
3980 case NUM_INT:
3981 case NUM_FLOAT:
3982 case NUM_LONG:
3983 case NUM_DOUBLE:
3984 case NUM_BIG_INT:
3985 case NUM_BIG_DECIMAL:
3986 {
3987 break;
3988 }
3989 default:
3990 {
3991 throw new NoViableAltException(LT(1), getFilename());
3992 }
3993 }
3994 }
3995 conditionalExpression_AST = (AST)currentAST.root;
3996 returnAST = conditionalExpression_AST;
3997 }
3998
3999 public final void annotationMemberArrayValueInitializer() throws RecognitionException, TokenStreamException {
4000
4001 returnAST = null;
4002 ASTPair currentAST = new ASTPair();
4003 AST annotationMemberArrayValueInitializer_AST = null;
4004
4005 switch ( LA(1)) {
4006 case IDENT:
4007 case LBRACK:
4008 case LPAREN:
4009 case LITERAL_super:
4010 case LITERAL_void:
4011 case LITERAL_boolean:
4012 case LITERAL_byte:
4013 case LITERAL_char:
4014 case LITERAL_short:
4015 case LITERAL_int:
4016 case LITERAL_float:
4017 case LITERAL_long:
4018 case LITERAL_double:
4019 case LITERAL_any:
4020 case LCURLY:
4021 case LITERAL_this:
4022 case STRING_LITERAL:
4023 case PLUS:
4024 case MINUS:
4025 case INC:
4026 case DEC:
4027 case BNOT:
4028 case LNOT:
4029 case DOLLAR:
4030 case STRING_CTOR_START:
4031 case LITERAL_new:
4032 case LITERAL_true:
4033 case LITERAL_false:
4034 case LITERAL_null:
4035 case NUM_INT:
4036 case NUM_FLOAT:
4037 case NUM_LONG:
4038 case NUM_DOUBLE:
4039 case NUM_BIG_INT:
4040 case NUM_BIG_DECIMAL:
4041 {
4042 conditionalExpression(0);
4043 astFactory.addASTChild(currentAST, returnAST);
4044 annotationMemberArrayValueInitializer_AST = (AST)currentAST.root;
4045 break;
4046 }
4047 case AT:
4048 {
4049 annotation();
4050 astFactory.addASTChild(currentAST, returnAST);
4051 nls();
4052 annotationMemberArrayValueInitializer_AST = (AST)currentAST.root;
4053 break;
4054 }
4055 default:
4056 {
4057 throw new NoViableAltException(LT(1), getFilename());
4058 }
4059 }
4060 returnAST = annotationMemberArrayValueInitializer_AST;
4061 }
4062
4063 public final void superClassClause() throws RecognitionException, TokenStreamException {
4064
4065 returnAST = null;
4066 ASTPair currentAST = new ASTPair();
4067 AST superClassClause_AST = null;
4068 AST c_AST = null;
4069 Token first = LT(1);
4070
4071 {
4072 switch ( LA(1)) {
4073 case LITERAL_extends:
4074 {
4075 match(LITERAL_extends);
4076 nls();
4077 classOrInterfaceType(false);
4078 c_AST = (AST)returnAST;
4079 nls();
4080 break;
4081 }
4082 case LCURLY:
4083 case LITERAL_implements:
4084 {
4085 break;
4086 }
4087 default:
4088 {
4089 throw new NoViableAltException(LT(1), getFilename());
4090 }
4091 }
4092 }
4093 if ( inputState.guessing==0 ) {
4094 superClassClause_AST = (AST)currentAST.root;
4095 superClassClause_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXTENDS_CLAUSE,"EXTENDS_CLAUSE",first,LT(1))).add(c_AST));
4096 currentAST.root = superClassClause_AST;
4097 currentAST.child = superClassClause_AST!=null &&superClassClause_AST.getFirstChild()!=null ?
4098 superClassClause_AST.getFirstChild() : superClassClause_AST;
4099 currentAST.advanceChildToEnd();
4100 }
4101 returnAST = superClassClause_AST;
4102 }
4103
4104 public final void typeParameters() throws RecognitionException, TokenStreamException {
4105
4106 returnAST = null;
4107 ASTPair currentAST = new ASTPair();
4108 AST typeParameters_AST = null;
4109 Token first = LT(1);int currentLtLevel = 0;
4110
4111 if ( inputState.guessing==0 ) {
4112 currentLtLevel = ltCounter;
4113 }
4114 match(LT);
4115 if ( inputState.guessing==0 ) {
4116 ltCounter++;
4117 }
4118 nls();
4119 typeParameter();
4120 astFactory.addASTChild(currentAST, returnAST);
4121 {
4122 _loop97:
4123 do {
4124 if ((LA(1)==COMMA)) {
4125 match(COMMA);
4126 nls();
4127 typeParameter();
4128 astFactory.addASTChild(currentAST, returnAST);
4129 }
4130 else {
4131 break _loop97;
4132 }
4133
4134 } while (true);
4135 }
4136 nls();
4137 {
4138 switch ( LA(1)) {
4139 case GT:
4140 case SR:
4141 case BSR:
4142 {
4143 typeArgumentsOrParametersEnd();
4144 astFactory.addASTChild(currentAST, returnAST);
4145 break;
4146 }
4147 case IDENT:
4148 case LITERAL_extends:
4149 case LITERAL_void:
4150 case LITERAL_boolean:
4151 case LITERAL_byte:
4152 case LITERAL_char:
4153 case LITERAL_short:
4154 case LITERAL_int:
4155 case LITERAL_float:
4156 case LITERAL_long:
4157 case LITERAL_double:
4158 case LITERAL_any:
4159 case LCURLY:
4160 case LITERAL_implements:
4161 {
4162 break;
4163 }
4164 default:
4165 {
4166 throw new NoViableAltException(LT(1), getFilename());
4167 }
4168 }
4169 }
4170 if (!((currentLtLevel != 0) || ltCounter == currentLtLevel))
4171 throw new SemanticException("(currentLtLevel != 0) || ltCounter == currentLtLevel");
4172 if ( inputState.guessing==0 ) {
4173 typeParameters_AST = (AST)currentAST.root;
4174 typeParameters_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_PARAMETERS,"TYPE_PARAMETERS",first,LT(1))).add(typeParameters_AST));
4175 currentAST.root = typeParameters_AST;
4176 currentAST.child = typeParameters_AST!=null &&typeParameters_AST.getFirstChild()!=null ?
4177 typeParameters_AST.getFirstChild() : typeParameters_AST;
4178 currentAST.advanceChildToEnd();
4179 }
4180 typeParameters_AST = (AST)currentAST.root;
4181 returnAST = typeParameters_AST;
4182 }
4183
4184 public final void implementsClause() throws RecognitionException, TokenStreamException {
4185
4186 returnAST = null;
4187 ASTPair currentAST = new ASTPair();
4188 AST implementsClause_AST = null;
4189 Token i = null;
4190 AST i_AST = null;
4191 Token first = LT(1);
4192
4193 {
4194 switch ( LA(1)) {
4195 case LITERAL_implements:
4196 {
4197 i = LT(1);
4198 i_AST = astFactory.create(i);
4199 match(LITERAL_implements);
4200 nls();
4201 classOrInterfaceType(false);
4202 astFactory.addASTChild(currentAST, returnAST);
4203 {
4204 _loop165:
4205 do {
4206 if ((LA(1)==COMMA)) {
4207 match(COMMA);
4208 nls();
4209 classOrInterfaceType(false);
4210 astFactory.addASTChild(currentAST, returnAST);
4211 }
4212 else {
4213 break _loop165;
4214 }
4215
4216 } while (true);
4217 }
4218 nls();
4219 break;
4220 }
4221 case LCURLY:
4222 {
4223 break;
4224 }
4225 default:
4226 {
4227 throw new NoViableAltException(LT(1), getFilename());
4228 }
4229 }
4230 }
4231 if ( inputState.guessing==0 ) {
4232 implementsClause_AST = (AST)currentAST.root;
4233 implementsClause_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(IMPLEMENTS_CLAUSE,"IMPLEMENTS_CLAUSE",first,LT(1))).add(implementsClause_AST));
4234 currentAST.root = implementsClause_AST;
4235 currentAST.child = implementsClause_AST!=null &&implementsClause_AST.getFirstChild()!=null ?
4236 implementsClause_AST.getFirstChild() : implementsClause_AST;
4237 currentAST.advanceChildToEnd();
4238 }
4239 implementsClause_AST = (AST)currentAST.root;
4240 returnAST = implementsClause_AST;
4241 }
4242
4243 public final void classBlock() throws RecognitionException, TokenStreamException {
4244
4245 returnAST = null;
4246 ASTPair currentAST = new ASTPair();
4247 AST classBlock_AST = null;
4248 Token first = LT(1);
4249
4250 match(LCURLY);
4251 {
4252 switch ( LA(1)) {
4253 case FINAL:
4254 case ABSTRACT:
4255 case STRICTFP:
4256 case LITERAL_static:
4257 case LITERAL_def:
4258 case AT:
4259 case IDENT:
4260 case LITERAL_class:
4261 case LITERAL_interface:
4262 case LITERAL_enum:
4263 case LITERAL_void:
4264 case LITERAL_boolean:
4265 case LITERAL_byte:
4266 case LITERAL_char:
4267 case LITERAL_short:
4268 case LITERAL_int:
4269 case LITERAL_float:
4270 case LITERAL_long:
4271 case LITERAL_double:
4272 case LITERAL_any:
4273 case LITERAL_private:
4274 case LITERAL_public:
4275 case LITERAL_protected:
4276 case LITERAL_transient:
4277 case LITERAL_native:
4278 case LITERAL_threadsafe:
4279 case LITERAL_synchronized:
4280 case LITERAL_volatile:
4281 case LCURLY:
4282 {
4283 classField();
4284 astFactory.addASTChild(currentAST, returnAST);
4285 break;
4286 }
4287 case RCURLY:
4288 case SEMI:
4289 case NLS:
4290 {
4291 break;
4292 }
4293 default:
4294 {
4295 throw new NoViableAltException(LT(1), getFilename());
4296 }
4297 }
4298 }
4299 {
4300 _loop109:
4301 do {
4302 if ((LA(1)==SEMI||LA(1)==NLS)) {
4303 sep();
4304 {
4305 switch ( LA(1)) {
4306 case FINAL:
4307 case ABSTRACT:
4308 case STRICTFP:
4309 case LITERAL_static:
4310 case LITERAL_def:
4311 case AT:
4312 case IDENT:
4313 case LITERAL_class:
4314 case LITERAL_interface:
4315 case LITERAL_enum:
4316 case LITERAL_void:
4317 case LITERAL_boolean:
4318 case LITERAL_byte:
4319 case LITERAL_char:
4320 case LITERAL_short:
4321 case LITERAL_int:
4322 case LITERAL_float:
4323 case LITERAL_long:
4324 case LITERAL_double:
4325 case LITERAL_any:
4326 case LITERAL_private:
4327 case LITERAL_public:
4328 case LITERAL_protected:
4329 case LITERAL_transient:
4330 case LITERAL_native:
4331 case LITERAL_threadsafe:
4332 case LITERAL_synchronized:
4333 case LITERAL_volatile:
4334 case LCURLY:
4335 {
4336 classField();
4337 astFactory.addASTChild(currentAST, returnAST);
4338 break;
4339 }
4340 case RCURLY:
4341 case SEMI:
4342 case NLS:
4343 {
4344 break;
4345 }
4346 default:
4347 {
4348 throw new NoViableAltException(LT(1), getFilename());
4349 }
4350 }
4351 }
4352 }
4353 else {
4354 break _loop109;
4355 }
4356
4357 } while (true);
4358 }
4359 match(RCURLY);
4360 if ( inputState.guessing==0 ) {
4361 classBlock_AST = (AST)currentAST.root;
4362 classBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(classBlock_AST));
4363 currentAST.root = classBlock_AST;
4364 currentAST.child = classBlock_AST!=null &&classBlock_AST.getFirstChild()!=null ?
4365 classBlock_AST.getFirstChild() : classBlock_AST;
4366 currentAST.advanceChildToEnd();
4367 }
4368 classBlock_AST = (AST)currentAST.root;
4369 returnAST = classBlock_AST;
4370 }
4371
4372 public final void interfaceExtends() throws RecognitionException, TokenStreamException {
4373
4374 returnAST = null;
4375 ASTPair currentAST = new ASTPair();
4376 AST interfaceExtends_AST = null;
4377 Token e = null;
4378 AST e_AST = null;
4379 Token first = LT(1);
4380
4381 {
4382 switch ( LA(1)) {
4383 case LITERAL_extends:
4384 {
4385 e = LT(1);
4386 e_AST = astFactory.create(e);
4387 match(LITERAL_extends);
4388 nls();
4389 classOrInterfaceType(false);
4390 astFactory.addASTChild(currentAST, returnAST);
4391 {
4392 _loop161:
4393 do {
4394 if ((LA(1)==COMMA)) {
4395 match(COMMA);
4396 nls();
4397 classOrInterfaceType(false);
4398 astFactory.addASTChild(currentAST, returnAST);
4399 }
4400 else {
4401 break _loop161;
4402 }
4403
4404 } while (true);
4405 }
4406 nls();
4407 break;
4408 }
4409 case LCURLY:
4410 {
4411 break;
4412 }
4413 default:
4414 {
4415 throw new NoViableAltException(LT(1), getFilename());
4416 }
4417 }
4418 }
4419 if ( inputState.guessing==0 ) {
4420 interfaceExtends_AST = (AST)currentAST.root;
4421 interfaceExtends_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXTENDS_CLAUSE,"EXTENDS_CLAUSE",first,LT(1))).add(interfaceExtends_AST));
4422 currentAST.root = interfaceExtends_AST;
4423 currentAST.child = interfaceExtends_AST!=null &&interfaceExtends_AST.getFirstChild()!=null ?
4424 interfaceExtends_AST.getFirstChild() : interfaceExtends_AST;
4425 currentAST.advanceChildToEnd();
4426 }
4427 interfaceExtends_AST = (AST)currentAST.root;
4428 returnAST = interfaceExtends_AST;
4429 }
4430
4431 public final void interfaceBlock() throws RecognitionException, TokenStreamException {
4432
4433 returnAST = null;
4434 ASTPair currentAST = new ASTPair();
4435 AST interfaceBlock_AST = null;
4436 Token first = LT(1);
4437
4438 match(LCURLY);
4439 {
4440 switch ( LA(1)) {
4441 case FINAL:
4442 case ABSTRACT:
4443 case STRICTFP:
4444 case LITERAL_static:
4445 case LITERAL_def:
4446 case AT:
4447 case IDENT:
4448 case LITERAL_class:
4449 case LITERAL_interface:
4450 case LITERAL_enum:
4451 case LITERAL_void:
4452 case LITERAL_boolean:
4453 case LITERAL_byte:
4454 case LITERAL_char:
4455 case LITERAL_short:
4456 case LITERAL_int:
4457 case LITERAL_float:
4458 case LITERAL_long:
4459 case LITERAL_double:
4460 case LITERAL_any:
4461 case LITERAL_private:
4462 case LITERAL_public:
4463 case LITERAL_protected:
4464 case LITERAL_transient:
4465 case LITERAL_native:
4466 case LITERAL_threadsafe:
4467 case LITERAL_synchronized:
4468 case LITERAL_volatile:
4469 {
4470 interfaceField();
4471 astFactory.addASTChild(currentAST, returnAST);
4472 break;
4473 }
4474 case RCURLY:
4475 case SEMI:
4476 case NLS:
4477 {
4478 break;
4479 }
4480 default:
4481 {
4482 throw new NoViableAltException(LT(1), getFilename());
4483 }
4484 }
4485 }
4486 {
4487 _loop114:
4488 do {
4489 if ((LA(1)==SEMI||LA(1)==NLS)) {
4490 sep();
4491 {
4492 switch ( LA(1)) {
4493 case FINAL:
4494 case ABSTRACT:
4495 case STRICTFP:
4496 case LITERAL_static:
4497 case LITERAL_def:
4498 case AT:
4499 case IDENT:
4500 case LITERAL_class:
4501 case LITERAL_interface:
4502 case LITERAL_enum:
4503 case LITERAL_void:
4504 case LITERAL_boolean:
4505 case LITERAL_byte:
4506 case LITERAL_char:
4507 case LITERAL_short:
4508 case LITERAL_int:
4509 case LITERAL_float:
4510 case LITERAL_long:
4511 case LITERAL_double:
4512 case LITERAL_any:
4513 case LITERAL_private:
4514 case LITERAL_public:
4515 case LITERAL_protected:
4516 case LITERAL_transient:
4517 case LITERAL_native:
4518 case LITERAL_threadsafe:
4519 case LITERAL_synchronized:
4520 case LITERAL_volatile:
4521 {
4522 interfaceField();
4523 astFactory.addASTChild(currentAST, returnAST);
4524 break;
4525 }
4526 case RCURLY:
4527 case SEMI:
4528 case NLS:
4529 {
4530 break;
4531 }
4532 default:
4533 {
4534 throw new NoViableAltException(LT(1), getFilename());
4535 }
4536 }
4537 }
4538 }
4539 else {
4540 break _loop114;
4541 }
4542
4543 } while (true);
4544 }
4545 match(RCURLY);
4546 if ( inputState.guessing==0 ) {
4547 interfaceBlock_AST = (AST)currentAST.root;
4548 interfaceBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(interfaceBlock_AST));
4549 currentAST.root = interfaceBlock_AST;
4550 currentAST.child = interfaceBlock_AST!=null &&interfaceBlock_AST.getFirstChild()!=null ?
4551 interfaceBlock_AST.getFirstChild() : interfaceBlock_AST;
4552 currentAST.advanceChildToEnd();
4553 }
4554 interfaceBlock_AST = (AST)currentAST.root;
4555 returnAST = interfaceBlock_AST;
4556 }
4557
4558 public final void enumBlock() throws RecognitionException, TokenStreamException {
4559
4560 returnAST = null;
4561 ASTPair currentAST = new ASTPair();
4562 AST enumBlock_AST = null;
4563 Token first = LT(1);
4564
4565 match(LCURLY);
4566 {
4567 boolean synPredMatched123 = false;
4568 if (((LA(1)==AT||LA(1)==IDENT) && (_tokenSet_51.member(LA(2))) && (_tokenSet_52.member(LA(3))))) {
4569 int _m123 = mark();
4570 synPredMatched123 = true;
4571 inputState.guessing++;
4572 try {
4573 {
4574 enumConstantsStart();
4575 }
4576 }
4577 catch (RecognitionException pe) {
4578 synPredMatched123 = false;
4579 }
4580 rewind(_m123);
4581 inputState.guessing--;
4582 }
4583 if ( synPredMatched123 ) {
4584 enumConstants();
4585 astFactory.addASTChild(currentAST, returnAST);
4586 }
4587 else if ((_tokenSet_53.member(LA(1))) && (_tokenSet_54.member(LA(2))) && (_tokenSet_18.member(LA(3)))) {
4588 {
4589 switch ( LA(1)) {
4590 case FINAL:
4591 case ABSTRACT:
4592 case STRICTFP:
4593 case LITERAL_static:
4594 case LITERAL_def:
4595 case AT:
4596 case IDENT:
4597 case LITERAL_class:
4598 case LITERAL_interface:
4599 case LITERAL_enum:
4600 case LITERAL_void:
4601 case LITERAL_boolean:
4602 case LITERAL_byte:
4603 case LITERAL_char:
4604 case LITERAL_short:
4605 case LITERAL_int:
4606 case LITERAL_float:
4607 case LITERAL_long:
4608 case LITERAL_double:
4609 case LITERAL_any:
4610 case LITERAL_private:
4611 case LITERAL_public:
4612 case LITERAL_protected:
4613 case LITERAL_transient:
4614 case LITERAL_native:
4615 case LITERAL_threadsafe:
4616 case LITERAL_synchronized:
4617 case LITERAL_volatile:
4618 case LCURLY:
4619 {
4620 classField();
4621 astFactory.addASTChild(currentAST, returnAST);
4622 break;
4623 }
4624 case RCURLY:
4625 case SEMI:
4626 case NLS:
4627 {
4628 break;
4629 }
4630 default:
4631 {
4632 throw new NoViableAltException(LT(1), getFilename());
4633 }
4634 }
4635 }
4636 }
4637 else {
4638 throw new NoViableAltException(LT(1), getFilename());
4639 }
4640
4641 }
4642 {
4643 _loop127:
4644 do {
4645 if ((LA(1)==SEMI||LA(1)==NLS)) {
4646 sep();
4647 {
4648 switch ( LA(1)) {
4649 case FINAL:
4650 case ABSTRACT:
4651 case STRICTFP:
4652 case LITERAL_static:
4653 case LITERAL_def:
4654 case AT:
4655 case IDENT:
4656 case LITERAL_class:
4657 case LITERAL_interface:
4658 case LITERAL_enum:
4659 case LITERAL_void:
4660 case LITERAL_boolean:
4661 case LITERAL_byte:
4662 case LITERAL_char:
4663 case LITERAL_short:
4664 case LITERAL_int:
4665 case LITERAL_float:
4666 case LITERAL_long:
4667 case LITERAL_double:
4668 case LITERAL_any:
4669 case LITERAL_private:
4670 case LITERAL_public:
4671 case LITERAL_protected:
4672 case LITERAL_transient:
4673 case LITERAL_native:
4674 case LITERAL_threadsafe:
4675 case LITERAL_synchronized:
4676 case LITERAL_volatile:
4677 case LCURLY:
4678 {
4679 classField();
4680 astFactory.addASTChild(currentAST, returnAST);
4681 break;
4682 }
4683 case RCURLY:
4684 case SEMI:
4685 case NLS:
4686 {
4687 break;
4688 }
4689 default:
4690 {
4691 throw new NoViableAltException(LT(1), getFilename());
4692 }
4693 }
4694 }
4695 }
4696 else {
4697 break _loop127;
4698 }
4699
4700 } while (true);
4701 }
4702 match(RCURLY);
4703 if ( inputState.guessing==0 ) {
4704 enumBlock_AST = (AST)currentAST.root;
4705 enumBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(enumBlock_AST));
4706 currentAST.root = enumBlock_AST;
4707 currentAST.child = enumBlock_AST!=null &&enumBlock_AST.getFirstChild()!=null ?
4708 enumBlock_AST.getFirstChild() : enumBlock_AST;
4709 currentAST.advanceChildToEnd();
4710 }
4711 enumBlock_AST = (AST)currentAST.root;
4712 returnAST = enumBlock_AST;
4713 }
4714
4715 public final void annotationBlock() throws RecognitionException, TokenStreamException {
4716
4717 returnAST = null;
4718 ASTPair currentAST = new ASTPair();
4719 AST annotationBlock_AST = null;
4720 Token first = LT(1);
4721
4722 match(LCURLY);
4723 {
4724 switch ( LA(1)) {
4725 case FINAL:
4726 case ABSTRACT:
4727 case STRICTFP:
4728 case LITERAL_static:
4729 case LITERAL_def:
4730 case AT:
4731 case IDENT:
4732 case LITERAL_class:
4733 case LITERAL_interface:
4734 case LITERAL_enum:
4735 case LITERAL_void:
4736 case LITERAL_boolean:
4737 case LITERAL_byte:
4738 case LITERAL_char:
4739 case LITERAL_short:
4740 case LITERAL_int:
4741 case LITERAL_float:
4742 case LITERAL_long:
4743 case LITERAL_double:
4744 case LITERAL_any:
4745 case LITERAL_private:
4746 case LITERAL_public:
4747 case LITERAL_protected:
4748 case LITERAL_transient:
4749 case LITERAL_native:
4750 case LITERAL_threadsafe:
4751 case LITERAL_synchronized:
4752 case LITERAL_volatile:
4753 {
4754 annotationField();
4755 astFactory.addASTChild(currentAST, returnAST);
4756 break;
4757 }
4758 case RCURLY:
4759 case SEMI:
4760 case NLS:
4761 {
4762 break;
4763 }
4764 default:
4765 {
4766 throw new NoViableAltException(LT(1), getFilename());
4767 }
4768 }
4769 }
4770 {
4771 _loop119:
4772 do {
4773 if ((LA(1)==SEMI||LA(1)==NLS)) {
4774 sep();
4775 {
4776 switch ( LA(1)) {
4777 case FINAL:
4778 case ABSTRACT:
4779 case STRICTFP:
4780 case LITERAL_static:
4781 case LITERAL_def:
4782 case AT:
4783 case IDENT:
4784 case LITERAL_class:
4785 case LITERAL_interface:
4786 case LITERAL_enum:
4787 case LITERAL_void:
4788 case LITERAL_boolean:
4789 case LITERAL_byte:
4790 case LITERAL_char:
4791 case LITERAL_short:
4792 case LITERAL_int:
4793 case LITERAL_float:
4794 case LITERAL_long:
4795 case LITERAL_double:
4796 case LITERAL_any:
4797 case LITERAL_private:
4798 case LITERAL_public:
4799 case LITERAL_protected:
4800 case LITERAL_transient:
4801 case LITERAL_native:
4802 case LITERAL_threadsafe:
4803 case LITERAL_synchronized:
4804 case LITERAL_volatile:
4805 {
4806 annotationField();
4807 astFactory.addASTChild(currentAST, returnAST);
4808 break;
4809 }
4810 case RCURLY:
4811 case SEMI:
4812 case NLS:
4813 {
4814 break;
4815 }
4816 default:
4817 {
4818 throw new NoViableAltException(LT(1), getFilename());
4819 }
4820 }
4821 }
4822 }
4823 else {
4824 break _loop119;
4825 }
4826
4827 } while (true);
4828 }
4829 match(RCURLY);
4830 if ( inputState.guessing==0 ) {
4831 annotationBlock_AST = (AST)currentAST.root;
4832 annotationBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(annotationBlock_AST));
4833 currentAST.root = annotationBlock_AST;
4834 currentAST.child = annotationBlock_AST!=null &&annotationBlock_AST.getFirstChild()!=null ?
4835 annotationBlock_AST.getFirstChild() : annotationBlock_AST;
4836 currentAST.advanceChildToEnd();
4837 }
4838 annotationBlock_AST = (AST)currentAST.root;
4839 returnAST = annotationBlock_AST;
4840 }
4841
4842 public final void typeParameter() throws RecognitionException, TokenStreamException {
4843
4844 returnAST = null;
4845 ASTPair currentAST = new ASTPair();
4846 AST typeParameter_AST = null;
4847 Token id = null;
4848 AST id_AST = null;
4849 Token first = LT(1);
4850
4851 {
4852 id = LT(1);
4853 id_AST = astFactory.create(id);
4854 astFactory.addASTChild(currentAST, id_AST);
4855 match(IDENT);
4856 }
4857 {
4858 if ((LA(1)==LITERAL_extends) && (LA(2)==IDENT||LA(2)==NLS) && (_tokenSet_55.member(LA(3)))) {
4859 typeParameterBounds();
4860 astFactory.addASTChild(currentAST, returnAST);
4861 }
4862 else if ((_tokenSet_56.member(LA(1))) && (_tokenSet_57.member(LA(2))) && (_tokenSet_58.member(LA(3)))) {
4863 }
4864 else {
4865 throw new NoViableAltException(LT(1), getFilename());
4866 }
4867
4868 }
4869 if ( inputState.guessing==0 ) {
4870 typeParameter_AST = (AST)currentAST.root;
4871 typeParameter_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_PARAMETER,"TYPE_PARAMETER",first,LT(1))).add(typeParameter_AST));
4872 currentAST.root = typeParameter_AST;
4873 currentAST.child = typeParameter_AST!=null &&typeParameter_AST.getFirstChild()!=null ?
4874 typeParameter_AST.getFirstChild() : typeParameter_AST;
4875 currentAST.advanceChildToEnd();
4876 }
4877 typeParameter_AST = (AST)currentAST.root;
4878 returnAST = typeParameter_AST;
4879 }
4880
4881 public final void typeParameterBounds() throws RecognitionException, TokenStreamException {
4882
4883 returnAST = null;
4884 ASTPair currentAST = new ASTPair();
4885 AST typeParameterBounds_AST = null;
4886 Token first = LT(1);
4887
4888 match(LITERAL_extends);
4889 nls();
4890 classOrInterfaceType(false);
4891 astFactory.addASTChild(currentAST, returnAST);
4892 {
4893 _loop104:
4894 do {
4895 if ((LA(1)==BAND)) {
4896 match(BAND);
4897 nls();
4898 classOrInterfaceType(false);
4899 astFactory.addASTChild(currentAST, returnAST);
4900 }
4901 else {
4902 break _loop104;
4903 }
4904
4905 } while (true);
4906 }
4907 if ( inputState.guessing==0 ) {
4908 typeParameterBounds_AST = (AST)currentAST.root;
4909 typeParameterBounds_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_UPPER_BOUNDS,"TYPE_UPPER_BOUNDS",first,LT(1))).add(typeParameterBounds_AST));
4910 currentAST.root = typeParameterBounds_AST;
4911 currentAST.child = typeParameterBounds_AST!=null &&typeParameterBounds_AST.getFirstChild()!=null ?
4912 typeParameterBounds_AST.getFirstChild() : typeParameterBounds_AST;
4913 currentAST.advanceChildToEnd();
4914 }
4915 typeParameterBounds_AST = (AST)currentAST.root;
4916 returnAST = typeParameterBounds_AST;
4917 }
4918
4919 public final void classField() throws RecognitionException, TokenStreamException {
4920
4921 returnAST = null;
4922 ASTPair currentAST = new ASTPair();
4923 AST classField_AST = null;
4924 AST mc_AST = null;
4925 AST ctor_AST = null;
4926 AST d_AST = null;
4927 AST mods_AST = null;
4928 AST td_AST = null;
4929 AST s3_AST = null;
4930 AST s4_AST = null;
4931 Token first = LT(1);
4932
4933 boolean synPredMatched168 = false;
4934 if (((_tokenSet_59.member(LA(1))) && (_tokenSet_60.member(LA(2))) && (_tokenSet_61.member(LA(3))))) {
4935 int _m168 = mark();
4936 synPredMatched168 = true;
4937 inputState.guessing++;
4938 try {
4939 {
4940 constructorStart();
4941 }
4942 }
4943 catch (RecognitionException pe) {
4944 synPredMatched168 = false;
4945 }
4946 rewind(_m168);
4947 inputState.guessing--;
4948 }
4949 if ( synPredMatched168 ) {
4950 modifiersOpt();
4951 mc_AST = (AST)returnAST;
4952 constructorDefinition(mc_AST);
4953 ctor_AST = (AST)returnAST;
4954 if ( inputState.guessing==0 ) {
4955 classField_AST = (AST)currentAST.root;
4956 classField_AST = ctor_AST;
4957 currentAST.root = classField_AST;
4958 currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
4959 classField_AST.getFirstChild() : classField_AST;
4960 currentAST.advanceChildToEnd();
4961 }
4962 }
4963 else {
4964 boolean synPredMatched170 = false;
4965 if (((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2))) && (_tokenSet_62.member(LA(3))))) {
4966 int _m170 = mark();
4967 synPredMatched170 = true;
4968 inputState.guessing++;
4969 try {
4970 {
4971 declarationStart();
4972 }
4973 }
4974 catch (RecognitionException pe) {
4975 synPredMatched170 = false;
4976 }
4977 rewind(_m170);
4978 inputState.guessing--;
4979 }
4980 if ( synPredMatched170 ) {
4981 declaration();
4982 d_AST = (AST)returnAST;
4983 if ( inputState.guessing==0 ) {
4984 classField_AST = (AST)currentAST.root;
4985 classField_AST = d_AST;
4986 currentAST.root = classField_AST;
4987 currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
4988 classField_AST.getFirstChild() : classField_AST;
4989 currentAST.advanceChildToEnd();
4990 }
4991 }
4992 else {
4993 boolean synPredMatched172 = false;
4994 if (((_tokenSet_21.member(LA(1))) && (_tokenSet_22.member(LA(2))) && (_tokenSet_23.member(LA(3))))) {
4995 int _m172 = mark();
4996 synPredMatched172 = true;
4997 inputState.guessing++;
4998 try {
4999 {
5000 typeDeclarationStart();
5001 }
5002 }
5003 catch (RecognitionException pe) {
5004 synPredMatched172 = false;
5005 }
5006 rewind(_m172);
5007 inputState.guessing--;
5008 }
5009 if ( synPredMatched172 ) {
5010 modifiersOpt();
5011 mods_AST = (AST)returnAST;
5012 {
5013 typeDefinitionInternal(mods_AST);
5014 td_AST = (AST)returnAST;
5015 if ( inputState.guessing==0 ) {
5016 classField_AST = (AST)currentAST.root;
5017 classField_AST = td_AST;
5018 currentAST.root = classField_AST;
5019 currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
5020 classField_AST.getFirstChild() : classField_AST;
5021 currentAST.advanceChildToEnd();
5022 }
5023 }
5024 }
5025 else if ((LA(1)==LITERAL_static) && (LA(2)==LCURLY)) {
5026 match(LITERAL_static);
5027 compoundStatement();
5028 s3_AST = (AST)returnAST;
5029 if ( inputState.guessing==0 ) {
5030 classField_AST = (AST)currentAST.root;
5031 classField_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(STATIC_INIT,"STATIC_INIT",first,LT(1))).add(s3_AST));
5032 currentAST.root = classField_AST;
5033 currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
5034 classField_AST.getFirstChild() : classField_AST;
5035 currentAST.advanceChildToEnd();
5036 }
5037 }
5038 else if ((LA(1)==LCURLY)) {
5039 compoundStatement();
5040 s4_AST = (AST)returnAST;
5041 if ( inputState.guessing==0 ) {
5042 classField_AST = (AST)currentAST.root;
5043 classField_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(INSTANCE_INIT,"INSTANCE_INIT",first,LT(1))).add(s4_AST));
5044 currentAST.root = classField_AST;
5045 currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
5046 classField_AST.getFirstChild() : classField_AST;
5047 currentAST.advanceChildToEnd();
5048 }
5049 }
5050 else {
5051 throw new NoViableAltException(LT(1), getFilename());
5052 }
5053 }}
5054 returnAST = classField_AST;
5055 }
5056
5057 public final void interfaceField() throws RecognitionException, TokenStreamException {
5058
5059 returnAST = null;
5060 ASTPair currentAST = new ASTPair();
5061 AST interfaceField_AST = null;
5062 AST d_AST = null;
5063 AST mods_AST = null;
5064 AST td_AST = null;
5065
5066 boolean synPredMatched176 = false;
5067 if (((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2))) && (_tokenSet_62.member(LA(3))))) {
5068 int _m176 = mark();
5069 synPredMatched176 = true;
5070 inputState.guessing++;
5071 try {
5072 {
5073 declarationStart();
5074 }
5075 }
5076 catch (RecognitionException pe) {
5077 synPredMatched176 = false;
5078 }
5079 rewind(_m176);
5080 inputState.guessing--;
5081 }
5082 if ( synPredMatched176 ) {
5083 declaration();
5084 d_AST = (AST)returnAST;
5085 if ( inputState.guessing==0 ) {
5086 interfaceField_AST = (AST)currentAST.root;
5087 interfaceField_AST = d_AST;
5088 currentAST.root = interfaceField_AST;
5089 currentAST.child = interfaceField_AST!=null &&interfaceField_AST.getFirstChild()!=null ?
5090 interfaceField_AST.getFirstChild() : interfaceField_AST;
5091 currentAST.advanceChildToEnd();
5092 }
5093 }
5094 else {
5095 boolean synPredMatched178 = false;
5096 if (((_tokenSet_21.member(LA(1))) && (_tokenSet_22.member(LA(2))) && (_tokenSet_23.member(LA(3))))) {
5097 int _m178 = mark();
5098 synPredMatched178 = true;
5099 inputState.guessing++;
5100 try {
5101 {
5102 typeDeclarationStart();
5103 }
5104 }
5105 catch (RecognitionException pe) {
5106 synPredMatched178 = false;
5107 }
5108 rewind(_m178);
5109 inputState.guessing--;
5110 }
5111 if ( synPredMatched178 ) {
5112 modifiersOpt();
5113 mods_AST = (AST)returnAST;
5114 {
5115 typeDefinitionInternal(mods_AST);
5116 td_AST = (AST)returnAST;
5117 if ( inputState.guessing==0 ) {
5118 interfaceField_AST = (AST)currentAST.root;
5119 interfaceField_AST = td_AST;
5120 currentAST.root = interfaceField_AST;
5121 currentAST.child = interfaceField_AST!=null &&interfaceField_AST.getFirstChild()!=null ?
5122 interfaceField_AST.getFirstChild() : interfaceField_AST;
5123 currentAST.advanceChildToEnd();
5124 }
5125 }
5126 }
5127 else {
5128 throw new NoViableAltException(LT(1), getFilename());
5129 }
5130 }
5131 returnAST = interfaceField_AST;
5132 }
5133
5134 public final void annotationField() throws RecognitionException, TokenStreamException {
5135
5136 returnAST = null;
5137 ASTPair currentAST = new ASTPair();
5138 AST annotationField_AST = null;
5139 AST mods_AST = null;
5140 AST td_AST = null;
5141 AST t_AST = null;
5142 Token i = null;
5143 AST i_AST = null;
5144 AST amvi_AST = null;
5145 AST v_AST = null;
5146 Token first = LT(1);
5147
5148 modifiersOpt();
5149 mods_AST = (AST)returnAST;
5150 {
5151 switch ( LA(1)) {
5152 case AT:
5153 case LITERAL_class:
5154 case LITERAL_interface:
5155 case LITERAL_enum:
5156 {
5157 typeDefinitionInternal(mods_AST);
5158 td_AST = (AST)returnAST;
5159 if ( inputState.guessing==0 ) {
5160 annotationField_AST = (AST)currentAST.root;
5161 annotationField_AST = td_AST;
5162 currentAST.root = annotationField_AST;
5163 currentAST.child = annotationField_AST!=null &&annotationField_AST.getFirstChild()!=null ?
5164 annotationField_AST.getFirstChild() : annotationField_AST;
5165 currentAST.advanceChildToEnd();
5166 }
5167 break;
5168 }
5169 case IDENT:
5170 case LITERAL_void:
5171 case LITERAL_boolean:
5172 case LITERAL_byte:
5173 case LITERAL_char:
5174 case LITERAL_short:
5175 case LITERAL_int:
5176 case LITERAL_float:
5177 case LITERAL_long:
5178 case LITERAL_double:
5179 case LITERAL_any:
5180 {
5181 typeSpec(false);
5182 t_AST = (AST)returnAST;
5183 {
5184 boolean synPredMatched138 = false;
5185 if (((LA(1)==IDENT) && (LA(2)==LPAREN) && (LA(3)==RPAREN))) {
5186 int _m138 = mark();
5187 synPredMatched138 = true;
5188 inputState.guessing++;
5189 try {
5190 {
5191 match(IDENT);
5192 match(LPAREN);
5193 }
5194 }
5195 catch (RecognitionException pe) {
5196 synPredMatched138 = false;
5197 }
5198 rewind(_m138);
5199 inputState.guessing--;
5200 }
5201 if ( synPredMatched138 ) {
5202 i = LT(1);
5203 i_AST = astFactory.create(i);
5204 match(IDENT);
5205 match(LPAREN);
5206 match(RPAREN);
5207 {
5208 switch ( LA(1)) {
5209 case LITERAL_default:
5210 {
5211 match(LITERAL_default);
5212 nls();
5213 annotationMemberValueInitializer();
5214 amvi_AST = (AST)returnAST;
5215 break;
5216 }
5217 case RCURLY:
5218 case SEMI:
5219 case NLS:
5220 {
5221 break;
5222 }
5223 default:
5224 {
5225 throw new NoViableAltException(LT(1), getFilename());
5226 }
5227 }
5228 }
5229 if ( inputState.guessing==0 ) {
5230 annotationField_AST = (AST)currentAST.root;
5231 annotationField_AST =
5232 (AST)astFactory.make( (new ASTArray(5)).add(create(ANNOTATION_FIELD_DEF,"ANNOTATION_FIELD_DEF",first,LT(1))).add(mods_AST).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t_AST))).add(i_AST).add(amvi_AST));
5233 currentAST.root = annotationField_AST;
5234 currentAST.child = annotationField_AST!=null &&annotationField_AST.getFirstChild()!=null ?
5235 annotationField_AST.getFirstChild() : annotationField_AST;
5236 currentAST.advanceChildToEnd();
5237 }
5238 }
5239 else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (_tokenSet_63.member(LA(2))) && (_tokenSet_64.member(LA(3)))) {
5240 variableDefinitions(mods_AST,t_AST);
5241 v_AST = (AST)returnAST;
5242 if ( inputState.guessing==0 ) {
5243 annotationField_AST = (AST)currentAST.root;
5244 annotationField_AST = v_AST;
5245 currentAST.root = annotationField_AST;
5246 currentAST.child = annotationField_AST!=null &&annotationField_AST.getFirstChild()!=null ?
5247 annotationField_AST.getFirstChild() : annotationField_AST;
5248 currentAST.advanceChildToEnd();
5249 }
5250 }
5251 else {
5252 throw new NoViableAltException(LT(1), getFilename());
5253 }
5254
5255 }
5256 break;
5257 }
5258 default:
5259 {
5260 throw new NoViableAltException(LT(1), getFilename());
5261 }
5262 }
5263 }
5264 returnAST = annotationField_AST;
5265 }
5266
5267 /*** Guard for enumConstants. */
5268 public final void enumConstantsStart() throws RecognitionException, TokenStreamException {
5269
5270 returnAST = null;
5271 ASTPair currentAST = new ASTPair();
5272 AST enumConstantsStart_AST = null;
5273
5274 enumConstant();
5275 astFactory.addASTChild(currentAST, returnAST);
5276 {
5277 switch ( LA(1)) {
5278 case COMMA:
5279 {
5280 AST tmp129_AST = null;
5281 tmp129_AST = astFactory.create(LT(1));
5282 astFactory.addASTChild(currentAST, tmp129_AST);
5283 match(COMMA);
5284 break;
5285 }
5286 case SEMI:
5287 {
5288 AST tmp130_AST = null;
5289 tmp130_AST = astFactory.create(LT(1));
5290 astFactory.addASTChild(currentAST, tmp130_AST);
5291 match(SEMI);
5292 break;
5293 }
5294 case NLS:
5295 {
5296 AST tmp131_AST = null;
5297 tmp131_AST = astFactory.create(LT(1));
5298 astFactory.addASTChild(currentAST, tmp131_AST);
5299 match(NLS);
5300 break;
5301 }
5302 case RCURLY:
5303 {
5304 AST tmp132_AST = null;
5305 tmp132_AST = astFactory.create(LT(1));
5306 astFactory.addASTChild(currentAST, tmp132_AST);
5307 match(RCURLY);
5308 break;
5309 }
5310 default:
5311 {
5312 throw new NoViableAltException(LT(1), getFilename());
5313 }
5314 }
5315 }
5316 enumConstantsStart_AST = (AST)currentAST.root;
5317 returnAST = enumConstantsStart_AST;
5318 }
5319
5320 /*** Comma-separated list of one or more enum constant definitions. */
5321 public final void enumConstants() throws RecognitionException, TokenStreamException {
5322
5323 returnAST = null;
5324 ASTPair currentAST = new ASTPair();
5325 AST enumConstants_AST = null;
5326
5327 enumConstant();
5328 astFactory.addASTChild(currentAST, returnAST);
5329 {
5330 _loop132:
5331 do {
5332 if ((LA(1)==COMMA) && (_tokenSet_65.member(LA(2))) && (_tokenSet_66.member(LA(3)))) {
5333 match(COMMA);
5334 nls();
5335 enumConstant();
5336 astFactory.addASTChild(currentAST, returnAST);
5337 }
5338 else {
5339 break _loop132;
5340 }
5341
5342 } while (true);
5343 }
5344 {
5345 switch ( LA(1)) {
5346 case COMMA:
5347 {
5348 match(COMMA);
5349 nls();
5350 break;
5351 }
5352 case RCURLY:
5353 case SEMI:
5354 case NLS:
5355 {
5356 break;
5357 }
5358 default:
5359 {
5360 throw new NoViableAltException(LT(1), getFilename());
5361 }
5362 }
5363 }
5364 enumConstants_AST = (AST)currentAST.root;
5365 returnAST = enumConstants_AST;
5366 }
5367
5368 public final void enumConstant() throws RecognitionException, TokenStreamException {
5369
5370 returnAST = null;
5371 ASTPair currentAST = new ASTPair();
5372 AST enumConstant_AST = null;
5373 AST an_AST = null;
5374 Token i = null;
5375 AST i_AST = null;
5376 AST a_AST = null;
5377 AST b_AST = null;
5378 Token first = LT(1);
5379
5380 annotationsOpt();
5381 an_AST = (AST)returnAST;
5382 i = LT(1);
5383 i_AST = astFactory.create(i);
5384 match(IDENT);
5385 {
5386 switch ( LA(1)) {
5387 case LPAREN:
5388 {
5389 match(LPAREN);
5390 argList();
5391 a_AST = (AST)returnAST;
5392 match(RPAREN);
5393 break;
5394 }
5395 case COMMA:
5396 case LCURLY:
5397 case RCURLY:
5398 case SEMI:
5399 case NLS:
5400 {
5401 break;
5402 }
5403 default:
5404 {
5405 throw new NoViableAltException(LT(1), getFilename());
5406 }
5407 }
5408 }
5409 {
5410 switch ( LA(1)) {
5411 case LCURLY:
5412 {
5413 enumConstantBlock();
5414 b_AST = (AST)returnAST;
5415 break;
5416 }
5417 case COMMA:
5418 case RCURLY:
5419 case SEMI:
5420 case NLS:
5421 {
5422 break;
5423 }
5424 default:
5425 {
5426 throw new NoViableAltException(LT(1), getFilename());
5427 }
5428 }
5429 }
5430 if ( inputState.guessing==0 ) {
5431 enumConstant_AST = (AST)currentAST.root;
5432 enumConstant_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(ENUM_CONSTANT_DEF,"ENUM_CONSTANT_DEF",first,LT(1))).add(an_AST).add(i_AST).add(a_AST).add(b_AST));
5433 currentAST.root = enumConstant_AST;
5434 currentAST.child = enumConstant_AST!=null &&enumConstant_AST.getFirstChild()!=null ?
5435 enumConstant_AST.getFirstChild() : enumConstant_AST;
5436 currentAST.advanceChildToEnd();
5437 }
5438 returnAST = enumConstant_AST;
5439 }
5440
5441 public final void argList() throws RecognitionException, TokenStreamException {
5442
5443 returnAST = null;
5444 ASTPair currentAST = new ASTPair();
5445 AST argList_AST = null;
5446 Token first = LT(1); boolean hl = false, hl2;
5447
5448 {
5449 switch ( LA(1)) {
5450 case FINAL:
5451 case ABSTRACT:
5452 case UNUSED_DO:
5453 case STRICTFP:
5454 case LITERAL_static:
5455 case LITERAL_def:
5456 case AT:
5457 case IDENT:
5458 case LBRACK:
5459 case LPAREN:
5460 case LITERAL_class:
5461 case LITERAL_super:
5462 case LITERAL_void:
5463 case LITERAL_boolean:
5464 case LITERAL_byte:
5465 case LITERAL_char:
5466 case LITERAL_short:
5467 case LITERAL_int:
5468 case LITERAL_float:
5469 case LITERAL_long:
5470 case LITERAL_double:
5471 case LITERAL_any:
5472 case STAR:
5473 case LITERAL_as:
5474 case LITERAL_private:
5475 case LITERAL_public:
5476 case LITERAL_protected:
5477 case LITERAL_transient:
5478 case LITERAL_native:
5479 case LITERAL_threadsafe:
5480 case LITERAL_synchronized:
5481 case LITERAL_volatile:
5482 case LCURLY:
5483 case LITERAL_this:
5484 case STRING_LITERAL:
5485 case LITERAL_if:
5486 case LITERAL_else:
5487 case LITERAL_while:
5488 case LITERAL_switch:
5489 case LITERAL_for:
5490 case LITERAL_in:
5491 case LITERAL_return:
5492 case LITERAL_break:
5493 case LITERAL_continue:
5494 case LITERAL_throw:
5495 case LITERAL_assert:
5496 case PLUS:
5497 case MINUS:
5498 case LITERAL_try:
5499 case LITERAL_finally:
5500 case LITERAL_catch:
5501 case INC:
5502 case DEC:
5503 case BNOT:
5504 case LNOT:
5505 case DOLLAR:
5506 case STRING_CTOR_START:
5507 case LITERAL_new:
5508 case LITERAL_true:
5509 case LITERAL_false:
5510 case LITERAL_null:
5511 case NUM_INT:
5512 case NUM_FLOAT:
5513 case NUM_LONG:
5514 case NUM_DOUBLE:
5515 case NUM_BIG_INT:
5516 case NUM_BIG_DECIMAL:
5517 {
5518 hl=argument();
5519 astFactory.addASTChild(currentAST, returnAST);
5520 {
5521 _loop446:
5522 do {
5523 if ((LA(1)==COMMA) && (_tokenSet_67.member(LA(2))) && (_tokenSet_68.member(LA(3)))) {
5524 match(COMMA);
5525 hl2=argument();
5526 astFactory.addASTChild(currentAST, returnAST);
5527 if ( inputState.guessing==0 ) {
5528 hl |= hl2;
5529 }
5530 }
5531 else {
5532 break _loop446;
5533 }
5534
5535 } while (true);
5536 }
5537 if ( inputState.guessing==0 ) {
5538 argList_AST = (AST)currentAST.root;
5539 argList_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(ELIST,"ELIST",first,LT(1))).add(argList_AST));
5540 currentAST.root = argList_AST;
5541 currentAST.child = argList_AST!=null &&argList_AST.getFirstChild()!=null ?
5542 argList_AST.getFirstChild() : argList_AST;
5543 currentAST.advanceChildToEnd();
5544 }
5545 break;
5546 }
5547 case RBRACK:
5548 case COMMA:
5549 case RPAREN:
5550 {
5551 if ( inputState.guessing==0 ) {
5552 argList_AST = (AST)currentAST.root;
5553 argList_AST = create(ELIST,"ELIST",first,LT(1));
5554 currentAST.root = argList_AST;
5555 currentAST.child = argList_AST!=null &&argList_AST.getFirstChild()!=null ?
5556 argList_AST.getFirstChild() : argList_AST;
5557 currentAST.advanceChildToEnd();
5558 }
5559 break;
5560 }
5561 default:
5562 {
5563 throw new NoViableAltException(LT(1), getFilename());
5564 }
5565 }
5566 }
5567 {
5568 switch ( LA(1)) {
5569 case COMMA:
5570 {
5571 match(COMMA);
5572 break;
5573 }
5574 case RBRACK:
5575 case RPAREN:
5576 {
5577 break;
5578 }
5579 default:
5580 {
5581 throw new NoViableAltException(LT(1), getFilename());
5582 }
5583 }
5584 }
5585 if ( inputState.guessing==0 ) {
5586 argListHasLabels = hl;
5587 }
5588 argList_AST = (AST)currentAST.root;
5589 returnAST = argList_AST;
5590 }
5591
5592 public final void enumConstantBlock() throws RecognitionException, TokenStreamException {
5593
5594 returnAST = null;
5595 ASTPair currentAST = new ASTPair();
5596 AST enumConstantBlock_AST = null;
5597 Token first = LT(1);
5598
5599 match(LCURLY);
5600 {
5601 switch ( LA(1)) {
5602 case FINAL:
5603 case ABSTRACT:
5604 case STRICTFP:
5605 case LITERAL_static:
5606 case LITERAL_def:
5607 case AT:
5608 case IDENT:
5609 case LITERAL_class:
5610 case LITERAL_interface:
5611 case LITERAL_enum:
5612 case LT:
5613 case LITERAL_void:
5614 case LITERAL_boolean:
5615 case LITERAL_byte:
5616 case LITERAL_char:
5617 case LITERAL_short:
5618 case LITERAL_int:
5619 case LITERAL_float:
5620 case LITERAL_long:
5621 case LITERAL_double:
5622 case LITERAL_any:
5623 case LITERAL_private:
5624 case LITERAL_public:
5625 case LITERAL_protected:
5626 case LITERAL_transient:
5627 case LITERAL_native:
5628 case LITERAL_threadsafe:
5629 case LITERAL_synchronized:
5630 case LITERAL_volatile:
5631 case LCURLY:
5632 {
5633 enumConstantField();
5634 astFactory.addASTChild(currentAST, returnAST);
5635 break;
5636 }
5637 case RCURLY:
5638 case SEMI:
5639 case NLS:
5640 {
5641 break;
5642 }
5643 default:
5644 {
5645 throw new NoViableAltException(LT(1), getFilename());
5646 }
5647 }
5648 }
5649 {
5650 _loop147:
5651 do {
5652 if ((LA(1)==SEMI||LA(1)==NLS)) {
5653 sep();
5654 {
5655 switch ( LA(1)) {
5656 case FINAL:
5657 case ABSTRACT:
5658 case STRICTFP:
5659 case LITERAL_static:
5660 case LITERAL_def:
5661 case AT:
5662 case IDENT:
5663 case LITERAL_class:
5664 case LITERAL_interface:
5665 case LITERAL_enum:
5666 case LT:
5667 case LITERAL_void:
5668 case LITERAL_boolean:
5669 case LITERAL_byte:
5670 case LITERAL_char:
5671 case LITERAL_short:
5672 case LITERAL_int:
5673 case LITERAL_float:
5674 case LITERAL_long:
5675 case LITERAL_double:
5676 case LITERAL_any:
5677 case LITERAL_private:
5678 case LITERAL_public:
5679 case LITERAL_protected:
5680 case LITERAL_transient:
5681 case LITERAL_native:
5682 case LITERAL_threadsafe:
5683 case LITERAL_synchronized:
5684 case LITERAL_volatile:
5685 case LCURLY:
5686 {
5687 enumConstantField();
5688 astFactory.addASTChild(currentAST, returnAST);
5689 break;
5690 }
5691 case RCURLY:
5692 case SEMI:
5693 case NLS:
5694 {
5695 break;
5696 }
5697 default:
5698 {
5699 throw new NoViableAltException(LT(1), getFilename());
5700 }
5701 }
5702 }
5703 }
5704 else {
5705 break _loop147;
5706 }
5707
5708 } while (true);
5709 }
5710 match(RCURLY);
5711 if ( inputState.guessing==0 ) {
5712 enumConstantBlock_AST = (AST)currentAST.root;
5713 enumConstantBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(enumConstantBlock_AST));
5714 currentAST.root = enumConstantBlock_AST;
5715 currentAST.child = enumConstantBlock_AST!=null &&enumConstantBlock_AST.getFirstChild()!=null ?
5716 enumConstantBlock_AST.getFirstChild() : enumConstantBlock_AST;
5717 currentAST.advanceChildToEnd();
5718 }
5719 enumConstantBlock_AST = (AST)currentAST.root;
5720 returnAST = enumConstantBlock_AST;
5721 }
5722
5723 public final void enumConstantField() throws RecognitionException, TokenStreamException {
5724
5725 returnAST = null;
5726 ASTPair currentAST = new ASTPair();
5727 AST enumConstantField_AST = null;
5728 AST mods_AST = null;
5729 AST td_AST = null;
5730 AST tp_AST = null;
5731 AST t_AST = null;
5732 AST param_AST = null;
5733 AST tc_AST = null;
5734 AST s2_AST = null;
5735 AST v_AST = null;
5736 AST s4_AST = null;
5737 Token first = LT(1);
5738
5739 switch ( LA(1)) {
5740 case FINAL:
5741 case ABSTRACT:
5742 case STRICTFP:
5743 case LITERAL_static:
5744 case LITERAL_def:
5745 case AT:
5746 case IDENT:
5747 case LITERAL_class:
5748 case LITERAL_interface:
5749 case LITERAL_enum:
5750 case LT:
5751 case LITERAL_void:
5752 case LITERAL_boolean:
5753 case LITERAL_byte:
5754 case LITERAL_char:
5755 case LITERAL_short:
5756 case LITERAL_int:
5757 case LITERAL_float:
5758 case LITERAL_long:
5759 case LITERAL_double:
5760 case LITERAL_any:
5761 case LITERAL_private:
5762 case LITERAL_public:
5763 case LITERAL_protected:
5764 case LITERAL_transient:
5765 case LITERAL_native:
5766 case LITERAL_threadsafe:
5767 case LITERAL_synchronized:
5768 case LITERAL_volatile:
5769 {
5770 modifiersOpt();
5771 mods_AST = (AST)returnAST;
5772 {
5773 switch ( LA(1)) {
5774 case AT:
5775 case LITERAL_class:
5776 case LITERAL_interface:
5777 case LITERAL_enum:
5778 {
5779 typeDefinitionInternal(mods_AST);
5780 td_AST = (AST)returnAST;
5781 if ( inputState.guessing==0 ) {
5782 enumConstantField_AST = (AST)currentAST.root;
5783 enumConstantField_AST = td_AST;
5784 currentAST.root = enumConstantField_AST;
5785 currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
5786 enumConstantField_AST.getFirstChild() : enumConstantField_AST;
5787 currentAST.advanceChildToEnd();
5788 }
5789 break;
5790 }
5791 case IDENT:
5792 case LT:
5793 case LITERAL_void:
5794 case LITERAL_boolean:
5795 case LITERAL_byte:
5796 case LITERAL_char:
5797 case LITERAL_short:
5798 case LITERAL_int:
5799 case LITERAL_float:
5800 case LITERAL_long:
5801 case LITERAL_double:
5802 case LITERAL_any:
5803 {
5804 {
5805 switch ( LA(1)) {
5806 case LT:
5807 {
5808 typeParameters();
5809 tp_AST = (AST)returnAST;
5810 break;
5811 }
5812 case IDENT:
5813 case LITERAL_void:
5814 case LITERAL_boolean:
5815 case LITERAL_byte:
5816 case LITERAL_char:
5817 case LITERAL_short:
5818 case LITERAL_int:
5819 case LITERAL_float:
5820 case LITERAL_long:
5821 case LITERAL_double:
5822 case LITERAL_any:
5823 {
5824 break;
5825 }
5826 default:
5827 {
5828 throw new NoViableAltException(LT(1), getFilename());
5829 }
5830 }
5831 }
5832 typeSpec(false);
5833 t_AST = (AST)returnAST;
5834 {
5835 boolean synPredMatched153 = false;
5836 if (((LA(1)==IDENT) && (LA(2)==LPAREN) && (_tokenSet_69.member(LA(3))))) {
5837 int _m153 = mark();
5838 synPredMatched153 = true;
5839 inputState.guessing++;
5840 try {
5841 {
5842 match(IDENT);
5843 match(LPAREN);
5844 }
5845 }
5846 catch (RecognitionException pe) {
5847 synPredMatched153 = false;
5848 }
5849 rewind(_m153);
5850 inputState.guessing--;
5851 }
5852 if ( synPredMatched153 ) {
5853 AST tmp141_AST = null;
5854 tmp141_AST = astFactory.create(LT(1));
5855 match(IDENT);
5856 match(LPAREN);
5857 parameterDeclarationList();
5858 param_AST = (AST)returnAST;
5859 match(RPAREN);
5860 {
5861 boolean synPredMatched156 = false;
5862 if (((LA(1)==NLS||LA(1)==LITERAL_throws) && (_tokenSet_30.member(LA(2))) && (_tokenSet_70.member(LA(3))))) {
5863 int _m156 = mark();
5864 synPredMatched156 = true;
5865 inputState.guessing++;
5866 try {
5867 {
5868 nls();
5869 match(LITERAL_throws);
5870 }
5871 }
5872 catch (RecognitionException pe) {
5873 synPredMatched156 = false;
5874 }
5875 rewind(_m156);
5876 inputState.guessing--;
5877 }
5878 if ( synPredMatched156 ) {
5879 throwsClause();
5880 tc_AST = (AST)returnAST;
5881 }
5882 else if (((LA(1) >= LCURLY && LA(1) <= NLS)) && (_tokenSet_71.member(LA(2))) && (_tokenSet_8.member(LA(3)))) {
5883 }
5884 else {
5885 throw new NoViableAltException(LT(1), getFilename());
5886 }
5887
5888 }
5889 {
5890 switch ( LA(1)) {
5891 case LCURLY:
5892 {
5893 compoundStatement();
5894 s2_AST = (AST)returnAST;
5895 break;
5896 }
5897 case RCURLY:
5898 case SEMI:
5899 case NLS:
5900 {
5901 break;
5902 }
5903 default:
5904 {
5905 throw new NoViableAltException(LT(1), getFilename());
5906 }
5907 }
5908 }
5909 if ( inputState.guessing==0 ) {
5910 enumConstantField_AST = (AST)currentAST.root;
5911 enumConstantField_AST = (AST)astFactory.make( (new ASTArray(8)).add(create(METHOD_DEF,"METHOD_DEF",first,LT(1))).add(mods_AST).add(tp_AST).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t_AST))).add(tmp141_AST).add(param_AST).add(tc_AST).add(s2_AST));
5912 currentAST.root = enumConstantField_AST;
5913 currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
5914 enumConstantField_AST.getFirstChild() : enumConstantField_AST;
5915 currentAST.advanceChildToEnd();
5916 }
5917 }
5918 else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (_tokenSet_63.member(LA(2))) && (_tokenSet_72.member(LA(3)))) {
5919 variableDefinitions(mods_AST,t_AST);
5920 v_AST = (AST)returnAST;
5921 if ( inputState.guessing==0 ) {
5922 enumConstantField_AST = (AST)currentAST.root;
5923 enumConstantField_AST = v_AST;
5924 currentAST.root = enumConstantField_AST;
5925 currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
5926 enumConstantField_AST.getFirstChild() : enumConstantField_AST;
5927 currentAST.advanceChildToEnd();
5928 }
5929 }
5930 else {
5931 throw new NoViableAltException(LT(1), getFilename());
5932 }
5933
5934 }
5935 break;
5936 }
5937 default:
5938 {
5939 throw new NoViableAltException(LT(1), getFilename());
5940 }
5941 }
5942 }
5943 break;
5944 }
5945 case LCURLY:
5946 {
5947 compoundStatement();
5948 s4_AST = (AST)returnAST;
5949 if ( inputState.guessing==0 ) {
5950 enumConstantField_AST = (AST)currentAST.root;
5951 enumConstantField_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(INSTANCE_INIT,"INSTANCE_INIT",first,LT(1))).add(s4_AST));
5952 currentAST.root = enumConstantField_AST;
5953 currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
5954 enumConstantField_AST.getFirstChild() : enumConstantField_AST;
5955 currentAST.advanceChildToEnd();
5956 }
5957 break;
5958 }
5959 default:
5960 {
5961 throw new NoViableAltException(LT(1), getFilename());
5962 }
5963 }
5964 returnAST = enumConstantField_AST;
5965 }
5966
5967 /*** A list of zero or more formal parameters.
5968 * If a parameter is variable length (e.g. String... myArg) it should be
5969 * to the right of any other parameters of the same kind.
5970 * General form: (req, ..., opt, ..., [rest], key, ..., [restKeys], [block]
5971 * This must be sorted out after parsing, since the various declaration forms
5972 * are impossible to tell apart without backtracking.
5973 */
5974 public final void parameterDeclarationList() throws RecognitionException, TokenStreamException {
5975
5976 returnAST = null;
5977 ASTPair currentAST = new ASTPair();
5978 AST parameterDeclarationList_AST = null;
5979 Token first = LT(1);
5980
5981 {
5982 switch ( LA(1)) {
5983 case FINAL:
5984 case LITERAL_def:
5985 case AT:
5986 case IDENT:
5987 case LITERAL_void:
5988 case LITERAL_boolean:
5989 case LITERAL_byte:
5990 case LITERAL_char:
5991 case LITERAL_short:
5992 case LITERAL_int:
5993 case LITERAL_float:
5994 case LITERAL_long:
5995 case LITERAL_double:
5996 case LITERAL_any:
5997 case TRIPLE_DOT:
5998 {
5999 parameterDeclaration();
6000 astFactory.addASTChild(currentAST, returnAST);
6001 {
6002 _loop217:
6003 do {
6004 if ((LA(1)==COMMA)) {
6005 match(COMMA);
6006 nls();
6007 parameterDeclaration();
6008 astFactory.addASTChild(currentAST, returnAST);
6009 }
6010 else {
6011 break _loop217;
6012 }
6013
6014 } while (true);
6015 }
6016 break;
6017 }
6018 case RPAREN:
6019 case NLS:
6020 case CLOSABLE_BLOCK_OP:
6021 {
6022 break;
6023 }
6024 default:
6025 {
6026 throw new NoViableAltException(LT(1), getFilename());
6027 }
6028 }
6029 }
6030 if ( inputState.guessing==0 ) {
6031 parameterDeclarationList_AST = (AST)currentAST.root;
6032 parameterDeclarationList_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(PARAMETERS,"PARAMETERS",first,LT(1))).add(parameterDeclarationList_AST));
6033 currentAST.root = parameterDeclarationList_AST;
6034 currentAST.child = parameterDeclarationList_AST!=null &¶meterDeclarationList_AST.getFirstChild()!=null ?
6035 parameterDeclarationList_AST.getFirstChild() : parameterDeclarationList_AST;
6036 currentAST.advanceChildToEnd();
6037 }
6038 parameterDeclarationList_AST = (AST)currentAST.root;
6039 returnAST = parameterDeclarationList_AST;
6040 }
6041
6042 public final void throwsClause() throws RecognitionException, TokenStreamException {
6043
6044 returnAST = null;
6045 ASTPair currentAST = new ASTPair();
6046 AST throwsClause_AST = null;
6047
6048 nls();
6049 AST tmp145_AST = null;
6050 tmp145_AST = astFactory.create(LT(1));
6051 astFactory.makeASTRoot(currentAST, tmp145_AST);
6052 match(LITERAL_throws);
6053 nls();
6054 identifier();
6055 astFactory.addASTChild(currentAST, returnAST);
6056 {
6057 _loop213:
6058 do {
6059 if ((LA(1)==COMMA)) {
6060 match(COMMA);
6061 nls();
6062 identifier();
6063 astFactory.addASTChild(currentAST, returnAST);
6064 }
6065 else {
6066 break _loop213;
6067 }
6068
6069 } while (true);
6070 }
6071 throwsClause_AST = (AST)currentAST.root;
6072 returnAST = throwsClause_AST;
6073 }
6074
6075 public final void compoundStatement() throws RecognitionException, TokenStreamException {
6076
6077 returnAST = null;
6078 ASTPair currentAST = new ASTPair();
6079 AST compoundStatement_AST = null;
6080
6081 openBlock();
6082 astFactory.addASTChild(currentAST, returnAST);
6083 compoundStatement_AST = (AST)currentAST.root;
6084 returnAST = compoundStatement_AST;
6085 }
6086
6087 /*** I've split out constructors separately; we could maybe integrate back into variableDefinitions
6088 * later on if we maybe simplified 'def' to be a type declaration?
6089 */
6090 public final void constructorDefinition(
6091 AST mods
6092 ) throws RecognitionException, TokenStreamException {
6093
6094 returnAST = null;
6095 ASTPair currentAST = new ASTPair();
6096 AST constructorDefinition_AST = null;
6097 Token id = null;
6098 AST id_AST = null;
6099 AST param_AST = null;
6100 AST tc_AST = null;
6101 AST cb_AST = null;
6102 Token first = LT(1);
6103
6104 id = LT(1);
6105 id_AST = astFactory.create(id);
6106 astFactory.addASTChild(currentAST, id_AST);
6107 match(IDENT);
6108 match(LPAREN);
6109 parameterDeclarationList();
6110 param_AST = (AST)returnAST;
6111 match(RPAREN);
6112 {
6113 boolean synPredMatched202 = false;
6114 if (((LA(1)==NLS||LA(1)==LITERAL_throws) && (_tokenSet_30.member(LA(2))) && (_tokenSet_73.member(LA(3))))) {
6115 int _m202 = mark();
6116 synPredMatched202 = true;
6117 inputState.guessing++;
6118 try {
6119 {
6120 nls();
6121 match(LITERAL_throws);
6122 }
6123 }
6124 catch (RecognitionException pe) {
6125 synPredMatched202 = false;
6126 }
6127 rewind(_m202);
6128 inputState.guessing--;
6129 }
6130 if ( synPredMatched202 ) {
6131 throwsClause();
6132 tc_AST = (AST)returnAST;
6133 }
6134 else if ((LA(1)==LCURLY||LA(1)==NLS) && (_tokenSet_74.member(LA(2))) && (_tokenSet_75.member(LA(3)))) {
6135 }
6136 else {
6137 throw new NoViableAltException(LT(1), getFilename());
6138 }
6139
6140 }
6141 nlsWarn();
6142 if ( inputState.guessing==0 ) {
6143 isConstructorIdent(id);
6144 }
6145 constructorBody();
6146 cb_AST = (AST)returnAST;
6147 if ( inputState.guessing==0 ) {
6148 constructorDefinition_AST = (AST)currentAST.root;
6149 constructorDefinition_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(CTOR_IDENT,"CTOR_IDENT",first,LT(1))).add(mods).add(param_AST).add(tc_AST).add(cb_AST));
6150
6151 currentAST.root = constructorDefinition_AST;
6152 currentAST.child = constructorDefinition_AST!=null &&constructorDefinition_AST.getFirstChild()!=null ?
6153 constructorDefinition_AST.getFirstChild() : constructorDefinition_AST;
6154 currentAST.advanceChildToEnd();
6155 }
6156 constructorDefinition_AST = (AST)currentAST.root;
6157 returnAST = constructorDefinition_AST;
6158 }
6159
6160 public final void constructorBody() throws RecognitionException, TokenStreamException {
6161
6162 returnAST = null;
6163 ASTPair currentAST = new ASTPair();
6164 AST constructorBody_AST = null;
6165 Token lc = null;
6166 AST lc_AST = null;
6167
6168 lc = LT(1);
6169 lc_AST = astFactory.create(lc);
6170 astFactory.makeASTRoot(currentAST, lc_AST);
6171 match(LCURLY);
6172 nls();
6173 if ( inputState.guessing==0 ) {
6174 lc_AST.setType(SLIST);
6175 }
6176 {
6177 boolean synPredMatched183 = false;
6178 if (((_tokenSet_76.member(LA(1))) && (_tokenSet_77.member(LA(2))) && (_tokenSet_78.member(LA(3))))) {
6179 int _m183 = mark();
6180 synPredMatched183 = true;
6181 inputState.guessing++;
6182 try {
6183 {
6184 explicitConstructorInvocation();
6185 }
6186 }
6187 catch (RecognitionException pe) {
6188 synPredMatched183 = false;
6189 }
6190 rewind(_m183);
6191 inputState.guessing--;
6192 }
6193 if ( synPredMatched183 ) {
6194 explicitConstructorInvocation();
6195 astFactory.addASTChild(currentAST, returnAST);
6196 {
6197 switch ( LA(1)) {
6198 case SEMI:
6199 case NLS:
6200 {
6201 sep();
6202 blockBody(sepToken);
6203 astFactory.addASTChild(currentAST, returnAST);
6204 break;
6205 }
6206 case RCURLY:
6207 {
6208 break;
6209 }
6210 default:
6211 {
6212 throw new NoViableAltException(LT(1), getFilename());
6213 }
6214 }
6215 }
6216 }
6217 else if ((_tokenSet_33.member(LA(1))) && (_tokenSet_75.member(LA(2))) && (_tokenSet_18.member(LA(3)))) {
6218 blockBody(EOF);
6219 astFactory.addASTChild(currentAST, returnAST);
6220 }
6221 else {
6222 throw new NoViableAltException(LT(1), getFilename());
6223 }
6224
6225 }
6226 match(RCURLY);
6227 constructorBody_AST = (AST)currentAST.root;
6228 returnAST = constructorBody_AST;
6229 }
6230
6231 /*** Catch obvious constructor calls, but not the expr.super(...) calls */
6232 public final void explicitConstructorInvocation() throws RecognitionException, TokenStreamException {
6233
6234 returnAST = null;
6235 ASTPair currentAST = new ASTPair();
6236 AST explicitConstructorInvocation_AST = null;
6237 Token lp1 = null;
6238 AST lp1_AST = null;
6239 Token lp2 = null;
6240 AST lp2_AST = null;
6241
6242 {
6243 switch ( LA(1)) {
6244 case LT:
6245 {
6246 typeArguments();
6247 astFactory.addASTChild(currentAST, returnAST);
6248 break;
6249 }
6250 case LITERAL_super:
6251 case LITERAL_this:
6252 {
6253 break;
6254 }
6255 default:
6256 {
6257 throw new NoViableAltException(LT(1), getFilename());
6258 }
6259 }
6260 }
6261 {
6262 switch ( LA(1)) {
6263 case LITERAL_this:
6264 {
6265 match(LITERAL_this);
6266 lp1 = LT(1);
6267 lp1_AST = astFactory.create(lp1);
6268 astFactory.makeASTRoot(currentAST, lp1_AST);
6269 match(LPAREN);
6270 argList();
6271 astFactory.addASTChild(currentAST, returnAST);
6272 match(RPAREN);
6273 if ( inputState.guessing==0 ) {
6274 lp1_AST.setType(CTOR_CALL);
6275 }
6276 break;
6277 }
6278 case LITERAL_super:
6279 {
6280 match(LITERAL_super);
6281 lp2 = LT(1);
6282 lp2_AST = astFactory.create(lp2);
6283 astFactory.makeASTRoot(currentAST, lp2_AST);
6284 match(LPAREN);
6285 argList();
6286 astFactory.addASTChild(currentAST, returnAST);
6287 match(RPAREN);
6288 if ( inputState.guessing==0 ) {
6289 lp2_AST.setType(SUPER_CTOR_CALL);
6290 }
6291 break;
6292 }
6293 default:
6294 {
6295 throw new NoViableAltException(LT(1), getFilename());
6296 }
6297 }
6298 }
6299 explicitConstructorInvocation_AST = (AST)currentAST.root;
6300 returnAST = explicitConstructorInvocation_AST;
6301 }
6302
6303 /*** Declaration of a variable. This can be a class/instance variable,
6304 * or a local variable in a method
6305 * It can also include possible initialization.
6306 */
6307 public final void variableDeclarator(
6308 AST mods, AST t
6309 ) throws RecognitionException, TokenStreamException {
6310
6311 returnAST = null;
6312 ASTPair currentAST = new ASTPair();
6313 AST variableDeclarator_AST = null;
6314 AST id_AST = null;
6315 AST v_AST = null;
6316 Token first = LT(1);
6317
6318 variableName();
6319 id_AST = (AST)returnAST;
6320 {
6321 switch ( LA(1)) {
6322 case ASSIGN:
6323 {
6324 varInitializer();
6325 v_AST = (AST)returnAST;
6326 break;
6327 }
6328 case EOF:
6329 case COMMA:
6330 case RCURLY:
6331 case SEMI:
6332 case NLS:
6333 case LITERAL_default:
6334 case LITERAL_else:
6335 case LITERAL_case:
6336 {
6337 break;
6338 }
6339 default:
6340 {
6341 throw new NoViableAltException(LT(1), getFilename());
6342 }
6343 }
6344 }
6345 if ( inputState.guessing==0 ) {
6346 variableDeclarator_AST = (AST)currentAST.root;
6347 variableDeclarator_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(VARIABLE_DEF,"VARIABLE_DEF",first,LT(1))).add(mods).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t))).add(id_AST).add(v_AST));
6348 currentAST.root = variableDeclarator_AST;
6349 currentAST.child = variableDeclarator_AST!=null &&variableDeclarator_AST.getFirstChild()!=null ?
6350 variableDeclarator_AST.getFirstChild() : variableDeclarator_AST;
6351 currentAST.advanceChildToEnd();
6352 }
6353 returnAST = variableDeclarator_AST;
6354 }
6355
6356 /*** Zero or more insignificant newlines, all gobbled up and thrown away,
6357 * but a warning message is left for the user, if there was a newline.
6358 */
6359 public final void nlsWarn() throws RecognitionException, TokenStreamException {
6360
6361 returnAST = null;
6362 ASTPair currentAST = new ASTPair();
6363 AST nlsWarn_AST = null;
6364
6365 {
6366 boolean synPredMatched485 = false;
6367 if (((_tokenSet_15.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_18.member(LA(3))))) {
6368 int _m485 = mark();
6369 synPredMatched485 = true;
6370 inputState.guessing++;
6371 try {
6372 {
6373 match(NLS);
6374 }
6375 }
6376 catch (RecognitionException pe) {
6377 synPredMatched485 = false;
6378 }
6379 rewind(_m485);
6380 inputState.guessing--;
6381 }
6382 if ( synPredMatched485 ) {
6383 if ( inputState.guessing==0 ) {
6384 addWarning(
6385 "A newline at this point does not follow the Groovy Coding Conventions.",
6386 "Keep this statement on one line, or use curly braces to break across multiple lines."
6387 );
6388 }
6389 }
6390 else if ((_tokenSet_15.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_18.member(LA(3)))) {
6391 }
6392 else {
6393 throw new NoViableAltException(LT(1), getFilename());
6394 }
6395
6396 }
6397 nls();
6398 returnAST = nlsWarn_AST;
6399 }
6400
6401 /*** An open block is not allowed to have closure arguments. */
6402 public final void openBlock() throws RecognitionException, TokenStreamException {
6403
6404 returnAST = null;
6405 ASTPair currentAST = new ASTPair();
6406 AST openBlock_AST = null;
6407 Token lc = null;
6408 AST lc_AST = null;
6409
6410 lc = LT(1);
6411 lc_AST = astFactory.create(lc);
6412 astFactory.makeASTRoot(currentAST, lc_AST);
6413 match(LCURLY);
6414 nls();
6415 if ( inputState.guessing==0 ) {
6416 lc_AST.setType(SLIST);
6417 }
6418 blockBody(EOF);
6419 astFactory.addASTChild(currentAST, returnAST);
6420 match(RCURLY);
6421 openBlock_AST = (AST)currentAST.root;
6422 returnAST = openBlock_AST;
6423 }
6424
6425 public final void variableName() throws RecognitionException, TokenStreamException {
6426
6427 returnAST = null;
6428 ASTPair currentAST = new ASTPair();
6429 AST variableName_AST = null;
6430
6431 AST tmp155_AST = null;
6432 tmp155_AST = astFactory.create(LT(1));
6433 astFactory.addASTChild(currentAST, tmp155_AST);
6434 match(IDENT);
6435 variableName_AST = (AST)currentAST.root;
6436 returnAST = variableName_AST;
6437 }
6438
6439 public final void expression(
6440 int lc_stmt
6441 ) throws RecognitionException, TokenStreamException {
6442
6443 returnAST = null;
6444 ASTPair currentAST = new ASTPair();
6445 AST expression_AST = null;
6446
6447 assignmentExpression(lc_stmt);
6448 astFactory.addASTChild(currentAST, returnAST);
6449 expression_AST = (AST)currentAST.root;
6450 returnAST = expression_AST;
6451 }
6452
6453 /*** A formal parameter for a method or closure. */
6454 public final void parameterDeclaration() throws RecognitionException, TokenStreamException {
6455
6456 returnAST = null;
6457 ASTPair currentAST = new ASTPair();
6458 AST parameterDeclaration_AST = null;
6459 AST pm_AST = null;
6460 AST t_AST = null;
6461 Token id = null;
6462 AST id_AST = null;
6463 AST exp_AST = null;
6464 Token first = LT(1);boolean spreadParam = false;
6465
6466 parameterModifiersOpt();
6467 pm_AST = (AST)returnAST;
6468 {
6469 if ((_tokenSet_26.member(LA(1))) && (_tokenSet_79.member(LA(2))) && (_tokenSet_80.member(LA(3)))) {
6470 typeSpec(false);
6471 t_AST = (AST)returnAST;
6472 }
6473 else if ((LA(1)==IDENT||LA(1)==TRIPLE_DOT) && (_tokenSet_81.member(LA(2))) && (_tokenSet_82.member(LA(3)))) {
6474 }
6475 else {
6476 throw new NoViableAltException(LT(1), getFilename());
6477 }
6478
6479 }
6480 {
6481 switch ( LA(1)) {
6482 case TRIPLE_DOT:
6483 {
6484 match(TRIPLE_DOT);
6485 if ( inputState.guessing==0 ) {
6486 spreadParam = true;
6487 }
6488 break;
6489 }
6490 case IDENT:
6491 {
6492 break;
6493 }
6494 default:
6495 {
6496 throw new NoViableAltException(LT(1), getFilename());
6497 }
6498 }
6499 }
6500 id = LT(1);
6501 id_AST = astFactory.create(id);
6502 match(IDENT);
6503 {
6504 switch ( LA(1)) {
6505 case ASSIGN:
6506 {
6507 varInitializer();
6508 exp_AST = (AST)returnAST;
6509 break;
6510 }
6511 case COMMA:
6512 case RPAREN:
6513 case NLS:
6514 case CLOSABLE_BLOCK_OP:
6515 {
6516 break;
6517 }
6518 default:
6519 {
6520 throw new NoViableAltException(LT(1), getFilename());
6521 }
6522 }
6523 }
6524 if ( inputState.guessing==0 ) {
6525 parameterDeclaration_AST = (AST)currentAST.root;
6526
6527 if (spreadParam) {
6528 parameterDeclaration_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(VARIABLE_PARAMETER_DEF,"VARIABLE_PARAMETER_DEF",first,LT(1))).add(pm_AST).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t_AST))).add(id_AST).add(exp_AST));
6529 } else {
6530 parameterDeclaration_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(PARAMETER_DEF,"PARAMETER_DEF",first,LT(1))).add(pm_AST).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t_AST))).add(id_AST).add(exp_AST));
6531 }
6532
6533 currentAST.root = parameterDeclaration_AST;
6534 currentAST.child = parameterDeclaration_AST!=null &¶meterDeclaration_AST.getFirstChild()!=null ?
6535 parameterDeclaration_AST.getFirstChild() : parameterDeclaration_AST;
6536 currentAST.advanceChildToEnd();
6537 }
6538 returnAST = parameterDeclaration_AST;
6539 }
6540
6541 public final void parameterModifiersOpt() throws RecognitionException, TokenStreamException {
6542
6543 returnAST = null;
6544 ASTPair currentAST = new ASTPair();
6545 AST parameterModifiersOpt_AST = null;
6546 Token first = LT(1);int seenDef = 0;
6547
6548 {
6549 _loop224:
6550 do {
6551 switch ( LA(1)) {
6552 case FINAL:
6553 {
6554 AST tmp157_AST = null;
6555 tmp157_AST = astFactory.create(LT(1));
6556 astFactory.addASTChild(currentAST, tmp157_AST);
6557 match(FINAL);
6558 nls();
6559 break;
6560 }
6561 case AT:
6562 {
6563 annotation();
6564 astFactory.addASTChild(currentAST, returnAST);
6565 nls();
6566 break;
6567 }
6568 default:
6569 if (((LA(1)==LITERAL_def))&&(seenDef++ == 0)) {
6570 match(LITERAL_def);
6571 nls();
6572 }
6573 else {
6574 break _loop224;
6575 }
6576 }
6577 } while (true);
6578 }
6579 if ( inputState.guessing==0 ) {
6580 parameterModifiersOpt_AST = (AST)currentAST.root;
6581 parameterModifiersOpt_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(MODIFIERS,"MODIFIERS",first,LT(1))).add(parameterModifiersOpt_AST));
6582 currentAST.root = parameterModifiersOpt_AST;
6583 currentAST.child = parameterModifiersOpt_AST!=null &¶meterModifiersOpt_AST.getFirstChild()!=null ?
6584 parameterModifiersOpt_AST.getFirstChild() : parameterModifiersOpt_AST;
6585 currentAST.advanceChildToEnd();
6586 }
6587 parameterModifiersOpt_AST = (AST)currentAST.root;
6588 returnAST = parameterModifiersOpt_AST;
6589 }
6590
6591 /*** Closure parameters are exactly like method parameters,
6592 * except that they are not enclosed in parentheses, but rather
6593 * are prepended to the front of a block, just after the brace.
6594 * They are separated from the closure body by a CLOSABLE_BLOCK_OP token '->'.
6595 */
6596 public final void closableBlockParamsOpt(
6597 boolean addImplicit
6598 ) throws RecognitionException, TokenStreamException {
6599
6600 returnAST = null;
6601 ASTPair currentAST = new ASTPair();
6602 AST closableBlockParamsOpt_AST = null;
6603
6604 boolean synPredMatched227 = false;
6605 if (((_tokenSet_83.member(LA(1))) && (_tokenSet_84.member(LA(2))) && (_tokenSet_20.member(LA(3))))) {
6606 int _m227 = mark();
6607 synPredMatched227 = true;
6608 inputState.guessing++;
6609 try {
6610 {
6611 parameterDeclarationList();
6612 nls();
6613 match(CLOSABLE_BLOCK_OP);
6614 }
6615 }
6616 catch (RecognitionException pe) {
6617 synPredMatched227 = false;
6618 }
6619 rewind(_m227);
6620 inputState.guessing--;
6621 }
6622 if ( synPredMatched227 ) {
6623 parameterDeclarationList();
6624 astFactory.addASTChild(currentAST, returnAST);
6625 nls();
6626 match(CLOSABLE_BLOCK_OP);
6627 nls();
6628 closableBlockParamsOpt_AST = (AST)currentAST.root;
6629 }
6630 else if (((_tokenSet_33.member(LA(1))) && (_tokenSet_20.member(LA(2))) && (_tokenSet_5.member(LA(3))))&&(addImplicit)) {
6631 implicitParameters();
6632 astFactory.addASTChild(currentAST, returnAST);
6633 closableBlockParamsOpt_AST = (AST)currentAST.root;
6634 }
6635 else if ((_tokenSet_33.member(LA(1))) && (_tokenSet_20.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
6636 closableBlockParamsOpt_AST = (AST)currentAST.root;
6637 }
6638 else {
6639 throw new NoViableAltException(LT(1), getFilename());
6640 }
6641
6642 returnAST = closableBlockParamsOpt_AST;
6643 }
6644
6645 /*** A block known to be a closure, but which omits its arguments, is given this placeholder.
6646 * A subsequent pass is responsible for deciding if there is an implicit 'it' parameter,
6647 * or if the parameter list should be empty.
6648 */
6649 public final void implicitParameters() throws RecognitionException, TokenStreamException {
6650
6651 returnAST = null;
6652 ASTPair currentAST = new ASTPair();
6653 AST implicitParameters_AST = null;
6654 Token first = LT(1);
6655
6656 if ( inputState.guessing==0 ) {
6657 implicitParameters_AST = (AST)currentAST.root;
6658 implicitParameters_AST = (AST)astFactory.make( (new ASTArray(1)).add(create(IMPLICIT_PARAMETERS,"IMPLICIT_PARAMETERS",first,LT(1))));
6659 currentAST.root = implicitParameters_AST;
6660 currentAST.child = implicitParameters_AST!=null &&implicitParameters_AST.getFirstChild()!=null ?
6661 implicitParameters_AST.getFirstChild() : implicitParameters_AST;
6662 currentAST.advanceChildToEnd();
6663 }
6664 implicitParameters_AST = (AST)currentAST.root;
6665 returnAST = implicitParameters_AST;
6666 }
6667
6668 /*** Lookahead to check whether a block begins with explicit closure arguments. */
6669 public final void closableBlockParamsStart() throws RecognitionException, TokenStreamException {
6670
6671 returnAST = null;
6672 ASTPair currentAST = new ASTPair();
6673 AST closableBlockParamsStart_AST = null;
6674
6675 parameterDeclarationList();
6676 nls();
6677 AST tmp160_AST = null;
6678 tmp160_AST = astFactory.create(LT(1));
6679 match(CLOSABLE_BLOCK_OP);
6680 returnAST = closableBlockParamsStart_AST;
6681 }
6682
6683 /*** Simple names, as in {x|...}, are completely equivalent to {(def x)|...}. Build the right AST. */
6684 public final void closableBlockParam() throws RecognitionException, TokenStreamException {
6685
6686 returnAST = null;
6687 ASTPair currentAST = new ASTPair();
6688 AST closableBlockParam_AST = null;
6689 Token id = null;
6690 AST id_AST = null;
6691 Token first = LT(1);
6692
6693 id = LT(1);
6694 id_AST = astFactory.create(id);
6695 match(IDENT);
6696 if ( inputState.guessing==0 ) {
6697 closableBlockParam_AST = (AST)currentAST.root;
6698 closableBlockParam_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(PARAMETER_DEF,"PARAMETER_DEF",first,LT(1))).add((AST)astFactory.make( (new ASTArray(1)).add(create(MODIFIERS,"MODIFIERS",first,LT(1))))).add((AST)astFactory.make( (new ASTArray(1)).add(create(TYPE,"TYPE",first,LT(1))))).add(id_AST));
6699 currentAST.root = closableBlockParam_AST;
6700 currentAST.child = closableBlockParam_AST!=null &&closableBlockParam_AST.getFirstChild()!=null ?
6701 closableBlockParam_AST.getFirstChild() : closableBlockParam_AST;
6702 currentAST.advanceChildToEnd();
6703 }
6704 returnAST = closableBlockParam_AST;
6705 }
6706
6707 /*** A block which is known to be a closure, even if it has no apparent arguments.
6708 * A block inside an expression or after a method call is always assumed to be a closure.
6709 * Only labeled, unparameterized blocks which occur directly as substatements are kept open.
6710 */
6711 public final void closableBlock() throws RecognitionException, TokenStreamException {
6712
6713 returnAST = null;
6714 ASTPair currentAST = new ASTPair();
6715 AST closableBlock_AST = null;
6716 Token lc = null;
6717 AST lc_AST = null;
6718
6719 lc = LT(1);
6720 lc_AST = astFactory.create(lc);
6721 astFactory.makeASTRoot(currentAST, lc_AST);
6722 match(LCURLY);
6723 nls();
6724 if ( inputState.guessing==0 ) {
6725 lc_AST.setType(CLOSABLE_BLOCK);
6726 }
6727 closableBlockParamsOpt(true);
6728 astFactory.addASTChild(currentAST, returnAST);
6729 blockBody(EOF);
6730 astFactory.addASTChild(currentAST, returnAST);
6731 match(RCURLY);
6732 closableBlock_AST = (AST)currentAST.root;
6733 returnAST = closableBlock_AST;
6734 }
6735
6736 /*** A sub-block of a block can be either open or closable.
6737 * It is closable if and only if there are explicit closure arguments.
6738 * Compare this to a block which is appended to a method call,
6739 * which is given closure arguments, even if they are not explicit in the code.
6740 */
6741 public final void openOrClosableBlock() throws RecognitionException, TokenStreamException {
6742
6743 returnAST = null;
6744 ASTPair currentAST = new ASTPair();
6745 AST openOrClosableBlock_AST = null;
6746 Token lc = null;
6747 AST lc_AST = null;
6748 AST cp_AST = null;
6749
6750 lc = LT(1);
6751 lc_AST = astFactory.create(lc);
6752 astFactory.makeASTRoot(currentAST, lc_AST);
6753 match(LCURLY);
6754 nls();
6755 closableBlockParamsOpt(false);
6756 cp_AST = (AST)returnAST;
6757 astFactory.addASTChild(currentAST, returnAST);
6758 if ( inputState.guessing==0 ) {
6759 if (cp_AST == null) lc_AST.setType(SLIST);
6760 else lc_AST.setType(CLOSABLE_BLOCK);
6761
6762 }
6763 blockBody(EOF);
6764 astFactory.addASTChild(currentAST, returnAST);
6765 match(RCURLY);
6766 openOrClosableBlock_AST = (AST)currentAST.root;
6767 returnAST = openOrClosableBlock_AST;
6768 }
6769
6770 /*** A labeled statement, consisting of a vanilla identifier followed by a colon. */
6771 public final void statementLabelPrefix() throws RecognitionException, TokenStreamException {
6772
6773 returnAST = null;
6774 ASTPair currentAST = new ASTPair();
6775 AST statementLabelPrefix_AST = null;
6776 Token c = null;
6777 AST c_AST = null;
6778
6779 AST tmp163_AST = null;
6780 tmp163_AST = astFactory.create(LT(1));
6781 astFactory.addASTChild(currentAST, tmp163_AST);
6782 match(IDENT);
6783 c = LT(1);
6784 c_AST = astFactory.create(c);
6785 astFactory.makeASTRoot(currentAST, c_AST);
6786 match(COLON);
6787 if ( inputState.guessing==0 ) {
6788 c_AST.setType(LABELED_STAT);
6789 }
6790 nls();
6791 statementLabelPrefix_AST = (AST)currentAST.root;
6792 returnAST = statementLabelPrefix_AST;
6793 }
6794
6795 /*** An expression statement can be any general expression.
6796 * <p>
6797 * An expression statement can also be a <em>command</em>,
6798 * which is a simple method call in which the outermost parentheses are omitted.
6799 * <p>
6800 * Certain "suspicious" looking forms are flagged for the user to disambiguate.
6801 */
6802 public final void expressionStatement(
6803 int prevToken
6804 ) throws RecognitionException, TokenStreamException {
6805
6806 returnAST = null;
6807 ASTPair currentAST = new ASTPair();
6808 AST expressionStatement_AST = null;
6809 AST head_AST = null;
6810 AST cmd_AST = null;
6811 Token first = LT(1);boolean isPathExpr = false;
6812
6813 {
6814 boolean synPredMatched281 = false;
6815 if (((_tokenSet_19.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_20.member(LA(3))))) {
6816 int _m281 = mark();
6817 synPredMatched281 = true;
6818 inputState.guessing++;
6819 try {
6820 {
6821 suspiciousExpressionStatementStart();
6822 }
6823 }
6824 catch (RecognitionException pe) {
6825 synPredMatched281 = false;
6826 }
6827 rewind(_m281);
6828 inputState.guessing--;
6829 }
6830 if ( synPredMatched281 ) {
6831 checkSuspiciousExpressionStatement(prevToken);
6832 astFactory.addASTChild(currentAST, returnAST);
6833 }
6834 else if ((_tokenSet_19.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
6835 }
6836 else {
6837 throw new NoViableAltException(LT(1), getFilename());
6838 }
6839
6840 }
6841 expression(LC_STMT);
6842 head_AST = (AST)returnAST;
6843 astFactory.addASTChild(currentAST, returnAST);
6844 if ( inputState.guessing==0 ) {
6845 isPathExpr = (head_AST == lastPathExpression);
6846 }
6847 {
6848 if (((_tokenSet_19.member(LA(1))))&&(isPathExpr)) {
6849 commandArguments(head_AST);
6850 cmd_AST = (AST)returnAST;
6851 if ( inputState.guessing==0 ) {
6852 expressionStatement_AST = (AST)currentAST.root;
6853 expressionStatement_AST = cmd_AST;
6854 currentAST.root = expressionStatement_AST;
6855 currentAST.child = expressionStatement_AST!=null &&expressionStatement_AST.getFirstChild()!=null ?
6856 expressionStatement_AST.getFirstChild() : expressionStatement_AST;
6857 currentAST.advanceChildToEnd();
6858 }
6859 }
6860 else if ((_tokenSet_9.member(LA(1)))) {
6861 }
6862 else {
6863 throw new NoViableAltException(LT(1), getFilename());
6864 }
6865
6866 }
6867 if ( inputState.guessing==0 ) {
6868 expressionStatement_AST = (AST)currentAST.root;
6869 expressionStatement_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXPR,"EXPR",first,LT(1))).add(expressionStatement_AST));
6870 currentAST.root = expressionStatement_AST;
6871 currentAST.child = expressionStatement_AST!=null &&expressionStatement_AST.getFirstChild()!=null ?
6872 expressionStatement_AST.getFirstChild() : expressionStatement_AST;
6873 currentAST.advanceChildToEnd();
6874 }
6875 expressionStatement_AST = (AST)currentAST.root;
6876 returnAST = expressionStatement_AST;
6877 }
6878
6879 public final void assignmentLessExpression() throws RecognitionException, TokenStreamException {
6880
6881 returnAST = null;
6882 ASTPair currentAST = new ASTPair();
6883 AST assignmentLessExpression_AST = null;
6884 Token first = LT(1);
6885
6886 {
6887 conditionalExpression(0);
6888 astFactory.addASTChild(currentAST, returnAST);
6889 }
6890 if ( inputState.guessing==0 ) {
6891 assignmentLessExpression_AST = (AST)currentAST.root;
6892 assignmentLessExpression_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXPR,"EXPR",first,LT(1))).add(assignmentLessExpression_AST));
6893 currentAST.root = assignmentLessExpression_AST;
6894 currentAST.child = assignmentLessExpression_AST!=null &&assignmentLessExpression_AST.getFirstChild()!=null ?
6895 assignmentLessExpression_AST.getFirstChild() : assignmentLessExpression_AST;
6896 currentAST.advanceChildToEnd();
6897 }
6898 assignmentLessExpression_AST = (AST)currentAST.root;
6899 returnAST = assignmentLessExpression_AST;
6900 }
6901
6902 /*** In Java, "if", "while", and "for" statements can take random, non-braced statements as their bodies.
6903 * Support this practice, even though it isn't very Groovy.
6904 */
6905 public final void compatibleBodyStatement() throws RecognitionException, TokenStreamException {
6906
6907 returnAST = null;
6908 ASTPair currentAST = new ASTPair();
6909 AST compatibleBodyStatement_AST = null;
6910
6911 boolean synPredMatched267 = false;
6912 if (((LA(1)==LCURLY) && (_tokenSet_33.member(LA(2))) && (_tokenSet_8.member(LA(3))))) {
6913 int _m267 = mark();
6914 synPredMatched267 = true;
6915 inputState.guessing++;
6916 try {
6917 {
6918 match(LCURLY);
6919 }
6920 }
6921 catch (RecognitionException pe) {
6922 synPredMatched267 = false;
6923 }
6924 rewind(_m267);
6925 inputState.guessing--;
6926 }
6927 if ( synPredMatched267 ) {
6928 compoundStatement();
6929 astFactory.addASTChild(currentAST, returnAST);
6930 compatibleBodyStatement_AST = (AST)currentAST.root;
6931 }
6932 else if ((_tokenSet_17.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_18.member(LA(3)))) {
6933 statement(EOF);
6934 astFactory.addASTChild(currentAST, returnAST);
6935 compatibleBodyStatement_AST = (AST)currentAST.root;
6936 }
6937 else {
6938 throw new NoViableAltException(LT(1), getFilename());
6939 }
6940
6941 returnAST = compatibleBodyStatement_AST;
6942 }
6943
6944 public final void forStatement() throws RecognitionException, TokenStreamException {
6945
6946 returnAST = null;
6947 ASTPair currentAST = new ASTPair();
6948 AST forStatement_AST = null;
6949 Token f = null;
6950 AST f_AST = null;
6951
6952 f = LT(1);
6953 f_AST = astFactory.create(f);
6954 astFactory.makeASTRoot(currentAST, f_AST);
6955 match(LITERAL_for);
6956 match(LPAREN);
6957 {
6958 boolean synPredMatched258 = false;
6959 if (((_tokenSet_85.member(LA(1))) && (_tokenSet_75.member(LA(2))) && (_tokenSet_86.member(LA(3))))) {
6960 int _m258 = mark();
6961 synPredMatched258 = true;
6962 inputState.guessing++;
6963 try {
6964 {
6965 forInit();
6966 match(SEMI);
6967 }
6968 }
6969 catch (RecognitionException pe) {
6970 synPredMatched258 = false;
6971 }
6972 rewind(_m258);
6973 inputState.guessing--;
6974 }
6975 if ( synPredMatched258 ) {
6976 traditionalForClause();
6977 astFactory.addASTChild(currentAST, returnAST);
6978 }
6979 else if ((_tokenSet_12.member(LA(1))) && (_tokenSet_87.member(LA(2))) && (_tokenSet_88.member(LA(3)))) {
6980 forInClause();
6981 astFactory.addASTChild(currentAST, returnAST);
6982 }
6983 else {
6984 throw new NoViableAltException(LT(1), getFilename());
6985 }
6986
6987 }
6988 match(RPAREN);
6989 nlsWarn();
6990 compatibleBodyStatement();
6991 astFactory.addASTChild(currentAST, returnAST);
6992 forStatement_AST = (AST)currentAST.root;
6993 returnAST = forStatement_AST;
6994 }
6995
6996 /*** Things that can show up as expressions, but only in strict
6997 * contexts like inside parentheses, argument lists, and list constructors.
6998 */
6999 public final void strictContextExpression() throws RecognitionException, TokenStreamException {
7000
7001 returnAST = null;
7002 ASTPair currentAST = new ASTPair();
7003 AST strictContextExpression_AST = null;
7004 Token first = LT(1);
7005
7006 {
7007 boolean synPredMatched428 = false;
7008 if (((_tokenSet_12.member(LA(1))) && (_tokenSet_89.member(LA(2))) && (_tokenSet_90.member(LA(3))))) {
7009 int _m428 = mark();
7010 synPredMatched428 = true;
7011 inputState.guessing++;
7012 try {
7013 {
7014 declarationStart();
7015 }
7016 }
7017 catch (RecognitionException pe) {
7018 synPredMatched428 = false;
7019 }
7020 rewind(_m428);
7021 inputState.guessing--;
7022 }
7023 if ( synPredMatched428 ) {
7024 singleDeclaration();
7025 astFactory.addASTChild(currentAST, returnAST);
7026 }
7027 else if ((_tokenSet_19.member(LA(1))) && (_tokenSet_68.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
7028 expression(0);
7029 astFactory.addASTChild(currentAST, returnAST);
7030 }
7031 else if (((LA(1) >= LITERAL_return && LA(1) <= LITERAL_assert))) {
7032 branchStatement();
7033 astFactory.addASTChild(currentAST, returnAST);
7034 }
7035 else if ((LA(1)==AT) && (LA(2)==IDENT) && (_tokenSet_91.member(LA(3)))) {
7036 annotation();
7037 astFactory.addASTChild(currentAST, returnAST);
7038 }
7039 else {
7040 throw new NoViableAltException(LT(1), getFilename());
7041 }
7042
7043 }
7044 if ( inputState.guessing==0 ) {
7045 strictContextExpression_AST = (AST)currentAST.root;
7046 strictContextExpression_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXPR,"EXPR",first,LT(1))).add(strictContextExpression_AST));
7047 currentAST.root = strictContextExpression_AST;
7048 currentAST.child = strictContextExpression_AST!=null &&strictContextExpression_AST.getFirstChild()!=null ?
7049 strictContextExpression_AST.getFirstChild() : strictContextExpression_AST;
7050 currentAST.advanceChildToEnd();
7051 }
7052 strictContextExpression_AST = (AST)currentAST.root;
7053 returnAST = strictContextExpression_AST;
7054 }
7055
7056 public final void casesGroup() throws RecognitionException, TokenStreamException {
7057
7058 returnAST = null;
7059 ASTPair currentAST = new ASTPair();
7060 AST casesGroup_AST = null;
7061 Token first = LT(1);
7062
7063 {
7064 int _cnt293=0;
7065 _loop293:
7066 do {
7067 if ((LA(1)==LITERAL_default||LA(1)==LITERAL_case)) {
7068 aCase();
7069 astFactory.addASTChild(currentAST, returnAST);
7070 }
7071 else {
7072 if ( _cnt293>=1 ) { break _loop293; } else {throw new NoViableAltException(LT(1), getFilename());}
7073 }
7074
7075 _cnt293++;
7076 } while (true);
7077 }
7078 caseSList();
7079 astFactory.addASTChild(currentAST, returnAST);
7080 if ( inputState.guessing==0 ) {
7081 casesGroup_AST = (AST)currentAST.root;
7082 casesGroup_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(CASE_GROUP,"CASE_GROUP",first,LT(1))).add(casesGroup_AST));
7083 currentAST.root = casesGroup_AST;
7084 currentAST.child = casesGroup_AST!=null &&casesGroup_AST.getFirstChild()!=null ?
7085 casesGroup_AST.getFirstChild() : casesGroup_AST;
7086 currentAST.advanceChildToEnd();
7087 }
7088 casesGroup_AST = (AST)currentAST.root;
7089 returnAST = casesGroup_AST;
7090 }
7091
7092 public final void tryBlock() throws RecognitionException, TokenStreamException {
7093
7094 returnAST = null;
7095 ASTPair currentAST = new ASTPair();
7096 AST tryBlock_AST = null;
7097
7098 AST tmp166_AST = null;
7099 tmp166_AST = astFactory.create(LT(1));
7100 astFactory.makeASTRoot(currentAST, tmp166_AST);
7101 match(LITERAL_try);
7102 nlsWarn();
7103 compoundStatement();
7104 astFactory.addASTChild(currentAST, returnAST);
7105 {
7106 _loop310:
7107 do {
7108 if ((LA(1)==NLS||LA(1)==LITERAL_catch) && (LA(2)==LPAREN||LA(2)==LITERAL_catch) && (_tokenSet_92.member(LA(3)))) {
7109 nls();
7110 handler();
7111 astFactory.addASTChild(currentAST, returnAST);
7112 }
7113 else {
7114 break _loop310;
7115 }
7116
7117 } while (true);
7118 }
7119 {
7120 if ((LA(1)==NLS||LA(1)==LITERAL_finally) && (_tokenSet_93.member(LA(2))) && (_tokenSet_33.member(LA(3)))) {
7121 nls();
7122 finallyClause();
7123 astFactory.addASTChild(currentAST, returnAST);
7124 }
7125 else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
7126 }
7127 else {
7128 throw new NoViableAltException(LT(1), getFilename());
7129 }
7130
7131 }
7132 tryBlock_AST = (AST)currentAST.root;
7133 returnAST = tryBlock_AST;
7134 }
7135
7136 /*** In Groovy, return, break, continue, throw, and assert can be used in a parenthesized expression context.
7137 * Example: println (x || (return)); println assert x, "won't print a false value!"
7138 * If an optional expression is missing, its value is void (this coerces to null when a value is required).
7139 */
7140 public final void branchStatement() throws RecognitionException, TokenStreamException {
7141
7142 returnAST = null;
7143 ASTPair currentAST = new ASTPair();
7144 AST branchStatement_AST = null;
7145
7146 switch ( LA(1)) {
7147 case LITERAL_return:
7148 {
7149 AST tmp167_AST = null;
7150 tmp167_AST = astFactory.create(LT(1));
7151 astFactory.makeASTRoot(currentAST, tmp167_AST);
7152 match(LITERAL_return);
7153 {
7154 switch ( LA(1)) {
7155 case IDENT:
7156 case LBRACK:
7157 case LPAREN:
7158 case LITERAL_super:
7159 case LITERAL_void:
7160 case LITERAL_boolean:
7161 case LITERAL_byte:
7162 case LITERAL_char:
7163 case LITERAL_short:
7164 case LITERAL_int:
7165 case LITERAL_float:
7166 case LITERAL_long:
7167 case LITERAL_double:
7168 case LITERAL_any:
7169 case LCURLY:
7170 case LITERAL_this:
7171 case STRING_LITERAL:
7172 case PLUS:
7173 case MINUS:
7174 case INC:
7175 case DEC:
7176 case BNOT:
7177 case LNOT:
7178 case DOLLAR:
7179 case STRING_CTOR_START:
7180 case LITERAL_new:
7181 case LITERAL_true:
7182 case LITERAL_false:
7183 case LITERAL_null:
7184 case NUM_INT:
7185 case NUM_FLOAT:
7186 case NUM_LONG:
7187 case NUM_DOUBLE:
7188 case NUM_BIG_INT:
7189 case NUM_BIG_DECIMAL:
7190 {
7191 expression(0);
7192 astFactory.addASTChild(currentAST, returnAST);
7193 break;
7194 }
7195 case EOF:
7196 case RBRACK:
7197 case COMMA:
7198 case RPAREN:
7199 case RCURLY:
7200 case SEMI:
7201 case NLS:
7202 case LITERAL_default:
7203 case LITERAL_else:
7204 case LITERAL_case:
7205 {
7206 break;
7207 }
7208 default:
7209 {
7210 throw new NoViableAltException(LT(1), getFilename());
7211 }
7212 }
7213 }
7214 branchStatement_AST = (AST)currentAST.root;
7215 break;
7216 }
7217 case LITERAL_break:
7218 case LITERAL_continue:
7219 {
7220 {
7221 switch ( LA(1)) {
7222 case LITERAL_break:
7223 {
7224 AST tmp168_AST = null;
7225 tmp168_AST = astFactory.create(LT(1));
7226 astFactory.makeASTRoot(currentAST, tmp168_AST);
7227 match(LITERAL_break);
7228 break;
7229 }
7230 case LITERAL_continue:
7231 {
7232 AST tmp169_AST = null;
7233 tmp169_AST = astFactory.create(LT(1));
7234 astFactory.makeASTRoot(currentAST, tmp169_AST);
7235 match(LITERAL_continue);
7236 break;
7237 }
7238 default:
7239 {
7240 throw new NoViableAltException(LT(1), getFilename());
7241 }
7242 }
7243 }
7244 {
7245 boolean synPredMatched273 = false;
7246 if (((LA(1)==IDENT) && (LA(2)==COLON) && (_tokenSet_94.member(LA(3))))) {
7247 int _m273 = mark();
7248 synPredMatched273 = true;
7249 inputState.guessing++;
7250 try {
7251 {
7252 match(IDENT);
7253 match(COLON);
7254 }
7255 }
7256 catch (RecognitionException pe) {
7257 synPredMatched273 = false;
7258 }
7259 rewind(_m273);
7260 inputState.guessing--;
7261 }
7262 if ( synPredMatched273 ) {
7263 statementLabelPrefix();
7264 astFactory.addASTChild(currentAST, returnAST);
7265 }
7266 else if ((_tokenSet_94.member(LA(1))) && (_tokenSet_20.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
7267 }
7268 else {
7269 throw new NoViableAltException(LT(1), getFilename());
7270 }
7271
7272 }
7273 {
7274 switch ( LA(1)) {
7275 case IDENT:
7276 case LBRACK:
7277 case LPAREN:
7278 case LITERAL_super:
7279 case LITERAL_void:
7280 case LITERAL_boolean:
7281 case LITERAL_byte:
7282 case LITERAL_char:
7283 case LITERAL_short:
7284 case LITERAL_int:
7285 case LITERAL_float:
7286 case LITERAL_long:
7287 case LITERAL_double:
7288 case LITERAL_any:
7289 case LCURLY:
7290 case LITERAL_this:
7291 case STRING_LITERAL:
7292 case PLUS:
7293 case MINUS:
7294 case INC:
7295 case DEC:
7296 case BNOT:
7297 case LNOT:
7298 case DOLLAR:
7299 case STRING_CTOR_START:
7300 case LITERAL_new:
7301 case LITERAL_true:
7302 case LITERAL_false:
7303 case LITERAL_null:
7304 case NUM_INT:
7305 case NUM_FLOAT:
7306 case NUM_LONG:
7307 case NUM_DOUBLE:
7308 case NUM_BIG_INT:
7309 case NUM_BIG_DECIMAL:
7310 {
7311 expression(0);
7312 astFactory.addASTChild(currentAST, returnAST);
7313 break;
7314 }
7315 case EOF:
7316 case RBRACK:
7317 case COMMA:
7318 case RPAREN:
7319 case RCURLY:
7320 case SEMI:
7321 case NLS:
7322 case LITERAL_default:
7323 case LITERAL_else:
7324 case LITERAL_case:
7325 {
7326 break;
7327 }
7328 default:
7329 {
7330 throw new NoViableAltException(LT(1), getFilename());
7331 }
7332 }
7333 }
7334 branchStatement_AST = (AST)currentAST.root;
7335 break;
7336 }
7337 case LITERAL_throw:
7338 {
7339 AST tmp170_AST = null;
7340 tmp170_AST = astFactory.create(LT(1));
7341 astFactory.makeASTRoot(currentAST, tmp170_AST);
7342 match(LITERAL_throw);
7343 expression(0);
7344 astFactory.addASTChild(currentAST, returnAST);
7345 branchStatement_AST = (AST)currentAST.root;
7346 break;
7347 }
7348 case LITERAL_assert:
7349 {
7350 AST tmp171_AST = null;
7351 tmp171_AST = astFactory.create(LT(1));
7352 astFactory.makeASTRoot(currentAST, tmp171_AST);
7353 match(LITERAL_assert);
7354 assignmentLessExpression();
7355 astFactory.addASTChild(currentAST, returnAST);
7356 {
7357 if ((LA(1)==COMMA||LA(1)==COLON) && (_tokenSet_19.member(LA(2))) && (_tokenSet_95.member(LA(3)))) {
7358 {
7359 switch ( LA(1)) {
7360 case COMMA:
7361 {
7362 match(COMMA);
7363 break;
7364 }
7365 case COLON:
7366 {
7367 match(COLON);
7368 break;
7369 }
7370 default:
7371 {
7372 throw new NoViableAltException(LT(1), getFilename());
7373 }
7374 }
7375 }
7376 expression(0);
7377 astFactory.addASTChild(currentAST, returnAST);
7378 }
7379 else if ((_tokenSet_96.member(LA(1))) && (_tokenSet_97.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
7380 }
7381 else {
7382 throw new NoViableAltException(LT(1), getFilename());
7383 }
7384
7385 }
7386 branchStatement_AST = (AST)currentAST.root;
7387 break;
7388 }
7389 default:
7390 {
7391 throw new NoViableAltException(LT(1), getFilename());
7392 }
7393 }
7394 returnAST = branchStatement_AST;
7395 }
7396
7397 public final void forInit() throws RecognitionException, TokenStreamException {
7398
7399 returnAST = null;
7400 ASTPair currentAST = new ASTPair();
7401 AST forInit_AST = null;
7402 Token first = LT(1);
7403
7404 boolean synPredMatched302 = false;
7405 if (((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2))) && (_tokenSet_98.member(LA(3))))) {
7406 int _m302 = mark();
7407 synPredMatched302 = true;
7408 inputState.guessing++;
7409 try {
7410 {
7411 declarationStart();
7412 }
7413 }
7414 catch (RecognitionException pe) {
7415 synPredMatched302 = false;
7416 }
7417 rewind(_m302);
7418 inputState.guessing--;
7419 }
7420 if ( synPredMatched302 ) {
7421 declaration();
7422 astFactory.addASTChild(currentAST, returnAST);
7423 forInit_AST = (AST)currentAST.root;
7424 }
7425 else if ((_tokenSet_85.member(LA(1))) && (_tokenSet_75.member(LA(2))) && (_tokenSet_86.member(LA(3)))) {
7426 {
7427 switch ( LA(1)) {
7428 case FINAL:
7429 case ABSTRACT:
7430 case STRICTFP:
7431 case LITERAL_static:
7432 case LITERAL_def:
7433 case AT:
7434 case IDENT:
7435 case LBRACK:
7436 case LPAREN:
7437 case LITERAL_super:
7438 case LITERAL_void:
7439 case LITERAL_boolean:
7440 case LITERAL_byte:
7441 case LITERAL_char:
7442 case LITERAL_short:
7443 case LITERAL_int:
7444 case LITERAL_float:
7445 case LITERAL_long:
7446 case LITERAL_double:
7447 case LITERAL_any:
7448 case LITERAL_private:
7449 case LITERAL_public:
7450 case LITERAL_protected:
7451 case LITERAL_transient:
7452 case LITERAL_native:
7453 case LITERAL_threadsafe:
7454 case LITERAL_synchronized:
7455 case LITERAL_volatile:
7456 case LCURLY:
7457 case LITERAL_this:
7458 case STRING_LITERAL:
7459 case LITERAL_return:
7460 case LITERAL_break:
7461 case LITERAL_continue:
7462 case LITERAL_throw:
7463 case LITERAL_assert:
7464 case PLUS:
7465 case MINUS:
7466 case INC:
7467 case DEC:
7468 case BNOT:
7469 case LNOT:
7470 case DOLLAR:
7471 case STRING_CTOR_START:
7472 case LITERAL_new:
7473 case LITERAL_true:
7474 case LITERAL_false:
7475 case LITERAL_null:
7476 case NUM_INT:
7477 case NUM_FLOAT:
7478 case NUM_LONG:
7479 case NUM_DOUBLE:
7480 case NUM_BIG_INT:
7481 case NUM_BIG_DECIMAL:
7482 {
7483 controlExpressionList();
7484 astFactory.addASTChild(currentAST, returnAST);
7485 break;
7486 }
7487 case SEMI:
7488 {
7489 break;
7490 }
7491 default:
7492 {
7493 throw new NoViableAltException(LT(1), getFilename());
7494 }
7495 }
7496 }
7497 if ( inputState.guessing==0 ) {
7498 forInit_AST = (AST)currentAST.root;
7499 forInit_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(FOR_INIT,"FOR_INIT",first,LT(1))).add(forInit_AST));
7500 currentAST.root = forInit_AST;
7501 currentAST.child = forInit_AST!=null &&forInit_AST.getFirstChild()!=null ?
7502 forInit_AST.getFirstChild() : forInit_AST;
7503 currentAST.advanceChildToEnd();
7504 }
7505 forInit_AST = (AST)currentAST.root;
7506 }
7507 else {
7508 throw new NoViableAltException(LT(1), getFilename());
7509 }
7510
7511 returnAST = forInit_AST;
7512 }
7513
7514 public final void traditionalForClause() throws RecognitionException, TokenStreamException {
7515
7516 returnAST = null;
7517 ASTPair currentAST = new ASTPair();
7518 AST traditionalForClause_AST = null;
7519
7520 forInit();
7521 astFactory.addASTChild(currentAST, returnAST);
7522 match(SEMI);
7523 forCond();
7524 astFactory.addASTChild(currentAST, returnAST);
7525 match(SEMI);
7526 forIter();
7527 astFactory.addASTChild(currentAST, returnAST);
7528 traditionalForClause_AST = (AST)currentAST.root;
7529 returnAST = traditionalForClause_AST;
7530 }
7531
7532 public final void forInClause() throws RecognitionException, TokenStreamException {
7533
7534 returnAST = null;
7535 ASTPair currentAST = new ASTPair();
7536 AST forInClause_AST = null;
7537 AST decl_AST = null;
7538 Token i = null;
7539 AST i_AST = null;
7540 Token c = null;
7541 AST c_AST = null;
7542
7543 {
7544 boolean synPredMatched263 = false;
7545 if (((_tokenSet_12.member(LA(1))) && (_tokenSet_89.member(LA(2))))) {
7546 int _m263 = mark();
7547 synPredMatched263 = true;
7548 inputState.guessing++;
7549 try {
7550 {
7551 declarationStart();
7552 }
7553 }
7554 catch (RecognitionException pe) {
7555 synPredMatched263 = false;
7556 }
7557 rewind(_m263);
7558 inputState.guessing--;
7559 }
7560 if ( synPredMatched263 ) {
7561 singleDeclarationNoInit();
7562 decl_AST = (AST)returnAST;
7563 astFactory.addASTChild(currentAST, returnAST);
7564 }
7565 else if ((LA(1)==IDENT) && (LA(2)==COLON||LA(2)==LITERAL_in)) {
7566 AST tmp176_AST = null;
7567 tmp176_AST = astFactory.create(LT(1));
7568 astFactory.addASTChild(currentAST, tmp176_AST);
7569 match(IDENT);
7570 }
7571 else {
7572 throw new NoViableAltException(LT(1), getFilename());
7573 }
7574
7575 }
7576 {
7577 switch ( LA(1)) {
7578 case LITERAL_in:
7579 {
7580 i = LT(1);
7581 i_AST = astFactory.create(i);
7582 astFactory.makeASTRoot(currentAST, i_AST);
7583 match(LITERAL_in);
7584 if ( inputState.guessing==0 ) {
7585 i_AST.setType(FOR_IN_ITERABLE);
7586 }
7587 shiftExpression(0);
7588 astFactory.addASTChild(currentAST, returnAST);
7589 break;
7590 }
7591 case COLON:
7592 {
7593 if ( inputState.guessing==0 ) {
7594 addWarning(
7595 "A colon at this point is legal Java but not recommended in Groovy.",
7596 "Use the 'in' keyword."
7597 );
7598 require(decl_AST != null,
7599 "Java-style for-each statement requires a type declaration."
7600 ,
7601 "Use the 'in' keyword, as for (x in y) {...}"
7602 );
7603
7604 }
7605 c = LT(1);
7606 c_AST = astFactory.create(c);
7607 astFactory.makeASTRoot(currentAST, c_AST);
7608 match(COLON);
7609 if ( inputState.guessing==0 ) {
7610 c_AST.setType(FOR_IN_ITERABLE);
7611 }
7612 expression(0);
7613 astFactory.addASTChild(currentAST, returnAST);
7614 break;
7615 }
7616 default:
7617 {
7618 throw new NoViableAltException(LT(1), getFilename());
7619 }
7620 }
7621 }
7622 forInClause_AST = (AST)currentAST.root;
7623 returnAST = forInClause_AST;
7624 }
7625
7626 public final void forCond() throws RecognitionException, TokenStreamException {
7627
7628 returnAST = null;
7629 ASTPair currentAST = new ASTPair();
7630 AST forCond_AST = null;
7631 Token first = LT(1);
7632
7633 {
7634 switch ( LA(1)) {
7635 case FINAL:
7636 case ABSTRACT:
7637 case STRICTFP:
7638 case LITERAL_static:
7639 case LITERAL_def:
7640 case AT:
7641 case IDENT:
7642 case LBRACK:
7643 case LPAREN:
7644 case LITERAL_super:
7645 case LITERAL_void:
7646 case LITERAL_boolean:
7647 case LITERAL_byte:
7648 case LITERAL_char:
7649 case LITERAL_short:
7650 case LITERAL_int:
7651 case LITERAL_float:
7652 case LITERAL_long:
7653 case LITERAL_double:
7654 case LITERAL_any:
7655 case LITERAL_private:
7656 case LITERAL_public:
7657 case LITERAL_protected:
7658 case LITERAL_transient:
7659 case LITERAL_native:
7660 case LITERAL_threadsafe:
7661 case LITERAL_synchronized:
7662 case LITERAL_volatile:
7663 case LCURLY:
7664 case LITERAL_this:
7665 case STRING_LITERAL:
7666 case LITERAL_return:
7667 case LITERAL_break:
7668 case LITERAL_continue:
7669 case LITERAL_throw:
7670 case LITERAL_assert:
7671 case PLUS:
7672 case MINUS:
7673 case INC:
7674 case DEC:
7675 case BNOT:
7676 case LNOT:
7677 case DOLLAR:
7678 case STRING_CTOR_START:
7679 case LITERAL_new:
7680 case LITERAL_true:
7681 case LITERAL_false:
7682 case LITERAL_null:
7683 case NUM_INT:
7684 case NUM_FLOAT:
7685 case NUM_LONG:
7686 case NUM_DOUBLE:
7687 case NUM_BIG_INT:
7688 case NUM_BIG_DECIMAL:
7689 {
7690 strictContextExpression();
7691 astFactory.addASTChild(currentAST, returnAST);
7692 break;
7693 }
7694 case SEMI:
7695 {
7696 break;
7697 }
7698 default:
7699 {
7700 throw new NoViableAltException(LT(1), getFilename());
7701 }
7702 }
7703 }
7704 if ( inputState.guessing==0 ) {
7705 forCond_AST = (AST)currentAST.root;
7706 forCond_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(FOR_CONDITION,"FOR_CONDITION",first,LT(1))).add(forCond_AST));
7707 currentAST.root = forCond_AST;
7708 currentAST.child = forCond_AST!=null &&forCond_AST.getFirstChild()!=null ?
7709 forCond_AST.getFirstChild() : forCond_AST;
7710 currentAST.advanceChildToEnd();
7711 }
7712 forCond_AST = (AST)currentAST.root;
7713 returnAST = forCond_AST;
7714 }
7715
7716 public final void forIter() throws RecognitionException, TokenStreamException {
7717
7718 returnAST = null;
7719 ASTPair currentAST = new ASTPair();
7720 AST forIter_AST = null;
7721 Token first = LT(1);
7722
7723 {
7724 switch ( LA(1)) {
7725 case FINAL:
7726 case ABSTRACT:
7727 case STRICTFP:
7728 case LITERAL_static:
7729 case LITERAL_def:
7730 case AT:
7731 case IDENT:
7732 case LBRACK:
7733 case LPAREN:
7734 case LITERAL_super:
7735 case LITERAL_void:
7736 case LITERAL_boolean:
7737 case LITERAL_byte:
7738 case LITERAL_char:
7739 case LITERAL_short:
7740 case LITERAL_int:
7741 case LITERAL_float:
7742 case LITERAL_long:
7743 case LITERAL_double:
7744 case LITERAL_any:
7745 case LITERAL_private:
7746 case LITERAL_public:
7747 case LITERAL_protected:
7748 case LITERAL_transient:
7749 case LITERAL_native:
7750 case LITERAL_threadsafe:
7751 case LITERAL_synchronized:
7752 case LITERAL_volatile:
7753 case LCURLY:
7754 case LITERAL_this:
7755 case STRING_LITERAL:
7756 case LITERAL_return:
7757 case LITERAL_break:
7758 case LITERAL_continue:
7759 case LITERAL_throw:
7760 case LITERAL_assert:
7761 case PLUS:
7762 case MINUS:
7763 case INC:
7764 case DEC:
7765 case BNOT:
7766 case LNOT:
7767 case DOLLAR:
7768 case STRING_CTOR_START:
7769 case LITERAL_new:
7770 case LITERAL_true:
7771 case LITERAL_false:
7772 case LITERAL_null:
7773 case NUM_INT:
7774 case NUM_FLOAT:
7775 case NUM_LONG:
7776 case NUM_DOUBLE:
7777 case NUM_BIG_INT:
7778 case NUM_BIG_DECIMAL:
7779 {
7780 controlExpressionList();
7781 astFactory.addASTChild(currentAST, returnAST);
7782 break;
7783 }
7784 case RPAREN:
7785 {
7786 break;
7787 }
7788 default:
7789 {
7790 throw new NoViableAltException(LT(1), getFilename());
7791 }
7792 }
7793 }
7794 if ( inputState.guessing==0 ) {
7795 forIter_AST = (AST)currentAST.root;
7796 forIter_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(FOR_ITERATOR,"FOR_ITERATOR",first,LT(1))).add(forIter_AST));
7797 currentAST.root = forIter_AST;
7798 currentAST.child = forIter_AST!=null &&forIter_AST.getFirstChild()!=null ?
7799 forIter_AST.getFirstChild() : forIter_AST;
7800 currentAST.advanceChildToEnd();
7801 }
7802 forIter_AST = (AST)currentAST.root;
7803 returnAST = forIter_AST;
7804 }
7805
7806 public final void shiftExpression(
7807 int lc_stmt
7808 ) throws RecognitionException, TokenStreamException {
7809
7810 returnAST = null;
7811 ASTPair currentAST = new ASTPair();
7812 AST shiftExpression_AST = null;
7813
7814 additiveExpression(lc_stmt);
7815 astFactory.addASTChild(currentAST, returnAST);
7816 {
7817 _loop380:
7818 do {
7819 if ((_tokenSet_99.member(LA(1)))) {
7820 {
7821 switch ( LA(1)) {
7822 case SR:
7823 case BSR:
7824 case SL:
7825 {
7826 {
7827 switch ( LA(1)) {
7828 case SL:
7829 {
7830 AST tmp177_AST = null;
7831 tmp177_AST = astFactory.create(LT(1));
7832 astFactory.makeASTRoot(currentAST, tmp177_AST);
7833 match(SL);
7834 break;
7835 }
7836 case SR:
7837 {
7838 AST tmp178_AST = null;
7839 tmp178_AST = astFactory.create(LT(1));
7840 astFactory.makeASTRoot(currentAST, tmp178_AST);
7841 match(SR);
7842 break;
7843 }
7844 case BSR:
7845 {
7846 AST tmp179_AST = null;
7847 tmp179_AST = astFactory.create(LT(1));
7848 astFactory.makeASTRoot(currentAST, tmp179_AST);
7849 match(BSR);
7850 break;
7851 }
7852 default:
7853 {
7854 throw new NoViableAltException(LT(1), getFilename());
7855 }
7856 }
7857 }
7858 break;
7859 }
7860 case RANGE_INCLUSIVE:
7861 {
7862 AST tmp180_AST = null;
7863 tmp180_AST = astFactory.create(LT(1));
7864 astFactory.makeASTRoot(currentAST, tmp180_AST);
7865 match(RANGE_INCLUSIVE);
7866 break;
7867 }
7868 case RANGE_EXCLUSIVE:
7869 {
7870 AST tmp181_AST = null;
7871 tmp181_AST = astFactory.create(LT(1));
7872 astFactory.makeASTRoot(currentAST, tmp181_AST);
7873 match(RANGE_EXCLUSIVE);
7874 break;
7875 }
7876 default:
7877 {
7878 throw new NoViableAltException(LT(1), getFilename());
7879 }
7880 }
7881 }
7882 nls();
7883 additiveExpression(0);
7884 astFactory.addASTChild(currentAST, returnAST);
7885 }
7886 else {
7887 break _loop380;
7888 }
7889
7890 } while (true);
7891 }
7892 shiftExpression_AST = (AST)currentAST.root;
7893 returnAST = shiftExpression_AST;
7894 }
7895
7896 /*** Lookahead for suspicious statement warnings and errors. */
7897 public final void suspiciousExpressionStatementStart() throws RecognitionException, TokenStreamException {
7898
7899 returnAST = null;
7900 ASTPair currentAST = new ASTPair();
7901 AST suspiciousExpressionStatementStart_AST = null;
7902
7903 {
7904 switch ( LA(1)) {
7905 case PLUS:
7906 case MINUS:
7907 {
7908 {
7909 switch ( LA(1)) {
7910 case PLUS:
7911 {
7912 AST tmp182_AST = null;
7913 tmp182_AST = astFactory.create(LT(1));
7914 astFactory.addASTChild(currentAST, tmp182_AST);
7915 match(PLUS);
7916 break;
7917 }
7918 case MINUS:
7919 {
7920 AST tmp183_AST = null;
7921 tmp183_AST = astFactory.create(LT(1));
7922 astFactory.addASTChild(currentAST, tmp183_AST);
7923 match(MINUS);
7924 break;
7925 }
7926 default:
7927 {
7928 throw new NoViableAltException(LT(1), getFilename());
7929 }
7930 }
7931 }
7932 break;
7933 }
7934 case LBRACK:
7935 case LPAREN:
7936 case LCURLY:
7937 {
7938 {
7939 switch ( LA(1)) {
7940 case LBRACK:
7941 {
7942 AST tmp184_AST = null;
7943 tmp184_AST = astFactory.create(LT(1));
7944 astFactory.addASTChild(currentAST, tmp184_AST);
7945 match(LBRACK);
7946 break;
7947 }
7948 case LPAREN:
7949 {
7950 AST tmp185_AST = null;
7951 tmp185_AST = astFactory.create(LT(1));
7952 astFactory.addASTChild(currentAST, tmp185_AST);
7953 match(LPAREN);
7954 break;
7955 }
7956 case LCURLY:
7957 {
7958 AST tmp186_AST = null;
7959 tmp186_AST = astFactory.create(LT(1));
7960 astFactory.addASTChild(currentAST, tmp186_AST);
7961 match(LCURLY);
7962 break;
7963 }
7964 default:
7965 {
7966 throw new NoViableAltException(LT(1), getFilename());
7967 }
7968 }
7969 }
7970 break;
7971 }
7972 default:
7973 {
7974 throw new NoViableAltException(LT(1), getFilename());
7975 }
7976 }
7977 }
7978 suspiciousExpressionStatementStart_AST = (AST)currentAST.root;
7979 returnAST = suspiciousExpressionStatementStart_AST;
7980 }
7981
7982 /***
7983 * If two statements are separated by newline (not SEMI), the second had
7984 * better not look like the latter half of an expression. If it does, issue a warning.
7985 * <p>
7986 * Also, if the expression starts with a closure, it needs to
7987 * have an explicit parameter list, in order to avoid the appearance of a
7988 * compound statement. This is a hard error.
7989 * <p>
7990 * These rules are different from Java's "dumb expression" restriction.
7991 * Unlike Java, Groovy blocks can end with arbitrary (even dumb) expressions,
7992 * as a consequence of optional 'return' and 'continue' tokens.
7993 * <p>
7994 * To make the programmer's intention clear, a leading closure must have an
7995 * explicit parameter list, and must not follow a previous statement separated
7996 * only by newlines.
7997 */
7998 public final void checkSuspiciousExpressionStatement(
7999 int prevToken
8000 ) throws RecognitionException, TokenStreamException {
8001
8002 returnAST = null;
8003 ASTPair currentAST = new ASTPair();
8004 AST checkSuspiciousExpressionStatement_AST = null;
8005
8006 boolean synPredMatched285 = false;
8007 if (((_tokenSet_19.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_20.member(LA(3))))) {
8008 int _m285 = mark();
8009 synPredMatched285 = true;
8010 inputState.guessing++;
8011 try {
8012 {
8013 if ((_tokenSet_100.member(LA(1)))) {
8014 matchNot(LCURLY);
8015 }
8016 else if ((LA(1)==LCURLY)) {
8017 match(LCURLY);
8018 closableBlockParamsStart();
8019 }
8020 else {
8021 throw new NoViableAltException(LT(1), getFilename());
8022 }
8023
8024 }
8025 }
8026 catch (RecognitionException pe) {
8027 synPredMatched285 = false;
8028 }
8029 rewind(_m285);
8030 inputState.guessing--;
8031 }
8032 if ( synPredMatched285 ) {
8033 {
8034 if (((_tokenSet_19.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_20.member(LA(3))))&&(prevToken == NLS)) {
8035 if ( inputState.guessing==0 ) {
8036 addWarning(
8037 "Expression statement looks like it may continue a previous statement.",
8038 "Either remove previous newline, or add an explicit semicolon ';'.");
8039
8040 }
8041 }
8042 else if ((_tokenSet_19.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
8043 }
8044 else {
8045 throw new NoViableAltException(LT(1), getFilename());
8046 }
8047
8048 }
8049 checkSuspiciousExpressionStatement_AST = (AST)currentAST.root;
8050 }
8051 else if (((_tokenSet_19.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_20.member(LA(3))))&&(prevToken == NLS)) {
8052 if ( inputState.guessing==0 ) {
8053 require(false,
8054 "Closure expression looks like it may be an isolated open block, "+
8055 "or it may continue a previous statement."
8056 ,
8057 "Add an explicit parameter list, as in {it -> ...}, or label it as L:{...}, "+
8058 "and also either remove previous newline, or add an explicit semicolon ';'."
8059 );
8060
8061 }
8062 checkSuspiciousExpressionStatement_AST = (AST)currentAST.root;
8063 }
8064 else if (((_tokenSet_19.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_20.member(LA(3))))&&(prevToken != NLS)) {
8065 if ( inputState.guessing==0 ) {
8066 require(false,
8067 "Closure expression looks like it may be an isolated open block.",
8068 "Add an explicit parameter list, as in {it -> ...}, or label it as L:{...}.");
8069
8070 }
8071 checkSuspiciousExpressionStatement_AST = (AST)currentAST.root;
8072 }
8073 else {
8074 throw new NoViableAltException(LT(1), getFilename());
8075 }
8076
8077 returnAST = checkSuspiciousExpressionStatement_AST;
8078 }
8079
8080 /*** A member name (x.y) or element name (x[y]) can serve as a command name,
8081 * which may be followed by a list of arguments.
8082 * Unlike parenthesized arguments, these must be plain expressions,
8083 * without labels or spread operators.
8084 */
8085 public final void commandArguments(
8086 AST head
8087 ) throws RecognitionException, TokenStreamException {
8088
8089 returnAST = null;
8090 ASTPair currentAST = new ASTPair();
8091 AST commandArguments_AST = null;
8092 Token first = LT(1);
8093
8094 expression(0);
8095 astFactory.addASTChild(currentAST, returnAST);
8096 {
8097 _loop316:
8098 do {
8099 if ((LA(1)==COMMA)) {
8100 match(COMMA);
8101 nls();
8102 expression(0);
8103 astFactory.addASTChild(currentAST, returnAST);
8104 }
8105 else {
8106 break _loop316;
8107 }
8108
8109 } while (true);
8110 }
8111 if ( inputState.guessing==0 ) {
8112 commandArguments_AST = (AST)currentAST.root;
8113
8114 AST elist = (AST)astFactory.make( (new ASTArray(2)).add(create(ELIST,"ELIST",first,LT(1))).add(commandArguments_AST));
8115 AST headid = getASTFactory().dup(head);
8116 headid.setType(METHOD_CALL);
8117 headid.setText("<command>");
8118 commandArguments_AST = (AST)astFactory.make( (new ASTArray(3)).add(headid).add(head).add(elist));
8119
8120 currentAST.root = commandArguments_AST;
8121 currentAST.child = commandArguments_AST!=null &&commandArguments_AST.getFirstChild()!=null ?
8122 commandArguments_AST.getFirstChild() : commandArguments_AST;
8123 currentAST.advanceChildToEnd();
8124 }
8125 commandArguments_AST = (AST)currentAST.root;
8126 returnAST = commandArguments_AST;
8127 }
8128
8129 public final void aCase() throws RecognitionException, TokenStreamException {
8130
8131 returnAST = null;
8132 ASTPair currentAST = new ASTPair();
8133 AST aCase_AST = null;
8134
8135 {
8136 switch ( LA(1)) {
8137 case LITERAL_case:
8138 {
8139 AST tmp188_AST = null;
8140 tmp188_AST = astFactory.create(LT(1));
8141 astFactory.makeASTRoot(currentAST, tmp188_AST);
8142 match(LITERAL_case);
8143 expression(0);
8144 astFactory.addASTChild(currentAST, returnAST);
8145 break;
8146 }
8147 case LITERAL_default:
8148 {
8149 AST tmp189_AST = null;
8150 tmp189_AST = astFactory.create(LT(1));
8151 astFactory.addASTChild(currentAST, tmp189_AST);
8152 match(LITERAL_default);
8153 break;
8154 }
8155 default:
8156 {
8157 throw new NoViableAltException(LT(1), getFilename());
8158 }
8159 }
8160 }
8161 match(COLON);
8162 nls();
8163 aCase_AST = (AST)currentAST.root;
8164 returnAST = aCase_AST;
8165 }
8166
8167 public final void caseSList() throws RecognitionException, TokenStreamException {
8168
8169 returnAST = null;
8170 ASTPair currentAST = new ASTPair();
8171 AST caseSList_AST = null;
8172 Token first = LT(1);
8173
8174 statement(COLON);
8175 astFactory.addASTChild(currentAST, returnAST);
8176 {
8177 _loop299:
8178 do {
8179 if ((LA(1)==SEMI||LA(1)==NLS)) {
8180 sep();
8181 {
8182 switch ( LA(1)) {
8183 case FINAL:
8184 case ABSTRACT:
8185 case STRICTFP:
8186 case LITERAL_import:
8187 case LITERAL_static:
8188 case LITERAL_def:
8189 case AT:
8190 case IDENT:
8191 case LBRACK:
8192 case LPAREN:
8193 case LITERAL_class:
8194 case LITERAL_interface:
8195 case LITERAL_enum:
8196 case LITERAL_super:
8197 case LITERAL_void:
8198 case LITERAL_boolean:
8199 case LITERAL_byte:
8200 case LITERAL_char:
8201 case LITERAL_short:
8202 case LITERAL_int:
8203 case LITERAL_float:
8204 case LITERAL_long:
8205 case LITERAL_double:
8206 case LITERAL_any:
8207 case STAR:
8208 case LITERAL_private:
8209 case LITERAL_public:
8210 case LITERAL_protected:
8211 case LITERAL_transient:
8212 case LITERAL_native:
8213 case LITERAL_threadsafe:
8214 case LITERAL_synchronized:
8215 case LITERAL_volatile:
8216 case LCURLY:
8217 case LITERAL_this:
8218 case STRING_LITERAL:
8219 case LITERAL_if:
8220 case LITERAL_while:
8221 case LITERAL_with:
8222 case LITERAL_switch:
8223 case LITERAL_for:
8224 case LITERAL_return:
8225 case LITERAL_break:
8226 case LITERAL_continue:
8227 case LITERAL_throw:
8228 case LITERAL_assert:
8229 case PLUS:
8230 case MINUS:
8231 case LITERAL_try:
8232 case INC:
8233 case DEC:
8234 case BNOT:
8235 case LNOT:
8236 case DOLLAR:
8237 case STRING_CTOR_START:
8238 case LITERAL_new:
8239 case LITERAL_true:
8240 case LITERAL_false:
8241 case LITERAL_null:
8242 case NUM_INT:
8243 case NUM_FLOAT:
8244 case NUM_LONG:
8245 case NUM_DOUBLE:
8246 case NUM_BIG_INT:
8247 case NUM_BIG_DECIMAL:
8248 {
8249 statement(sepToken);
8250 astFactory.addASTChild(currentAST, returnAST);
8251 break;
8252 }
8253 case RCURLY:
8254 case SEMI:
8255 case NLS:
8256 case LITERAL_default:
8257 case LITERAL_case:
8258 {
8259 break;
8260 }
8261 default:
8262 {
8263 throw new NoViableAltException(LT(1), getFilename());
8264 }
8265 }
8266 }
8267 }
8268 else {
8269 break _loop299;
8270 }
8271
8272 } while (true);
8273 }
8274 if ( inputState.guessing==0 ) {
8275 caseSList_AST = (AST)currentAST.root;
8276 caseSList_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(SLIST,"SLIST",first,LT(1))).add(caseSList_AST));
8277 currentAST.root = caseSList_AST;
8278 currentAST.child = caseSList_AST!=null &&caseSList_AST.getFirstChild()!=null ?
8279 caseSList_AST.getFirstChild() : caseSList_AST;
8280 currentAST.advanceChildToEnd();
8281 }
8282 caseSList_AST = (AST)currentAST.root;
8283 returnAST = caseSList_AST;
8284 }
8285
8286 public final void controlExpressionList() throws RecognitionException, TokenStreamException {
8287
8288 returnAST = null;
8289 ASTPair currentAST = new ASTPair();
8290 AST controlExpressionList_AST = null;
8291 Token first = LT(1);
8292
8293 strictContextExpression();
8294 astFactory.addASTChild(currentAST, returnAST);
8295 {
8296 _loop320:
8297 do {
8298 if ((LA(1)==COMMA)) {
8299 match(COMMA);
8300 nls();
8301 strictContextExpression();
8302 astFactory.addASTChild(currentAST, returnAST);
8303 }
8304 else {
8305 break _loop320;
8306 }
8307
8308 } while (true);
8309 }
8310 if ( inputState.guessing==0 ) {
8311 controlExpressionList_AST = (AST)currentAST.root;
8312 controlExpressionList_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(ELIST,"ELIST",first,LT(1))).add(controlExpressionList_AST));
8313 currentAST.root = controlExpressionList_AST;
8314 currentAST.child = controlExpressionList_AST!=null &&controlExpressionList_AST.getFirstChild()!=null ?
8315 controlExpressionList_AST.getFirstChild() : controlExpressionList_AST;
8316 currentAST.advanceChildToEnd();
8317 }
8318 controlExpressionList_AST = (AST)currentAST.root;
8319 returnAST = controlExpressionList_AST;
8320 }
8321
8322 public final void handler() throws RecognitionException, TokenStreamException {
8323
8324 returnAST = null;
8325 ASTPair currentAST = new ASTPair();
8326 AST handler_AST = null;
8327
8328 AST tmp192_AST = null;
8329 tmp192_AST = astFactory.create(LT(1));
8330 astFactory.makeASTRoot(currentAST, tmp192_AST);
8331 match(LITERAL_catch);
8332 match(LPAREN);
8333 parameterDeclaration();
8334 astFactory.addASTChild(currentAST, returnAST);
8335 match(RPAREN);
8336 nlsWarn();
8337 compoundStatement();
8338 astFactory.addASTChild(currentAST, returnAST);
8339 handler_AST = (AST)currentAST.root;
8340 returnAST = handler_AST;
8341 }
8342
8343 public final void finallyClause() throws RecognitionException, TokenStreamException {
8344
8345 returnAST = null;
8346 ASTPair currentAST = new ASTPair();
8347 AST finallyClause_AST = null;
8348
8349 AST tmp195_AST = null;
8350 tmp195_AST = astFactory.create(LT(1));
8351 astFactory.makeASTRoot(currentAST, tmp195_AST);
8352 match(LITERAL_finally);
8353 nlsWarn();
8354 compoundStatement();
8355 astFactory.addASTChild(currentAST, returnAST);
8356 finallyClause_AST = (AST)currentAST.root;
8357 returnAST = finallyClause_AST;
8358 }
8359
8360 public final void assignmentExpression(
8361 int lc_stmt
8362 ) throws RecognitionException, TokenStreamException {
8363
8364 returnAST = null;
8365 ASTPair currentAST = new ASTPair();
8366 AST assignmentExpression_AST = null;
8367
8368 conditionalExpression(lc_stmt);
8369 astFactory.addASTChild(currentAST, returnAST);
8370 {
8371 switch ( LA(1)) {
8372 case ASSIGN:
8373 case PLUS_ASSIGN:
8374 case MINUS_ASSIGN:
8375 case STAR_ASSIGN:
8376 case DIV_ASSIGN:
8377 case MOD_ASSIGN:
8378 case SR_ASSIGN:
8379 case BSR_ASSIGN:
8380 case SL_ASSIGN:
8381 case BAND_ASSIGN:
8382 case BXOR_ASSIGN:
8383 case BOR_ASSIGN:
8384 case STAR_STAR_ASSIGN:
8385 {
8386 {
8387 switch ( LA(1)) {
8388 case ASSIGN:
8389 {
8390 AST tmp196_AST = null;
8391 tmp196_AST = astFactory.create(LT(1));
8392 astFactory.makeASTRoot(currentAST, tmp196_AST);
8393 match(ASSIGN);
8394 break;
8395 }
8396 case PLUS_ASSIGN:
8397 {
8398 AST tmp197_AST = null;
8399 tmp197_AST = astFactory.create(LT(1));
8400 astFactory.makeASTRoot(currentAST, tmp197_AST);
8401 match(PLUS_ASSIGN);
8402 break;
8403 }
8404 case MINUS_ASSIGN:
8405 {
8406 AST tmp198_AST = null;
8407 tmp198_AST = astFactory.create(LT(1));
8408 astFactory.makeASTRoot(currentAST, tmp198_AST);
8409 match(MINUS_ASSIGN);
8410 break;
8411 }
8412 case STAR_ASSIGN:
8413 {
8414 AST tmp199_AST = null;
8415 tmp199_AST = astFactory.create(LT(1));
8416 astFactory.makeASTRoot(currentAST, tmp199_AST);
8417 match(STAR_ASSIGN);
8418 break;
8419 }
8420 case DIV_ASSIGN:
8421 {
8422 AST tmp200_AST = null;
8423 tmp200_AST = astFactory.create(LT(1));
8424 astFactory.makeASTRoot(currentAST, tmp200_AST);
8425 match(DIV_ASSIGN);
8426 break;
8427 }
8428 case MOD_ASSIGN:
8429 {
8430 AST tmp201_AST = null;
8431 tmp201_AST = astFactory.create(LT(1));
8432 astFactory.makeASTRoot(currentAST, tmp201_AST);
8433 match(MOD_ASSIGN);
8434 break;
8435 }
8436 case SR_ASSIGN:
8437 {
8438 AST tmp202_AST = null;
8439 tmp202_AST = astFactory.create(LT(1));
8440 astFactory.makeASTRoot(currentAST, tmp202_AST);
8441 match(SR_ASSIGN);
8442 break;
8443 }
8444 case BSR_ASSIGN:
8445 {
8446 AST tmp203_AST = null;
8447 tmp203_AST = astFactory.create(LT(1));
8448 astFactory.makeASTRoot(currentAST, tmp203_AST);
8449 match(BSR_ASSIGN);
8450 break;
8451 }
8452 case SL_ASSIGN:
8453 {
8454 AST tmp204_AST = null;
8455 tmp204_AST = astFactory.create(LT(1));
8456 astFactory.makeASTRoot(currentAST, tmp204_AST);
8457 match(SL_ASSIGN);
8458 break;
8459 }
8460 case BAND_ASSIGN:
8461 {
8462 AST tmp205_AST = null;
8463 tmp205_AST = astFactory.create(LT(1));
8464 astFactory.makeASTRoot(currentAST, tmp205_AST);
8465 match(BAND_ASSIGN);
8466 break;
8467 }
8468 case BXOR_ASSIGN:
8469 {
8470 AST tmp206_AST = null;
8471 tmp206_AST = astFactory.create(LT(1));
8472 astFactory.makeASTRoot(currentAST, tmp206_AST);
8473 match(BXOR_ASSIGN);
8474 break;
8475 }
8476 case BOR_ASSIGN:
8477 {
8478 AST tmp207_AST = null;
8479 tmp207_AST = astFactory.create(LT(1));
8480 astFactory.makeASTRoot(currentAST, tmp207_AST);
8481 match(BOR_ASSIGN);
8482 break;
8483 }
8484 case STAR_STAR_ASSIGN:
8485 {
8486 AST tmp208_AST = null;
8487 tmp208_AST = astFactory.create(LT(1));
8488 astFactory.makeASTRoot(currentAST, tmp208_AST);
8489 match(STAR_STAR_ASSIGN);
8490 break;
8491 }
8492 default:
8493 {
8494 throw new NoViableAltException(LT(1), getFilename());
8495 }
8496 }
8497 }
8498 nls();
8499 assignmentExpression(lc_stmt == LC_STMT? LC_INIT: 0);
8500 astFactory.addASTChild(currentAST, returnAST);
8501 break;
8502 }
8503 case EOF:
8504 case IDENT:
8505 case LBRACK:
8506 case RBRACK:
8507 case LPAREN:
8508 case LITERAL_super:
8509 case COMMA:
8510 case LITERAL_void:
8511 case LITERAL_boolean:
8512 case LITERAL_byte:
8513 case LITERAL_char:
8514 case LITERAL_short:
8515 case LITERAL_int:
8516 case LITERAL_float:
8517 case LITERAL_long:
8518 case LITERAL_double:
8519 case LITERAL_any:
8520 case RPAREN:
8521 case LCURLY:
8522 case RCURLY:
8523 case SEMI:
8524 case NLS:
8525 case LITERAL_default:
8526 case LITERAL_this:
8527 case STRING_LITERAL:
8528 case CLOSABLE_BLOCK_OP:
8529 case COLON:
8530 case LITERAL_else:
8531 case PLUS:
8532 case MINUS:
8533 case LITERAL_case:
8534 case INC:
8535 case DEC:
8536 case BNOT:
8537 case LNOT:
8538 case DOLLAR:
8539 case STRING_CTOR_START:
8540 case LITERAL_new:
8541 case LITERAL_true:
8542 case LITERAL_false:
8543 case LITERAL_null:
8544 case NUM_INT:
8545 case NUM_FLOAT:
8546 case NUM_LONG:
8547 case NUM_DOUBLE:
8548 case NUM_BIG_INT:
8549 case NUM_BIG_DECIMAL:
8550 {
8551 break;
8552 }
8553 default:
8554 {
8555 throw new NoViableAltException(LT(1), getFilename());
8556 }
8557 }
8558 }
8559 assignmentExpression_AST = (AST)currentAST.root;
8560 returnAST = assignmentExpression_AST;
8561 }
8562
8563 /*** A "path expression" is a name or other primary, possibly qualified by various
8564 * forms of dot, and/or followed by various kinds of brackets.
8565 * It can be used for value or assigned to, or else further qualified, indexed, or called.
8566 * It is called a "path" because it looks like a linear path through a data structure.
8567 * Examples: x.y, x?.y, x*.y, x.@y; x[], x[y], x[y,z]; x(), x(y), x(y,z); x{s}; a.b[n].c(x).d{s}
8568 * (Compare to a C lvalue, or LeftHandSide in the JLS section 15.26.)
8569 * General expressions are built up from path expressions, using operators like '+' and '='.
8570 */
8571 public final void pathExpression(
8572 int lc_stmt
8573 ) throws RecognitionException, TokenStreamException {
8574
8575 returnAST = null;
8576 ASTPair currentAST = new ASTPair();
8577 AST pathExpression_AST = null;
8578 AST pre_AST = null;
8579 AST pe_AST = null;
8580 AST apb_AST = null;
8581 AST prefix = null;
8582
8583 primaryExpression();
8584 pre_AST = (AST)returnAST;
8585 if ( inputState.guessing==0 ) {
8586 prefix = pre_AST;
8587 }
8588 {
8589 _loop327:
8590 do {
8591 boolean synPredMatched324 = false;
8592 if (((_tokenSet_101.member(LA(1))) && (_tokenSet_102.member(LA(2))) && (_tokenSet_95.member(LA(3))))) {
8593 int _m324 = mark();
8594 synPredMatched324 = true;
8595 inputState.guessing++;
8596 try {
8597 {
8598 pathElementStart();
8599 }
8600 }
8601 catch (RecognitionException pe) {
8602 synPredMatched324 = false;
8603 }
8604 rewind(_m324);
8605 inputState.guessing--;
8606 }
8607 if ( synPredMatched324 ) {
8608 nls();
8609 pathElement(prefix);
8610 pe_AST = (AST)returnAST;
8611 if ( inputState.guessing==0 ) {
8612 prefix = pe_AST;
8613 }
8614 }
8615 else {
8616 boolean synPredMatched326 = false;
8617 if ((((LA(1)==LCURLY||LA(1)==NLS) && (_tokenSet_16.member(LA(2))) && (_tokenSet_95.member(LA(3))))&&(lc_stmt == LC_STMT || lc_stmt == LC_INIT))) {
8618 int _m326 = mark();
8619 synPredMatched326 = true;
8620 inputState.guessing++;
8621 try {
8622 {
8623 nls();
8624 match(LCURLY);
8625 }
8626 }
8627 catch (RecognitionException pe) {
8628 synPredMatched326 = false;
8629 }
8630 rewind(_m326);
8631 inputState.guessing--;
8632 }
8633 if ( synPredMatched326 ) {
8634 nlsWarn();
8635 appendedBlock(prefix);
8636 apb_AST = (AST)returnAST;
8637 if ( inputState.guessing==0 ) {
8638 prefix = apb_AST;
8639 }
8640 }
8641 else {
8642 break _loop327;
8643 }
8644 }
8645 } while (true);
8646 }
8647 if ( inputState.guessing==0 ) {
8648 pathExpression_AST = (AST)currentAST.root;
8649
8650 pathExpression_AST = prefix;
8651 lastPathExpression = pathExpression_AST;
8652
8653 currentAST.root = pathExpression_AST;
8654 currentAST.child = pathExpression_AST!=null &&pathExpression_AST.getFirstChild()!=null ?
8655 pathExpression_AST.getFirstChild() : pathExpression_AST;
8656 currentAST.advanceChildToEnd();
8657 }
8658 pathExpression_AST = (AST)currentAST.root;
8659 returnAST = pathExpression_AST;
8660 }
8661
8662 public final void primaryExpression() throws RecognitionException, TokenStreamException {
8663
8664 returnAST = null;
8665 ASTPair currentAST = new ASTPair();
8666 AST primaryExpression_AST = null;
8667
8668 switch ( LA(1)) {
8669 case IDENT:
8670 {
8671 AST tmp209_AST = null;
8672 tmp209_AST = astFactory.create(LT(1));
8673 astFactory.addASTChild(currentAST, tmp209_AST);
8674 match(IDENT);
8675 primaryExpression_AST = (AST)currentAST.root;
8676 break;
8677 }
8678 case STRING_LITERAL:
8679 case LITERAL_true:
8680 case LITERAL_false:
8681 case LITERAL_null:
8682 case NUM_INT:
8683 case NUM_FLOAT:
8684 case NUM_LONG:
8685 case NUM_DOUBLE:
8686 case NUM_BIG_INT:
8687 case NUM_BIG_DECIMAL:
8688 {
8689 constant();
8690 astFactory.addASTChild(currentAST, returnAST);
8691 primaryExpression_AST = (AST)currentAST.root;
8692 break;
8693 }
8694 case LITERAL_new:
8695 {
8696 newExpression();
8697 astFactory.addASTChild(currentAST, returnAST);
8698 primaryExpression_AST = (AST)currentAST.root;
8699 break;
8700 }
8701 case LITERAL_this:
8702 {
8703 AST tmp210_AST = null;
8704 tmp210_AST = astFactory.create(LT(1));
8705 astFactory.addASTChild(currentAST, tmp210_AST);
8706 match(LITERAL_this);
8707 primaryExpression_AST = (AST)currentAST.root;
8708 break;
8709 }
8710 case LITERAL_super:
8711 {
8712 AST tmp211_AST = null;
8713 tmp211_AST = astFactory.create(LT(1));
8714 astFactory.addASTChild(currentAST, tmp211_AST);
8715 match(LITERAL_super);
8716 primaryExpression_AST = (AST)currentAST.root;
8717 break;
8718 }
8719 case LPAREN:
8720 {
8721 parenthesizedExpression();
8722 astFactory.addASTChild(currentAST, returnAST);
8723 primaryExpression_AST = (AST)currentAST.root;
8724 break;
8725 }
8726 case LCURLY:
8727 {
8728 closableBlockConstructorExpression();
8729 astFactory.addASTChild(currentAST, returnAST);
8730 primaryExpression_AST = (AST)currentAST.root;
8731 break;
8732 }
8733 case LBRACK:
8734 {
8735 listOrMapConstructorExpression();
8736 astFactory.addASTChild(currentAST, returnAST);
8737 primaryExpression_AST = (AST)currentAST.root;
8738 break;
8739 }
8740 case STRING_CTOR_START:
8741 {
8742 stringConstructorExpression();
8743 astFactory.addASTChild(currentAST, returnAST);
8744 primaryExpression_AST = (AST)currentAST.root;
8745 break;
8746 }
8747 case DOLLAR:
8748 {
8749 scopeEscapeExpression();
8750 astFactory.addASTChild(currentAST, returnAST);
8751 primaryExpression_AST = (AST)currentAST.root;
8752 break;
8753 }
8754 case LITERAL_void:
8755 case LITERAL_boolean:
8756 case LITERAL_byte:
8757 case LITERAL_char:
8758 case LITERAL_short:
8759 case LITERAL_int:
8760 case LITERAL_float:
8761 case LITERAL_long:
8762 case LITERAL_double:
8763 case LITERAL_any:
8764 {
8765 builtInType();
8766 astFactory.addASTChild(currentAST, returnAST);
8767 primaryExpression_AST = (AST)currentAST.root;
8768 break;
8769 }
8770 default:
8771 {
8772 throw new NoViableAltException(LT(1), getFilename());
8773 }
8774 }
8775 returnAST = primaryExpression_AST;
8776 }
8777
8778 public final void pathElementStart() throws RecognitionException, TokenStreamException {
8779
8780 returnAST = null;
8781 ASTPair currentAST = new ASTPair();
8782 AST pathElementStart_AST = null;
8783
8784 switch ( LA(1)) {
8785 case DOT:
8786 case NLS:
8787 {
8788 {
8789 nls();
8790 AST tmp212_AST = null;
8791 tmp212_AST = astFactory.create(LT(1));
8792 match(DOT);
8793 }
8794 break;
8795 }
8796 case SPREAD_DOT:
8797 {
8798 AST tmp213_AST = null;
8799 tmp213_AST = astFactory.create(LT(1));
8800 match(SPREAD_DOT);
8801 break;
8802 }
8803 case OPTIONAL_DOT:
8804 {
8805 AST tmp214_AST = null;
8806 tmp214_AST = astFactory.create(LT(1));
8807 match(OPTIONAL_DOT);
8808 break;
8809 }
8810 case MEMBER_POINTER:
8811 {
8812 AST tmp215_AST = null;
8813 tmp215_AST = astFactory.create(LT(1));
8814 match(MEMBER_POINTER);
8815 break;
8816 }
8817 case LBRACK:
8818 {
8819 AST tmp216_AST = null;
8820 tmp216_AST = astFactory.create(LT(1));
8821 match(LBRACK);
8822 break;
8823 }
8824 case LPAREN:
8825 {
8826 AST tmp217_AST = null;
8827 tmp217_AST = astFactory.create(LT(1));
8828 match(LPAREN);
8829 break;
8830 }
8831 case LCURLY:
8832 {
8833 AST tmp218_AST = null;
8834 tmp218_AST = astFactory.create(LT(1));
8835 match(LCURLY);
8836 break;
8837 }
8838 default:
8839 {
8840 throw new NoViableAltException(LT(1), getFilename());
8841 }
8842 }
8843 returnAST = pathElementStart_AST;
8844 }
8845
8846 public final void pathElement(
8847 AST prefix
8848 ) throws RecognitionException, TokenStreamException {
8849
8850 returnAST = null;
8851 ASTPair currentAST = new ASTPair();
8852 AST pathElement_AST = null;
8853 AST mca_AST = null;
8854 AST apb_AST = null;
8855 AST ipa_AST = null;
8856
8857 switch ( LA(1)) {
8858 case DOT:
8859 case NLS:
8860 case SPREAD_DOT:
8861 case OPTIONAL_DOT:
8862 case MEMBER_POINTER:
8863 {
8864 if ( inputState.guessing==0 ) {
8865 pathElement_AST = (AST)currentAST.root;
8866 pathElement_AST = prefix;
8867 currentAST.root = pathElement_AST;
8868 currentAST.child = pathElement_AST!=null &&pathElement_AST.getFirstChild()!=null ?
8869 pathElement_AST.getFirstChild() : pathElement_AST;
8870 currentAST.advanceChildToEnd();
8871 }
8872 {
8873 switch ( LA(1)) {
8874 case SPREAD_DOT:
8875 {
8876 AST tmp219_AST = null;
8877 tmp219_AST = astFactory.create(LT(1));
8878 astFactory.makeASTRoot(currentAST, tmp219_AST);
8879 match(SPREAD_DOT);
8880 break;
8881 }
8882 case OPTIONAL_DOT:
8883 {
8884 AST tmp220_AST = null;
8885 tmp220_AST = astFactory.create(LT(1));
8886 astFactory.makeASTRoot(currentAST, tmp220_AST);
8887 match(OPTIONAL_DOT);
8888 break;
8889 }
8890 case MEMBER_POINTER:
8891 {
8892 AST tmp221_AST = null;
8893 tmp221_AST = astFactory.create(LT(1));
8894 astFactory.makeASTRoot(currentAST, tmp221_AST);
8895 match(MEMBER_POINTER);
8896 break;
8897 }
8898 case DOT:
8899 case NLS:
8900 {
8901 {
8902 nls();
8903 AST tmp222_AST = null;
8904 tmp222_AST = astFactory.create(LT(1));
8905 astFactory.makeASTRoot(currentAST, tmp222_AST);
8906 match(DOT);
8907 }
8908 break;
8909 }
8910 default:
8911 {
8912 throw new NoViableAltException(LT(1), getFilename());
8913 }
8914 }
8915 }
8916 nls();
8917 {
8918 switch ( LA(1)) {
8919 case LT:
8920 {
8921 typeArguments();
8922 astFactory.addASTChild(currentAST, returnAST);
8923 break;
8924 }
8925 case UNUSED_DO:
8926 case LITERAL_def:
8927 case AT:
8928 case IDENT:
8929 case LPAREN:
8930 case LITERAL_class:
8931 case LITERAL_void:
8932 case LITERAL_boolean:
8933 case LITERAL_byte:
8934 case LITERAL_char:
8935 case LITERAL_short:
8936 case LITERAL_int:
8937 case LITERAL_float:
8938 case LITERAL_long:
8939 case LITERAL_double:
8940 case LITERAL_any:
8941 case LITERAL_as:
8942 case LCURLY:
8943 case STRING_LITERAL:
8944 case LITERAL_if:
8945 case LITERAL_else:
8946 case LITERAL_while:
8947 case LITERAL_switch:
8948 case LITERAL_for:
8949 case LITERAL_in:
8950 case LITERAL_try:
8951 case LITERAL_finally:
8952 case LITERAL_catch:
8953 case STRING_CTOR_START:
8954 {
8955 break;
8956 }
8957 default:
8958 {
8959 throw new NoViableAltException(LT(1), getFilename());
8960 }
8961 }
8962 }
8963 namePart();
8964 astFactory.addASTChild(currentAST, returnAST);
8965 pathElement_AST = (AST)currentAST.root;
8966 break;
8967 }
8968 case LPAREN:
8969 {
8970 methodCallArgs(prefix);
8971 mca_AST = (AST)returnAST;
8972 if ( inputState.guessing==0 ) {
8973 pathElement_AST = (AST)currentAST.root;
8974 pathElement_AST = mca_AST;
8975 currentAST.root = pathElement_AST;
8976 currentAST.child = pathElement_AST!=null &&pathElement_AST.getFirstChild()!=null ?
8977 pathElement_AST.getFirstChild() : pathElement_AST;
8978 currentAST.advanceChildToEnd();
8979 }
8980 pathElement_AST = (AST)currentAST.root;
8981 break;
8982 }
8983 case LCURLY:
8984 {
8985 appendedBlock(prefix);
8986 apb_AST = (AST)returnAST;
8987 if ( inputState.guessing==0 ) {
8988 pathElement_AST = (AST)currentAST.root;
8989 pathElement_AST = apb_AST;
8990 currentAST.root = pathElement_AST;
8991 currentAST.child = pathElement_AST!=null &&pathElement_AST.getFirstChild()!=null ?
8992 pathElement_AST.getFirstChild() : pathElement_AST;
8993 currentAST.advanceChildToEnd();
8994 }
8995 pathElement_AST = (AST)currentAST.root;
8996 break;
8997 }
8998 case LBRACK:
8999 {
9000 indexPropertyArgs(prefix);
9001 ipa_AST = (AST)returnAST;
9002 if ( inputState.guessing==0 ) {
9003 pathElement_AST = (AST)currentAST.root;
9004 pathElement_AST = ipa_AST;
9005 currentAST.root = pathElement_AST;
9006 currentAST.child = pathElement_AST!=null &&pathElement_AST.getFirstChild()!=null ?
9007 pathElement_AST.getFirstChild() : pathElement_AST;
9008 currentAST.advanceChildToEnd();
9009 }
9010 pathElement_AST = (AST)currentAST.root;
9011 break;
9012 }
9013 default:
9014 {
9015 throw new NoViableAltException(LT(1), getFilename());
9016 }
9017 }
9018 returnAST = pathElement_AST;
9019 }
9020
9021 /*** An appended block follows any expression.
9022 * If the expression is not a method call, it is given an empty argument list.
9023 */
9024 public final void appendedBlock(
9025 AST callee
9026 ) throws RecognitionException, TokenStreamException {
9027
9028 returnAST = null;
9029 ASTPair currentAST = new ASTPair();
9030 AST appendedBlock_AST = null;
9031
9032 if ( inputState.guessing==0 ) {
9033 appendedBlock_AST = (AST)currentAST.root;
9034
9035
9036 if (callee != null && callee.getType() == METHOD_CALL) {
9037 appendedBlock_AST = callee;
9038 } else {
9039 AST lbrace = getASTFactory().create(LT(1));
9040 lbrace.setType(METHOD_CALL);
9041 if (callee != null) lbrace.addChild(callee);
9042 appendedBlock_AST = lbrace;
9043 }
9044
9045 currentAST.root = appendedBlock_AST;
9046 currentAST.child = appendedBlock_AST!=null &&appendedBlock_AST.getFirstChild()!=null ?
9047 appendedBlock_AST.getFirstChild() : appendedBlock_AST;
9048 currentAST.advanceChildToEnd();
9049 }
9050 closableBlock();
9051 astFactory.addASTChild(currentAST, returnAST);
9052 appendedBlock_AST = (AST)currentAST.root;
9053 returnAST = appendedBlock_AST;
9054 }
9055
9056 /*** This is the grammar for what can follow a dot: x.a, x.@a, x.&a, x.'a', etc.
9057 * Note: <code>typeArguments</code> is handled by the caller of <code>namePart</code>.
9058 */
9059 public final void namePart() throws RecognitionException, TokenStreamException {
9060
9061 returnAST = null;
9062 ASTPair currentAST = new ASTPair();
9063 AST namePart_AST = null;
9064 Token ats = null;
9065 AST ats_AST = null;
9066 Token sl = null;
9067 AST sl_AST = null;
9068 Token first = LT(1);
9069
9070 {
9071 switch ( LA(1)) {
9072 case AT:
9073 {
9074 ats = LT(1);
9075 ats_AST = astFactory.create(ats);
9076 astFactory.makeASTRoot(currentAST, ats_AST);
9077 match(AT);
9078 if ( inputState.guessing==0 ) {
9079 ats_AST.setType(SELECT_SLOT);
9080 }
9081 break;
9082 }
9083 case UNUSED_DO:
9084 case LITERAL_def:
9085 case IDENT:
9086 case LPAREN:
9087 case LITERAL_class:
9088 case LITERAL_void:
9089 case LITERAL_boolean:
9090 case LITERAL_byte:
9091 case LITERAL_char:
9092 case LITERAL_short:
9093 case LITERAL_int:
9094 case LITERAL_float:
9095 case LITERAL_long:
9096 case LITERAL_double:
9097 case LITERAL_any:
9098 case LITERAL_as:
9099 case LCURLY:
9100 case STRING_LITERAL:
9101 case LITERAL_if:
9102 case LITERAL_else:
9103 case LITERAL_while:
9104 case LITERAL_switch:
9105 case LITERAL_for:
9106 case LITERAL_in:
9107 case LITERAL_try:
9108 case LITERAL_finally:
9109 case LITERAL_catch:
9110 case STRING_CTOR_START:
9111 {
9112 break;
9113 }
9114 default:
9115 {
9116 throw new NoViableAltException(LT(1), getFilename());
9117 }
9118 }
9119 }
9120 {
9121 switch ( LA(1)) {
9122 case IDENT:
9123 {
9124 AST tmp223_AST = null;
9125 tmp223_AST = astFactory.create(LT(1));
9126 astFactory.addASTChild(currentAST, tmp223_AST);
9127 match(IDENT);
9128 break;
9129 }
9130 case STRING_LITERAL:
9131 {
9132 sl = LT(1);
9133 sl_AST = astFactory.create(sl);
9134 astFactory.addASTChild(currentAST, sl_AST);
9135 match(STRING_LITERAL);
9136 if ( inputState.guessing==0 ) {
9137 sl_AST.setType(IDENT);
9138 }
9139 break;
9140 }
9141 case LPAREN:
9142 case STRING_CTOR_START:
9143 {
9144 dynamicMemberName();
9145 astFactory.addASTChild(currentAST, returnAST);
9146 break;
9147 }
9148 case LCURLY:
9149 {
9150 openBlock();
9151 astFactory.addASTChild(currentAST, returnAST);
9152 break;
9153 }
9154 case UNUSED_DO:
9155 case LITERAL_def:
9156 case LITERAL_class:
9157 case LITERAL_void:
9158 case LITERAL_boolean:
9159 case LITERAL_byte:
9160 case LITERAL_char:
9161 case LITERAL_short:
9162 case LITERAL_int:
9163 case LITERAL_float:
9164 case LITERAL_long:
9165 case LITERAL_double:
9166 case LITERAL_any:
9167 case LITERAL_as:
9168 case LITERAL_if:
9169 case LITERAL_else:
9170 case LITERAL_while:
9171 case LITERAL_switch:
9172 case LITERAL_for:
9173 case LITERAL_in:
9174 case LITERAL_try:
9175 case LITERAL_finally:
9176 case LITERAL_catch:
9177 {
9178 keywordPropertyNames();
9179 astFactory.addASTChild(currentAST, returnAST);
9180 break;
9181 }
9182 default:
9183 {
9184 throw new NoViableAltException(LT(1), getFilename());
9185 }
9186 }
9187 }
9188 namePart_AST = (AST)currentAST.root;
9189 returnAST = namePart_AST;
9190 }
9191
9192 /*** An expression may be followed by one or both of (...) and {...}.
9193 * Note: If either is (...) or {...} present, it is a method call.
9194 * The {...} is appended to the argument list, and matches a formal of type Closure.
9195 * If there is no method member, a property (or field) is used instead, and must itself be callable.
9196 * <p>
9197 * If the methodCallArgs are absent, it is a property reference.
9198 * If there is no property, it is treated as a field reference, but never a method reference.
9199 * <p>
9200 * Arguments in the (...) can be labeled, and the appended block can be labeled also.
9201 * If there is a mix of unlabeled and labeled arguments,
9202 * all the labeled arguments must follow the unlabeled arguments,
9203 * except that the closure (labeled or not) is always a separate final argument.
9204 * Labeled arguments are collected up and passed as a single argument to a formal of type Map.
9205 * <p>
9206 * Therefore, f(x,y, a:p, b:q) {s} is equivalent in all ways to f(x,y, [a:p,b:q], {s}).
9207 * Spread arguments of sequence type count as unlabeled arguments,
9208 * while spread arguments of map type count as labeled arguments.
9209 * (This distinction must sometimes be checked dynamically.)
9210 *
9211 * A plain unlabeled argument is allowed to match a trailing Map or Closure argument:
9212 * f(x, a:p) {s} === f(*[ x, [a:p], {s} ])
9213 */
9214 public final void methodCallArgs(
9215 AST callee
9216 ) throws RecognitionException, TokenStreamException {
9217
9218 returnAST = null;
9219 ASTPair currentAST = new ASTPair();
9220 AST methodCallArgs_AST = null;
9221 Token lp = null;
9222 AST lp_AST = null;
9223
9224 if ( inputState.guessing==0 ) {
9225 methodCallArgs_AST = (AST)currentAST.root;
9226 methodCallArgs_AST = callee;
9227 currentAST.root = methodCallArgs_AST;
9228 currentAST.child = methodCallArgs_AST!=null &&methodCallArgs_AST.getFirstChild()!=null ?
9229 methodCallArgs_AST.getFirstChild() : methodCallArgs_AST;
9230 currentAST.advanceChildToEnd();
9231 }
9232 lp = LT(1);
9233 lp_AST = astFactory.create(lp);
9234 astFactory.makeASTRoot(currentAST, lp_AST);
9235 match(LPAREN);
9236 if ( inputState.guessing==0 ) {
9237 lp_AST.setType(METHOD_CALL);
9238 }
9239 argList();
9240 astFactory.addASTChild(currentAST, returnAST);
9241 match(RPAREN);
9242 methodCallArgs_AST = (AST)currentAST.root;
9243 returnAST = methodCallArgs_AST;
9244 }
9245
9246 /*** An expression may be followed by [...].
9247 * Unlike Java, these brackets may contain a general argument list,
9248 * which is passed to the array element operator, which can make of it what it wants.
9249 * The brackets may also be empty, as in T[]. This is how Groovy names array types.
9250 * <p>Returned AST is [INDEX_OP, indexee, ELIST].
9251 */
9252 public final void indexPropertyArgs(
9253 AST indexee
9254 ) throws RecognitionException, TokenStreamException {
9255
9256 returnAST = null;
9257 ASTPair currentAST = new ASTPair();
9258 AST indexPropertyArgs_AST = null;
9259 Token lb = null;
9260 AST lb_AST = null;
9261
9262 if ( inputState.guessing==0 ) {
9263 indexPropertyArgs_AST = (AST)currentAST.root;
9264 indexPropertyArgs_AST = indexee;
9265 currentAST.root = indexPropertyArgs_AST;
9266 currentAST.child = indexPropertyArgs_AST!=null &&indexPropertyArgs_AST.getFirstChild()!=null ?
9267 indexPropertyArgs_AST.getFirstChild() : indexPropertyArgs_AST;
9268 currentAST.advanceChildToEnd();
9269 }
9270 lb = LT(1);
9271 lb_AST = astFactory.create(lb);
9272 astFactory.makeASTRoot(currentAST, lb_AST);
9273 match(LBRACK);
9274 if ( inputState.guessing==0 ) {
9275 lb_AST.setType(INDEX_OP);
9276 }
9277 argList();
9278 astFactory.addASTChild(currentAST, returnAST);
9279 match(RBRACK);
9280 indexPropertyArgs_AST = (AST)currentAST.root;
9281 returnAST = indexPropertyArgs_AST;
9282 }
9283
9284 /*** If a dot is followed by a parenthesized or quoted expression, the member is computed dynamically,
9285 * and the member selection is done only at runtime. This forces a statically unchecked member access.
9286 */
9287 public final void dynamicMemberName() throws RecognitionException, TokenStreamException {
9288
9289 returnAST = null;
9290 ASTPair currentAST = new ASTPair();
9291 AST dynamicMemberName_AST = null;
9292 Token first = LT(1);
9293
9294 {
9295 switch ( LA(1)) {
9296 case LPAREN:
9297 {
9298 parenthesizedExpression();
9299 astFactory.addASTChild(currentAST, returnAST);
9300 break;
9301 }
9302 case STRING_CTOR_START:
9303 {
9304 stringConstructorExpression();
9305 astFactory.addASTChild(currentAST, returnAST);
9306 break;
9307 }
9308 default:
9309 {
9310 throw new NoViableAltException(LT(1), getFilename());
9311 }
9312 }
9313 }
9314 if ( inputState.guessing==0 ) {
9315 dynamicMemberName_AST = (AST)currentAST.root;
9316 dynamicMemberName_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(DYNAMIC_MEMBER,"DYNAMIC_MEMBER",first,LT(1))).add(dynamicMemberName_AST));
9317 currentAST.root = dynamicMemberName_AST;
9318 currentAST.child = dynamicMemberName_AST!=null &&dynamicMemberName_AST.getFirstChild()!=null ?
9319 dynamicMemberName_AST.getFirstChild() : dynamicMemberName_AST;
9320 currentAST.advanceChildToEnd();
9321 }
9322 dynamicMemberName_AST = (AST)currentAST.root;
9323 returnAST = dynamicMemberName_AST;
9324 }
9325
9326 /*** Allowed keywords after dot (as a member name) and before colon (as a label).
9327 * TODO: What's the rationale for these?
9328 */
9329 public final void keywordPropertyNames() throws RecognitionException, TokenStreamException {
9330
9331 returnAST = null;
9332 ASTPair currentAST = new ASTPair();
9333 AST keywordPropertyNames_AST = null;
9334
9335 {
9336 switch ( LA(1)) {
9337 case LITERAL_class:
9338 {
9339 AST tmp226_AST = null;
9340 tmp226_AST = astFactory.create(LT(1));
9341 astFactory.addASTChild(currentAST, tmp226_AST);
9342 match(LITERAL_class);
9343 break;
9344 }
9345 case LITERAL_in:
9346 {
9347 AST tmp227_AST = null;
9348 tmp227_AST = astFactory.create(LT(1));
9349 astFactory.addASTChild(currentAST, tmp227_AST);
9350 match(LITERAL_in);
9351 break;
9352 }
9353 case LITERAL_as:
9354 {
9355 AST tmp228_AST = null;
9356 tmp228_AST = astFactory.create(LT(1));
9357 astFactory.addASTChild(currentAST, tmp228_AST);
9358 match(LITERAL_as);
9359 break;
9360 }
9361 case LITERAL_def:
9362 {
9363 AST tmp229_AST = null;
9364 tmp229_AST = astFactory.create(LT(1));
9365 astFactory.addASTChild(currentAST, tmp229_AST);
9366 match(LITERAL_def);
9367 break;
9368 }
9369 case LITERAL_if:
9370 {
9371 AST tmp230_AST = null;
9372 tmp230_AST = astFactory.create(LT(1));
9373 astFactory.addASTChild(currentAST, tmp230_AST);
9374 match(LITERAL_if);
9375 break;
9376 }
9377 case LITERAL_else:
9378 {
9379 AST tmp231_AST = null;
9380 tmp231_AST = astFactory.create(LT(1));
9381 astFactory.addASTChild(currentAST, tmp231_AST);
9382 match(LITERAL_else);
9383 break;
9384 }
9385 case LITERAL_for:
9386 {
9387 AST tmp232_AST = null;
9388 tmp232_AST = astFactory.create(LT(1));
9389 astFactory.addASTChild(currentAST, tmp232_AST);
9390 match(LITERAL_for);
9391 break;
9392 }
9393 case LITERAL_while:
9394 {
9395 AST tmp233_AST = null;
9396 tmp233_AST = astFactory.create(LT(1));
9397 astFactory.addASTChild(currentAST, tmp233_AST);
9398 match(LITERAL_while);
9399 break;
9400 }
9401 case UNUSED_DO:
9402 {
9403 AST tmp234_AST = null;
9404 tmp234_AST = astFactory.create(LT(1));
9405 astFactory.addASTChild(currentAST, tmp234_AST);
9406 match(UNUSED_DO);
9407 break;
9408 }
9409 case LITERAL_switch:
9410 {
9411 AST tmp235_AST = null;
9412 tmp235_AST = astFactory.create(LT(1));
9413 astFactory.addASTChild(currentAST, tmp235_AST);
9414 match(LITERAL_switch);
9415 break;
9416 }
9417 case LITERAL_try:
9418 {
9419 AST tmp236_AST = null;
9420 tmp236_AST = astFactory.create(LT(1));
9421 astFactory.addASTChild(currentAST, tmp236_AST);
9422 match(LITERAL_try);
9423 break;
9424 }
9425 case LITERAL_catch:
9426 {
9427 AST tmp237_AST = null;
9428 tmp237_AST = astFactory.create(LT(1));
9429 astFactory.addASTChild(currentAST, tmp237_AST);
9430 match(LITERAL_catch);
9431 break;
9432 }
9433 case LITERAL_finally:
9434 {
9435 AST tmp238_AST = null;
9436 tmp238_AST = astFactory.create(LT(1));
9437 astFactory.addASTChild(currentAST, tmp238_AST);
9438 match(LITERAL_finally);
9439 break;
9440 }
9441 case LITERAL_void:
9442 case LITERAL_boolean:
9443 case LITERAL_byte:
9444 case LITERAL_char:
9445 case LITERAL_short:
9446 case LITERAL_int:
9447 case LITERAL_float:
9448 case LITERAL_long:
9449 case LITERAL_double:
9450 case LITERAL_any:
9451 {
9452 builtInType();
9453 astFactory.addASTChild(currentAST, returnAST);
9454 break;
9455 }
9456 default:
9457 {
9458 throw new NoViableAltException(LT(1), getFilename());
9459 }
9460 }
9461 }
9462 if ( inputState.guessing==0 ) {
9463 keywordPropertyNames_AST = (AST)currentAST.root;
9464 keywordPropertyNames_AST.setType(IDENT);
9465 }
9466 keywordPropertyNames_AST = (AST)currentAST.root;
9467 returnAST = keywordPropertyNames_AST;
9468 }
9469
9470 public final void parenthesizedExpression() throws RecognitionException, TokenStreamException {
9471
9472 returnAST = null;
9473 ASTPair currentAST = new ASTPair();
9474 AST parenthesizedExpression_AST = null;
9475
9476 match(LPAREN);
9477 strictContextExpression();
9478 astFactory.addASTChild(currentAST, returnAST);
9479 match(RPAREN);
9480 parenthesizedExpression_AST = (AST)currentAST.root;
9481 returnAST = parenthesizedExpression_AST;
9482 }
9483
9484 public final void stringConstructorExpression() throws RecognitionException, TokenStreamException {
9485
9486 returnAST = null;
9487 ASTPair currentAST = new ASTPair();
9488 AST stringConstructorExpression_AST = null;
9489 Token cs = null;
9490 AST cs_AST = null;
9491 Token cm = null;
9492 AST cm_AST = null;
9493 Token ce = null;
9494 AST ce_AST = null;
9495 Token first = LT(1);
9496
9497 cs = LT(1);
9498 cs_AST = astFactory.create(cs);
9499 astFactory.addASTChild(currentAST, cs_AST);
9500 match(STRING_CTOR_START);
9501 if ( inputState.guessing==0 ) {
9502 cs_AST.setType(STRING_LITERAL);
9503 }
9504 stringConstructorValuePart();
9505 astFactory.addASTChild(currentAST, returnAST);
9506 {
9507 _loop434:
9508 do {
9509 if ((LA(1)==STRING_CTOR_MIDDLE)) {
9510 cm = LT(1);
9511 cm_AST = astFactory.create(cm);
9512 astFactory.addASTChild(currentAST, cm_AST);
9513 match(STRING_CTOR_MIDDLE);
9514 if ( inputState.guessing==0 ) {
9515 cm_AST.setType(STRING_LITERAL);
9516 }
9517 stringConstructorValuePart();
9518 astFactory.addASTChild(currentAST, returnAST);
9519 }
9520 else {
9521 break _loop434;
9522 }
9523
9524 } while (true);
9525 }
9526 ce = LT(1);
9527 ce_AST = astFactory.create(ce);
9528 astFactory.addASTChild(currentAST, ce_AST);
9529 match(STRING_CTOR_END);
9530 if ( inputState.guessing==0 ) {
9531 stringConstructorExpression_AST = (AST)currentAST.root;
9532 ce_AST.setType(STRING_LITERAL);
9533 stringConstructorExpression_AST =
9534 (AST)astFactory.make( (new ASTArray(2)).add(create(STRING_CONSTRUCTOR,"STRING_CONSTRUCTOR",first,LT(1))).add(stringConstructorExpression_AST));
9535
9536 currentAST.root = stringConstructorExpression_AST;
9537 currentAST.child = stringConstructorExpression_AST!=null &&stringConstructorExpression_AST.getFirstChild()!=null ?
9538 stringConstructorExpression_AST.getFirstChild() : stringConstructorExpression_AST;
9539 currentAST.advanceChildToEnd();
9540 }
9541 stringConstructorExpression_AST = (AST)currentAST.root;
9542 returnAST = stringConstructorExpression_AST;
9543 }
9544
9545 public final void logicalOrExpression(
9546 int lc_stmt
9547 ) throws RecognitionException, TokenStreamException {
9548
9549 returnAST = null;
9550 ASTPair currentAST = new ASTPair();
9551 AST logicalOrExpression_AST = null;
9552
9553 logicalAndExpression(lc_stmt);
9554 astFactory.addASTChild(currentAST, returnAST);
9555 {
9556 _loop351:
9557 do {
9558 if ((LA(1)==LOR)) {
9559 AST tmp241_AST = null;
9560 tmp241_AST = astFactory.create(LT(1));
9561 astFactory.makeASTRoot(currentAST, tmp241_AST);
9562 match(LOR);
9563 nls();
9564 logicalAndExpression(0);
9565 astFactory.addASTChild(currentAST, returnAST);
9566 }
9567 else {
9568 break _loop351;
9569 }
9570
9571 } while (true);
9572 }
9573 logicalOrExpression_AST = (AST)currentAST.root;
9574 returnAST = logicalOrExpression_AST;
9575 }
9576
9577 public final void logicalAndExpression(
9578 int lc_stmt
9579 ) throws RecognitionException, TokenStreamException {
9580
9581 returnAST = null;
9582 ASTPair currentAST = new ASTPair();
9583 AST logicalAndExpression_AST = null;
9584
9585 inclusiveOrExpression(lc_stmt);
9586 astFactory.addASTChild(currentAST, returnAST);
9587 {
9588 _loop354:
9589 do {
9590 if ((LA(1)==LAND)) {
9591 AST tmp242_AST = null;
9592 tmp242_AST = astFactory.create(LT(1));
9593 astFactory.makeASTRoot(currentAST, tmp242_AST);
9594 match(LAND);
9595 nls();
9596 inclusiveOrExpression(0);
9597 astFactory.addASTChild(currentAST, returnAST);
9598 }
9599 else {
9600 break _loop354;
9601 }
9602
9603 } while (true);
9604 }
9605 logicalAndExpression_AST = (AST)currentAST.root;
9606 returnAST = logicalAndExpression_AST;
9607 }
9608
9609 public final void inclusiveOrExpression(
9610 int lc_stmt
9611 ) throws RecognitionException, TokenStreamException {
9612
9613 returnAST = null;
9614 ASTPair currentAST = new ASTPair();
9615 AST inclusiveOrExpression_AST = null;
9616
9617 exclusiveOrExpression(lc_stmt);
9618 astFactory.addASTChild(currentAST, returnAST);
9619 {
9620 _loop357:
9621 do {
9622 if ((LA(1)==BOR)) {
9623 AST tmp243_AST = null;
9624 tmp243_AST = astFactory.create(LT(1));
9625 astFactory.makeASTRoot(currentAST, tmp243_AST);
9626 match(BOR);
9627 nls();
9628 exclusiveOrExpression(0);
9629 astFactory.addASTChild(currentAST, returnAST);
9630 }
9631 else {
9632 break _loop357;
9633 }
9634
9635 } while (true);
9636 }
9637 inclusiveOrExpression_AST = (AST)currentAST.root;
9638 returnAST = inclusiveOrExpression_AST;
9639 }
9640
9641 public final void exclusiveOrExpression(
9642 int lc_stmt
9643 ) throws RecognitionException, TokenStreamException {
9644
9645 returnAST = null;
9646 ASTPair currentAST = new ASTPair();
9647 AST exclusiveOrExpression_AST = null;
9648
9649 andExpression(lc_stmt);
9650 astFactory.addASTChild(currentAST, returnAST);
9651 {
9652 _loop360:
9653 do {
9654 if ((LA(1)==BXOR)) {
9655 AST tmp244_AST = null;
9656 tmp244_AST = astFactory.create(LT(1));
9657 astFactory.makeASTRoot(currentAST, tmp244_AST);
9658 match(BXOR);
9659 nls();
9660 andExpression(0);
9661 astFactory.addASTChild(currentAST, returnAST);
9662 }
9663 else {
9664 break _loop360;
9665 }
9666
9667 } while (true);
9668 }
9669 exclusiveOrExpression_AST = (AST)currentAST.root;
9670 returnAST = exclusiveOrExpression_AST;
9671 }
9672
9673 public final void andExpression(
9674 int lc_stmt
9675 ) throws RecognitionException, TokenStreamException {
9676
9677 returnAST = null;
9678 ASTPair currentAST = new ASTPair();
9679 AST andExpression_AST = null;
9680
9681 regexExpression(lc_stmt);
9682 astFactory.addASTChild(currentAST, returnAST);
9683 {
9684 _loop363:
9685 do {
9686 if ((LA(1)==BAND)) {
9687 AST tmp245_AST = null;
9688 tmp245_AST = astFactory.create(LT(1));
9689 astFactory.makeASTRoot(currentAST, tmp245_AST);
9690 match(BAND);
9691 nls();
9692 regexExpression(0);
9693 astFactory.addASTChild(currentAST, returnAST);
9694 }
9695 else {
9696 break _loop363;
9697 }
9698
9699 } while (true);
9700 }
9701 andExpression_AST = (AST)currentAST.root;
9702 returnAST = andExpression_AST;
9703 }
9704
9705 public final void regexExpression(
9706 int lc_stmt
9707 ) throws RecognitionException, TokenStreamException {
9708
9709 returnAST = null;
9710 ASTPair currentAST = new ASTPair();
9711 AST regexExpression_AST = null;
9712
9713 equalityExpression(lc_stmt);
9714 astFactory.addASTChild(currentAST, returnAST);
9715 {
9716 _loop367:
9717 do {
9718 if ((LA(1)==REGEX_FIND||LA(1)==REGEX_MATCH)) {
9719 {
9720 switch ( LA(1)) {
9721 case REGEX_FIND:
9722 {
9723 AST tmp246_AST = null;
9724 tmp246_AST = astFactory.create(LT(1));
9725 astFactory.makeASTRoot(currentAST, tmp246_AST);
9726 match(REGEX_FIND);
9727 break;
9728 }
9729 case REGEX_MATCH:
9730 {
9731 AST tmp247_AST = null;
9732 tmp247_AST = astFactory.create(LT(1));
9733 astFactory.makeASTRoot(currentAST, tmp247_AST);
9734 match(REGEX_MATCH);
9735 break;
9736 }
9737 default:
9738 {
9739 throw new NoViableAltException(LT(1), getFilename());
9740 }
9741 }
9742 }
9743 nls();
9744 equalityExpression(0);
9745 astFactory.addASTChild(currentAST, returnAST);
9746 }
9747 else {
9748 break _loop367;
9749 }
9750
9751 } while (true);
9752 }
9753 regexExpression_AST = (AST)currentAST.root;
9754 returnAST = regexExpression_AST;
9755 }
9756
9757 public final void equalityExpression(
9758 int lc_stmt
9759 ) throws RecognitionException, TokenStreamException {
9760
9761 returnAST = null;
9762 ASTPair currentAST = new ASTPair();
9763 AST equalityExpression_AST = null;
9764
9765 relationalExpression(lc_stmt);
9766 astFactory.addASTChild(currentAST, returnAST);
9767 {
9768 _loop371:
9769 do {
9770 if (((LA(1) >= NOT_EQUAL && LA(1) <= COMPARE_TO))) {
9771 {
9772 switch ( LA(1)) {
9773 case NOT_EQUAL:
9774 {
9775 AST tmp248_AST = null;
9776 tmp248_AST = astFactory.create(LT(1));
9777 astFactory.makeASTRoot(currentAST, tmp248_AST);
9778 match(NOT_EQUAL);
9779 break;
9780 }
9781 case EQUAL:
9782 {
9783 AST tmp249_AST = null;
9784 tmp249_AST = astFactory.create(LT(1));
9785 astFactory.makeASTRoot(currentAST, tmp249_AST);
9786 match(EQUAL);
9787 break;
9788 }
9789 case COMPARE_TO:
9790 {
9791 AST tmp250_AST = null;
9792 tmp250_AST = astFactory.create(LT(1));
9793 astFactory.makeASTRoot(currentAST, tmp250_AST);
9794 match(COMPARE_TO);
9795 break;
9796 }
9797 default:
9798 {
9799 throw new NoViableAltException(LT(1), getFilename());
9800 }
9801 }
9802 }
9803 nls();
9804 relationalExpression(0);
9805 astFactory.addASTChild(currentAST, returnAST);
9806 }
9807 else {
9808 break _loop371;
9809 }
9810
9811 } while (true);
9812 }
9813 equalityExpression_AST = (AST)currentAST.root;
9814 returnAST = equalityExpression_AST;
9815 }
9816
9817 public final void relationalExpression(
9818 int lc_stmt
9819 ) throws RecognitionException, TokenStreamException {
9820
9821 returnAST = null;
9822 ASTPair currentAST = new ASTPair();
9823 AST relationalExpression_AST = null;
9824
9825 shiftExpression(lc_stmt);
9826 astFactory.addASTChild(currentAST, returnAST);
9827 {
9828 switch ( LA(1)) {
9829 case EOF:
9830 case IDENT:
9831 case LBRACK:
9832 case RBRACK:
9833 case LPAREN:
9834 case QUESTION:
9835 case LITERAL_super:
9836 case LT:
9837 case COMMA:
9838 case GT:
9839 case LITERAL_void:
9840 case LITERAL_boolean:
9841 case LITERAL_byte:
9842 case LITERAL_char:
9843 case LITERAL_short:
9844 case LITERAL_int:
9845 case LITERAL_float:
9846 case LITERAL_long:
9847 case LITERAL_double:
9848 case LITERAL_any:
9849 case RPAREN:
9850 case ASSIGN:
9851 case BAND:
9852 case LCURLY:
9853 case RCURLY:
9854 case SEMI:
9855 case NLS:
9856 case LITERAL_default:
9857 case LITERAL_this:
9858 case STRING_LITERAL:
9859 case CLOSABLE_BLOCK_OP:
9860 case COLON:
9861 case LITERAL_else:
9862 case LITERAL_in:
9863 case PLUS:
9864 case MINUS:
9865 case LITERAL_case:
9866 case PLUS_ASSIGN:
9867 case MINUS_ASSIGN:
9868 case STAR_ASSIGN:
9869 case DIV_ASSIGN:
9870 case MOD_ASSIGN:
9871 case SR_ASSIGN:
9872 case BSR_ASSIGN:
9873 case SL_ASSIGN:
9874 case BAND_ASSIGN:
9875 case BXOR_ASSIGN:
9876 case BOR_ASSIGN:
9877 case STAR_STAR_ASSIGN:
9878 case LOR:
9879 case LAND:
9880 case BOR:
9881 case BXOR:
9882 case REGEX_FIND:
9883 case REGEX_MATCH:
9884 case NOT_EQUAL:
9885 case EQUAL:
9886 case COMPARE_TO:
9887 case LE:
9888 case GE:
9889 case INC:
9890 case DEC:
9891 case BNOT:
9892 case LNOT:
9893 case DOLLAR:
9894 case STRING_CTOR_START:
9895 case LITERAL_new:
9896 case LITERAL_true:
9897 case LITERAL_false:
9898 case LITERAL_null:
9899 case NUM_INT:
9900 case NUM_FLOAT:
9901 case NUM_LONG:
9902 case NUM_DOUBLE:
9903 case NUM_BIG_INT:
9904 case NUM_BIG_DECIMAL:
9905 {
9906 {
9907 switch ( LA(1)) {
9908 case LT:
9909 case GT:
9910 case LITERAL_in:
9911 case LE:
9912 case GE:
9913 {
9914 {
9915 switch ( LA(1)) {
9916 case LT:
9917 {
9918 AST tmp251_AST = null;
9919 tmp251_AST = astFactory.create(LT(1));
9920 astFactory.makeASTRoot(currentAST, tmp251_AST);
9921 match(LT);
9922 break;
9923 }
9924 case GT:
9925 {
9926 AST tmp252_AST = null;
9927 tmp252_AST = astFactory.create(LT(1));
9928 astFactory.makeASTRoot(currentAST, tmp252_AST);
9929 match(GT);
9930 break;
9931 }
9932 case LE:
9933 {
9934 AST tmp253_AST = null;
9935 tmp253_AST = astFactory.create(LT(1));
9936 astFactory.makeASTRoot(currentAST, tmp253_AST);
9937 match(LE);
9938 break;
9939 }
9940 case GE:
9941 {
9942 AST tmp254_AST = null;
9943 tmp254_AST = astFactory.create(LT(1));
9944 astFactory.makeASTRoot(currentAST, tmp254_AST);
9945 match(GE);
9946 break;
9947 }
9948 case LITERAL_in:
9949 {
9950 AST tmp255_AST = null;
9951 tmp255_AST = astFactory.create(LT(1));
9952 astFactory.makeASTRoot(currentAST, tmp255_AST);
9953 match(LITERAL_in);
9954 break;
9955 }
9956 default:
9957 {
9958 throw new NoViableAltException(LT(1), getFilename());
9959 }
9960 }
9961 }
9962 nls();
9963 shiftExpression(0);
9964 astFactory.addASTChild(currentAST, returnAST);
9965 break;
9966 }
9967 case EOF:
9968 case IDENT:
9969 case LBRACK:
9970 case RBRACK:
9971 case LPAREN:
9972 case QUESTION:
9973 case LITERAL_super:
9974 case COMMA:
9975 case LITERAL_void:
9976 case LITERAL_boolean:
9977 case LITERAL_byte:
9978 case LITERAL_char:
9979 case LITERAL_short:
9980 case LITERAL_int:
9981 case LITERAL_float:
9982 case LITERAL_long:
9983 case LITERAL_double:
9984 case LITERAL_any:
9985 case RPAREN:
9986 case ASSIGN:
9987 case BAND:
9988 case LCURLY:
9989 case RCURLY:
9990 case SEMI:
9991 case NLS:
9992 case LITERAL_default:
9993 case LITERAL_this:
9994 case STRING_LITERAL:
9995 case CLOSABLE_BLOCK_OP:
9996 case COLON:
9997 case LITERAL_else:
9998 case PLUS:
9999 case MINUS:
10000 case LITERAL_case:
10001 case PLUS_ASSIGN:
10002 case MINUS_ASSIGN:
10003 case STAR_ASSIGN:
10004 case DIV_ASSIGN:
10005 case MOD_ASSIGN:
10006 case SR_ASSIGN:
10007 case BSR_ASSIGN:
10008 case SL_ASSIGN:
10009 case BAND_ASSIGN:
10010 case BXOR_ASSIGN:
10011 case BOR_ASSIGN:
10012 case STAR_STAR_ASSIGN:
10013 case LOR:
10014 case LAND:
10015 case BOR:
10016 case BXOR:
10017 case REGEX_FIND:
10018 case REGEX_MATCH:
10019 case NOT_EQUAL:
10020 case EQUAL:
10021 case COMPARE_TO:
10022 case INC:
10023 case DEC:
10024 case BNOT:
10025 case LNOT:
10026 case DOLLAR:
10027 case STRING_CTOR_START:
10028 case LITERAL_new:
10029 case LITERAL_true:
10030 case LITERAL_false:
10031 case LITERAL_null:
10032 case NUM_INT:
10033 case NUM_FLOAT:
10034 case NUM_LONG:
10035 case NUM_DOUBLE:
10036 case NUM_BIG_INT:
10037 case NUM_BIG_DECIMAL:
10038 {
10039 break;
10040 }
10041 default:
10042 {
10043 throw new NoViableAltException(LT(1), getFilename());
10044 }
10045 }
10046 }
10047 break;
10048 }
10049 case LITERAL_instanceof:
10050 {
10051 AST tmp256_AST = null;
10052 tmp256_AST = astFactory.create(LT(1));
10053 astFactory.makeASTRoot(currentAST, tmp256_AST);
10054 match(LITERAL_instanceof);
10055 nls();
10056 typeSpec(true);
10057 astFactory.addASTChild(currentAST, returnAST);
10058 break;
10059 }
10060 case LITERAL_as:
10061 {
10062 AST tmp257_AST = null;
10063 tmp257_AST = astFactory.create(LT(1));
10064 astFactory.makeASTRoot(currentAST, tmp257_AST);
10065 match(LITERAL_as);
10066 nls();
10067 typeSpec(true);
10068 astFactory.addASTChild(currentAST, returnAST);
10069 break;
10070 }
10071 default:
10072 {
10073 throw new NoViableAltException(LT(1), getFilename());
10074 }
10075 }
10076 }
10077 relationalExpression_AST = (AST)currentAST.root;
10078 returnAST = relationalExpression_AST;
10079 }
10080
10081 public final void additiveExpression(
10082 int lc_stmt
10083 ) throws RecognitionException, TokenStreamException {
10084
10085 returnAST = null;
10086 ASTPair currentAST = new ASTPair();
10087 AST additiveExpression_AST = null;
10088
10089 multiplicativeExpression(lc_stmt);
10090 astFactory.addASTChild(currentAST, returnAST);
10091 {
10092 _loop384:
10093 do {
10094 if ((LA(1)==PLUS||LA(1)==MINUS) && (_tokenSet_103.member(LA(2))) && (_tokenSet_95.member(LA(3)))) {
10095 {
10096 switch ( LA(1)) {
10097 case PLUS:
10098 {
10099 AST tmp258_AST = null;
10100 tmp258_AST = astFactory.create(LT(1));
10101 astFactory.makeASTRoot(currentAST, tmp258_AST);
10102 match(PLUS);
10103 break;
10104 }
10105 case MINUS:
10106 {
10107 AST tmp259_AST = null;
10108 tmp259_AST = astFactory.create(LT(1));
10109 astFactory.makeASTRoot(currentAST, tmp259_AST);
10110 match(MINUS);
10111 break;
10112 }
10113 default:
10114 {
10115 throw new NoViableAltException(LT(1), getFilename());
10116 }
10117 }
10118 }
10119 nls();
10120 multiplicativeExpression(0);
10121 astFactory.addASTChild(currentAST, returnAST);
10122 }
10123 else {
10124 break _loop384;
10125 }
10126
10127 } while (true);
10128 }
10129 additiveExpression_AST = (AST)currentAST.root;
10130 returnAST = additiveExpression_AST;
10131 }
10132
10133 public final void multiplicativeExpression(
10134 int lc_stmt
10135 ) throws RecognitionException, TokenStreamException {
10136
10137 returnAST = null;
10138 ASTPair currentAST = new ASTPair();
10139 AST multiplicativeExpression_AST = null;
10140
10141 switch ( LA(1)) {
10142 case INC:
10143 {
10144 {
10145 AST tmp260_AST = null;
10146 tmp260_AST = astFactory.create(LT(1));
10147 astFactory.makeASTRoot(currentAST, tmp260_AST);
10148 match(INC);
10149 nls();
10150 powerExpressionNotPlusMinus(0);
10151 astFactory.addASTChild(currentAST, returnAST);
10152 {
10153 _loop389:
10154 do {
10155 if ((_tokenSet_104.member(LA(1)))) {
10156 {
10157 switch ( LA(1)) {
10158 case STAR:
10159 {
10160 AST tmp261_AST = null;
10161 tmp261_AST = astFactory.create(LT(1));
10162 astFactory.makeASTRoot(currentAST, tmp261_AST);
10163 match(STAR);
10164 break;
10165 }
10166 case DIV:
10167 {
10168 AST tmp262_AST = null;
10169 tmp262_AST = astFactory.create(LT(1));
10170 astFactory.makeASTRoot(currentAST, tmp262_AST);
10171 match(DIV);
10172 break;
10173 }
10174 case MOD:
10175 {
10176 AST tmp263_AST = null;
10177 tmp263_AST = astFactory.create(LT(1));
10178 astFactory.makeASTRoot(currentAST, tmp263_AST);
10179 match(MOD);
10180 break;
10181 }
10182 default:
10183 {
10184 throw new NoViableAltException(LT(1), getFilename());
10185 }
10186 }
10187 }
10188 nls();
10189 powerExpression(0);
10190 astFactory.addASTChild(currentAST, returnAST);
10191 }
10192 else {
10193 break _loop389;
10194 }
10195
10196 } while (true);
10197 }
10198 }
10199 multiplicativeExpression_AST = (AST)currentAST.root;
10200 break;
10201 }
10202 case DEC:
10203 {
10204 {
10205 AST tmp264_AST = null;
10206 tmp264_AST = astFactory.create(LT(1));
10207 astFactory.makeASTRoot(currentAST, tmp264_AST);
10208 match(DEC);
10209 nls();
10210 powerExpressionNotPlusMinus(0);
10211 astFactory.addASTChild(currentAST, returnAST);
10212 {
10213 _loop393:
10214 do {
10215 if ((_tokenSet_104.member(LA(1)))) {
10216 {
10217 switch ( LA(1)) {
10218 case STAR:
10219 {
10220 AST tmp265_AST = null;
10221 tmp265_AST = astFactory.create(LT(1));
10222 astFactory.makeASTRoot(currentAST, tmp265_AST);
10223 match(STAR);
10224 break;
10225 }
10226 case DIV:
10227 {
10228 AST tmp266_AST = null;
10229 tmp266_AST = astFactory.create(LT(1));
10230 astFactory.makeASTRoot(currentAST, tmp266_AST);
10231 match(DIV);
10232 break;
10233 }
10234 case MOD:
10235 {
10236 AST tmp267_AST = null;
10237 tmp267_AST = astFactory.create(LT(1));
10238 astFactory.makeASTRoot(currentAST, tmp267_AST);
10239 match(MOD);
10240 break;
10241 }
10242 default:
10243 {
10244 throw new NoViableAltException(LT(1), getFilename());
10245 }
10246 }
10247 }
10248 nls();
10249 powerExpression(0);
10250 astFactory.addASTChild(currentAST, returnAST);
10251 }
10252 else {
10253 break _loop393;
10254 }
10255
10256 } while (true);
10257 }
10258 }
10259 multiplicativeExpression_AST = (AST)currentAST.root;
10260 break;
10261 }
10262 case MINUS:
10263 {
10264 {
10265 AST tmp268_AST = null;
10266 tmp268_AST = astFactory.create(LT(1));
10267 astFactory.makeASTRoot(currentAST, tmp268_AST);
10268 match(MINUS);
10269 if ( inputState.guessing==0 ) {
10270 tmp268_AST.setType(UNARY_MINUS);
10271 }
10272 nls();
10273 powerExpressionNotPlusMinus(0);
10274 astFactory.addASTChild(currentAST, returnAST);
10275 {
10276 _loop397:
10277 do {
10278 if ((_tokenSet_104.member(LA(1)))) {
10279 {
10280 switch ( LA(1)) {
10281 case STAR:
10282 {
10283 AST tmp269_AST = null;
10284 tmp269_AST = astFactory.create(LT(1));
10285 astFactory.makeASTRoot(currentAST, tmp269_AST);
10286 match(STAR);
10287 break;
10288 }
10289 case DIV:
10290 {
10291 AST tmp270_AST = null;
10292 tmp270_AST = astFactory.create(LT(1));
10293 astFactory.makeASTRoot(currentAST, tmp270_AST);
10294 match(DIV);
10295 break;
10296 }
10297 case MOD:
10298 {
10299 AST tmp271_AST = null;
10300 tmp271_AST = astFactory.create(LT(1));
10301 astFactory.makeASTRoot(currentAST, tmp271_AST);
10302 match(MOD);
10303 break;
10304 }
10305 default:
10306 {
10307 throw new NoViableAltException(LT(1), getFilename());
10308 }
10309 }
10310 }
10311 nls();
10312 powerExpression(0);
10313 astFactory.addASTChild(currentAST, returnAST);
10314 }
10315 else {
10316 break _loop397;
10317 }
10318
10319 } while (true);
10320 }
10321 }
10322 multiplicativeExpression_AST = (AST)currentAST.root;
10323 break;
10324 }
10325 case PLUS:
10326 {
10327 {
10328 AST tmp272_AST = null;
10329 tmp272_AST = astFactory.create(LT(1));
10330 astFactory.makeASTRoot(currentAST, tmp272_AST);
10331 match(PLUS);
10332 if ( inputState.guessing==0 ) {
10333 tmp272_AST.setType(UNARY_PLUS);
10334 }
10335 nls();
10336 powerExpressionNotPlusMinus(0);
10337 astFactory.addASTChild(currentAST, returnAST);
10338 {
10339 _loop401:
10340 do {
10341 if ((_tokenSet_104.member(LA(1)))) {
10342 {
10343 switch ( LA(1)) {
10344 case STAR:
10345 {
10346 AST tmp273_AST = null;
10347 tmp273_AST = astFactory.create(LT(1));
10348 astFactory.makeASTRoot(currentAST, tmp273_AST);
10349 match(STAR);
10350 break;
10351 }
10352 case DIV:
10353 {
10354 AST tmp274_AST = null;
10355 tmp274_AST = astFactory.create(LT(1));
10356 astFactory.makeASTRoot(currentAST, tmp274_AST);
10357 match(DIV);
10358 break;
10359 }
10360 case MOD:
10361 {
10362 AST tmp275_AST = null;
10363 tmp275_AST = astFactory.create(LT(1));
10364 astFactory.makeASTRoot(currentAST, tmp275_AST);
10365 match(MOD);
10366 break;
10367 }
10368 default:
10369 {
10370 throw new NoViableAltException(LT(1), getFilename());
10371 }
10372 }
10373 }
10374 nls();
10375 powerExpression(0);
10376 astFactory.addASTChild(currentAST, returnAST);
10377 }
10378 else {
10379 break _loop401;
10380 }
10381
10382 } while (true);
10383 }
10384 }
10385 multiplicativeExpression_AST = (AST)currentAST.root;
10386 break;
10387 }
10388 case IDENT:
10389 case LBRACK:
10390 case LPAREN:
10391 case LITERAL_super:
10392 case LITERAL_void:
10393 case LITERAL_boolean:
10394 case LITERAL_byte:
10395 case LITERAL_char:
10396 case LITERAL_short:
10397 case LITERAL_int:
10398 case LITERAL_float:
10399 case LITERAL_long:
10400 case LITERAL_double:
10401 case LITERAL_any:
10402 case LCURLY:
10403 case LITERAL_this:
10404 case STRING_LITERAL:
10405 case BNOT:
10406 case LNOT:
10407 case DOLLAR:
10408 case STRING_CTOR_START:
10409 case LITERAL_new:
10410 case LITERAL_true:
10411 case LITERAL_false:
10412 case LITERAL_null:
10413 case NUM_INT:
10414 case NUM_FLOAT:
10415 case NUM_LONG:
10416 case NUM_DOUBLE:
10417 case NUM_BIG_INT:
10418 case NUM_BIG_DECIMAL:
10419 {
10420 {
10421 powerExpressionNotPlusMinus(lc_stmt);
10422 astFactory.addASTChild(currentAST, returnAST);
10423 {
10424 _loop405:
10425 do {
10426 if ((_tokenSet_104.member(LA(1)))) {
10427 {
10428 switch ( LA(1)) {
10429 case STAR:
10430 {
10431 AST tmp276_AST = null;
10432 tmp276_AST = astFactory.create(LT(1));
10433 astFactory.makeASTRoot(currentAST, tmp276_AST);
10434 match(STAR);
10435 break;
10436 }
10437 case DIV:
10438 {
10439 AST tmp277_AST = null;
10440 tmp277_AST = astFactory.create(LT(1));
10441 astFactory.makeASTRoot(currentAST, tmp277_AST);
10442 match(DIV);
10443 break;
10444 }
10445 case MOD:
10446 {
10447 AST tmp278_AST = null;
10448 tmp278_AST = astFactory.create(LT(1));
10449 astFactory.makeASTRoot(currentAST, tmp278_AST);
10450 match(MOD);
10451 break;
10452 }
10453 default:
10454 {
10455 throw new NoViableAltException(LT(1), getFilename());
10456 }
10457 }
10458 }
10459 nls();
10460 powerExpression(0);
10461 astFactory.addASTChild(currentAST, returnAST);
10462 }
10463 else {
10464 break _loop405;
10465 }
10466
10467 } while (true);
10468 }
10469 }
10470 multiplicativeExpression_AST = (AST)currentAST.root;
10471 break;
10472 }
10473 default:
10474 {
10475 throw new NoViableAltException(LT(1), getFilename());
10476 }
10477 }
10478 returnAST = multiplicativeExpression_AST;
10479 }
10480
10481 public final void powerExpressionNotPlusMinus(
10482 int lc_stmt
10483 ) throws RecognitionException, TokenStreamException {
10484
10485 returnAST = null;
10486 ASTPair currentAST = new ASTPair();
10487 AST powerExpressionNotPlusMinus_AST = null;
10488
10489 unaryExpressionNotPlusMinus(lc_stmt);
10490 astFactory.addASTChild(currentAST, returnAST);
10491 {
10492 _loop411:
10493 do {
10494 if ((LA(1)==STAR_STAR)) {
10495 AST tmp279_AST = null;
10496 tmp279_AST = astFactory.create(LT(1));
10497 astFactory.makeASTRoot(currentAST, tmp279_AST);
10498 match(STAR_STAR);
10499 nls();
10500 unaryExpression(0);
10501 astFactory.addASTChild(currentAST, returnAST);
10502 }
10503 else {
10504 break _loop411;
10505 }
10506
10507 } while (true);
10508 }
10509 powerExpressionNotPlusMinus_AST = (AST)currentAST.root;
10510 returnAST = powerExpressionNotPlusMinus_AST;
10511 }
10512
10513 public final void powerExpression(
10514 int lc_stmt
10515 ) throws RecognitionException, TokenStreamException {
10516
10517 returnAST = null;
10518 ASTPair currentAST = new ASTPair();
10519 AST powerExpression_AST = null;
10520
10521 unaryExpression(lc_stmt);
10522 astFactory.addASTChild(currentAST, returnAST);
10523 {
10524 _loop408:
10525 do {
10526 if ((LA(1)==STAR_STAR)) {
10527 AST tmp280_AST = null;
10528 tmp280_AST = astFactory.create(LT(1));
10529 astFactory.makeASTRoot(currentAST, tmp280_AST);
10530 match(STAR_STAR);
10531 nls();
10532 unaryExpression(0);
10533 astFactory.addASTChild(currentAST, returnAST);
10534 }
10535 else {
10536 break _loop408;
10537 }
10538
10539 } while (true);
10540 }
10541 powerExpression_AST = (AST)currentAST.root;
10542 returnAST = powerExpression_AST;
10543 }
10544
10545 public final void unaryExpression(
10546 int lc_stmt
10547 ) throws RecognitionException, TokenStreamException {
10548
10549 returnAST = null;
10550 ASTPair currentAST = new ASTPair();
10551 AST unaryExpression_AST = null;
10552
10553 switch ( LA(1)) {
10554 case INC:
10555 {
10556 AST tmp281_AST = null;
10557 tmp281_AST = astFactory.create(LT(1));
10558 astFactory.makeASTRoot(currentAST, tmp281_AST);
10559 match(INC);
10560 nls();
10561 unaryExpression(0);
10562 astFactory.addASTChild(currentAST, returnAST);
10563 unaryExpression_AST = (AST)currentAST.root;
10564 break;
10565 }
10566 case DEC:
10567 {
10568 AST tmp282_AST = null;
10569 tmp282_AST = astFactory.create(LT(1));
10570 astFactory.makeASTRoot(currentAST, tmp282_AST);
10571 match(DEC);
10572 nls();
10573 unaryExpression(0);
10574 astFactory.addASTChild(currentAST, returnAST);
10575 unaryExpression_AST = (AST)currentAST.root;
10576 break;
10577 }
10578 case MINUS:
10579 {
10580 AST tmp283_AST = null;
10581 tmp283_AST = astFactory.create(LT(1));
10582 astFactory.makeASTRoot(currentAST, tmp283_AST);
10583 match(MINUS);
10584 if ( inputState.guessing==0 ) {
10585 tmp283_AST.setType(UNARY_MINUS);
10586 }
10587 nls();
10588 unaryExpression(0);
10589 astFactory.addASTChild(currentAST, returnAST);
10590 unaryExpression_AST = (AST)currentAST.root;
10591 break;
10592 }
10593 case PLUS:
10594 {
10595 AST tmp284_AST = null;
10596 tmp284_AST = astFactory.create(LT(1));
10597 astFactory.makeASTRoot(currentAST, tmp284_AST);
10598 match(PLUS);
10599 if ( inputState.guessing==0 ) {
10600 tmp284_AST.setType(UNARY_PLUS);
10601 }
10602 nls();
10603 unaryExpression(0);
10604 astFactory.addASTChild(currentAST, returnAST);
10605 unaryExpression_AST = (AST)currentAST.root;
10606 break;
10607 }
10608 case IDENT:
10609 case LBRACK:
10610 case LPAREN:
10611 case LITERAL_super:
10612 case LITERAL_void:
10613 case LITERAL_boolean:
10614 case LITERAL_byte:
10615 case LITERAL_char:
10616 case LITERAL_short:
10617 case LITERAL_int:
10618 case LITERAL_float:
10619 case LITERAL_long:
10620 case LITERAL_double:
10621 case LITERAL_any:
10622 case LCURLY:
10623 case LITERAL_this:
10624 case STRING_LITERAL:
10625 case BNOT:
10626 case LNOT:
10627 case DOLLAR:
10628 case STRING_CTOR_START:
10629 case LITERAL_new:
10630 case LITERAL_true:
10631 case LITERAL_false:
10632 case LITERAL_null:
10633 case NUM_INT:
10634 case NUM_FLOAT:
10635 case NUM_LONG:
10636 case NUM_DOUBLE:
10637 case NUM_BIG_INT:
10638 case NUM_BIG_DECIMAL:
10639 {
10640 unaryExpressionNotPlusMinus(lc_stmt);
10641 astFactory.addASTChild(currentAST, returnAST);
10642 unaryExpression_AST = (AST)currentAST.root;
10643 break;
10644 }
10645 default:
10646 {
10647 throw new NoViableAltException(LT(1), getFilename());
10648 }
10649 }
10650 returnAST = unaryExpression_AST;
10651 }
10652
10653 public final void unaryExpressionNotPlusMinus(
10654 int lc_stmt
10655 ) throws RecognitionException, TokenStreamException {
10656
10657 returnAST = null;
10658 ASTPair currentAST = new ASTPair();
10659 AST unaryExpressionNotPlusMinus_AST = null;
10660 Token lpb = null;
10661 AST lpb_AST = null;
10662 Token lp = null;
10663 AST lp_AST = null;
10664
10665 switch ( LA(1)) {
10666 case BNOT:
10667 {
10668 AST tmp285_AST = null;
10669 tmp285_AST = astFactory.create(LT(1));
10670 astFactory.makeASTRoot(currentAST, tmp285_AST);
10671 match(BNOT);
10672 nls();
10673 unaryExpression(0);
10674 astFactory.addASTChild(currentAST, returnAST);
10675 unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
10676 break;
10677 }
10678 case LNOT:
10679 {
10680 AST tmp286_AST = null;
10681 tmp286_AST = astFactory.create(LT(1));
10682 astFactory.makeASTRoot(currentAST, tmp286_AST);
10683 match(LNOT);
10684 nls();
10685 unaryExpression(0);
10686 astFactory.addASTChild(currentAST, returnAST);
10687 unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
10688 break;
10689 }
10690 case IDENT:
10691 case LBRACK:
10692 case LPAREN:
10693 case LITERAL_super:
10694 case LITERAL_void:
10695 case LITERAL_boolean:
10696 case LITERAL_byte:
10697 case LITERAL_char:
10698 case LITERAL_short:
10699 case LITERAL_int:
10700 case LITERAL_float:
10701 case LITERAL_long:
10702 case LITERAL_double:
10703 case LITERAL_any:
10704 case LCURLY:
10705 case LITERAL_this:
10706 case STRING_LITERAL:
10707 case DOLLAR:
10708 case STRING_CTOR_START:
10709 case LITERAL_new:
10710 case LITERAL_true:
10711 case LITERAL_false:
10712 case LITERAL_null:
10713 case NUM_INT:
10714 case NUM_FLOAT:
10715 case NUM_LONG:
10716 case NUM_DOUBLE:
10717 case NUM_BIG_INT:
10718 case NUM_BIG_DECIMAL:
10719 {
10720 {
10721 boolean synPredMatched416 = false;
10722 if (((LA(1)==LPAREN) && ((LA(2) >= LITERAL_void && LA(2) <= LITERAL_any)) && (LA(3)==LBRACK||LA(3)==RPAREN))) {
10723 int _m416 = mark();
10724 synPredMatched416 = true;
10725 inputState.guessing++;
10726 try {
10727 {
10728 match(LPAREN);
10729 builtInTypeSpec(true);
10730 match(RPAREN);
10731 unaryExpression(0);
10732 }
10733 }
10734 catch (RecognitionException pe) {
10735 synPredMatched416 = false;
10736 }
10737 rewind(_m416);
10738 inputState.guessing--;
10739 }
10740 if ( synPredMatched416 ) {
10741 lpb = LT(1);
10742 lpb_AST = astFactory.create(lpb);
10743 astFactory.makeASTRoot(currentAST, lpb_AST);
10744 match(LPAREN);
10745 if ( inputState.guessing==0 ) {
10746 lpb_AST.setType(TYPECAST);
10747 }
10748 builtInTypeSpec(true);
10749 astFactory.addASTChild(currentAST, returnAST);
10750 match(RPAREN);
10751 unaryExpression(0);
10752 astFactory.addASTChild(currentAST, returnAST);
10753 }
10754 else {
10755 boolean synPredMatched418 = false;
10756 if (((LA(1)==LPAREN) && (LA(2)==IDENT) && (_tokenSet_105.member(LA(3))))) {
10757 int _m418 = mark();
10758 synPredMatched418 = true;
10759 inputState.guessing++;
10760 try {
10761 {
10762 match(LPAREN);
10763 classTypeSpec(true);
10764 match(RPAREN);
10765 unaryExpressionNotPlusMinus(0);
10766 }
10767 }
10768 catch (RecognitionException pe) {
10769 synPredMatched418 = false;
10770 }
10771 rewind(_m418);
10772 inputState.guessing--;
10773 }
10774 if ( synPredMatched418 ) {
10775 lp = LT(1);
10776 lp_AST = astFactory.create(lp);
10777 astFactory.makeASTRoot(currentAST, lp_AST);
10778 match(LPAREN);
10779 if ( inputState.guessing==0 ) {
10780 lp_AST.setType(TYPECAST);
10781 }
10782 classTypeSpec(true);
10783 astFactory.addASTChild(currentAST, returnAST);
10784 match(RPAREN);
10785 unaryExpressionNotPlusMinus(0);
10786 astFactory.addASTChild(currentAST, returnAST);
10787 }
10788 else if ((_tokenSet_106.member(LA(1))) && (_tokenSet_95.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
10789 postfixExpression(lc_stmt);
10790 astFactory.addASTChild(currentAST, returnAST);
10791 }
10792 else {
10793 throw new NoViableAltException(LT(1), getFilename());
10794 }
10795 }
10796 }
10797 unaryExpressionNotPlusMinus_AST = (AST)currentAST.root;
10798 break;
10799 }
10800 default:
10801 {
10802 throw new NoViableAltException(LT(1), getFilename());
10803 }
10804 }
10805 returnAST = unaryExpressionNotPlusMinus_AST;
10806 }
10807
10808 public final void postfixExpression(
10809 int lc_stmt
10810 ) throws RecognitionException, TokenStreamException {
10811
10812 returnAST = null;
10813 ASTPair currentAST = new ASTPair();
10814 AST postfixExpression_AST = null;
10815 Token in = null;
10816 AST in_AST = null;
10817 Token de = null;
10818 AST de_AST = null;
10819
10820 pathExpression(lc_stmt);
10821 astFactory.addASTChild(currentAST, returnAST);
10822 {
10823 if ((LA(1)==INC) && (_tokenSet_107.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
10824 in = LT(1);
10825 in_AST = astFactory.create(in);
10826 astFactory.makeASTRoot(currentAST, in_AST);
10827 match(INC);
10828 if ( inputState.guessing==0 ) {
10829 in_AST.setType(POST_INC);
10830 }
10831 }
10832 else if ((LA(1)==DEC) && (_tokenSet_107.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
10833 de = LT(1);
10834 de_AST = astFactory.create(de);
10835 astFactory.makeASTRoot(currentAST, de_AST);
10836 match(DEC);
10837 if ( inputState.guessing==0 ) {
10838 de_AST.setType(POST_DEC);
10839 }
10840 }
10841 else if ((_tokenSet_107.member(LA(1))) && (_tokenSet_11.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
10842 }
10843 else {
10844 throw new NoViableAltException(LT(1), getFilename());
10845 }
10846
10847 }
10848 postfixExpression_AST = (AST)currentAST.root;
10849 returnAST = postfixExpression_AST;
10850 }
10851
10852 /*** Numeric, string, regexp, boolean, or null constant. */
10853 public final void constant() throws RecognitionException, TokenStreamException {
10854
10855 returnAST = null;
10856 ASTPair currentAST = new ASTPair();
10857 AST constant_AST = null;
10858
10859 switch ( LA(1)) {
10860 case NUM_INT:
10861 case NUM_FLOAT:
10862 case NUM_LONG:
10863 case NUM_DOUBLE:
10864 case NUM_BIG_INT:
10865 case NUM_BIG_DECIMAL:
10866 {
10867 constantNumber();
10868 astFactory.addASTChild(currentAST, returnAST);
10869 constant_AST = (AST)currentAST.root;
10870 break;
10871 }
10872 case STRING_LITERAL:
10873 {
10874 AST tmp289_AST = null;
10875 tmp289_AST = astFactory.create(LT(1));
10876 astFactory.addASTChild(currentAST, tmp289_AST);
10877 match(STRING_LITERAL);
10878 constant_AST = (AST)currentAST.root;
10879 break;
10880 }
10881 case LITERAL_true:
10882 {
10883 AST tmp290_AST = null;
10884 tmp290_AST = astFactory.create(LT(1));
10885 astFactory.addASTChild(currentAST, tmp290_AST);
10886 match(LITERAL_true);
10887 constant_AST = (AST)currentAST.root;
10888 break;
10889 }
10890 case LITERAL_false:
10891 {
10892 AST tmp291_AST = null;
10893 tmp291_AST = astFactory.create(LT(1));
10894 astFactory.addASTChild(currentAST, tmp291_AST);
10895 match(LITERAL_false);
10896 constant_AST = (AST)currentAST.root;
10897 break;
10898 }
10899 case LITERAL_null:
10900 {
10901 AST tmp292_AST = null;
10902 tmp292_AST = astFactory.create(LT(1));
10903 astFactory.addASTChild(currentAST, tmp292_AST);
10904 match(LITERAL_null);
10905 constant_AST = (AST)currentAST.root;
10906 break;
10907 }
10908 default:
10909 {
10910 throw new NoViableAltException(LT(1), getFilename());
10911 }
10912 }
10913 returnAST = constant_AST;
10914 }
10915
10916 /*** object instantiation.
10917 * Trees are built as illustrated by the following input/tree pairs:
10918 *
10919 * new T()
10920 *
10921 * new
10922 * |
10923 * T -- ELIST
10924 * |
10925 * arg1 -- arg2 -- .. -- argn
10926 *
10927 * new int[]
10928 *
10929 * new
10930 * |
10931 * int -- ARRAY_DECLARATOR
10932 *
10933 * new int[] {1,2}
10934 *
10935 * new
10936 * |
10937 * int -- ARRAY_DECLARATOR -- ARRAY_INIT
10938 * |
10939 * EXPR -- EXPR
10940 * | |
10941 * 1 2
10942 *
10943 * new int[3]
10944 * new
10945 * |
10946 * int -- ARRAY_DECLARATOR
10947 * |
10948 * EXPR
10949 * |
10950 * 3
10951 *
10952 * new int[1][2]
10953 *
10954 * new
10955 * |
10956 * int -- ARRAY_DECLARATOR
10957 * |
10958 * ARRAY_DECLARATOR -- EXPR
10959 * | |
10960 * EXPR 1
10961 * |
10962 * 2
10963 *
10964 */
10965 public final void newExpression() throws RecognitionException, TokenStreamException {
10966
10967 returnAST = null;
10968 ASTPair currentAST = new ASTPair();
10969 AST newExpression_AST = null;
10970 AST mca_AST = null;
10971 AST apb1_AST = null;
10972
10973 AST tmp293_AST = null;
10974 tmp293_AST = astFactory.create(LT(1));
10975 astFactory.makeASTRoot(currentAST, tmp293_AST);
10976 match(LITERAL_new);
10977 nls();
10978 {
10979 switch ( LA(1)) {
10980 case LT:
10981 {
10982 typeArguments();
10983 astFactory.addASTChild(currentAST, returnAST);
10984 break;
10985 }
10986 case IDENT:
10987 case LITERAL_void:
10988 case LITERAL_boolean:
10989 case LITERAL_byte:
10990 case LITERAL_char:
10991 case LITERAL_short:
10992 case LITERAL_int:
10993 case LITERAL_float:
10994 case LITERAL_long:
10995 case LITERAL_double:
10996 case LITERAL_any:
10997 {
10998 break;
10999 }
11000 default:
11001 {
11002 throw new NoViableAltException(LT(1), getFilename());
11003 }
11004 }
11005 }
11006 type();
11007 astFactory.addASTChild(currentAST, returnAST);
11008 {
11009 switch ( LA(1)) {
11010 case LPAREN:
11011 case NLS:
11012 {
11013 nls();
11014 methodCallArgs(null);
11015 mca_AST = (AST)returnAST;
11016 {
11017 if ((LA(1)==LCURLY) && (_tokenSet_16.member(LA(2))) && (_tokenSet_95.member(LA(3)))) {
11018 appendedBlock(mca_AST);
11019 apb1_AST = (AST)returnAST;
11020 if ( inputState.guessing==0 ) {
11021 mca_AST = apb1_AST;
11022 }
11023 }
11024 else if ((_tokenSet_108.member(LA(1))) && (_tokenSet_11.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
11025 }
11026 else {
11027 throw new NoViableAltException(LT(1), getFilename());
11028 }
11029
11030 }
11031 if ( inputState.guessing==0 ) {
11032 newExpression_AST = (AST)currentAST.root;
11033 newExpression_AST.addChild(mca_AST.getFirstChild());
11034 }
11035 break;
11036 }
11037 case LBRACK:
11038 {
11039 newArrayDeclarator();
11040 astFactory.addASTChild(currentAST, returnAST);
11041 break;
11042 }
11043 default:
11044 {
11045 throw new NoViableAltException(LT(1), getFilename());
11046 }
11047 }
11048 }
11049 newExpression_AST = (AST)currentAST.root;
11050 returnAST = newExpression_AST;
11051 }
11052
11053 public final void closableBlockConstructorExpression() throws RecognitionException, TokenStreamException {
11054
11055 returnAST = null;
11056 ASTPair currentAST = new ASTPair();
11057 AST closableBlockConstructorExpression_AST = null;
11058
11059 closableBlock();
11060 astFactory.addASTChild(currentAST, returnAST);
11061 closableBlockConstructorExpression_AST = (AST)currentAST.root;
11062 returnAST = closableBlockConstructorExpression_AST;
11063 }
11064
11065 /***
11066 * A list constructor is a argument list enclosed in square brackets, without labels.
11067 * Any argument can be decorated with a spread operator (*x), but not a label (a:x).
11068 * Examples: [], [1], [1,2], [1,*l1,2], [*l1,*l2].
11069 * (The l1, l2 must be a sequence or null.)
11070 * <p>
11071 * A map constructor is an argument list enclosed in square brackets, with labels everywhere,
11072 * except on spread arguments, which stand for whole maps spliced in.
11073 * A colon alone between the brackets also forces the expression to be an empty map constructor.
11074 * Examples: [:], [a:1], [a:1,b:2], [a:1,*:m1,b:2], [*:m1,*:m2]
11075 * (The m1, m2 must be a map or null.)
11076 * Values associated with identical keys overwrite from left to right:
11077 * [a:1,a:2] === [a:2]
11078 * <p>
11079 * Some malformed constructor expressions are not detected in the parser, but in a post-pass.
11080 * Bad examples: [1,b:2], [a:1,2], [:1].
11081 * (Note that method call arguments, by contrast, can be a mix of keyworded and non-keyworded arguments.)
11082 */
11083 public final void listOrMapConstructorExpression() throws RecognitionException, TokenStreamException {
11084
11085 returnAST = null;
11086 ASTPair currentAST = new ASTPair();
11087 AST listOrMapConstructorExpression_AST = null;
11088 Token lcon = null;
11089 AST lcon_AST = null;
11090 Token emcon = null;
11091 AST emcon_AST = null;
11092 boolean hasLabels = false;
11093
11094 if ((LA(1)==LBRACK) && (_tokenSet_109.member(LA(2)))) {
11095 lcon = LT(1);
11096 lcon_AST = astFactory.create(lcon);
11097 astFactory.makeASTRoot(currentAST, lcon_AST);
11098 match(LBRACK);
11099 argList();
11100 astFactory.addASTChild(currentAST, returnAST);
11101 if ( inputState.guessing==0 ) {
11102 hasLabels |= argListHasLabels;
11103 }
11104 match(RBRACK);
11105 if ( inputState.guessing==0 ) {
11106 lcon_AST.setType(hasLabels ? MAP_CONSTRUCTOR : LIST_CONSTRUCTOR);
11107 }
11108 listOrMapConstructorExpression_AST = (AST)currentAST.root;
11109 }
11110 else if ((LA(1)==LBRACK) && (LA(2)==COLON)) {
11111 emcon = LT(1);
11112 emcon_AST = astFactory.create(emcon);
11113 astFactory.makeASTRoot(currentAST, emcon_AST);
11114 match(LBRACK);
11115 match(COLON);
11116 match(RBRACK);
11117 if ( inputState.guessing==0 ) {
11118 emcon_AST.setType(MAP_CONSTRUCTOR);
11119 }
11120 listOrMapConstructorExpression_AST = (AST)currentAST.root;
11121 }
11122 else {
11123 throw new NoViableAltException(LT(1), getFilename());
11124 }
11125
11126 returnAST = listOrMapConstructorExpression_AST;
11127 }
11128
11129 public final void scopeEscapeExpression() throws RecognitionException, TokenStreamException {
11130
11131 returnAST = null;
11132 ASTPair currentAST = new ASTPair();
11133 AST scopeEscapeExpression_AST = null;
11134
11135 AST tmp297_AST = null;
11136 tmp297_AST = astFactory.create(LT(1));
11137 astFactory.makeASTRoot(currentAST, tmp297_AST);
11138 match(DOLLAR);
11139 if ( inputState.guessing==0 ) {
11140 tmp297_AST.setType(SCOPE_ESCAPE);
11141 }
11142 {
11143 switch ( LA(1)) {
11144 case IDENT:
11145 {
11146 AST tmp298_AST = null;
11147 tmp298_AST = astFactory.create(LT(1));
11148 astFactory.addASTChild(currentAST, tmp298_AST);
11149 match(IDENT);
11150 break;
11151 }
11152 case DOLLAR:
11153 {
11154 scopeEscapeExpression();
11155 astFactory.addASTChild(currentAST, returnAST);
11156 break;
11157 }
11158 default:
11159 {
11160 throw new NoViableAltException(LT(1), getFilename());
11161 }
11162 }
11163 }
11164 scopeEscapeExpression_AST = (AST)currentAST.root;
11165 returnAST = scopeEscapeExpression_AST;
11166 }
11167
11168 public final void stringConstructorValuePart() throws RecognitionException, TokenStreamException {
11169
11170 returnAST = null;
11171 ASTPair currentAST = new ASTPair();
11172 AST stringConstructorValuePart_AST = null;
11173 Token sp = null;
11174 AST sp_AST = null;
11175
11176 {
11177 switch ( LA(1)) {
11178 case STAR:
11179 {
11180 sp = LT(1);
11181 sp_AST = astFactory.create(sp);
11182 astFactory.makeASTRoot(currentAST, sp_AST);
11183 match(STAR);
11184 if ( inputState.guessing==0 ) {
11185 sp_AST.setType(SPREAD_ARG);
11186 }
11187 break;
11188 }
11189 case IDENT:
11190 case LCURLY:
11191 {
11192 break;
11193 }
11194 default:
11195 {
11196 throw new NoViableAltException(LT(1), getFilename());
11197 }
11198 }
11199 }
11200 {
11201 switch ( LA(1)) {
11202 case IDENT:
11203 {
11204 identifier();
11205 astFactory.addASTChild(currentAST, returnAST);
11206 break;
11207 }
11208 case LCURLY:
11209 {
11210 openOrClosableBlock();
11211 astFactory.addASTChild(currentAST, returnAST);
11212 break;
11213 }
11214 default:
11215 {
11216 throw new NoViableAltException(LT(1), getFilename());
11217 }
11218 }
11219 }
11220 stringConstructorValuePart_AST = (AST)currentAST.root;
11221 returnAST = stringConstructorValuePart_AST;
11222 }
11223
11224 public final void newArrayDeclarator() throws RecognitionException, TokenStreamException {
11225
11226 returnAST = null;
11227 ASTPair currentAST = new ASTPair();
11228 AST newArrayDeclarator_AST = null;
11229 Token lb = null;
11230 AST lb_AST = null;
11231
11232 {
11233 int _cnt465=0;
11234 _loop465:
11235 do {
11236 if ((LA(1)==LBRACK) && (_tokenSet_110.member(LA(2))) && (_tokenSet_95.member(LA(3)))) {
11237 lb = LT(1);
11238 lb_AST = astFactory.create(lb);
11239 astFactory.makeASTRoot(currentAST, lb_AST);
11240 match(LBRACK);
11241 if ( inputState.guessing==0 ) {
11242 lb_AST.setType(ARRAY_DECLARATOR);
11243 }
11244 {
11245 switch ( LA(1)) {
11246 case IDENT:
11247 case LBRACK:
11248 case LPAREN:
11249 case LITERAL_super:
11250 case LITERAL_void:
11251 case LITERAL_boolean:
11252 case LITERAL_byte:
11253 case LITERAL_char:
11254 case LITERAL_short:
11255 case LITERAL_int:
11256 case LITERAL_float:
11257 case LITERAL_long:
11258 case LITERAL_double:
11259 case LITERAL_any:
11260 case LCURLY:
11261 case LITERAL_this:
11262 case STRING_LITERAL:
11263 case PLUS:
11264 case MINUS:
11265 case INC:
11266 case DEC:
11267 case BNOT:
11268 case LNOT:
11269 case DOLLAR:
11270 case STRING_CTOR_START:
11271 case LITERAL_new:
11272 case LITERAL_true:
11273 case LITERAL_false:
11274 case LITERAL_null:
11275 case NUM_INT:
11276 case NUM_FLOAT:
11277 case NUM_LONG:
11278 case NUM_DOUBLE:
11279 case NUM_BIG_INT:
11280 case NUM_BIG_DECIMAL:
11281 {
11282 expression(0);
11283 astFactory.addASTChild(currentAST, returnAST);
11284 break;
11285 }
11286 case RBRACK:
11287 {
11288 break;
11289 }
11290 default:
11291 {
11292 throw new NoViableAltException(LT(1), getFilename());
11293 }
11294 }
11295 }
11296 match(RBRACK);
11297 }
11298 else {
11299 if ( _cnt465>=1 ) { break _loop465; } else {throw new NoViableAltException(LT(1), getFilename());}
11300 }
11301
11302 _cnt465++;
11303 } while (true);
11304 }
11305 newArrayDeclarator_AST = (AST)currentAST.root;
11306 returnAST = newArrayDeclarator_AST;
11307 }
11308
11309 /*** A single argument in (...) or [...]. Corresponds to to a method or closure parameter.
11310 * May be labeled. May be modified by the spread operator '*' ('*:' for keywords).
11311 */
11312 public final boolean argument() throws RecognitionException, TokenStreamException {
11313 boolean hasLabel = false;
11314
11315 returnAST = null;
11316 ASTPair currentAST = new ASTPair();
11317 AST argument_AST = null;
11318 Token c = null;
11319 AST c_AST = null;
11320 Token sp = null;
11321 AST sp_AST = null;
11322
11323 {
11324 boolean synPredMatched451 = false;
11325 if (((_tokenSet_111.member(LA(1))) && (_tokenSet_112.member(LA(2))) && (_tokenSet_86.member(LA(3))))) {
11326 int _m451 = mark();
11327 synPredMatched451 = true;
11328 inputState.guessing++;
11329 try {
11330 {
11331 argumentLabelStart();
11332 }
11333 }
11334 catch (RecognitionException pe) {
11335 synPredMatched451 = false;
11336 }
11337 rewind(_m451);
11338 inputState.guessing--;
11339 }
11340 if ( synPredMatched451 ) {
11341 argumentLabel();
11342 astFactory.addASTChild(currentAST, returnAST);
11343 c = LT(1);
11344 c_AST = astFactory.create(c);
11345 astFactory.makeASTRoot(currentAST, c_AST);
11346 match(COLON);
11347 if ( inputState.guessing==0 ) {
11348 c_AST.setType(LABELED_ARG);
11349 }
11350 if ( inputState.guessing==0 ) {
11351 hasLabel = true;
11352 }
11353 }
11354 else if ((LA(1)==STAR)) {
11355 sp = LT(1);
11356 sp_AST = astFactory.create(sp);
11357 astFactory.makeASTRoot(currentAST, sp_AST);
11358 match(STAR);
11359 if ( inputState.guessing==0 ) {
11360 sp_AST.setType(SPREAD_ARG);
11361 }
11362 {
11363 switch ( LA(1)) {
11364 case COLON:
11365 {
11366 match(COLON);
11367 if ( inputState.guessing==0 ) {
11368 sp_AST.setType(SPREAD_MAP_ARG);
11369 }
11370 if ( inputState.guessing==0 ) {
11371 hasLabel = true;
11372 }
11373 break;
11374 }
11375 case FINAL:
11376 case ABSTRACT:
11377 case STRICTFP:
11378 case LITERAL_static:
11379 case LITERAL_def:
11380 case AT:
11381 case IDENT:
11382 case LBRACK:
11383 case LPAREN:
11384 case LITERAL_super:
11385 case LITERAL_void:
11386 case LITERAL_boolean:
11387 case LITERAL_byte:
11388 case LITERAL_char:
11389 case LITERAL_short:
11390 case LITERAL_int:
11391 case LITERAL_float:
11392 case LITERAL_long:
11393 case LITERAL_double:
11394 case LITERAL_any:
11395 case LITERAL_private:
11396 case LITERAL_public:
11397 case LITERAL_protected:
11398 case LITERAL_transient:
11399 case LITERAL_native:
11400 case LITERAL_threadsafe:
11401 case LITERAL_synchronized:
11402 case LITERAL_volatile:
11403 case LCURLY:
11404 case LITERAL_this:
11405 case STRING_LITERAL:
11406 case LITERAL_return:
11407 case LITERAL_break:
11408 case LITERAL_continue:
11409 case LITERAL_throw:
11410 case LITERAL_assert:
11411 case PLUS:
11412 case MINUS:
11413 case INC:
11414 case DEC:
11415 case BNOT:
11416 case LNOT:
11417 case DOLLAR:
11418 case STRING_CTOR_START:
11419 case LITERAL_new:
11420 case LITERAL_true:
11421 case LITERAL_false:
11422 case LITERAL_null:
11423 case NUM_INT:
11424 case NUM_FLOAT:
11425 case NUM_LONG:
11426 case NUM_DOUBLE:
11427 case NUM_BIG_INT:
11428 case NUM_BIG_DECIMAL:
11429 {
11430 break;
11431 }
11432 default:
11433 {
11434 throw new NoViableAltException(LT(1), getFilename());
11435 }
11436 }
11437 }
11438 }
11439 else if ((_tokenSet_113.member(LA(1))) && (_tokenSet_68.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
11440 }
11441 else {
11442 throw new NoViableAltException(LT(1), getFilename());
11443 }
11444
11445 }
11446 strictContextExpression();
11447 astFactory.addASTChild(currentAST, returnAST);
11448 if ( inputState.guessing==0 ) {
11449
11450 require(LA(1) != COLON,
11451 "illegal colon after argument expression",
11452 "a complex label expression before a colon must be parenthesized");
11453
11454 }
11455 argument_AST = (AST)currentAST.root;
11456 returnAST = argument_AST;
11457 return hasLabel;
11458 }
11459
11460 /*** For lookahead only. Fast approximate parse of an argumentLabel followed by a colon. */
11461 public final void argumentLabelStart() throws RecognitionException, TokenStreamException {
11462
11463 returnAST = null;
11464 ASTPair currentAST = new ASTPair();
11465 AST argumentLabelStart_AST = null;
11466
11467 {
11468 switch ( LA(1)) {
11469 case IDENT:
11470 {
11471 AST tmp301_AST = null;
11472 tmp301_AST = astFactory.create(LT(1));
11473 match(IDENT);
11474 break;
11475 }
11476 case UNUSED_DO:
11477 case LITERAL_def:
11478 case LITERAL_class:
11479 case LITERAL_void:
11480 case LITERAL_boolean:
11481 case LITERAL_byte:
11482 case LITERAL_char:
11483 case LITERAL_short:
11484 case LITERAL_int:
11485 case LITERAL_float:
11486 case LITERAL_long:
11487 case LITERAL_double:
11488 case LITERAL_any:
11489 case LITERAL_as:
11490 case LITERAL_if:
11491 case LITERAL_else:
11492 case LITERAL_while:
11493 case LITERAL_switch:
11494 case LITERAL_for:
11495 case LITERAL_in:
11496 case LITERAL_try:
11497 case LITERAL_finally:
11498 case LITERAL_catch:
11499 {
11500 keywordPropertyNames();
11501 break;
11502 }
11503 case NUM_INT:
11504 case NUM_FLOAT:
11505 case NUM_LONG:
11506 case NUM_DOUBLE:
11507 case NUM_BIG_INT:
11508 case NUM_BIG_DECIMAL:
11509 {
11510 constantNumber();
11511 break;
11512 }
11513 case STRING_LITERAL:
11514 {
11515 AST tmp302_AST = null;
11516 tmp302_AST = astFactory.create(LT(1));
11517 match(STRING_LITERAL);
11518 break;
11519 }
11520 case LBRACK:
11521 case LPAREN:
11522 case LCURLY:
11523 case STRING_CTOR_START:
11524 {
11525 balancedBrackets();
11526 break;
11527 }
11528 default:
11529 {
11530 throw new NoViableAltException(LT(1), getFilename());
11531 }
11532 }
11533 }
11534 AST tmp303_AST = null;
11535 tmp303_AST = astFactory.create(LT(1));
11536 match(COLON);
11537 returnAST = argumentLabelStart_AST;
11538 }
11539
11540 /*** A label for an argument is of the form a:b, 'a':b, "a":b, (a):b, etc..
11541 * The labels in (a:b), ('a':b), and ("a":b) are in all ways equivalent,
11542 * except that the quotes allow more spellings.
11543 * Equivalent dynamically computed labels are (('a'):b) and ("${'a'}":b)
11544 * but not ((a):b) or "$a":b, since the latter cases evaluate (a) as a normal identifier.
11545 * Bottom line: If you want a truly variable label, use parens and say ((a):b).
11546 */
11547 public final void argumentLabel() throws RecognitionException, TokenStreamException {
11548
11549 returnAST = null;
11550 ASTPair currentAST = new ASTPair();
11551 AST argumentLabel_AST = null;
11552 Token id = null;
11553 AST id_AST = null;
11554 AST kw_AST = null;
11555
11556 boolean synPredMatched455 = false;
11557 if (((LA(1)==IDENT) && (LA(2)==COLON) && (_tokenSet_113.member(LA(3))))) {
11558 int _m455 = mark();
11559 synPredMatched455 = true;
11560 inputState.guessing++;
11561 try {
11562 {
11563 match(IDENT);
11564 }
11565 }
11566 catch (RecognitionException pe) {
11567 synPredMatched455 = false;
11568 }
11569 rewind(_m455);
11570 inputState.guessing--;
11571 }
11572 if ( synPredMatched455 ) {
11573 id = LT(1);
11574 id_AST = astFactory.create(id);
11575 astFactory.addASTChild(currentAST, id_AST);
11576 match(IDENT);
11577 if ( inputState.guessing==0 ) {
11578 id_AST.setType(STRING_LITERAL);
11579 }
11580 argumentLabel_AST = (AST)currentAST.root;
11581 }
11582 else {
11583 boolean synPredMatched457 = false;
11584 if (((_tokenSet_114.member(LA(1))) && (LA(2)==COLON) && (_tokenSet_113.member(LA(3))))) {
11585 int _m457 = mark();
11586 synPredMatched457 = true;
11587 inputState.guessing++;
11588 try {
11589 {
11590 keywordPropertyNames();
11591 }
11592 }
11593 catch (RecognitionException pe) {
11594 synPredMatched457 = false;
11595 }
11596 rewind(_m457);
11597 inputState.guessing--;
11598 }
11599 if ( synPredMatched457 ) {
11600 keywordPropertyNames();
11601 kw_AST = (AST)returnAST;
11602 astFactory.addASTChild(currentAST, returnAST);
11603 if ( inputState.guessing==0 ) {
11604 kw_AST.setType(STRING_LITERAL);
11605 }
11606 argumentLabel_AST = (AST)currentAST.root;
11607 }
11608 else if ((_tokenSet_106.member(LA(1))) && (_tokenSet_112.member(LA(2))) && (_tokenSet_86.member(LA(3)))) {
11609 primaryExpression();
11610 astFactory.addASTChild(currentAST, returnAST);
11611 argumentLabel_AST = (AST)currentAST.root;
11612 }
11613 else {
11614 throw new NoViableAltException(LT(1), getFilename());
11615 }
11616 }
11617 returnAST = argumentLabel_AST;
11618 }
11619
11620 /*** Numeric constant. */
11621 public final void constantNumber() throws RecognitionException, TokenStreamException {
11622
11623 returnAST = null;
11624 ASTPair currentAST = new ASTPair();
11625 AST constantNumber_AST = null;
11626
11627 switch ( LA(1)) {
11628 case NUM_INT:
11629 {
11630 AST tmp304_AST = null;
11631 tmp304_AST = astFactory.create(LT(1));
11632 astFactory.addASTChild(currentAST, tmp304_AST);
11633 match(NUM_INT);
11634 constantNumber_AST = (AST)currentAST.root;
11635 break;
11636 }
11637 case NUM_FLOAT:
11638 {
11639 AST tmp305_AST = null;
11640 tmp305_AST = astFactory.create(LT(1));
11641 astFactory.addASTChild(currentAST, tmp305_AST);
11642 match(NUM_FLOAT);
11643 constantNumber_AST = (AST)currentAST.root;
11644 break;
11645 }
11646 case NUM_LONG:
11647 {
11648 AST tmp306_AST = null;
11649 tmp306_AST = astFactory.create(LT(1));
11650 astFactory.addASTChild(currentAST, tmp306_AST);
11651 match(NUM_LONG);
11652 constantNumber_AST = (AST)currentAST.root;
11653 break;
11654 }
11655 case NUM_DOUBLE:
11656 {
11657 AST tmp307_AST = null;
11658 tmp307_AST = astFactory.create(LT(1));
11659 astFactory.addASTChild(currentAST, tmp307_AST);
11660 match(NUM_DOUBLE);
11661 constantNumber_AST = (AST)currentAST.root;
11662 break;
11663 }
11664 case NUM_BIG_INT:
11665 {
11666 AST tmp308_AST = null;
11667 tmp308_AST = astFactory.create(LT(1));
11668 astFactory.addASTChild(currentAST, tmp308_AST);
11669 match(NUM_BIG_INT);
11670 constantNumber_AST = (AST)currentAST.root;
11671 break;
11672 }
11673 case NUM_BIG_DECIMAL:
11674 {
11675 AST tmp309_AST = null;
11676 tmp309_AST = astFactory.create(LT(1));
11677 astFactory.addASTChild(currentAST, tmp309_AST);
11678 match(NUM_BIG_DECIMAL);
11679 constantNumber_AST = (AST)currentAST.root;
11680 break;
11681 }
11682 default:
11683 {
11684 throw new NoViableAltException(LT(1), getFilename());
11685 }
11686 }
11687 returnAST = constantNumber_AST;
11688 }
11689
11690 /*** Fast lookahead across balanced brackets of all sorts. */
11691 public final void balancedBrackets() throws RecognitionException, TokenStreamException {
11692
11693 returnAST = null;
11694 ASTPair currentAST = new ASTPair();
11695 AST balancedBrackets_AST = null;
11696
11697 switch ( LA(1)) {
11698 case LPAREN:
11699 {
11700 AST tmp310_AST = null;
11701 tmp310_AST = astFactory.create(LT(1));
11702 match(LPAREN);
11703 balancedTokens();
11704 AST tmp311_AST = null;
11705 tmp311_AST = astFactory.create(LT(1));
11706 match(RPAREN);
11707 break;
11708 }
11709 case LBRACK:
11710 {
11711 AST tmp312_AST = null;
11712 tmp312_AST = astFactory.create(LT(1));
11713 match(LBRACK);
11714 balancedTokens();
11715 AST tmp313_AST = null;
11716 tmp313_AST = astFactory.create(LT(1));
11717 match(RBRACK);
11718 break;
11719 }
11720 case LCURLY:
11721 {
11722 AST tmp314_AST = null;
11723 tmp314_AST = astFactory.create(LT(1));
11724 match(LCURLY);
11725 balancedTokens();
11726 AST tmp315_AST = null;
11727 tmp315_AST = astFactory.create(LT(1));
11728 match(RCURLY);
11729 break;
11730 }
11731 case STRING_CTOR_START:
11732 {
11733 AST tmp316_AST = null;
11734 tmp316_AST = astFactory.create(LT(1));
11735 match(STRING_CTOR_START);
11736 balancedTokens();
11737 AST tmp317_AST = null;
11738 tmp317_AST = astFactory.create(LT(1));
11739 match(STRING_CTOR_END);
11740 break;
11741 }
11742 default:
11743 {
11744 throw new NoViableAltException(LT(1), getFilename());
11745 }
11746 }
11747 returnAST = balancedBrackets_AST;
11748 }
11749
11750
11751 public static final String[] _tokenNames = {
11752 "<0>",
11753 "EOF",
11754 "<2>",
11755 "NULL_TREE_LOOKAHEAD",
11756 "BLOCK",
11757 "MODIFIERS",
11758 "OBJBLOCK",
11759 "SLIST",
11760 "METHOD_DEF",
11761 "VARIABLE_DEF",
11762 "INSTANCE_INIT",
11763 "STATIC_INIT",
11764 "TYPE",
11765 "CLASS_DEF",
11766 "INTERFACE_DEF",
11767 "PACKAGE_DEF",
11768 "ARRAY_DECLARATOR",
11769 "EXTENDS_CLAUSE",
11770 "IMPLEMENTS_CLAUSE",
11771 "PARAMETERS",
11772 "PARAMETER_DEF",
11773 "LABELED_STAT",
11774 "TYPECAST",
11775 "INDEX_OP",
11776 "POST_INC",
11777 "POST_DEC",
11778 "METHOD_CALL",
11779 "EXPR",
11780 "IMPORT",
11781 "UNARY_MINUS",
11782 "UNARY_PLUS",
11783 "CASE_GROUP",
11784 "ELIST",
11785 "FOR_INIT",
11786 "FOR_CONDITION",
11787 "FOR_ITERATOR",
11788 "EMPTY_STAT",
11789 "\"final\"",
11790 "\"abstract\"",
11791 "\"goto\"",
11792 "\"const\"",
11793 "\"do\"",
11794 "\"strictfp\"",
11795 "SUPER_CTOR_CALL",
11796 "CTOR_CALL",
11797 "CTOR_IDENT",
11798 "VARIABLE_PARAMETER_DEF",
11799 "STRING_CONSTRUCTOR",
11800 "STRING_CTOR_MIDDLE",
11801 "CLOSABLE_BLOCK",
11802 "IMPLICIT_PARAMETERS",
11803 "SELECT_SLOT",
11804 "DYNAMIC_MEMBER",
11805 "LABELED_ARG",
11806 "SPREAD_ARG",
11807 "SPREAD_MAP_ARG",
11808 "SCOPE_ESCAPE",
11809 "LIST_CONSTRUCTOR",
11810 "MAP_CONSTRUCTOR",
11811 "FOR_IN_ITERABLE",
11812 "STATIC_IMPORT",
11813 "ENUM_DEF",
11814 "ENUM_CONSTANT_DEF",
11815 "FOR_EACH_CLAUSE",
11816 "ANNOTATION_DEF",
11817 "ANNOTATIONS",
11818 "ANNOTATION",
11819 "ANNOTATION_MEMBER_VALUE_PAIR",
11820 "ANNOTATION_FIELD_DEF",
11821 "ANNOTATION_ARRAY_INIT",
11822 "TYPE_ARGUMENTS",
11823 "TYPE_ARGUMENT",
11824 "TYPE_PARAMETERS",
11825 "TYPE_PARAMETER",
11826 "WILDCARD_TYPE",
11827 "TYPE_UPPER_BOUNDS",
11828 "TYPE_LOWER_BOUNDS",
11829 "a script header",
11830 "\"package\"",
11831 "\"import\"",
11832 "\"static\"",
11833 "\"def\"",
11834 "'@'",
11835 "an identifier",
11836 "'['",
11837 "']'",
11838 "'.'",
11839 "'('",
11840 "\"class\"",
11841 "\"interface\"",
11842 "\"enum\"",
11843 "'?'",
11844 "\"extends\"",
11845 "\"super\"",
11846 "'<'",
11847 "','",
11848 "'>'",
11849 "'>>'",
11850 "'>>>'",
11851 "\"void\"",
11852 "\"boolean\"",
11853 "\"byte\"",
11854 "\"char\"",
11855 "\"short\"",
11856 "\"int\"",
11857 "\"float\"",
11858 "\"long\"",
11859 "\"double\"",
11860 "\"any\"",
11861 "'*'",
11862 "\"as\"",
11863 "\"private\"",
11864 "\"public\"",
11865 "\"protected\"",
11866 "\"transient\"",
11867 "\"native\"",
11868 "\"threadsafe\"",
11869 "\"synchronized\"",
11870 "\"volatile\"",
11871 "')'",
11872 "'='",
11873 "'&'",
11874 "'{'",
11875 "'}'",
11876 "';'",
11877 "some newlines, whitespace or comments",
11878 "\"default\"",
11879 "\"throws\"",
11880 "\"implements\"",
11881 "\"this\"",
11882 "a string literal",
11883 "'...'",
11884 "'->'",
11885 "':'",
11886 "\"if\"",
11887 "\"else\"",
11888 "\"while\"",
11889 "\"with\"",
11890 "\"switch\"",
11891 "\"for\"",
11892 "\"in\"",
11893 "\"return\"",
11894 "\"break\"",
11895 "\"continue\"",
11896 "\"throw\"",
11897 "\"assert\"",
11898 "'+'",
11899 "'-'",
11900 "\"case\"",
11901 "\"try\"",
11902 "\"finally\"",
11903 "\"catch\"",
11904 "'*.'",
11905 "'?.'",
11906 "'.&'",
11907 "'+='",
11908 "'-='",
11909 "'*='",
11910 "'/='",
11911 "'%='",
11912 "'>>='",
11913 "'>>>='",
11914 "'<<='",
11915 "'&='",
11916 "'^='",
11917 "'|='",
11918 "'**='",
11919 "'||'",
11920 "'&&'",
11921 "'|'",
11922 "'^'",
11923 "'=~'",
11924 "'==~'",
11925 "'!='",
11926 "'=='",
11927 "'<=>'",
11928 "'<='",
11929 "'>='",
11930 "\"instanceof\"",
11931 "'<<'",
11932 "'..'",
11933 "'..<'",
11934 "'++'",
11935 "'/'",
11936 "'%'",
11937 "'--'",
11938 "'**'",
11939 "'~'",
11940 "'!'",
11941 "'$'",
11942 "STRING_CTOR_START",
11943 "a string literal end",
11944 "\"new\"",
11945 "\"true\"",
11946 "\"false\"",
11947 "\"null\"",
11948 "a numeric literal",
11949 "NUM_FLOAT",
11950 "NUM_LONG",
11951 "NUM_DOUBLE",
11952 "NUM_BIG_INT",
11953 "NUM_BIG_DECIMAL",
11954 "whitespace",
11955 "a newline",
11956 "a single line comment",
11957 "a comment",
11958 "a string character",
11959 "a regular expression literal",
11960 "a regular expression literal end",
11961 "a regular expression character",
11962 "an escape sequence",
11963 "a newline inside a string",
11964 "a hexadecimal digit",
11965 "a character",
11966 "a letter",
11967 "a digit",
11968 "an exponent",
11969 "a float or double suffix",
11970 "a big decimal suffix"
11971 };
11972
11973 protected void buildTokenTypeASTClassMap() {
11974 tokenTypeToASTClassMap=null;
11975 };
11976
11977 private static final long[] mk_tokenSet_0() {
11978 long[] data = { 2L, 3458764513833402368L, 0L, 0L};
11979 return data;
11980 }
11981 public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0());
11982 private static final long[] mk_tokenSet_1() {
11983 long[] data = new long[8];
11984 data[0]=4810363371522L;
11985 data[1]=3782953284552065024L;
11986 data[2]=8809040871139831622L;
11987 data[3]=1023L;
11988 return data;
11989 }
11990 public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1());
11991 private static final long[] mk_tokenSet_2() {
11992 long[] data = new long[8];
11993 data[0]=7009386627074L;
11994 data[1]=4575657221139955712L;
11995 data[2]=9223372036853727230L;
11996 data[3]=1023L;
11997 return data;
11998 }
11999 public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2());
12000 private static final long[] mk_tokenSet_3() {
12001 long[] data = new long[8];
12002 data[0]=288484363337730L;
12003 data[1]=4611686018427355136L;
12004 data[2]=-1048577L;
12005 data[3]=1023L;
12006 return data;
12007 }
12008 public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3());
12009 private static final long[] mk_tokenSet_4() {
12010 long[] data = new long[8];
12011 data[0]=7009386627074L;
12012 data[1]=-16384L;
12013 data[2]=8809322346113400831L;
12014 data[3]=1023L;
12015 return data;
12016 }
12017 public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4());
12018 private static final long[] mk_tokenSet_5() {
12019 long[] data = new long[8];
12020 data[0]=288484363337730L;
12021 data[1]=-16384L;
12022 data[2]=-1L;
12023 data[3]=1023L;
12024 return data;
12025 }
12026 public static final BitSet _tokenSet_5 = new BitSet(mk_tokenSet_5());
12027 private static final long[] mk_tokenSet_6() {
12028 long[] data = { 0L, 3458764513820540928L, 128L, 0L, 0L, 0L};
12029 return data;
12030 }
12031 public static final BitSet _tokenSet_6 = new BitSet(mk_tokenSet_6());
12032 private static final long[] mk_tokenSet_7() {
12033 long[] data = new long[8];
12034 data[0]=4810363371520L;
12035 data[1]=3782953284552065024L;
12036 data[2]=8809040871139831750L;
12037 data[3]=1023L;
12038 return data;
12039 }
12040 public static final BitSet _tokenSet_7 = new BitSet(mk_tokenSet_7());
12041 private static final long[] mk_tokenSet_8() {
12042 long[] data = new long[8];
12043 data[0]=7009386627074L;
12044 data[1]=9187343239567343616L;
12045 data[2]=9223372036854775806L;
12046 data[3]=1023L;
12047 return data;
12048 }
12049 public static final BitSet _tokenSet_8 = new BitSet(mk_tokenSet_8());
12050 private static final long[] mk_tokenSet_9() {
12051 long[] data = { 2L, 8646911284551352320L, 1048704L, 0L, 0L, 0L};
12052 return data;
12053 }
12054 public static final BitSet _tokenSet_9 = new BitSet(mk_tokenSet_9());
12055 private static final long[] mk_tokenSet_10() {
12056 long[] data = new long[8];
12057 data[0]=286285340082178L;
12058 data[1]=9223372036586307584L;
12059 data[2]=-10L;
12060 data[3]=1023L;
12061 return data;
12062 }
12063 public static final BitSet _tokenSet_10 = new BitSet(mk_tokenSet_10());
12064 private static final long[] mk_tokenSet_11() {
12065 long[] data = new long[8];
12066 data[0]=288484363337730L;
12067 data[1]=-268451840L;
12068 data[2]=-2L;
12069 data[3]=1023L;
12070 return data;
12071 }
12072 public static final BitSet _tokenSet_11 = new BitSet(mk_tokenSet_11());
12073 private static final long[] mk_tokenSet_12() {
12074 long[] data = { 4810363371520L, 35923209543942144L, 0L, 0L};
12075 return data;
12076 }
12077 public static final BitSet _tokenSet_12 = new BitSet(mk_tokenSet_12());
12078 private static final long[] mk_tokenSet_13() {
12079 long[] data = { 4810363371520L, 2341766219836620800L, 4L, 0L, 0L, 0L};
12080 return data;
12081 }
12082 public static final BitSet _tokenSet_13 = new BitSet(mk_tokenSet_13());
12083 private static final long[] mk_tokenSet_14() {
12084 long[] data = { 4810363371522L, 8754892091504394240L, 1048708L, 0L, 0L, 0L};
12085 return data;
12086 }
12087 public static final BitSet _tokenSet_14 = new BitSet(mk_tokenSet_14());
12088 private static final long[] mk_tokenSet_15() {
12089 long[] data = new long[8];
12090 data[0]=4810363371520L;
12091 data[1]=2630031779945218048L;
12092 data[2]=8809040871139831622L;
12093 data[3]=1023L;
12094 return data;
12095 }
12096 public static final BitSet _tokenSet_15 = new BitSet(mk_tokenSet_15());
12097 private static final long[] mk_tokenSet_16() {
12098 long[] data = new long[8];
12099 data[0]=4810363371520L;
12100 data[1]=4359414036855488512L;
12101 data[2]=8809040871139831646L;
12102 data[3]=1023L;
12103 return data;
12104 }
12105 public static final BitSet _tokenSet_16 = new BitSet(mk_tokenSet_16());
12106 private static final long[] mk_tokenSet_17() {
12107 long[] data = new long[8];
12108 data[0]=4810363371520L;
12109 data[1]=324188770731524096L;
12110 data[2]=8809040871139831622L;
12111 data[3]=1023L;
12112 return data;
12113 }
12114 public static final BitSet _tokenSet_17 = new BitSet(mk_tokenSet_17());
12115 private static final long[] mk_tokenSet_18() {
12116 long[] data = new long[8];
12117 data[0]=288484363337730L;
12118 data[1]=9223372036854743040L;
12119 data[2]=-1L;
12120 data[3]=1023L;
12121 return data;
12122 }
12123 public static final BitSet _tokenSet_18 = new BitSet(mk_tokenSet_18());
12124 private static final long[] mk_tokenSet_19() {
12125 long[] data = new long[8];
12126 data[1]=288265526710894592L;
12127 data[2]=8809040871137476614L;
12128 data[3]=1023L;
12129 return data;
12130 }
12131 public static final BitSet _tokenSet_19 = new BitSet(mk_tokenSet_19());
12132 private static final long[] mk_tokenSet_20() {
12133 long[] data = new long[8];
12134 data[0]=288484363337730L;
12135 data[1]=9223372036586307584L;
12136 data[2]=-2L;
12137 data[3]=1023L;
12138 return data;
12139 }
12140 public static final BitSet _tokenSet_20 = new BitSet(mk_tokenSet_20());
12141 private static final long[] mk_tokenSet_21() {
12142 long[] data = { 4810363371520L, 35888059648507904L, 0L, 0L};
12143 return data;
12144 }
12145 public static final BitSet _tokenSet_21 = new BitSet(mk_tokenSet_21());
12146 private static final long[] mk_tokenSet_22() {
12147 long[] data = { 4810363371520L, 2341731068862726144L, 0L, 0L};
12148 return data;
12149 }
12150 public static final BitSet _tokenSet_22 = new BitSet(mk_tokenSet_22());
12151 private static final long[] mk_tokenSet_23() {
12152 long[] data = { 4810363371520L, 2629961446369198080L, 1L, 0L, 0L, 0L};
12153 return data;
12154 }
12155 public static final BitSet _tokenSet_23 = new BitSet(mk_tokenSet_23());
12156 private static final long[] mk_tokenSet_24() {
12157 long[] data = new long[8];
12158 data[0]=4810363371522L;
12159 data[1]=8971100056356618240L;
12160 data[2]=8809040871140880326L;
12161 data[3]=1023L;
12162 return data;
12163 }
12164 public static final BitSet _tokenSet_24 = new BitSet(mk_tokenSet_24());
12165 private static final long[] mk_tokenSet_25() {
12166 long[] data = { 2L, 8646981653300248576L, 1048704L, 0L, 0L, 0L};
12167 return data;
12168 }
12169 public static final BitSet _tokenSet_25 = new BitSet(mk_tokenSet_25());
12170 private static final long[] mk_tokenSet_26() {
12171 long[] data = { 0L, 35150012874752L, 0L, 0L};
12172 return data;
12173 }
12174 public static final BitSet _tokenSet_26 = new BitSet(mk_tokenSet_26());
12175 private static final long[] mk_tokenSet_27() {
12176 long[] data = { 0L, 1079508992L, 4L, 0L, 0L, 0L};
12177 return data;
12178 }
12179 public static final BitSet _tokenSet_27 = new BitSet(mk_tokenSet_27());
12180 private static final long[] mk_tokenSet_28() {
12181 long[] data = { 2L, 8718968880745152512L, 1048704L, 0L, 0L, 0L};
12182 return data;
12183 }
12184 public static final BitSet _tokenSet_28 = new BitSet(mk_tokenSet_28());
12185 private static final long[] mk_tokenSet_29() {
12186 long[] data = { 2L, 8718968880736763904L, 1048704L, 0L, 0L, 0L};
12187 return data;
12188 }
12189 public static final BitSet _tokenSet_29 = new BitSet(mk_tokenSet_29());
12190 private static final long[] mk_tokenSet_30() {
12191 long[] data = { 0L, -6917529027640557568L, 0L, 0L};
12192 return data;
12193 }
12194 public static final BitSet _tokenSet_30 = new BitSet(mk_tokenSet_30());
12195 private static final long[] mk_tokenSet_31() {
12196 long[] data = { 2L, 8935141662855266304L, 1048704L, 0L, 0L, 0L};
12197 return data;
12198 }
12199 public static final BitSet _tokenSet_31 = new BitSet(mk_tokenSet_31());
12200 private static final long[] mk_tokenSet_32() {
12201 long[] data = { 2L, 8935141660703064064L, 1048704L, 0L, 0L, 0L};
12202 return data;
12203 }
12204 public static final BitSet _tokenSet_32 = new BitSet(mk_tokenSet_32());
12205 private static final long[] mk_tokenSet_33() {
12206 long[] data = new long[8];
12207 data[0]=4810363371520L;
12208 data[1]=4359414036855488512L;
12209 data[2]=8809040871139831622L;
12210 data[3]=1023L;
12211 return data;
12212 }
12213 public static final BitSet _tokenSet_33 = new BitSet(mk_tokenSet_33());
12214 private static final long[] mk_tokenSet_34() {
12215 long[] data = { 0L, 1079508992L, 0L, 0L};
12216 return data;
12217 }
12218 public static final BitSet _tokenSet_34 = new BitSet(mk_tokenSet_34());
12219 private static final long[] mk_tokenSet_35() {
12220 long[] data = { 0L, 1261007897813319680L, 4128L, 0L, 0L, 0L};
12221 return data;
12222 }
12223 public static final BitSet _tokenSet_35 = new BitSet(mk_tokenSet_35());
12224 private static final long[] mk_tokenSet_36() {
12225 long[] data = { 0L, 288230376161148928L, 4611686018427387904L, 0L, 0L, 0L};
12226 return data;
12227 }
12228 public static final BitSet _tokenSet_36 = new BitSet(mk_tokenSet_36());
12229 private static final long[] mk_tokenSet_37() {
12230 long[] data = new long[12];
12231 data[0]=-16L;
12232 data[1]=-900719925485633537L;
12233 data[2]=4611686018427387903L;
12234 data[3]=134217727L;
12235 return data;
12236 }
12237 public static final BitSet _tokenSet_37 = new BitSet(mk_tokenSet_37());
12238 private static final long[] mk_tokenSet_38() {
12239 long[] data = { 4810363371520L, 35888059531067392L, 0L, 0L};
12240 return data;
12241 }
12242 public static final BitSet _tokenSet_38 = new BitSet(mk_tokenSet_38());
12243 private static final long[] mk_tokenSet_39() {
12244 long[] data = { 4810363371520L, 2341766219948818432L, 0L, 0L};
12245 return data;
12246 }
12247 public static final BitSet _tokenSet_39 = new BitSet(mk_tokenSet_39());
12248 private static final long[] mk_tokenSet_40() {
12249 long[] data = { 4810363371522L, 2341766219962449920L, 4L, 0L, 0L, 0L};
12250 return data;
12251 }
12252 public static final BitSet _tokenSet_40 = new BitSet(mk_tokenSet_40());
12253 private static final long[] mk_tokenSet_41() {
12254 long[] data = { 0L, 35151204319232L, 0L, 0L};
12255 return data;
12256 }
12257 public static final BitSet _tokenSet_41 = new BitSet(mk_tokenSet_41());
12258 private static final long[] mk_tokenSet_42() {
12259 long[] data = { 2L, 2305843010335145984L, 4L, 0L, 0L, 0L};
12260 return data;
12261 }
12262 public static final BitSet _tokenSet_42 = new BitSet(mk_tokenSet_42());
12263 private static final long[] mk_tokenSet_43() {
12264 long[] data = { 137438953474L, 4431577217044971520L, 9L, 0L, 0L, 0L};
12265 return data;
12266 }
12267 public static final BitSet _tokenSet_43 = new BitSet(mk_tokenSet_43());
12268 private static final long[] mk_tokenSet_44() {
12269 long[] data = new long[8];
12270 data[0]=2199023255554L;
12271 data[1]=9187448792851283968L;
12272 data[2]=8809322345995705855L;
12273 data[3]=1023L;
12274 return data;
12275 }
12276 public static final BitSet _tokenSet_44 = new BitSet(mk_tokenSet_44());
12277 private static final long[] mk_tokenSet_45() {
12278 long[] data = new long[8];
12279 data[0]=2199023255554L;
12280 data[1]=9187448791777542144L;
12281 data[2]=8809322345995705855L;
12282 data[3]=1023L;
12283 return data;
12284 }
12285 public static final BitSet _tokenSet_45 = new BitSet(mk_tokenSet_45());
12286 private static final long[] mk_tokenSet_46() {
12287 long[] data = { 0L, 2305878159360786432L, 0L, 0L};
12288 return data;
12289 }
12290 public static final BitSet _tokenSet_46 = new BitSet(mk_tokenSet_46());
12291 private static final long[] mk_tokenSet_47() {
12292 long[] data = { 4810363371520L, 35888059530674176L, 0L, 0L};
12293 return data;
12294 }
12295 public static final BitSet _tokenSet_47 = new BitSet(mk_tokenSet_47());
12296 private static final long[] mk_tokenSet_48() {
12297 long[] data = { 4810363371520L, 2341766219961401344L, 4L, 0L, 0L, 0L};
12298 return data;
12299 }
12300 public static final BitSet _tokenSet_48 = new BitSet(mk_tokenSet_48());
12301 private static final long[] mk_tokenSet_49() {
12302 long[] data = new long[8];
12303 data[1]=288265526711156736L;
12304 data[2]=8809040871137476614L;
12305 data[3]=1023L;
12306 return data;
12307 }
12308 public static final BitSet _tokenSet_49 = new BitSet(mk_tokenSet_49());
12309 private static final long[] mk_tokenSet_50() {
12310 long[] data = new long[8];
12311 data[0]=7009386627072L;
12312 data[1]=4539628424120991744L;
12313 data[2]=9223371487232131070L;
12314 data[3]=1023L;
12315 return data;
12316 }
12317 public static final BitSet _tokenSet_50 = new BitSet(mk_tokenSet_50());
12318 private static final long[] mk_tokenSet_51() {
12319 long[] data = { 0L, 4323455644432072704L, 0L, 0L};
12320 return data;
12321 }
12322 public static final BitSet _tokenSet_51 = new BitSet(mk_tokenSet_51());
12323 private static final long[] mk_tokenSet_52() {
12324 long[] data = new long[8];
12325 data[0]=7009386627074L;
12326 data[1]=9007199224271405056L;
12327 data[2]=8809040871153466822L;
12328 data[3]=1023L;
12329 return data;
12330 }
12331 public static final BitSet _tokenSet_52 = new BitSet(mk_tokenSet_52());
12332 private static final long[] mk_tokenSet_53() {
12333 long[] data = { 4810363371520L, 4359378851937058816L, 0L, 0L};
12334 return data;
12335 }
12336 public static final BitSet _tokenSet_53 = new BitSet(mk_tokenSet_53());
12337 private static final long[] mk_tokenSet_54() {
12338 long[] data = new long[8];
12339 data[0]=4810363371522L;
12340 data[1]=8971100056360812544L;
12341 data[2]=8809040871140880326L;
12342 data[3]=1023L;
12343 return data;
12344 }
12345 public static final BitSet _tokenSet_54 = new BitSet(mk_tokenSet_54());
12346 private static final long[] mk_tokenSet_55() {
12347 long[] data = { 0L, 2738223757012762624L, 1L, 0L, 0L, 0L};
12348 return data;
12349 }
12350 public static final BitSet _tokenSet_55 = new BitSet(mk_tokenSet_55());
12351 private static final long[] mk_tokenSet_56() {
12352 long[] data = { 0L, 2594108567858970624L, 1L, 0L, 0L, 0L};
12353 return data;
12354 }
12355 public static final BitSet _tokenSet_56 = new BitSet(mk_tokenSet_56());
12356 private static final long[] mk_tokenSet_57() {
12357 long[] data = { 4810363371520L, 4359378883349250048L, 5L, 0L, 0L, 0L};
12358 return data;
12359 }
12360 public static final BitSet _tokenSet_57 = new BitSet(mk_tokenSet_57());
12361 private static final long[] mk_tokenSet_58() {
12362 long[] data = new long[8];
12363 data[0]=4810363371522L;
12364 data[1]=9043157683015745536L;
12365 data[2]=8809040871140880327L;
12366 data[3]=1023L;
12367 return data;
12368 }
12369 public static final BitSet _tokenSet_58 = new BitSet(mk_tokenSet_58());
12370 private static final long[] mk_tokenSet_59() {
12371 long[] data = { 4810363371520L, 35888059531591680L, 0L, 0L};
12372 return data;
12373 }
12374 public static final BitSet _tokenSet_59 = new BitSet(mk_tokenSet_59());
12375 private static final long[] mk_tokenSet_60() {
12376 long[] data = { 4810363371520L, 2341731068753674240L, 0L, 0L};
12377 return data;
12378 }
12379 public static final BitSet _tokenSet_60 = new BitSet(mk_tokenSet_60());
12380 private static final long[] mk_tokenSet_61() {
12381 long[] data = { 4810363371520L, 2377795015789182976L, 8L, 0L, 0L, 0L};
12382 return data;
12383 }
12384 public static final BitSet _tokenSet_61 = new BitSet(mk_tokenSet_61());
12385 private static final long[] mk_tokenSet_62() {
12386 long[] data = { 4810363371520L, 4143206073077006336L, 4L, 0L, 0L, 0L};
12387 return data;
12388 }
12389 public static final BitSet _tokenSet_62 = new BitSet(mk_tokenSet_62());
12390 private static final long[] mk_tokenSet_63() {
12391 long[] data = { 0L, 4107282862317764608L, 0L, 0L};
12392 return data;
12393 }
12394 public static final BitSet _tokenSet_63 = new BitSet(mk_tokenSet_63());
12395 private static final long[] mk_tokenSet_64() {
12396 long[] data = new long[8];
12397 data[0]=4810363371522L;
12398 data[1]=9007093667929718784L;
12399 data[2]=8809040871138525326L;
12400 data[3]=1023L;
12401 return data;
12402 }
12403 public static final BitSet _tokenSet_64 = new BitSet(mk_tokenSet_64());
12404 private static final long[] mk_tokenSet_65() {
12405 long[] data = { 0L, 2305843009214480384L, 0L, 0L};
12406 return data;
12407 }
12408 public static final BitSet _tokenSet_65 = new BitSet(mk_tokenSet_65());
12409 private static final long[] mk_tokenSet_66() {
12410 long[] data = { 0L, 4323455644432334848L, 0L, 0L};
12411 return data;
12412 }
12413 public static final BitSet _tokenSet_66 = new BitSet(mk_tokenSet_66());
12414 private static final long[] mk_tokenSet_67() {
12415 long[] data = new long[8];
12416 data[0]=7009386627072L;
12417 data[1]=324259139375005696L;
12418 data[2]=8809040871152418246L;
12419 data[3]=1023L;
12420 return data;
12421 }
12422 public static final BitSet _tokenSet_67 = new BitSet(mk_tokenSet_67());
12423 private static final long[] mk_tokenSet_68() {
12424 long[] data = new long[8];
12425 data[0]=7009386627072L;
12426 data[1]=4611686018158919680L;
12427 data[2]=9223372036853727230L;
12428 data[3]=1023L;
12429 return data;
12430 }
12431 public static final BitSet _tokenSet_68 = new BitSet(mk_tokenSet_68());
12432 private static final long[] mk_tokenSet_69() {
12433 long[] data = { 137438953472L, 36063947032231936L, 8L, 0L, 0L, 0L};
12434 return data;
12435 }
12436 public static final BitSet _tokenSet_69 = new BitSet(mk_tokenSet_69());
12437 private static final long[] mk_tokenSet_70() {
12438 long[] data = { 0L, 4323455644427878400L, 0L, 0L};
12439 return data;
12440 }
12441 public static final BitSet _tokenSet_70 = new BitSet(mk_tokenSet_70());
12442 private static final long[] mk_tokenSet_71() {
12443 long[] data = new long[8];
12444 data[0]=4810363371520L;
12445 data[1]=4359414040076713984L;
12446 data[2]=8809040871139831622L;
12447 data[3]=1023L;
12448 return data;
12449 }
12450 public static final BitSet _tokenSet_71 = new BitSet(mk_tokenSet_71());
12451 private static final long[] mk_tokenSet_72() {
12452 long[] data = new long[8];
12453 data[0]=4810363371520L;
12454 data[1]=4395407652723556352L;
12455 data[2]=8809040871137476622L;
12456 data[3]=1023L;
12457 return data;
12458 }
12459 public static final BitSet _tokenSet_72 = new BitSet(mk_tokenSet_72());
12460 private static final long[] mk_tokenSet_73() {
12461 long[] data = { 0L, 2594073387517607936L, 0L, 0L};
12462 return data;
12463 }
12464 public static final BitSet _tokenSet_73 = new BitSet(mk_tokenSet_73());
12465 private static final long[] mk_tokenSet_74() {
12466 long[] data = new long[8];
12467 data[0]=4810363371520L;
12468 data[1]=4359414037929230336L;
12469 data[2]=8809040871139831622L;
12470 data[3]=1023L;
12471 return data;
12472 }
12473 public static final BitSet _tokenSet_74 = new BitSet(mk_tokenSet_74());
12474 private static final long[] mk_tokenSet_75() {
12475 long[] data = new long[8];
12476 data[0]=7009386627072L;
12477 data[1]=4575657221139955712L;
12478 data[2]=9223372036853727230L;
12479 data[3]=1023L;
12480 return data;
12481 }
12482 public static final BitSet _tokenSet_75 = new BitSet(mk_tokenSet_75());
12483 private static final long[] mk_tokenSet_76() {
12484 long[] data = { 0L, 1610612736L, 2L, 0L, 0L, 0L};
12485 return data;
12486 }
12487 public static final BitSet _tokenSet_76 = new BitSet(mk_tokenSet_76());
12488 private static final long[] mk_tokenSet_77() {
12489 long[] data = { 0L, 2305878159369175040L, 0L, 0L};
12490 return data;
12491 }
12492 public static final BitSet _tokenSet_77 = new BitSet(mk_tokenSet_77());
12493 private static final long[] mk_tokenSet_78() {
12494 long[] data = new long[8];
12495 data[0]=7009386627072L;
12496 data[1]=2666130979300507648L;
12497 data[2]=8809040871152418246L;
12498 data[3]=1023L;
12499 return data;
12500 }
12501 public static final BitSet _tokenSet_78 = new BitSet(mk_tokenSet_78());
12502 private static final long[] mk_tokenSet_79() {
12503 long[] data = { 0L, 1079508992L, 8L, 0L, 0L, 0L};
12504 return data;
12505 }
12506 public static final BitSet _tokenSet_79 = new BitSet(mk_tokenSet_79());
12507 private static final long[] mk_tokenSet_80() {
12508 long[] data = { 0L, 2413964552567259136L, 16L, 0L, 0L, 0L};
12509 return data;
12510 }
12511 public static final BitSet _tokenSet_80 = new BitSet(mk_tokenSet_80());
12512 private static final long[] mk_tokenSet_81() {
12513 long[] data = { 0L, 2413929402418593792L, 16L, 0L, 0L, 0L};
12514 return data;
12515 }
12516 public static final BitSet _tokenSet_81 = new BitSet(mk_tokenSet_81());
12517 private static final long[] mk_tokenSet_82() {
12518 long[] data = new long[8];
12519 data[0]=4810363371522L;
12520 data[1]=-144185588367523840L;
12521 data[2]=8809040871140880350L;
12522 data[3]=1023L;
12523 return data;
12524 }
12525 public static final BitSet _tokenSet_82 = new BitSet(mk_tokenSet_82());
12526 private static final long[] mk_tokenSet_83() {
12527 long[] data = { 137438953472L, 2305878159226961920L, 24L, 0L, 0L, 0L};
12528 return data;
12529 }
12530 public static final BitSet _tokenSet_83 = new BitSet(mk_tokenSet_83());
12531 private static final long[] mk_tokenSet_84() {
12532 long[] data = new long[8];
12533 data[0]=4810363371520L;
12534 data[1]=4431471634118836224L;
12535 data[2]=8809040871139831646L;
12536 data[3]=1023L;
12537 return data;
12538 }
12539 public static final BitSet _tokenSet_84 = new BitSet(mk_tokenSet_84());
12540 private static final long[] mk_tokenSet_85() {
12541 long[] data = new long[8];
12542 data[0]=4810363371520L;
12543 data[1]=1477075090848808960L;
12544 data[2]=8809040871137730566L;
12545 data[3]=1023L;
12546 return data;
12547 }
12548 public static final BitSet _tokenSet_85 = new BitSet(mk_tokenSet_85());
12549 private static final long[] mk_tokenSet_86() {
12550 long[] data = new long[8];
12551 data[0]=288484363337728L;
12552 data[1]=4611686018158919680L;
12553 data[2]=-1048578L;
12554 data[3]=1023L;
12555 return data;
12556 }
12557 public static final BitSet _tokenSet_86 = new BitSet(mk_tokenSet_86());
12558 private static final long[] mk_tokenSet_87() {
12559 long[] data = { 4810363371520L, 2341766219836620800L, 4128L, 0L, 0L, 0L};
12560 return data;
12561 }
12562 public static final BitSet _tokenSet_87 = new BitSet(mk_tokenSet_87());
12563 private static final long[] mk_tokenSet_88() {
12564 long[] data = new long[8];
12565 data[0]=4810363371520L;
12566 data[1]=2629996596669906944L;
12567 data[2]=8809040871137480742L;
12568 data[3]=1023L;
12569 return data;
12570 }
12571 public static final BitSet _tokenSet_88 = new BitSet(mk_tokenSet_88());
12572 private static final long[] mk_tokenSet_89() {
12573 long[] data = { 4810363371520L, 2341766219836620800L, 0L, 0L};
12574 return data;
12575 }
12576 public static final BitSet _tokenSet_89 = new BitSet(mk_tokenSet_89());
12577 private static final long[] mk_tokenSet_90() {
12578 long[] data = { 4810363371520L, 3602774117792546816L, 0L, 0L};
12579 return data;
12580 }
12581 public static final BitSet _tokenSet_90 = new BitSet(mk_tokenSet_90());
12582 private static final long[] mk_tokenSet_91() {
12583 long[] data = { 0L, 1188950303787974656L, 0L, 0L};
12584 return data;
12585 }
12586 public static final BitSet _tokenSet_91 = new BitSet(mk_tokenSet_91());
12587 private static final long[] mk_tokenSet_92() {
12588 long[] data = { 137438953472L, 35150021656576L, 8L, 0L, 0L, 0L};
12589 return data;
12590 }
12591 public static final BitSet _tokenSet_92 = new BitSet(mk_tokenSet_92());
12592 private static final long[] mk_tokenSet_93() {
12593 long[] data = { 0L, 2594073385365405696L, 4194304L, 0L, 0L, 0L};
12594 return data;
12595 }
12596 public static final BitSet _tokenSet_93 = new BitSet(mk_tokenSet_93());
12597 private static final long[] mk_tokenSet_94() {
12598 long[] data = new long[8];
12599 data[0]=2L;
12600 data[1]=8971205610430791680L;
12601 data[2]=8809040871138525318L;
12602 data[3]=1023L;
12603 return data;
12604 }
12605 public static final BitSet _tokenSet_94 = new BitSet(mk_tokenSet_94());
12606 private static final long[] mk_tokenSet_95() {
12607 long[] data = new long[8];
12608 data[0]=7009386627074L;
12609 data[1]=9223372036586307584L;
12610 data[2]=9223372036854775806L;
12611 data[3]=1023L;
12612 return data;
12613 }
12614 public static final BitSet _tokenSet_95 = new BitSet(mk_tokenSet_95());
12615 private static final long[] mk_tokenSet_96() {
12616 long[] data = { 2L, 8682940083719897088L, 1048704L, 0L, 0L, 0L};
12617 return data;
12618 }
12619 public static final BitSet _tokenSet_96 = new BitSet(mk_tokenSet_96());
12620 private static final long[] mk_tokenSet_97() {
12621 long[] data = new long[8];
12622 data[0]=288484363337730L;
12623 data[1]=9223372036586307584L;
12624 data[2]=-10L;
12625 data[3]=1023L;
12626 return data;
12627 }
12628 public static final BitSet _tokenSet_97 = new BitSet(mk_tokenSet_97());
12629 private static final long[] mk_tokenSet_98() {
12630 long[] data = { 4810363371520L, 3566745320773582848L, 4L, 0L, 0L, 0L};
12631 return data;
12632 }
12633 public static final BitSet _tokenSet_98 = new BitSet(mk_tokenSet_98());
12634 private static final long[] mk_tokenSet_99() {
12635 long[] data = { 0L, 25769803776L, 15762598695796736L, 0L, 0L, 0L};
12636 return data;
12637 }
12638 public static final BitSet _tokenSet_99 = new BitSet(mk_tokenSet_99());
12639 private static final long[] mk_tokenSet_100() {
12640 long[] data = new long[8];
12641 data[0]=-16L;
12642 data[1]=-288230376151711745L;
12643 data[2]=-1L;
12644 data[3]=134217727L;
12645 return data;
12646 }
12647 public static final BitSet _tokenSet_100 = new BitSet(mk_tokenSet_100());
12648 private static final long[] mk_tokenSet_101() {
12649 long[] data = { 0L, 2594073385379037184L, 117440512L, 0L, 0L, 0L};
12650 return data;
12651 }
12652 public static final BitSet _tokenSet_101 = new BitSet(mk_tokenSet_101());
12653 private static final long[] mk_tokenSet_102() {
12654 long[] data = new long[8];
12655 data[0]=7009386627072L;
12656 data[1]=4395513205846147072L;
12657 data[2]=8809040871269859294L;
12658 data[3]=1023L;
12659 return data;
12660 }
12661 public static final BitSet _tokenSet_102 = new BitSet(mk_tokenSet_102());
12662 private static final long[] mk_tokenSet_103() {
12663 long[] data = new long[8];
12664 data[1]=2594108535924588544L;
12665 data[2]=8809040871137476614L;
12666 data[3]=1023L;
12667 return data;
12668 }
12669 public static final BitSet _tokenSet_103 = new BitSet(mk_tokenSet_103());
12670 private static final long[] mk_tokenSet_104() {
12671 long[] data = { 0L, 35184372088832L, 108086391056891904L, 0L, 0L, 0L};
12672 return data;
12673 }
12674 public static final BitSet _tokenSet_104 = new BitSet(mk_tokenSet_104());
12675 private static final long[] mk_tokenSet_105() {
12676 long[] data = { 0L, 36028798097948672L, 0L, 0L};
12677 return data;
12678 }
12679 public static final BitSet _tokenSet_105 = new BitSet(mk_tokenSet_105());
12680 private static final long[] mk_tokenSet_106() {
12681 long[] data = new long[8];
12682 data[1]=288265526710894592L;
12683 data[2]=6917529027641081862L;
12684 data[3]=1023L;
12685 return data;
12686 }
12687 public static final BitSet _tokenSet_106 = new BitSet(mk_tokenSet_106());
12688 private static final long[] mk_tokenSet_107() {
12689 long[] data = new long[8];
12690 data[0]=2L;
12691 data[1]=9187483976933572608L;
12692 data[2]=9223372036722397366L;
12693 data[3]=1023L;
12694 return data;
12695 }
12696 public static final BitSet _tokenSet_107 = new BitSet(mk_tokenSet_107());
12697 private static final long[] mk_tokenSet_108() {
12698 long[] data = new long[8];
12699 data[0]=2L;
12700 data[1]=9187483976937766912L;
12701 data[2]=9223372036839837878L;
12702 data[3]=1023L;
12703 return data;
12704 }
12705 public static final BitSet _tokenSet_108 = new BitSet(mk_tokenSet_108());
12706 private static final long[] mk_tokenSet_109() {
12707 long[] data = new long[8];
12708 data[0]=7009386627072L;
12709 data[1]=324259141524586496L;
12710 data[2]=8809040871152418246L;
12711 data[3]=1023L;
12712 return data;
12713 }
12714 public static final BitSet _tokenSet_109 = new BitSet(mk_tokenSet_109());
12715 private static final long[] mk_tokenSet_110() {
12716 long[] data = new long[8];
12717 data[1]=288265526712991744L;
12718 data[2]=8809040871137476614L;
12719 data[3]=1023L;
12720 return data;
12721 }
12722 public static final BitSet _tokenSet_110 = new BitSet(mk_tokenSet_110());
12723 private static final long[] mk_tokenSet_111() {
12724 long[] data = new long[8];
12725 data[0]=2199023255552L;
12726 data[1]=288335895471980544L;
12727 data[2]=6917529027655769542L;
12728 data[3]=1023L;
12729 return data;
12730 }
12731 public static final BitSet _tokenSet_111 = new BitSet(mk_tokenSet_111());
12732 private static final long[] mk_tokenSet_112() {
12733 long[] data = new long[8];
12734 data[0]=7009386627072L;
12735 data[1]=4359484408822988800L;
12736 data[2]=8809040871152418814L;
12737 data[3]=1023L;
12738 return data;
12739 }
12740 public static final BitSet _tokenSet_112 = new BitSet(mk_tokenSet_112());
12741 private static final long[] mk_tokenSet_113() {
12742 long[] data = new long[8];
12743 data[0]=4810363371520L;
12744 data[1]=324153586241961984L;
12745 data[2]=8809040871137730566L;
12746 data[3]=1023L;
12747 return data;
12748 }
12749 public static final BitSet _tokenSet_113 = new BitSet(mk_tokenSet_113());
12750 private static final long[] mk_tokenSet_114() {
12751 long[] data = { 2199023255552L, 105518773436416L, 14687680L, 0L, 0L, 0L};
12752 return data;
12753 }
12754 public static final BitSet _tokenSet_114 = new BitSet(mk_tokenSet_114());
12755
12756 }