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