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