KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > groovy > antlr > parser > GroovyRecognizer


1 // $ANTLR 2.7.2: "groovy.g" -> "GroovyRecognizer.java"$
2

3 package org.codehaus.groovy.antlr.parser;
4 import org.codehaus.groovy.antlr.*;
5 import java.util.*;
6 import java.io.InputStream JavaDoc;
7 import java.io.Reader JavaDoc;
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 JavaDoc;
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         // TODO: set up a common error-handling control block, to avoid excessive tangle between these guys
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     // Create a scanner that reads from the input stream passed to us...
220
public static GroovyRecognizer make(InputStream JavaDoc in) { return make(new GroovyLexer(in)); }
221     public static GroovyRecognizer make(Reader JavaDoc 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; // for now
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 JavaDoc 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 JavaDoc txt, Token first, Token last) {
250         AST t = astFactory.create(type,txt);
251         if ( t != null && first != null) {
252             // first copy details from first token
253
t.initialize(first);
254             // then ensure that type and txt are specific to this new node
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             // todo - we can populate AST snippets on the fly, but this may be better done as a post-parse decoration
263
if (sourceBuffer != null) {
264                 String JavaDoc snippet = sourceBuffer.getSnippet(
265                                         new LineColumn(first.getLine(),first.getColumn()),
266                                         new LineColumn(last.getLine(),last.getColumn())
267                 );
268                 node.setSnippet(snippet);
269             }
270         }
271         return t;
272     }
273
274
275     // stuff to adjust ANTLR's tracing machinery
276
public static boolean tracing = false; // only effective if antlr.Tool is run with -traceParser
277
public void traceIn(String JavaDoc rname) throws TokenStreamException {
278         if (!GroovyRecognizer.tracing) return;
279         super.traceIn(rname);
280     }
281     public void traceOut(String JavaDoc rname) throws TokenStreamException {
282         if (!GroovyRecognizer.tracing) return;
283         if (returnAST != null) rname += returnAST.toStringList();
284         super.traceOut(rname);
285     }
286         
287     // Error handling. This is a funnel through which parser errors go, when the parser can suggest a solution.
288
public void requireFailed(String JavaDoc problem, String JavaDoc solution) throws SemanticException {
289         // TODO: Needs more work.
290
Token lt = null;
291         try { lt = LT(1); }
292         catch (TokenStreamException ee) { }
293         if (lt == null) lt = Token.badToken;
294         throw new SemanticException(problem + ";\n solution: " + solution,
295                                     getFilename(), lt.getLine(), lt.getColumn());
296     }
297
298     public void addWarning(String JavaDoc warning, String JavaDoc solution) {
299         Token lt = null;
300         try { lt = LT(1); }
301         catch (TokenStreamException ee) { }
302         if (lt == null) lt = Token.badToken;
303
304         Map row = new HashMap();
305         row.put("warning" ,warning);
306         row.put("solution",solution);
307         row.put("filename",getFilename());
308         row.put("line" ,new Integer JavaDoc(lt.getLine()));
309         row.put("column" ,new Integer JavaDoc(lt.getColumn()));
310         // System.out.println(row);
311
warningList.add(row);
312     }
313
314     // Convenience method for checking of expected error syndromes.
315
private void require(boolean z, String JavaDoc problem, String JavaDoc solution) throws SemanticException {
316         if (!z) requireFailed(problem, solution);
317     }
318
319
320     // Query a name token to see if it begins with a capital letter.
321
// This is used to tell the difference (w/o symbol table access) between {String x} and {println x}.
322
private boolean isUpperCase(Token x) {
323         if (x == null || x.getType() != IDENT) return false; // cannot happen?
324
String JavaDoc xtext = x.getText();
325         return (xtext.length() > 0 && Character.isUpperCase(xtext.charAt(0)));
326     }
327
328     private AST currentClass = null; // current enclosing class (for constructor recognition)
329
// Query a name token to see if it is identical with the current class name.
330
// This is used to distinguish constructors from other methods.
331
private boolean isConstructorIdent(Token x) {
332         if (currentClass == null) return false;
333         if (currentClass.getType() != IDENT) return false; // cannot happen?
334
String JavaDoc cname = currentClass.getText();
335
336         if (x == null || x.getType() != IDENT) return false; // cannot happen?
337
return cname.equals(x.getText());
338     }
339
340     // Scratch variable for last 'sep' token.
341
// Written by the 'sep' rule, read only by immediate callers of 'sep'.
342
// (Not entirely clean, but better than a million xx=sep occurrences.)
343
private int sepToken = EOF;
344
345     // Scratch variable for last argument list; tells whether there was a label.
346
// Written by 'argList' rule, read only by immediate callers of 'argList'.
347
private boolean argListHasLabels = false;
348
349     // Scratch variable, holds most recently completed pathExpression.
350
// Read only by immediate callers of 'pathExpression' and 'expression'.
351
private AST lastPathExpression = null;
352
353     // Inherited attribute pushed into most expression rules.
354
// If not zero, it means that the left context of the expression
355
// being parsed is a statement boundary or an initializer sign '='.
356
// Only such expressions are allowed to reach across newlines
357
// to pull in an LCURLY and appended block.
358
private final int LC_STMT = 1, LC_INIT = 2;
359
360     /**
361      * Counts the number of LT seen in the typeArguments production.
362      * It is used in semantic predicates to ensure we have seen
363      * enough closing '>' characters; which actually may have been
364      * either GT, SR or BSR tokens.
365      */

366     private int ltCounter = 0;
367     
368     /* This symbol is used to work around a known ANTLR limitation.
369      * In a loop with syntactic predicate, ANTLR needs help knowing
370      * that the loop exit is a second alternative.
371      * Example usage: ( (LCURLY)=> block | {ANTLR_LOOP_EXIT}? )*
372      * Probably should be an ANTLR RFE.
373      */

374     ////// Original comment in Java grammar:
375
// Unfortunately a syntactic predicate can only select one of
376
// multiple alternatives on the same level, not break out of
377
// an enclosing loop, which is why this ugly hack (a fake
378
// empty alternative with always-false semantic predicate)
379
// is necessary.
380
private static final boolean ANTLR_LOOP_EXIT = false;
381
382 protected GroovyRecognizer(TokenBuffer tokenBuf, int k) {
383   super(tokenBuf,k);
384   tokenNames = _tokenNames;
385   buildTokenTypeASTClassMap();
386   astFactory = new ASTFactory(getTokenTypeToASTClassMap());
387 }
388
389 public GroovyRecognizer(TokenBuffer tokenBuf) {
390   this(tokenBuf,3);
391 }
392
393 protected GroovyRecognizer(TokenStream lexer, int k) {
394   super(lexer,k);
395   tokenNames = _tokenNames;
396   buildTokenTypeASTClassMap();
397   astFactory = new ASTFactory(getTokenTypeToASTClassMap());
398 }
399
400 public GroovyRecognizer(TokenStream lexer) {
401   this(lexer,3);
402 }
403
404 public GroovyRecognizer(ParserSharedInputState state) {
405   super(state,3);
406   tokenNames = _tokenNames;
407   buildTokenTypeASTClassMap();
408   astFactory = new ASTFactory(getTokenTypeToASTClassMap());
409 }
410
411     public final void compilationUnit() throws RecognitionException, TokenStreamException {
412         
413         returnAST = null;
414         ASTPair currentAST = new ASTPair();
415         AST compilationUnit_AST = null;
416         
417         {
418         switch ( LA(1)) {
419         case SH_COMMENT:
420         {
421             match(SH_COMMENT);
422             break;
423         }
424         case EOF:
425         case FINAL:
426         case ABSTRACT:
427         case STRICTFP:
428         case LITERAL_package:
429         case LITERAL_import:
430         case LITERAL_static:
431         case LITERAL_def:
432         case AT:
433         case IDENT:
434         case LBRACK:
435         case LPAREN:
436         case LITERAL_class:
437         case LITERAL_interface:
438         case LITERAL_enum:
439         case LITERAL_super:
440         case LITERAL_void:
441         case LITERAL_boolean:
442         case LITERAL_byte:
443         case LITERAL_char:
444         case LITERAL_short:
445         case LITERAL_int:
446         case LITERAL_float:
447         case LITERAL_long:
448         case LITERAL_double:
449         case LITERAL_any:
450         case STAR:
451         case LITERAL_private:
452         case LITERAL_public:
453         case LITERAL_protected:
454         case LITERAL_transient:
455         case LITERAL_native:
456         case LITERAL_threadsafe:
457         case LITERAL_synchronized:
458         case LITERAL_volatile:
459         case LCURLY:
460         case SEMI:
461         case NLS:
462         case LITERAL_this:
463         case STRING_LITERAL:
464         case LITERAL_if:
465         case LITERAL_while:
466         case LITERAL_with:
467         case LITERAL_switch:
468         case LITERAL_for:
469         case LITERAL_return:
470         case LITERAL_break:
471         case LITERAL_continue:
472         case LITERAL_throw:
473         case LITERAL_assert:
474         case PLUS:
475         case MINUS:
476         case LITERAL_try:
477         case INC:
478         case DEC:
479         case BNOT:
480         case LNOT:
481         case DOLLAR:
482         case STRING_CTOR_START:
483         case LITERAL_new:
484         case LITERAL_true:
485         case LITERAL_false:
486         case LITERAL_null:
487         case NUM_INT:
488         case NUM_FLOAT:
489         case NUM_LONG:
490         case NUM_DOUBLE:
491         case NUM_BIG_INT:
492         case NUM_BIG_DECIMAL:
493         {
494             break;
495         }
496         default:
497         {
498             throw new NoViableAltException(LT(1), getFilename());
499         }
500         }
501         }
502         nls();
503         {
504         boolean synPredMatched5 = false;
505         if (((LA(1)==LITERAL_package||LA(1)==AT) && (LA(2)==IDENT) && (_tokenSet_0.member(LA(3))))) {
506             int _m5 = mark();
507             synPredMatched5 = true;
508             inputState.guessing++;
509             try {
510                 {
511                 annotationsOpt();
512                 match(LITERAL_package);
513                 }
514             }
515             catch (RecognitionException pe) {
516                 synPredMatched5 = false;
517             }
518             rewind(_m5);
519             inputState.guessing--;
520         }
521         if ( synPredMatched5 ) {
522             packageDefinition();
523             astFactory.addASTChild(currentAST, returnAST);
524         }
525         else if ((_tokenSet_1.member(LA(1))) && (_tokenSet_2.member(LA(2))) && (_tokenSet_3.member(LA(3)))) {
526             {
527             switch ( LA(1)) {
528             case FINAL:
529             case ABSTRACT:
530             case STRICTFP:
531             case LITERAL_import:
532             case LITERAL_static:
533             case LITERAL_def:
534             case AT:
535             case IDENT:
536             case LBRACK:
537             case LPAREN:
538             case LITERAL_class:
539             case LITERAL_interface:
540             case LITERAL_enum:
541             case LITERAL_super:
542             case LITERAL_void:
543             case LITERAL_boolean:
544             case LITERAL_byte:
545             case LITERAL_char:
546             case LITERAL_short:
547             case LITERAL_int:
548             case LITERAL_float:
549             case LITERAL_long:
550             case LITERAL_double:
551             case LITERAL_any:
552             case STAR:
553             case LITERAL_private:
554             case LITERAL_public:
555             case LITERAL_protected:
556             case LITERAL_transient:
557             case LITERAL_native:
558             case LITERAL_threadsafe:
559             case LITERAL_synchronized:
560             case LITERAL_volatile:
561             case LCURLY:
562             case LITERAL_this:
563             case STRING_LITERAL:
564             case LITERAL_if:
565             case LITERAL_while:
566             case LITERAL_with:
567             case LITERAL_switch:
568             case LITERAL_for:
569             case LITERAL_return:
570             case LITERAL_break:
571             case LITERAL_continue:
572             case LITERAL_throw:
573             case LITERAL_assert:
574             case PLUS:
575             case MINUS:
576             case LITERAL_try:
577             case INC:
578             case DEC:
579             case BNOT:
580             case LNOT:
581             case DOLLAR:
582             case STRING_CTOR_START:
583             case LITERAL_new:
584             case LITERAL_true:
585             case LITERAL_false:
586             case LITERAL_null:
587             case NUM_INT:
588             case NUM_FLOAT:
589             case NUM_LONG:
590             case NUM_DOUBLE:
591             case NUM_BIG_INT:
592             case NUM_BIG_DECIMAL:
593             {
594                 statement(EOF);
595                 astFactory.addASTChild(currentAST, returnAST);
596                 break;
597             }
598             case EOF:
599             case SEMI:
600             case NLS:
601             {
602                 break;
603             }
604             default:
605             {
606                 throw new NoViableAltException(LT(1), getFilename());
607             }
608             }
609             }
610         }
611         else {
612             throw new NoViableAltException(LT(1), getFilename());
613         }
614         
615         }
616         {
617         _loop9:
618         do {
619             if ((LA(1)==SEMI||LA(1)==NLS)) {
620                 sep();
621                 {
622                 switch ( LA(1)) {
623                 case FINAL:
624                 case ABSTRACT:
625                 case STRICTFP:
626                 case LITERAL_import:
627                 case LITERAL_static:
628                 case LITERAL_def:
629                 case AT:
630                 case IDENT:
631                 case LBRACK:
632                 case LPAREN:
633                 case LITERAL_class:
634                 case LITERAL_interface:
635                 case LITERAL_enum:
636                 case LITERAL_super:
637                 case LITERAL_void:
638                 case LITERAL_boolean:
639                 case LITERAL_byte:
640                 case LITERAL_char:
641                 case LITERAL_short:
642                 case LITERAL_int:
643                 case LITERAL_float:
644                 case LITERAL_long:
645                 case LITERAL_double:
646                 case LITERAL_any:
647                 case STAR:
648                 case LITERAL_private:
649                 case LITERAL_public:
650                 case LITERAL_protected:
651                 case LITERAL_transient:
652                 case LITERAL_native:
653                 case LITERAL_threadsafe:
654                 case LITERAL_synchronized:
655                 case LITERAL_volatile:
656                 case LCURLY:
657                 case LITERAL_this:
658                 case STRING_LITERAL:
659                 case LITERAL_if:
660                 case LITERAL_while:
661                 case LITERAL_with:
662                 case LITERAL_switch:
663                 case LITERAL_for:
664                 case LITERAL_return:
665                 case LITERAL_break:
666                 case LITERAL_continue:
667                 case LITERAL_throw:
668                 case LITERAL_assert:
669                 case PLUS:
670                 case MINUS:
671                 case LITERAL_try:
672                 case INC:
673                 case DEC:
674                 case BNOT:
675                 case LNOT:
676                 case DOLLAR:
677                 case STRING_CTOR_START:
678                 case LITERAL_new:
679                 case LITERAL_true:
680                 case LITERAL_false:
681                 case LITERAL_null:
682                 case NUM_INT:
683                 case NUM_FLOAT:
684                 case NUM_LONG:
685                 case NUM_DOUBLE:
686                 case NUM_BIG_INT:
687                 case NUM_BIG_DECIMAL:
688                 {
689                     statement(sepToken);
690                     astFactory.addASTChild(currentAST, returnAST);
691                     break;
692                 }
693                 case EOF:
694                 case SEMI:
695                 case NLS:
696                 {
697                     break;
698                 }
699                 default:
700                 {
701                     throw new NoViableAltException(LT(1), getFilename());
702                 }
703                 }
704                 }
705             }
706             else {
707                 break _loop9;
708             }
709             
710         } while (true);
711         }
712         match(Token.EOF_TYPE);
713         compilationUnit_AST = (AST)currentAST.root;
714         returnAST = compilationUnit_AST;
715     }
716     
717 /** Zero or more insignificant newlines, all gobbled up and thrown away. */
718     public final void nls() throws RecognitionException, TokenStreamException {
719         
720         returnAST = null;
721         ASTPair currentAST = new ASTPair();
722         AST nls_AST = null;
723         
724         {
725         if ((LA(1)==NLS) && (_tokenSet_4.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
726             match(NLS);
727         }
728         else if ((_tokenSet_4.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
729         }
730         else {
731             throw new NoViableAltException(LT(1), getFilename());
732         }
733         
734         }
735         returnAST = nls_AST;
736     }
737     
738     public final void annotationsOpt() throws RecognitionException, TokenStreamException {
739         
740         returnAST = null;
741         ASTPair currentAST = new ASTPair();
742         AST annotationsOpt_AST = null;
743         Token first = LT(1);
744         
745         {
746         _loop79:
747         do {
748             if ((LA(1)==AT)) {
749                 annotation();
750                 astFactory.addASTChild(currentAST, returnAST);
751                 nls();
752             }
753             else {
754                 break _loop79;
755             }
756             
757         } while (true);
758         }
759         if ( inputState.guessing==0 ) {
760             annotationsOpt_AST = (AST)currentAST.root;
761             annotationsOpt_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(ANNOTATIONS,"ANNOTATIONS",first,LT(1))).add(annotationsOpt_AST));
762             currentAST.root = annotationsOpt_AST;
763             currentAST.child = annotationsOpt_AST!=null &&annotationsOpt_AST.getFirstChild()!=null ?
764                 annotationsOpt_AST.getFirstChild() : annotationsOpt_AST;
765             currentAST.advanceChildToEnd();
766         }
767         annotationsOpt_AST = (AST)currentAST.root;
768         returnAST = annotationsOpt_AST;
769     }
770     
771     public final void packageDefinition() throws RecognitionException, TokenStreamException {
772         
773         returnAST = null;
774         ASTPair currentAST = new ASTPair();
775         AST packageDefinition_AST = null;
776         Token p = null;
777         AST p_AST = null;
778         
779         annotationsOpt();
780         astFactory.addASTChild(currentAST, returnAST);
781         p = LT(1);
782         p_AST = astFactory.create(p);
783         astFactory.makeASTRoot(currentAST, p_AST);
784         match(LITERAL_package);
785         if ( inputState.guessing==0 ) {
786             p_AST.setType(PACKAGE_DEF);
787         }
788         identifier();
789         astFactory.addASTChild(currentAST, returnAST);
790         packageDefinition_AST = (AST)currentAST.root;
791         returnAST = packageDefinition_AST;
792     }
793     
794 /** A statement is an element of a block.
795  * Typical statements are declarations (which are scoped to the block)
796  * and expressions.
797  */

798     public final void statement(
799         int prevToken
800     ) throws RecognitionException, TokenStreamException {
801         
802         returnAST = null;
803         ASTPair currentAST = new ASTPair();
804         AST statement_AST = null;
805         AST pfx_AST = null;
806         AST m_AST = null;
807         Token sp = null;
808         AST sp_AST = null;
809         
810         switch ( LA(1)) {
811         case LITERAL_if:
812         {
813             AST tmp4_AST = null;
814             tmp4_AST = astFactory.create(LT(1));
815             astFactory.makeASTRoot(currentAST, tmp4_AST);
816             match(LITERAL_if);
817             match(LPAREN);
818             strictContextExpression();
819             astFactory.addASTChild(currentAST, returnAST);
820             match(RPAREN);
821             nlsWarn();
822             compatibleBodyStatement();
823             astFactory.addASTChild(currentAST, returnAST);
824             {
825             boolean synPredMatched263 = false;
826             if (((_tokenSet_6.member(LA(1))) && (_tokenSet_7.member(LA(2))) && (_tokenSet_8.member(LA(3))))) {
827                 int _m263 = mark();
828                 synPredMatched263 = true;
829                 inputState.guessing++;
830                 try {
831                     {
832                     {
833                     switch ( LA(1)) {
834                     case SEMI:
835                     case NLS:
836                     {
837                         sep();
838                         break;
839                     }
840                     case LITERAL_else:
841                     {
842                         break;
843                     }
844                     default:
845                     {
846                         throw new NoViableAltException(LT(1), getFilename());
847                     }
848                     }
849                     }
850                     match(LITERAL_else);
851                     }
852                 }
853                 catch (RecognitionException pe) {
854                     synPredMatched263 = false;
855                 }
856                 rewind(_m263);
857                 inputState.guessing--;
858             }
859             if ( synPredMatched263 ) {
860                 {
861                 switch ( LA(1)) {
862                 case SEMI:
863                 case NLS:
864                 {
865                     sep();
866                     break;
867                 }
868                 case LITERAL_else:
869                 {
870                     break;
871                 }
872                 default:
873                 {
874                     throw new NoViableAltException(LT(1), getFilename());
875                 }
876                 }
877                 }
878                 match(LITERAL_else);
879                 nlsWarn();
880                 compatibleBodyStatement();
881                 astFactory.addASTChild(currentAST, returnAST);
882             }
883             else if ((_tokenSet_9.member(LA(1))) && (_tokenSet_10.member(LA(2))) && (_tokenSet_11.member(LA(3)))) {
884             }
885             else {
886                 throw new NoViableAltException(LT(1), getFilename());
887             }
888             
889             }
890             statement_AST = (AST)currentAST.root;
891             break;
892         }
893         case LITERAL_for:
894         {
895             forStatement();
896             astFactory.addASTChild(currentAST, returnAST);
897             statement_AST = (AST)currentAST.root;
898             break;
899         }
900         case LITERAL_while:
901         {
902             AST tmp8_AST = null;
903             tmp8_AST = astFactory.create(LT(1));
904             astFactory.makeASTRoot(currentAST, tmp8_AST);
905             match(LITERAL_while);
906             match(LPAREN);
907             strictContextExpression();
908             astFactory.addASTChild(currentAST, returnAST);
909             match(RPAREN);
910             nlsWarn();
911             compatibleBodyStatement();
912             astFactory.addASTChild(currentAST, returnAST);
913             statement_AST = (AST)currentAST.root;
914             break;
915         }
916         case LITERAL_with:
917         {
918             AST tmp11_AST = null;
919             tmp11_AST = astFactory.create(LT(1));
920             astFactory.makeASTRoot(currentAST, tmp11_AST);
921             match(LITERAL_with);
922             match(LPAREN);
923             strictContextExpression();
924             astFactory.addASTChild(currentAST, returnAST);
925             match(RPAREN);
926             nlsWarn();
927             compoundStatement();
928             astFactory.addASTChild(currentAST, returnAST);
929             statement_AST = (AST)currentAST.root;
930             break;
931         }
932         case STAR:
933         {
934             sp = LT(1);
935             sp_AST = astFactory.create(sp);
936             astFactory.makeASTRoot(currentAST, sp_AST);
937             match(STAR);
938             nls();
939             if ( inputState.guessing==0 ) {
940                 sp_AST.setType(SPREAD_ARG);
941             }
942             expressionStatement(EOF);
943             astFactory.addASTChild(currentAST, returnAST);
944             statement_AST = (AST)currentAST.root;
945             break;
946         }
947         case LITERAL_import:
948         {
949             importStatement();
950             astFactory.addASTChild(currentAST, returnAST);
951             statement_AST = (AST)currentAST.root;
952             break;
953         }
954         case LITERAL_switch:
955         {
956             AST tmp14_AST = null;
957             tmp14_AST = astFactory.create(LT(1));
958             astFactory.makeASTRoot(currentAST, tmp14_AST);
959             match(LITERAL_switch);
960             match(LPAREN);
961             strictContextExpression();
962             astFactory.addASTChild(currentAST, returnAST);
963             match(RPAREN);
964             nlsWarn();
965             match(LCURLY);
966             nls();
967             {
968             _loop266:
969             do {
970                 if ((LA(1)==LITERAL_default||LA(1)==LITERAL_case)) {
971                     casesGroup();
972                     astFactory.addASTChild(currentAST, returnAST);
973                 }
974                 else {
975                     break _loop266;
976                 }
977                 
978             } while (true);
979             }
980             match(RCURLY);
981             statement_AST = (AST)currentAST.root;
982             break;
983         }
984         case LITERAL_try:
985         {
986             tryBlock();
987             astFactory.addASTChild(currentAST, returnAST);
988             statement_AST = (AST)currentAST.root;
989             break;
990         }
991         case LITERAL_return:
992         case LITERAL_break:
993         case LITERAL_continue:
994         case LITERAL_throw:
995         case LITERAL_assert:
996         {
997             branchStatement();
998             astFactory.addASTChild(currentAST, returnAST);
999             statement_AST = (AST)currentAST.root;
1000            break;
1001        }
1002        default:
1003            boolean synPredMatched254 = false;
1004            if (((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2))) && (_tokenSet_14.member(LA(3))))) {
1005                int _m254 = mark();
1006                synPredMatched254 = true;
1007                inputState.guessing++;
1008                try {
1009                    {
1010                    declarationStart();
1011                    }
1012                }
1013                catch (RecognitionException pe) {
1014                    synPredMatched254 = false;
1015                }
1016                rewind(_m254);
1017                inputState.guessing--;
1018            }
1019            if ( synPredMatched254 ) {
1020                declaration();
1021                astFactory.addASTChild(currentAST, returnAST);
1022                statement_AST = (AST)currentAST.root;
1023            }
1024            else {
1025                boolean synPredMatched256 = false;
1026                if (((LA(1)==IDENT) && (LA(2)==COLON) && (_tokenSet_15.member(LA(3))))) {
1027                    int _m256 = mark();
1028                    synPredMatched256 = true;
1029                    inputState.guessing++;
1030                    try {
1031                        {
1032                        match(IDENT);
1033                        match(COLON);
1034                        }
1035                    }
1036                    catch (RecognitionException pe) {
1037                        synPredMatched256 = false;
1038                    }
1039                    rewind(_m256);
1040                    inputState.guessing--;
1041                }
1042                if ( synPredMatched256 ) {
1043                    statementLabelPrefix();
1044                    pfx_AST = (AST)returnAST;
1045                    if ( inputState.guessing==0 ) {
1046                        statement_AST = (AST)currentAST.root;
1047                        statement_AST = pfx_AST;
1048                        currentAST.root = statement_AST;
1049                        currentAST.child = statement_AST!=null &&statement_AST.getFirstChild()!=null ?
1050                            statement_AST.getFirstChild() : statement_AST;
1051                        currentAST.advanceChildToEnd();
1052                    }
1053                    {
1054                    boolean synPredMatched259 = false;
1055                    if (((LA(1)==LCURLY) && (_tokenSet_16.member(LA(2))) && (_tokenSet_17.member(LA(3))))) {
1056                        int _m259 = mark();
1057                        synPredMatched259 = true;
1058                        inputState.guessing++;
1059                        try {
1060                            {
1061                            match(LCURLY);
1062                            }
1063                        }
1064                        catch (RecognitionException pe) {
1065                            synPredMatched259 = false;
1066                        }
1067                        rewind(_m259);
1068                        inputState.guessing--;
1069                    }
1070                    if ( synPredMatched259 ) {
1071                        openOrClosedBlock();
1072                        astFactory.addASTChild(currentAST, returnAST);
1073                    }
1074                    else if ((_tokenSet_15.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_18.member(LA(3)))) {
1075                        statement(COLON);
1076                        astFactory.addASTChild(currentAST, returnAST);
1077                    }
1078                    else {
1079                        throw new NoViableAltException(LT(1), getFilename());
1080                    }
1081                    
1082                    }
1083                    statement_AST = (AST)currentAST.root;
1084                }
1085                else if ((_tokenSet_19.member(LA(1))) && (_tokenSet_8.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
1086                    expressionStatement(prevToken);
1087                    astFactory.addASTChild(currentAST, returnAST);
1088                    statement_AST = (AST)currentAST.root;
1089                }
1090                else if ((_tokenSet_21.member(LA(1))) && (_tokenSet_22.member(LA(2))) && (_tokenSet_23.member(LA(3)))) {
1091                    modifiersOpt();
1092                    m_AST = (AST)returnAST;
1093                    typeDefinitionInternal(m_AST);
1094                    astFactory.addASTChild(currentAST, returnAST);
1095                    statement_AST = (AST)currentAST.root;
1096                }
1097                else if ((LA(1)==LITERAL_synchronized) && (LA(2)==LPAREN)) {
1098                    AST tmp19_AST = null;
1099                    tmp19_AST = astFactory.create(LT(1));
1100                    astFactory.makeASTRoot(currentAST, tmp19_AST);
1101                    match(LITERAL_synchronized);
1102                    match(LPAREN);
1103                    strictContextExpression();
1104                    astFactory.addASTChild(currentAST, returnAST);
1105                    match(RPAREN);
1106                    nlsWarn();
1107                    compoundStatement();
1108                    astFactory.addASTChild(currentAST, returnAST);
1109                    statement_AST = (AST)currentAST.root;
1110                }
1111            else {
1112                throw new NoViableAltException(LT(1), getFilename());
1113            }
1114            }}
1115            returnAST = statement_AST;
1116        }
1117        
1118/** A statement separator is either a semicolon or a significant newline.
1119 * Any number of additional (insignificant) newlines may accompany it.
1120 */

1121    public final void sep() throws RecognitionException, TokenStreamException {
1122        
1123        returnAST = null;
1124        ASTPair currentAST = new ASTPair();
1125        AST sep_AST = null;
1126        
1127        switch ( LA(1)) {
1128        case SEMI:
1129        {
1130            match(SEMI);
1131            {
1132            _loop480:
1133            do {
1134                if ((LA(1)==NLS) && (_tokenSet_24.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
1135                    match(NLS);
1136                }
1137                else {
1138                    break _loop480;
1139                }
1140                
1141            } while (true);
1142            }
1143            if ( inputState.guessing==0 ) {
1144                sepToken = SEMI;
1145            }
1146            break;
1147        }
1148        case NLS:
1149        {
1150            match(NLS);
1151            if ( inputState.guessing==0 ) {
1152                sepToken = NLS;
1153            }
1154            {
1155            _loop484:
1156            do {
1157                if ((LA(1)==SEMI) && (_tokenSet_24.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
1158                    match(SEMI);
1159                    {
1160                    _loop483:
1161                    do {
1162                        if ((LA(1)==NLS) && (_tokenSet_24.member(LA(2))) && (_tokenSet_20.member(LA(3)))) {
1163                            match(NLS);
1164                        }
1165                        else {
1166                            break _loop483;
1167                        }
1168                        
1169                    } while (true);
1170                    }
1171                    if ( inputState.guessing==0 ) {
1172                        sepToken = SEMI;
1173                    }
1174                }
1175                else {
1176                    break _loop484;
1177                }
1178                
1179            } while (true);
1180            }
1181            break;
1182        }
1183        default:
1184        {
1185            throw new NoViableAltException(LT(1), getFilename());
1186        }
1187        }
1188        returnAST = sep_AST;
1189    }
1190    
1191/** A Groovy script or simple expression. Can be anything legal inside {...}. */
1192    public final void snippetUnit() throws RecognitionException, TokenStreamException {
1193        
1194        returnAST = null;
1195        ASTPair currentAST = new ASTPair();
1196        AST snippetUnit_AST = null;
1197        
1198        nls();
1199        blockBody(EOF);
1200        astFactory.addASTChild(currentAST, returnAST);
1201        snippetUnit_AST = (AST)currentAST.root;
1202        returnAST = snippetUnit_AST;
1203    }
1204    
1205/** A block body is a parade of zero or more statements or expressions. */
1206    public final void blockBody(
1207        int prevToken
1208    ) throws RecognitionException, TokenStreamException {
1209        
1210        returnAST = null;
1211        ASTPair currentAST = new ASTPair();
1212        AST blockBody_AST = null;
1213        
1214        {
1215        switch ( LA(1)) {
1216        case FINAL:
1217        case ABSTRACT:
1218        case STRICTFP:
1219        case LITERAL_import:
1220        case LITERAL_static:
1221        case LITERAL_def:
1222        case AT:
1223        case IDENT:
1224        case LBRACK:
1225        case LPAREN:
1226        case LITERAL_class:
1227        case LITERAL_interface:
1228        case LITERAL_enum:
1229        case LITERAL_super:
1230        case LITERAL_void:
1231        case LITERAL_boolean:
1232        case LITERAL_byte:
1233        case LITERAL_char:
1234        case LITERAL_short:
1235        case LITERAL_int:
1236        case LITERAL_float:
1237        case LITERAL_long:
1238        case LITERAL_double:
1239        case LITERAL_any:
1240        case STAR:
1241        case LITERAL_private:
1242        case LITERAL_public:
1243        case LITERAL_protected:
1244        case LITERAL_transient:
1245        case LITERAL_native:
1246        case LITERAL_threadsafe:
1247        case LITERAL_synchronized:
1248        case LITERAL_volatile:
1249        case LCURLY:
1250        case LITERAL_this:
1251        case STRING_LITERAL:
1252        case LITERAL_if:
1253        case LITERAL_while:
1254        case LITERAL_with:
1255        case LITERAL_switch:
1256        case LITERAL_for:
1257        case LITERAL_return:
1258        case LITERAL_break:
1259        case LITERAL_continue:
1260        case LITERAL_throw:
1261        case LITERAL_assert:
1262        case PLUS:
1263        case MINUS:
1264        case LITERAL_try:
1265        case INC:
1266        case DEC:
1267        case BNOT:
1268        case LNOT:
1269        case DOLLAR:
1270        case STRING_CTOR_START:
1271        case LITERAL_new:
1272        case LITERAL_true:
1273        case LITERAL_false:
1274        case LITERAL_null:
1275        case NUM_INT:
1276        case NUM_FLOAT:
1277        case NUM_LONG:
1278        case NUM_DOUBLE:
1279        case NUM_BIG_INT:
1280        case NUM_BIG_DECIMAL:
1281        {
1282            statement(prevToken);
1283            astFactory.addASTChild(currentAST, returnAST);
1284            break;
1285        }
1286        case EOF:
1287        case RCURLY:
1288        case SEMI:
1289        case NLS:
1290        {
1291            break;
1292        }
1293        default:
1294        {
1295            throw new NoViableAltException(LT(1), getFilename());
1296        }
1297        }
1298        }
1299        {
1300        _loop248:
1301        do {
1302            if ((LA(1)==SEMI||LA(1)==NLS)) {
1303                sep();
1304                {
1305                switch ( LA(1)) {
1306                case FINAL:
1307                case ABSTRACT:
1308                case STRICTFP:
1309                case LITERAL_import:
1310                case LITERAL_static:
1311                case LITERAL_def:
1312                case AT:
1313                case IDENT:
1314                case LBRACK:
1315                case LPAREN:
1316                case LITERAL_class:
1317                case LITERAL_interface:
1318                case LITERAL_enum:
1319                case LITERAL_super:
1320                case LITERAL_void:
1321                case LITERAL_boolean:
1322                case LITERAL_byte:
1323                case LITERAL_char:
1324                case LITERAL_short:
1325                case LITERAL_int:
1326                case LITERAL_float:
1327                case LITERAL_long:
1328                case LITERAL_double:
1329                case LITERAL_any:
1330                case STAR:
1331                case LITERAL_private:
1332                case LITERAL_public:
1333                case LITERAL_protected:
1334                case LITERAL_transient:
1335                case LITERAL_native:
1336                case LITERAL_threadsafe:
1337                case LITERAL_synchronized:
1338                case LITERAL_volatile:
1339                case LCURLY:
1340                case LITERAL_this:
1341                case STRING_LITERAL:
1342                case LITERAL_if:
1343                case LITERAL_while:
1344                case LITERAL_with:
1345                case LITERAL_switch:
1346                case LITERAL_for:
1347                case LITERAL_return:
1348                case LITERAL_break:
1349                case LITERAL_continue:
1350                case LITERAL_throw:
1351                case LITERAL_assert:
1352                case PLUS:
1353                case MINUS:
1354                case LITERAL_try:
1355                case INC:
1356                case DEC:
1357                case BNOT:
1358                case LNOT:
1359                case DOLLAR:
1360                case STRING_CTOR_START:
1361                case LITERAL_new:
1362                case LITERAL_true:
1363                case LITERAL_false:
1364                case LITERAL_null:
1365                case NUM_INT:
1366                case NUM_FLOAT:
1367                case NUM_LONG:
1368                case NUM_DOUBLE:
1369                case NUM_BIG_INT:
1370                case NUM_BIG_DECIMAL:
1371                {
1372                    statement(sepToken);
1373                    astFactory.addASTChild(currentAST, returnAST);
1374                    break;
1375                }
1376                case EOF:
1377                case RCURLY:
1378                case SEMI:
1379                case NLS:
1380                {
1381                    break;
1382                }
1383                default:
1384                {
1385                    throw new NoViableAltException(LT(1), getFilename());
1386                }
1387                }
1388                }
1389            }
1390            else {
1391                break _loop248;
1392            }
1393            
1394        } while (true);
1395        }
1396        blockBody_AST = (AST)currentAST.root;
1397        returnAST = blockBody_AST;
1398    }
1399    
1400    public final void identifier() throws RecognitionException, TokenStreamException {
1401        
1402        returnAST = null;
1403        ASTPair currentAST = new ASTPair();
1404        AST identifier_AST = null;
1405        
1406        AST tmp27_AST = null;
1407        tmp27_AST = astFactory.create(LT(1));
1408        astFactory.addASTChild(currentAST, tmp27_AST);
1409        match(IDENT);
1410        {
1411        _loop62:
1412        do {
1413            if ((LA(1)==DOT)) {
1414                AST tmp28_AST = null;
1415                tmp28_AST = astFactory.create(LT(1));
1416                astFactory.makeASTRoot(currentAST, tmp28_AST);
1417                match(DOT);
1418                nls();
1419                AST tmp29_AST = null;
1420                tmp29_AST = astFactory.create(LT(1));
1421                astFactory.addASTChild(currentAST, tmp29_AST);
1422                match(IDENT);
1423            }
1424            else {
1425                break _loop62;
1426            }
1427            
1428        } while (true);
1429        }
1430        identifier_AST = (AST)currentAST.root;
1431        returnAST = identifier_AST;
1432    }
1433    
1434    public final void importStatement() throws RecognitionException, TokenStreamException {
1435        
1436        returnAST = null;
1437        ASTPair currentAST = new ASTPair();
1438        AST importStatement_AST = null;
1439        Token i = null;
1440        AST i_AST = null;
1441        boolean isStatic = false;
1442        
1443        i = LT(1);
1444        i_AST = astFactory.create(i);
1445        astFactory.makeASTRoot(currentAST, i_AST);
1446        match(LITERAL_import);
1447        if ( inputState.guessing==0 ) {
1448            i_AST.setType(IMPORT);
1449        }
1450        {
1451        switch ( LA(1)) {
1452        case LITERAL_static:
1453        {
1454            match(LITERAL_static);
1455            if ( inputState.guessing==0 ) {
1456                i_AST.setType(STATIC_IMPORT);
1457            }
1458            break;
1459        }
1460        case IDENT:
1461        {
1462            break;
1463        }
1464        default:
1465        {
1466            throw new NoViableAltException(LT(1), getFilename());
1467        }
1468        }
1469        }
1470        identifierStar();
1471        astFactory.addASTChild(currentAST, returnAST);
1472        importStatement_AST = (AST)currentAST.root;
1473        returnAST = importStatement_AST;
1474    }
1475    
1476    public final void identifierStar() throws RecognitionException, TokenStreamException {
1477        
1478        returnAST = null;
1479        ASTPair currentAST = new ASTPair();
1480        AST identifierStar_AST = null;
1481        
1482        AST tmp31_AST = null;
1483        tmp31_AST = astFactory.create(LT(1));
1484        astFactory.addASTChild(currentAST, tmp31_AST);
1485        match(IDENT);
1486        {
1487        _loop65:
1488        do {
1489            if ((LA(1)==DOT) && (LA(2)==IDENT||LA(2)==NLS) && (_tokenSet_25.member(LA(3)))) {
1490                AST tmp32_AST = null;
1491                tmp32_AST = astFactory.create(LT(1));
1492                astFactory.makeASTRoot(currentAST, tmp32_AST);
1493                match(DOT);
1494                nls();
1495                AST tmp33_AST = null;
1496                tmp33_AST = astFactory.create(LT(1));
1497                astFactory.addASTChild(currentAST, tmp33_AST);
1498                match(IDENT);
1499            }
1500            else {
1501                break _loop65;
1502            }
1503            
1504        } while (true);
1505        }
1506        {
1507        switch ( LA(1)) {
1508        case DOT:
1509        {
1510            AST tmp34_AST = null;
1511            tmp34_AST = astFactory.create(LT(1));
1512            astFactory.makeASTRoot(currentAST, tmp34_AST);
1513            match(DOT);
1514            nls();
1515            AST tmp35_AST = null;
1516            tmp35_AST = astFactory.create(LT(1));
1517            astFactory.addASTChild(currentAST, tmp35_AST);
1518            match(STAR);
1519            break;
1520        }
1521        case LITERAL_as:
1522        {
1523            AST tmp36_AST = null;
1524            tmp36_AST = astFactory.create(LT(1));
1525            astFactory.makeASTRoot(currentAST, tmp36_AST);
1526            match(LITERAL_as);
1527            nls();
1528            AST tmp37_AST = null;
1529            tmp37_AST = astFactory.create(LT(1));
1530            astFactory.addASTChild(currentAST, tmp37_AST);
1531            match(IDENT);
1532            break;
1533        }
1534        case EOF:
1535        case RCURLY:
1536        case SEMI:
1537        case NLS:
1538        case LITERAL_default:
1539        case LITERAL_else:
1540        case LITERAL_case:
1541        {
1542            break;
1543        }
1544        default:
1545        {
1546            throw new NoViableAltException(LT(1), getFilename());
1547        }
1548        }
1549        }
1550        identifierStar_AST = (AST)currentAST.root;
1551        returnAST = identifierStar_AST;
1552    }
1553    
1554    protected final void typeDefinitionInternal(
1555        AST mods
1556    ) throws RecognitionException, TokenStreamException {
1557        
1558        returnAST = null;
1559        ASTPair currentAST = new ASTPair();
1560        AST typeDefinitionInternal_AST = null;
1561        AST cd_AST = null;
1562        AST id_AST = null;
1563        AST ed_AST = null;
1564        AST ad_AST = null;
1565        
1566        switch ( LA(1)) {
1567        case LITERAL_class:
1568        {
1569            classDefinition(mods);
1570            cd_AST = (AST)returnAST;
1571            astFactory.addASTChild(currentAST, returnAST);
1572            if ( inputState.guessing==0 ) {
1573                typeDefinitionInternal_AST = (AST)currentAST.root;
1574                typeDefinitionInternal_AST = cd_AST;
1575                currentAST.root = typeDefinitionInternal_AST;
1576                currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ?
1577                    typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST;
1578                currentAST.advanceChildToEnd();
1579            }
1580            typeDefinitionInternal_AST = (AST)currentAST.root;
1581            break;
1582        }
1583        case LITERAL_interface:
1584        {
1585            interfaceDefinition(mods);
1586            id_AST = (AST)returnAST;
1587            astFactory.addASTChild(currentAST, returnAST);
1588            if ( inputState.guessing==0 ) {
1589                typeDefinitionInternal_AST = (AST)currentAST.root;
1590                typeDefinitionInternal_AST = id_AST;
1591                currentAST.root = typeDefinitionInternal_AST;
1592                currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ?
1593                    typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST;
1594                currentAST.advanceChildToEnd();
1595            }
1596            typeDefinitionInternal_AST = (AST)currentAST.root;
1597            break;
1598        }
1599        case LITERAL_enum:
1600        {
1601            enumDefinition(mods);
1602            ed_AST = (AST)returnAST;
1603            astFactory.addASTChild(currentAST, returnAST);
1604            if ( inputState.guessing==0 ) {
1605                typeDefinitionInternal_AST = (AST)currentAST.root;
1606                typeDefinitionInternal_AST = ed_AST;
1607                currentAST.root = typeDefinitionInternal_AST;
1608                currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ?
1609                    typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST;
1610                currentAST.advanceChildToEnd();
1611            }
1612            typeDefinitionInternal_AST = (AST)currentAST.root;
1613            break;
1614        }
1615        case AT:
1616        {
1617            annotationDefinition(mods);
1618            ad_AST = (AST)returnAST;
1619            astFactory.addASTChild(currentAST, returnAST);
1620            if ( inputState.guessing==0 ) {
1621                typeDefinitionInternal_AST = (AST)currentAST.root;
1622                typeDefinitionInternal_AST = ad_AST;
1623                currentAST.root = typeDefinitionInternal_AST;
1624                currentAST.child = typeDefinitionInternal_AST!=null &&typeDefinitionInternal_AST.getFirstChild()!=null ?
1625                    typeDefinitionInternal_AST.getFirstChild() : typeDefinitionInternal_AST;
1626                currentAST.advanceChildToEnd();
1627            }
1628            typeDefinitionInternal_AST = (AST)currentAST.root;
1629            break;
1630        }
1631        default:
1632        {
1633            throw new NoViableAltException(LT(1), getFilename());
1634        }
1635        }
1636        returnAST = typeDefinitionInternal_AST;
1637    }
1638    
1639    public final void classDefinition(
1640        AST modifiers
1641    ) throws RecognitionException, TokenStreamException {
1642        
1643        returnAST = null;
1644        ASTPair currentAST = new ASTPair();
1645        AST classDefinition_AST = null;
1646        AST tp_AST = null;
1647        AST sc_AST = null;
1648        AST ic_AST = null;
1649        AST cb_AST = null;
1650        Token first = LT(1);AST prevCurrentClass = currentClass;
1651        
1652        match(LITERAL_class);
1653        AST tmp39_AST = null;
1654        tmp39_AST = astFactory.create(LT(1));
1655        match(IDENT);
1656        nls();
1657        if ( inputState.guessing==0 ) {
1658            currentClass = tmp39_AST;
1659        }
1660        {
1661        switch ( LA(1)) {
1662        case LT:
1663        {
1664            typeParameters();
1665            tp_AST = (AST)returnAST;
1666            break;
1667        }
1668        case LITERAL_extends:
1669        case LCURLY:
1670        case LITERAL_implements:
1671        {
1672            break;
1673        }
1674        default:
1675        {
1676            throw new NoViableAltException(LT(1), getFilename());
1677        }
1678        }
1679        }
1680        superClassClause();
1681        sc_AST = (AST)returnAST;
1682        implementsClause();
1683        ic_AST = (AST)returnAST;
1684        classBlock();
1685        cb_AST = (AST)returnAST;
1686        if ( inputState.guessing==0 ) {
1687            classDefinition_AST = (AST)currentAST.root;
1688            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));
1689            currentAST.root = classDefinition_AST;
1690            currentAST.child = classDefinition_AST!=null &&classDefinition_AST.getFirstChild()!=null ?
1691                classDefinition_AST.getFirstChild() : classDefinition_AST;
1692            currentAST.advanceChildToEnd();
1693        }
1694        if ( inputState.guessing==0 ) {
1695            currentClass = prevCurrentClass;
1696        }
1697        returnAST = classDefinition_AST;
1698    }
1699    
1700    public final void interfaceDefinition(
1701        AST modifiers
1702    ) throws RecognitionException, TokenStreamException {
1703        
1704        returnAST = null;
1705        ASTPair currentAST = new ASTPair();
1706        AST interfaceDefinition_AST = null;
1707        AST tp_AST = null;
1708        AST ie_AST = null;
1709        AST ib_AST = null;
1710        Token first = LT(1);
1711        
1712        match(LITERAL_interface);
1713        AST tmp41_AST = null;
1714        tmp41_AST = astFactory.create(LT(1));
1715        match(IDENT);
1716        nls();
1717        {
1718        switch ( LA(1)) {
1719        case LT:
1720        {
1721            typeParameters();
1722            tp_AST = (AST)returnAST;
1723            break;
1724        }
1725        case LITERAL_extends:
1726        case LCURLY:
1727        {
1728            break;
1729        }
1730        default:
1731        {
1732            throw new NoViableAltException(LT(1), getFilename());
1733        }
1734        }
1735        }
1736        interfaceExtends();
1737        ie_AST = (AST)returnAST;
1738        interfaceBlock();
1739        ib_AST = (AST)returnAST;
1740        if ( inputState.guessing==0 ) {
1741            interfaceDefinition_AST = (AST)currentAST.root;
1742            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));
1743            currentAST.root = interfaceDefinition_AST;
1744            currentAST.child = interfaceDefinition_AST!=null &&interfaceDefinition_AST.getFirstChild()!=null ?
1745                interfaceDefinition_AST.getFirstChild() : interfaceDefinition_AST;
1746            currentAST.advanceChildToEnd();
1747        }
1748        returnAST = interfaceDefinition_AST;
1749    }
1750    
1751    public final void enumDefinition(
1752        AST modifiers
1753    ) throws RecognitionException, TokenStreamException {
1754        
1755        returnAST = null;
1756        ASTPair currentAST = new ASTPair();
1757        AST enumDefinition_AST = null;
1758        AST ic_AST = null;
1759        AST eb_AST = null;
1760        Token first = LT(1);
1761        
1762        match(LITERAL_enum);
1763        AST tmp43_AST = null;
1764        tmp43_AST = astFactory.create(LT(1));
1765        match(IDENT);
1766        implementsClause();
1767        ic_AST = (AST)returnAST;
1768        enumBlock();
1769        eb_AST = (AST)returnAST;
1770        if ( inputState.guessing==0 ) {
1771            enumDefinition_AST = (AST)currentAST.root;
1772            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));
1773            currentAST.root = enumDefinition_AST;
1774            currentAST.child = enumDefinition_AST!=null &&enumDefinition_AST.getFirstChild()!=null ?
1775                enumDefinition_AST.getFirstChild() : enumDefinition_AST;
1776            currentAST.advanceChildToEnd();
1777        }
1778        returnAST = enumDefinition_AST;
1779    }
1780    
1781    public final void annotationDefinition(
1782        AST modifiers
1783    ) throws RecognitionException, TokenStreamException {
1784        
1785        returnAST = null;
1786        ASTPair currentAST = new ASTPair();
1787        AST annotationDefinition_AST = null;
1788        AST ab_AST = null;
1789        Token first = LT(1);
1790        
1791        AST tmp44_AST = null;
1792        tmp44_AST = astFactory.create(LT(1));
1793        match(AT);
1794        match(LITERAL_interface);
1795        AST tmp46_AST = null;
1796        tmp46_AST = astFactory.create(LT(1));
1797        match(IDENT);
1798        annotationBlock();
1799        ab_AST = (AST)returnAST;
1800        if ( inputState.guessing==0 ) {
1801            annotationDefinition_AST = (AST)currentAST.root;
1802            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));
1803            currentAST.root = annotationDefinition_AST;
1804            currentAST.child = annotationDefinition_AST!=null &&annotationDefinition_AST.getFirstChild()!=null ?
1805                annotationDefinition_AST.getFirstChild() : annotationDefinition_AST;
1806            currentAST.advanceChildToEnd();
1807        }
1808        returnAST = annotationDefinition_AST;
1809    }
1810    
1811/** A declaration is the creation of a reference or primitive-type variable,
1812 * or (if arguments are present) of a method.
1813 * Generically, this is called a 'variable' definition, even in the case of a class field or method.
1814 * It may start with the modifiers and/or a declaration keyword "def".
1815 * It may also start with the modifiers and a capitalized type name.
1816 * <p>
1817 * AST effect: Create a separate Type/Var tree for each var in the var list.
1818 * Must be guarded, as in (declarationStart) => declaration.
1819 */

1820    public final void declaration() throws RecognitionException, TokenStreamException {
1821        
1822        returnAST = null;
1823        ASTPair currentAST = new ASTPair();
1824        AST declaration_AST = null;
1825        AST m_AST = null;
1826        AST t_AST = null;
1827        AST v_AST = null;
1828        AST t2_AST = null;
1829        AST v2_AST = null;
1830        
1831        switch ( LA(1)) {
1832        case FINAL:
1833        case ABSTRACT:
1834        case STRICTFP:
1835        case LITERAL_static:
1836        case LITERAL_def:
1837        case AT:
1838        case LITERAL_private:
1839        case LITERAL_public:
1840        case LITERAL_protected:
1841        case LITERAL_transient:
1842        case LITERAL_native:
1843        case LITERAL_threadsafe:
1844        case LITERAL_synchronized:
1845        case LITERAL_volatile:
1846        {
1847            modifiers();
1848            m_AST = (AST)returnAST;
1849            {
1850            if ((_tokenSet_26.member(LA(1))) && (_tokenSet_27.member(LA(2)))) {
1851                typeSpec(false);
1852                t_AST = (AST)returnAST;
1853            }
1854            else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (_tokenSet_28.member(LA(2)))) {
1855            }
1856            else {
1857                throw new NoViableAltException(LT(1), getFilename());
1858            }
1859            
1860            }
1861            variableDefinitions(m_AST, t_AST);
1862            v_AST = (AST)returnAST;
1863            if ( inputState.guessing==0 ) {
1864                declaration_AST = (AST)currentAST.root;
1865                declaration_AST = v_AST;
1866                currentAST.root = declaration_AST;
1867                currentAST.child = declaration_AST!=null &&declaration_AST.getFirstChild()!=null ?
1868                    declaration_AST.getFirstChild() : declaration_AST;
1869                currentAST.advanceChildToEnd();
1870            }
1871            break;
1872        }
1873        case IDENT:
1874        case LITERAL_void:
1875        case LITERAL_boolean:
1876        case LITERAL_byte:
1877        case LITERAL_char:
1878        case LITERAL_short:
1879        case LITERAL_int:
1880        case LITERAL_float:
1881        case LITERAL_long:
1882        case LITERAL_double:
1883        case LITERAL_any:
1884        {
1885            typeSpec(false);
1886            t2_AST = (AST)returnAST;
1887            variableDefinitions(null,t2_AST);
1888            v2_AST = (AST)returnAST;
1889            if ( inputState.guessing==0 ) {
1890                declaration_AST = (AST)currentAST.root;
1891                declaration_AST = v2_AST;
1892                currentAST.root = declaration_AST;
1893                currentAST.child = declaration_AST!=null &&declaration_AST.getFirstChild()!=null ?
1894                    declaration_AST.getFirstChild() : declaration_AST;
1895                currentAST.advanceChildToEnd();
1896            }
1897            break;
1898        }
1899        default:
1900        {
1901            throw new NoViableAltException(LT(1), getFilename());
1902        }
1903        }
1904        returnAST = declaration_AST;
1905    }
1906    
1907/** A list of one or more modifier, annotation, or "def". */
1908    public final void modifiers() throws RecognitionException, TokenStreamException {
1909        
1910        returnAST = null;
1911        ASTPair currentAST = new ASTPair();
1912        AST modifiers_AST = null;
1913        Token first = LT(1);
1914        
1915        modifiersInternal();
1916        astFactory.addASTChild(currentAST, returnAST);
1917        if ( inputState.guessing==0 ) {
1918            modifiers_AST = (AST)currentAST.root;
1919            modifiers_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(MODIFIERS,"MODIFIERS",first,LT(1))).add(modifiers_AST));
1920            currentAST.root = modifiers_AST;
1921            currentAST.child = modifiers_AST!=null &&modifiers_AST.getFirstChild()!=null ?
1922                modifiers_AST.getFirstChild() : modifiers_AST;
1923            currentAST.advanceChildToEnd();
1924        }
1925        modifiers_AST = (AST)currentAST.root;
1926        returnAST = modifiers_AST;
1927    }
1928    
1929    public final void typeSpec(
1930        boolean addImagNode
1931    ) throws RecognitionException, TokenStreamException {
1932        
1933        returnAST = null;
1934        ASTPair currentAST = new ASTPair();
1935        AST typeSpec_AST = null;
1936        
1937        switch ( LA(1)) {
1938        case IDENT:
1939        {
1940            classTypeSpec(addImagNode);
1941            astFactory.addASTChild(currentAST, returnAST);
1942            typeSpec_AST = (AST)currentAST.root;
1943            break;
1944        }
1945        case LITERAL_void:
1946        case LITERAL_boolean:
1947        case LITERAL_byte:
1948        case LITERAL_char:
1949        case LITERAL_short:
1950        case LITERAL_int:
1951        case LITERAL_float:
1952        case LITERAL_long:
1953        case LITERAL_double:
1954        case LITERAL_any:
1955        {
1956            builtInTypeSpec(addImagNode);
1957            astFactory.addASTChild(currentAST, returnAST);
1958            typeSpec_AST = (AST)currentAST.root;
1959            break;
1960        }
1961        default:
1962        {
1963            throw new NoViableAltException(LT(1), getFilename());
1964        }
1965        }
1966        returnAST = typeSpec_AST;
1967    }
1968    
1969/** The tail of a declaration.
1970  * Either v1, v2, ... (with possible initializers) or else m(args){body}.
1971  * The two arguments are the modifier list (if any) and the declaration head (if any).
1972  * The declaration head is the variable type, or (for a method) the return type.
1973  * If it is missing, then the variable type is taken from its initializer (if there is one).
1974  * Otherwise, the variable type defaults to 'any'.
1975  * DECIDE: Method return types default to the type of the method body, as an expression.
1976  */

1977    public final void variableDefinitions(
1978        AST mods, AST t
1979    ) throws RecognitionException, TokenStreamException {
1980        
1981        returnAST = null;
1982        ASTPair currentAST = new ASTPair();
1983        AST variableDefinitions_AST = null;
1984        Token id = null;
1985        AST id_AST = null;
1986        Token qid = null;
1987        AST qid_AST = null;
1988        AST param_AST = null;
1989        AST tc_AST = null;
1990        AST mb_AST = null;
1991        Token first = LT(1);
1992        
1993        if ((LA(1)==IDENT) && (_tokenSet_29.member(LA(2)))) {
1994            variableDeclarator(getASTFactory().dupTree(mods),
1995                           getASTFactory().dupTree(t));
1996            astFactory.addASTChild(currentAST, returnAST);
1997            {
1998            _loop188:
1999            do {
2000                if ((LA(1)==COMMA)) {
2001                    match(COMMA);
2002                    nls();
2003                    variableDeclarator(getASTFactory().dupTree(mods),
2004                               getASTFactory().dupTree(t));
2005                    astFactory.addASTChild(currentAST, returnAST);
2006                }
2007                else {
2008                    break _loop188;
2009                }
2010                
2011            } while (true);
2012            }
2013            variableDefinitions_AST = (AST)currentAST.root;
2014        }
2015        else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (LA(2)==LPAREN)) {
2016            {
2017            switch ( LA(1)) {
2018            case IDENT:
2019            {
2020                id = LT(1);
2021                id_AST = astFactory.create(id);
2022                astFactory.addASTChild(currentAST, id_AST);
2023                match(IDENT);
2024                break;
2025            }
2026            case STRING_LITERAL:
2027            {
2028                qid = LT(1);
2029                qid_AST = astFactory.create(qid);
2030                astFactory.addASTChild(currentAST, qid_AST);
2031                match(STRING_LITERAL);
2032                if ( inputState.guessing==0 ) {
2033                    qid_AST.setType(IDENT);
2034                }
2035                break;
2036            }
2037            default:
2038            {
2039                throw new NoViableAltException(LT(1), getFilename());
2040            }
2041            }
2042            }
2043            match(LPAREN);
2044            parameterDeclarationList();
2045            param_AST = (AST)returnAST;
2046            match(RPAREN);
2047            {
2048            switch ( LA(1)) {
2049            case LITERAL_throws:
2050            {
2051                throwsClause();
2052                tc_AST = (AST)returnAST;
2053                break;
2054            }
2055            case EOF:
2056            case LCURLY:
2057            case RCURLY:
2058            case SEMI:
2059            case NLS:
2060            case LITERAL_default:
2061            case LITERAL_else:
2062            case LITERAL_case:
2063            {
2064                break;
2065            }
2066            default:
2067            {
2068                throw new NoViableAltException(LT(1), getFilename());
2069            }
2070            }
2071            }
2072            nlsWarn();
2073            {
2074            switch ( LA(1)) {
2075            case LCURLY:
2076            {
2077                openBlock();
2078                mb_AST = (AST)returnAST;
2079                break;
2080            }
2081            case EOF:
2082            case RCURLY:
2083            case SEMI:
2084            case NLS:
2085            case LITERAL_default:
2086            case LITERAL_else:
2087            case LITERAL_case:
2088            {
2089                break;
2090            }
2091            default:
2092            {
2093                throw new NoViableAltException(LT(1), getFilename());
2094            }
2095            }
2096            }
2097            if ( inputState.guessing==0 ) {
2098                variableDefinitions_AST = (AST)currentAST.root;
2099                if (qid_AST != null) id_AST = qid_AST;
2100                variableDefinitions_AST =
2101                (AST)astFactory.make( (new ASTArray(7)).add(create(METHOD_DEF,"METHOD_DEF",first,LT(1))).add(mods).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t))).add(id_AST).add(param_AST).add(tc_AST).add(mb_AST));
2102                
2103                currentAST.root = variableDefinitions_AST;
2104                currentAST.child = variableDefinitions_AST!=null &&variableDefinitions_AST.getFirstChild()!=null ?
2105                    variableDefinitions_AST.getFirstChild() : variableDefinitions_AST;
2106                currentAST.advanceChildToEnd();
2107            }
2108            variableDefinitions_AST = (AST)currentAST.root;
2109        }
2110        else {
2111            throw new NoViableAltException(LT(1), getFilename());
2112        }
2113        
2114        returnAST = variableDefinitions_AST;
2115    }
2116    
2117/** A declaration with one declarator and no initialization, like a parameterDeclaration.
2118 * Used to parse loops like <code>for (int x in y)</code> (up to the <code>in</code> keyword).
2119 */

2120    public final void singleDeclarationNoInit() throws RecognitionException, TokenStreamException {
2121        
2122        returnAST = null;
2123        ASTPair currentAST = new ASTPair();
2124        AST singleDeclarationNoInit_AST = null;
2125        AST m_AST = null;
2126        AST t_AST = null;
2127        AST v_AST = null;
2128        AST t2_AST = null;
2129        AST v2_AST = null;
2130        
2131        switch ( LA(1)) {
2132        case FINAL:
2133        case ABSTRACT:
2134        case STRICTFP:
2135        case LITERAL_static:
2136        case LITERAL_def:
2137        case AT:
2138        case LITERAL_private:
2139        case LITERAL_public:
2140        case LITERAL_protected:
2141        case LITERAL_transient:
2142        case LITERAL_native:
2143        case LITERAL_threadsafe:
2144        case LITERAL_synchronized:
2145        case LITERAL_volatile:
2146        {
2147            modifiers();
2148            m_AST = (AST)returnAST;
2149            {
2150            if ((_tokenSet_26.member(LA(1))) && (_tokenSet_30.member(LA(2)))) {
2151                typeSpec(false);
2152                t_AST = (AST)returnAST;
2153            }
2154            else if ((LA(1)==IDENT) && (_tokenSet_31.member(LA(2)))) {
2155            }
2156            else {
2157                throw new NoViableAltException(LT(1), getFilename());
2158            }
2159            
2160            }
2161            singleVariable(m_AST, t_AST);
2162            v_AST = (AST)returnAST;
2163            if ( inputState.guessing==0 ) {
2164                singleDeclarationNoInit_AST = (AST)currentAST.root;
2165                singleDeclarationNoInit_AST = v_AST;
2166                currentAST.root = singleDeclarationNoInit_AST;
2167                currentAST.child = singleDeclarationNoInit_AST!=null &&singleDeclarationNoInit_AST.getFirstChild()!=null ?
2168                    singleDeclarationNoInit_AST.getFirstChild() : singleDeclarationNoInit_AST;
2169                currentAST.advanceChildToEnd();
2170            }
2171            break;
2172        }
2173        case IDENT:
2174        case LITERAL_void:
2175        case LITERAL_boolean:
2176        case LITERAL_byte:
2177        case LITERAL_char:
2178        case LITERAL_short:
2179        case LITERAL_int:
2180        case LITERAL_float:
2181        case LITERAL_long:
2182        case LITERAL_double:
2183        case LITERAL_any:
2184        {
2185            typeSpec(false);
2186            t2_AST = (AST)returnAST;
2187            singleVariable(null,t2_AST);
2188            v2_AST = (AST)returnAST;
2189            if ( inputState.guessing==0 ) {
2190                singleDeclarationNoInit_AST = (AST)currentAST.root;
2191                singleDeclarationNoInit_AST = v2_AST;
2192                currentAST.root = singleDeclarationNoInit_AST;
2193                currentAST.child = singleDeclarationNoInit_AST!=null &&singleDeclarationNoInit_AST.getFirstChild()!=null ?
2194                    singleDeclarationNoInit_AST.getFirstChild() : singleDeclarationNoInit_AST;
2195                currentAST.advanceChildToEnd();
2196            }
2197            break;
2198        }
2199        default:
2200        {
2201            throw new NoViableAltException(LT(1), getFilename());
2202        }
2203        }
2204        returnAST = singleDeclarationNoInit_AST;
2205    }
2206    
2207/** Used in cases where a declaration cannot have commas, or ends with the "in" operator instead of '='. */
2208    public final void singleVariable(
2209        AST mods, AST t
2210    ) throws RecognitionException, TokenStreamException {
2211        
2212        returnAST = null;
2213        ASTPair currentAST = new ASTPair();
2214        AST singleVariable_AST = null;
2215        AST id_AST = null;
2216        Token first = LT(1);
2217        
2218        variableName();
2219        id_AST = (AST)returnAST;
2220        if ( inputState.guessing==0 ) {
2221            singleVariable_AST = (AST)currentAST.root;
2222            singleVariable_AST = (AST)astFactory.make( (new ASTArray(4)).add(create(VARIABLE_DEF,"VARIABLE_DEF",first,LT(1))).add(mods).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t))).add(id_AST));
2223            currentAST.root = singleVariable_AST;
2224            currentAST.child = singleVariable_AST!=null &&singleVariable_AST.getFirstChild()!=null ?
2225                singleVariable_AST.getFirstChild() : singleVariable_AST;
2226            currentAST.advanceChildToEnd();
2227        }
2228        returnAST = singleVariable_AST;
2229    }
2230    
2231/** A declaration with one declarator and optional initialization, like a parameterDeclaration.
2232 * Used to parse declarations used for both binding and effect, in places like argument
2233 * lists and <code>while</code> statements.
2234 */

2235    public final void singleDeclaration() throws RecognitionException, TokenStreamException {
2236        
2237        returnAST = null;
2238        ASTPair currentAST = new ASTPair();
2239        AST singleDeclaration_AST = null;
2240        AST sd_AST = null;
2241        
2242        singleDeclarationNoInit();
2243        sd_AST = (AST)returnAST;
2244        if ( inputState.guessing==0 ) {
2245            singleDeclaration_AST = (AST)currentAST.root;
2246            singleDeclaration_AST = sd_AST;
2247            currentAST.root = singleDeclaration_AST;
2248            currentAST.child = singleDeclaration_AST!=null &&singleDeclaration_AST.getFirstChild()!=null ?
2249                singleDeclaration_AST.getFirstChild() : singleDeclaration_AST;
2250            currentAST.advanceChildToEnd();
2251        }
2252        {
2253        switch ( LA(1)) {
2254        case ASSIGN:
2255        {
2256            varInitializer();
2257            astFactory.addASTChild(currentAST, returnAST);
2258            break;
2259        }
2260        case RBRACK:
2261        case COMMA:
2262        case RPAREN:
2263        case SEMI:
2264        {
2265            break;
2266        }
2267        default:
2268        {
2269            throw new NoViableAltException(LT(1), getFilename());
2270        }
2271        }
2272        }
2273        singleDeclaration_AST = (AST)currentAST.root;
2274        returnAST = singleDeclaration_AST;
2275    }
2276    
2277/** An assignment operator '=' followed by an expression. (Never empty.) */
2278    public final void varInitializer() throws RecognitionException, TokenStreamException {
2279        
2280        returnAST = null;
2281        ASTPair currentAST = new ASTPair();
2282        AST varInitializer_AST = null;
2283        
2284        AST tmp50_AST = null;
2285        tmp50_AST = astFactory.create(LT(1));
2286        astFactory.makeASTRoot(currentAST, tmp50_AST);
2287        match(ASSIGN);
2288        nls();
2289        expression(LC_INIT);
2290        astFactory.addASTChild(currentAST, returnAST);
2291        varInitializer_AST = (AST)currentAST.root;
2292        returnAST = varInitializer_AST;
2293    }
2294    
2295/** Used only as a lookahead predicate, before diving in and parsing a declaration.
2296 * A declaration can be unambiguously introduced with "def", an annotation or a modifier token like "final".
2297 * It may also be introduced by a simple identifier whose first character is an uppercase letter,
2298 * as in {String x}. A declaration can also be introduced with a built in type like 'int' or 'void'.
2299 * Brackets (array and generic) are allowed, as in {List[] x} or {int[][] y}.
2300 * Anything else is parsed as a statement of some sort (expression or command).
2301 * <p>
2302 * (In the absence of explicit method-call parens, we assume a capitalized name is a type name.
2303 * Yes, this is a little hacky. Alternatives are to complicate the declaration or command
2304 * syntaxes, or to have the parser query the symbol table. Parse-time queries are evil.
2305 * And we want both {String x} and {println x}. So we need a syntactic razor-edge to slip
2306 * between 'println' and 'String'.)
2307 *
2308 * *TODO* The declarationStart production needs to be strengthened to recognize
2309 * things like {List<String> foo}.
2310 * Right now it only knows how to skip square brackets after the type, not
2311 * angle brackets.
2312 * This probably turns out to be tricky because of >> vs. > >. If so,
2313 * just put a TODO comment in.
2314 */

2315    public final void declarationStart() throws RecognitionException, TokenStreamException {
2316        
2317        returnAST = null;
2318        ASTPair currentAST = new ASTPair();
2319        AST declarationStart_AST = null;
2320        
2321        switch ( LA(1)) {
2322        case LITERAL_def:
2323        {
2324            match(LITERAL_def);
2325            break;
2326        }
2327        case FINAL:
2328        case ABSTRACT:
2329        case STRICTFP:
2330        case LITERAL_static:
2331        case LITERAL_private:
2332        case LITERAL_public:
2333        case LITERAL_protected:
2334        case LITERAL_transient:
2335        case LITERAL_native:
2336        case LITERAL_threadsafe:
2337        case LITERAL_synchronized:
2338        case LITERAL_volatile:
2339        {
2340            modifier();
2341            break;
2342        }
2343        case AT:
2344        {
2345            AST tmp52_AST = null;
2346            tmp52_AST = astFactory.create(LT(1));
2347            match(AT);
2348            AST tmp53_AST = null;
2349            tmp53_AST = astFactory.create(LT(1));
2350            match(IDENT);
2351            break;
2352        }
2353        case IDENT:
2354        case LITERAL_void:
2355        case LITERAL_boolean:
2356        case LITERAL_byte:
2357        case LITERAL_char:
2358        case LITERAL_short:
2359        case LITERAL_int:
2360        case LITERAL_float:
2361        case LITERAL_long:
2362        case LITERAL_double:
2363        case LITERAL_any:
2364        {
2365            {
2366            if ((LA(1)==IDENT) && (LA(2)==IDENT||LA(2)==LBRACK)) {
2367                upperCaseIdent();
2368            }
2369            else if (((LA(1) >= LITERAL_void && LA(1) <= LITERAL_any))) {
2370                builtInType();
2371            }
2372            else if ((LA(1)==IDENT) && (LA(2)==DOT)) {
2373                qualifiedTypeName();
2374            }
2375            else {
2376                throw new NoViableAltException(LT(1), getFilename());
2377            }
2378            
2379            }
2380            {
2381            _loop24:
2382            do {
2383                if ((LA(1)==LBRACK)) {
2384                    AST tmp54_AST = null;
2385                    tmp54_AST = astFactory.create(LT(1));
2386                    match(LBRACK);
2387                    balancedTokens();
2388                    AST tmp55_AST = null;
2389                    tmp55_AST = astFactory.create(LT(1));
2390                    match(RBRACK);
2391                }
2392                else {
2393                    break _loop24;
2394                }
2395                
2396            } while (true);
2397            }
2398            AST tmp56_AST = null;
2399            tmp56_AST = astFactory.create(LT(1));
2400            match(IDENT);
2401            break;
2402        }
2403        default:
2404        {
2405            throw new NoViableAltException(LT(1), getFilename());
2406        }
2407        }
2408        returnAST = declarationStart_AST;
2409    }
2410    
2411    public final void modifier() throws RecognitionException, TokenStreamException {
2412        
2413        returnAST = null;
2414        ASTPair currentAST = new ASTPair();
2415        AST modifier_AST = null;
2416        
2417        switch ( LA(1)) {
2418        case LITERAL_private:
2419        {
2420            AST tmp57_AST = null;
2421            tmp57_AST = astFactory.create(LT(1));
2422            astFactory.addASTChild(currentAST, tmp57_AST);
2423            match(LITERAL_private);
2424            modifier_AST = (AST)currentAST.root;
2425            break;
2426        }
2427        case LITERAL_public:
2428        {
2429            AST tmp58_AST = null;
2430            tmp58_AST = astFactory.create(LT(1));
2431            astFactory.addASTChild(currentAST, tmp58_AST);
2432            match(LITERAL_public);
2433            modifier_AST = (AST)currentAST.root;
2434            break;
2435        }
2436        case LITERAL_protected:
2437        {
2438            AST tmp59_AST = null;
2439            tmp59_AST = astFactory.create(LT(1));
2440            astFactory.addASTChild(currentAST, tmp59_AST);
2441            match(LITERAL_protected);
2442            modifier_AST = (AST)currentAST.root;
2443            break;
2444        }
2445        case LITERAL_static:
2446        {
2447            AST tmp60_AST = null;
2448            tmp60_AST = astFactory.create(LT(1));
2449            astFactory.addASTChild(currentAST, tmp60_AST);
2450            match(LITERAL_static);
2451            modifier_AST = (AST)currentAST.root;
2452            break;
2453        }
2454        case LITERAL_transient:
2455        {
2456            AST tmp61_AST = null;
2457            tmp61_AST = astFactory.create(LT(1));
2458            astFactory.addASTChild(currentAST, tmp61_AST);
2459            match(LITERAL_transient);
2460            modifier_AST = (AST)currentAST.root;
2461            break;
2462        }
2463        case FINAL:
2464        {
2465            AST tmp62_AST = null;
2466            tmp62_AST = astFactory.create(LT(1));
2467            astFactory.addASTChild(currentAST, tmp62_AST);
2468            match(FINAL);
2469            modifier_AST = (AST)currentAST.root;
2470            break;
2471        }
2472        case ABSTRACT:
2473        {
2474            AST tmp63_AST = null;
2475            tmp63_AST = astFactory.create(LT(1));
2476            astFactory.addASTChild(currentAST, tmp63_AST);
2477            match(ABSTRACT);
2478            modifier_AST = (AST)currentAST.root;
2479            break;
2480        }
2481        case LITERAL_native:
2482        {
2483            AST tmp64_AST = null;
2484            tmp64_AST = astFactory.create(LT(1));
2485            astFactory.addASTChild(currentAST, tmp64_AST);
2486            match(LITERAL_native);
2487            modifier_AST = (AST)currentAST.root;
2488            break;
2489        }
2490        case LITERAL_threadsafe:
2491        {
2492            AST tmp65_AST = null;
2493            tmp65_AST = astFactory.create(LT(1));
2494            astFactory.addASTChild(currentAST, tmp65_AST);
2495            match(LITERAL_threadsafe);
2496            modifier_AST = (AST)currentAST.root;
2497            break;
2498        }
2499        case LITERAL_synchronized:
2500        {
2501            AST tmp66_AST = null;
2502            tmp66_AST = astFactory.create(LT(1));
2503            astFactory.addASTChild(currentAST, tmp66_AST);
2504            match(LITERAL_synchronized);
2505            modifier_AST = (AST)currentAST.root;
2506            break;
2507        }
2508        case LITERAL_volatile:
2509        {
2510            AST tmp67_AST = null;
2511            tmp67_AST = astFactory.create(LT(1));
2512            astFactory.addASTChild(currentAST, tmp67_AST);
2513            match(LITERAL_volatile);
2514            modifier_AST = (AST)currentAST.root;
2515            break;
2516        }
2517        case STRICTFP:
2518        {
2519            AST tmp68_AST = null;
2520            tmp68_AST = astFactory.create(LT(1));
2521            astFactory.addASTChild(currentAST, tmp68_AST);
2522            match(STRICTFP);
2523            modifier_AST = (AST)currentAST.root;
2524            break;
2525        }
2526        default:
2527        {
2528            throw new NoViableAltException(LT(1), getFilename());
2529        }
2530        }
2531        returnAST = modifier_AST;
2532    }
2533    
2534/** An IDENT token whose spelling is required to start with an uppercase letter.
2535 * In the case of a simple statement {UpperID name} the identifier is taken to be a type name, not a command name.
2536 */

2537    public final void upperCaseIdent() throws RecognitionException, TokenStreamException {
2538        
2539        returnAST = null;
2540        ASTPair currentAST = new ASTPair();
2541        AST upperCaseIdent_AST = null;
2542        
2543        if (!(isUpperCase(LT(1))))
2544          throw new SemanticException("isUpperCase(LT(1))");
2545        AST tmp69_AST = null;
2546        tmp69_AST = astFactory.create(LT(1));
2547        astFactory.addASTChild(currentAST, tmp69_AST);
2548        match(IDENT);
2549        upperCaseIdent_AST = (AST)currentAST.root;
2550        returnAST = upperCaseIdent_AST;
2551    }
2552    
2553    public final void builtInType() throws RecognitionException, TokenStreamException {
2554        
2555        returnAST = null;
2556        ASTPair currentAST = new ASTPair();
2557        AST builtInType_AST = null;
2558        
2559        switch ( LA(1)) {
2560        case LITERAL_void:
2561        {
2562            AST tmp70_AST = null;
2563            tmp70_AST = astFactory.create(LT(1));
2564            astFactory.addASTChild(currentAST, tmp70_AST);
2565            match(LITERAL_void);
2566            builtInType_AST = (AST)currentAST.root;
2567            break;
2568        }
2569        case LITERAL_boolean:
2570        {
2571            AST tmp71_AST = null;
2572            tmp71_AST = astFactory.create(LT(1));
2573            astFactory.addASTChild(currentAST, tmp71_AST);
2574            match(LITERAL_boolean);
2575            builtInType_AST = (AST)currentAST.root;
2576            break;
2577        }
2578        case LITERAL_byte:
2579        {
2580            AST tmp72_AST = null;
2581            tmp72_AST = astFactory.create(LT(1));
2582            astFactory.addASTChild(currentAST, tmp72_AST);
2583            match(LITERAL_byte);
2584            builtInType_AST = (AST)currentAST.root;
2585            break;
2586        }
2587        case LITERAL_char:
2588        {
2589            AST tmp73_AST = null;
2590            tmp73_AST = astFactory.create(LT(1));
2591            astFactory.addASTChild(currentAST, tmp73_AST);
2592            match(LITERAL_char);
2593            builtInType_AST = (AST)currentAST.root;
2594            break;
2595        }
2596        case LITERAL_short:
2597        {
2598            AST tmp74_AST = null;
2599            tmp74_AST = astFactory.create(LT(1));
2600            astFactory.addASTChild(currentAST, tmp74_AST);
2601            match(LITERAL_short);
2602            builtInType_AST = (AST)currentAST.root;
2603            break;
2604        }
2605        case LITERAL_int:
2606        {
2607            AST tmp75_AST = null;
2608            tmp75_AST = astFactory.create(LT(1));
2609            astFactory.addASTChild(currentAST, tmp75_AST);
2610            match(LITERAL_int);
2611            builtInType_AST = (AST)currentAST.root;
2612            break;
2613        }
2614        case LITERAL_float:
2615        {
2616            AST tmp76_AST = null;
2617            tmp76_AST = astFactory.create(LT(1));
2618            astFactory.addASTChild(currentAST, tmp76_AST);
2619            match(LITERAL_float);
2620            builtInType_AST = (AST)currentAST.root;
2621            break;
2622        }
2623        case LITERAL_long:
2624        {
2625            AST tmp77_AST = null;
2626            tmp77_AST = astFactory.create(LT(1));
2627            astFactory.addASTChild(currentAST, tmp77_AST);
2628            match(LITERAL_long);
2629            builtInType_AST = (AST)currentAST.root;
2630            break;
2631        }
2632        case LITERAL_double:
2633        {
2634            AST tmp78_AST = null;
2635            tmp78_AST = astFactory.create(LT(1));
2636            astFactory.addASTChild(currentAST, tmp78_AST);
2637            match(LITERAL_double);
2638            builtInType_AST = (AST)currentAST.root;
2639            break;
2640        }
2641        case LITERAL_any:
2642        {
2643            AST tmp79_AST = null;
2644            tmp79_AST = astFactory.create(LT(1));
2645            astFactory.addASTChild(currentAST, tmp79_AST);
2646            match(LITERAL_any);
2647            builtInType_AST = (AST)currentAST.root;
2648            break;
2649        }
2650        default:
2651        {
2652            throw new NoViableAltException(LT(1), getFilename());
2653        }
2654        }
2655        returnAST = builtInType_AST;
2656    }
2657    
2658/** Not yet used - but we could use something like this to look for fully qualified type names
2659 */

2660    public final void qualifiedTypeName() throws RecognitionException, TokenStreamException {
2661        
2662        returnAST = null;
2663        ASTPair currentAST = new ASTPair();
2664        AST qualifiedTypeName_AST = null;
2665        
2666        AST tmp80_AST = null;
2667        tmp80_AST = astFactory.create(LT(1));
2668        match(IDENT);
2669        {
2670        _loop27:
2671        do {
2672            if ((LA(1)==DOT) && (LA(2)==IDENT) && (LA(3)==DOT)) {
2673                AST tmp81_AST = null;
2674                tmp81_AST = astFactory.create(LT(1));
2675                match(DOT);
2676                AST tmp82_AST = null;
2677                tmp82_AST = astFactory.create(LT(1));
2678                match(IDENT);
2679            }
2680            else {
2681                break _loop27;
2682            }
2683            
2684        } while (true);
2685        }
2686        AST tmp83_AST = null;
2687        tmp83_AST = astFactory.create(LT(1));
2688        match(DOT);
2689        upperCaseIdent();
2690        returnAST = qualifiedTypeName_AST;
2691    }
2692    
2693    public final void balancedTokens() throws RecognitionException, TokenStreamException {
2694        
2695        returnAST = null;
2696        ASTPair currentAST = new ASTPair();
2697        AST balancedTokens_AST = null;
2698        
2699        {
2700        _loop477:
2701        do {
2702            if ((_tokenSet_32.member(LA(1)))) {
2703                balancedBrackets();
2704            }
2705            else if ((_tokenSet_33.member(LA(1)))) {
2706                {
2707                match(_tokenSet_33);
2708                }
2709            }
2710            else {
2711                break _loop477;
2712            }
2713            
2714        } while (true);
2715        }
2716        returnAST = balancedTokens_AST;
2717    }
2718    
2719/** Used to look ahead for a constructor
2720 */

2721    public final void constructorStart() throws RecognitionException, TokenStreamException {
2722        
2723        returnAST = null;
2724        ASTPair currentAST = new ASTPair();
2725        AST constructorStart_AST = null;
2726        Token id = null;
2727        AST id_AST = null;
2728        
2729        modifiersOpt();
2730        id = LT(1);
2731        id_AST = astFactory.create(id);
2732        match(IDENT);
2733        if (!(isConstructorIdent(id)))
2734          throw new SemanticException("isConstructorIdent(id)");
2735        nls();
2736        match(LPAREN);
2737        returnAST = constructorStart_AST;
2738    }
2739    
2740/** A list of zero or more modifiers, annotations, or "def". */
2741    public final void modifiersOpt() throws RecognitionException, TokenStreamException {
2742        
2743        returnAST = null;
2744        ASTPair currentAST = new ASTPair();
2745        AST modifiersOpt_AST = null;
2746        Token first = LT(1);
2747        
2748        {
2749        if ((_tokenSet_34.member(LA(1))) && (_tokenSet_35.member(LA(2))) && (_tokenSet_36.member(LA(3)))) {
2750            modifiersInternal();
2751            astFactory.addASTChild(currentAST, returnAST);
2752        }
2753        else if ((_tokenSet_37.member(LA(1))) && (_tokenSet_38.member(LA(2))) && (_tokenSet_39.member(LA(3)))) {
2754        }
2755        else {
2756            throw new NoViableAltException(LT(1), getFilename());
2757        }
2758        
2759        }
2760        if ( inputState.guessing==0 ) {
2761            modifiersOpt_AST = (AST)currentAST.root;
2762            modifiersOpt_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(MODIFIERS,"MODIFIERS",first,LT(1))).add(modifiersOpt_AST));
2763            currentAST.root = modifiersOpt_AST;
2764            currentAST.child = modifiersOpt_AST!=null &&modifiersOpt_AST.getFirstChild()!=null ?
2765                modifiersOpt_AST.getFirstChild() : modifiersOpt_AST;
2766            currentAST.advanceChildToEnd();
2767        }
2768        modifiersOpt_AST = (AST)currentAST.root;
2769        returnAST = modifiersOpt_AST;
2770    }
2771    
2772/** Used only as a lookahead predicate for nested type declarations. */
2773    public final void typeDeclarationStart() throws RecognitionException, TokenStreamException {
2774        
2775        returnAST = null;
2776        ASTPair currentAST = new ASTPair();
2777        AST typeDeclarationStart_AST = null;
2778        
2779        modifiersOpt();
2780        {
2781        switch ( LA(1)) {
2782        case LITERAL_class:
2783        {
2784            match(LITERAL_class);
2785            break;
2786        }
2787        case LITERAL_interface:
2788        {
2789            match(LITERAL_interface);
2790            break;
2791        }
2792        case LITERAL_enum:
2793        {
2794            match(LITERAL_enum);
2795            break;
2796        }
2797        case AT:
2798        {
2799            AST tmp89_AST = null;
2800            tmp89_AST = astFactory.create(LT(1));
2801            match(AT);
2802            match(LITERAL_interface);
2803            break;
2804        }
2805        default:
2806        {
2807            throw new NoViableAltException(LT(1), getFilename());
2808        }
2809        }
2810        }
2811        returnAST = typeDeclarationStart_AST;
2812    }
2813    
2814    public final void classTypeSpec(
2815        boolean addImagNode
2816    ) throws RecognitionException, TokenStreamException {
2817        
2818        returnAST = null;
2819        ASTPair currentAST = new ASTPair();
2820        AST classTypeSpec_AST = null;
2821        AST ct_AST = null;
2822        Token first = LT(1);
2823        
2824        classOrInterfaceType(false);
2825        ct_AST = (AST)returnAST;
2826        declaratorBrackets(ct_AST);
2827        astFactory.addASTChild(currentAST, returnAST);
2828        if ( inputState.guessing==0 ) {
2829            classTypeSpec_AST = (AST)currentAST.root;
2830            
2831            if ( addImagNode ) {
2832            classTypeSpec_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(classTypeSpec_AST));
2833            }
2834            
2835            currentAST.root = classTypeSpec_AST;
2836            currentAST.child = classTypeSpec_AST!=null &&classTypeSpec_AST.getFirstChild()!=null ?
2837                classTypeSpec_AST.getFirstChild() : classTypeSpec_AST;
2838            currentAST.advanceChildToEnd();
2839        }
2840        classTypeSpec_AST = (AST)currentAST.root;
2841        returnAST = classTypeSpec_AST;
2842    }
2843    
2844    public final void builtInTypeSpec(
2845        boolean addImagNode
2846    ) throws RecognitionException, TokenStreamException {
2847        
2848        returnAST = null;
2849        ASTPair currentAST = new ASTPair();
2850        AST builtInTypeSpec_AST = null;
2851        AST bt_AST = null;
2852        Token first = LT(1);
2853        
2854        builtInType();
2855        bt_AST = (AST)returnAST;
2856        declaratorBrackets(bt_AST);
2857        astFactory.addASTChild(currentAST, returnAST);
2858        if ( inputState.guessing==0 ) {
2859            builtInTypeSpec_AST = (AST)currentAST.root;
2860            
2861            if ( addImagNode ) {
2862            builtInTypeSpec_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(builtInTypeSpec_AST));
2863            }
2864            
2865            currentAST.root = builtInTypeSpec_AST;
2866            currentAST.child = builtInTypeSpec_AST!=null &&builtInTypeSpec_AST.getFirstChild()!=null ?
2867                builtInTypeSpec_AST.getFirstChild() : builtInTypeSpec_AST;
2868            currentAST.advanceChildToEnd();
2869        }
2870        builtInTypeSpec_AST = (AST)currentAST.root;
2871        returnAST = builtInTypeSpec_AST;
2872    }
2873    
2874    public final void classOrInterfaceType(
2875        boolean addImagNode
2876    ) throws RecognitionException, TokenStreamException {
2877        
2878        returnAST = null;
2879        ASTPair currentAST = new ASTPair();
2880        AST classOrInterfaceType_AST = null;
2881        Token first = LT(1);
2882        
2883        AST tmp91_AST = null;
2884        tmp91_AST = astFactory.create(LT(1));
2885        astFactory.makeASTRoot(currentAST, tmp91_AST);
2886        match(IDENT);
2887        {
2888        switch ( LA(1)) {
2889        case LT:
2890        {
2891            typeArguments();
2892            astFactory.addASTChild(currentAST, returnAST);
2893            break;
2894        }
2895        case EOF:
2896        case UNUSED_DO:
2897        case LITERAL_def:
2898        case AT:
2899        case IDENT:
2900        case LBRACK:
2901        case RBRACK:
2902        case DOT:
2903        case LPAREN:
2904        case LITERAL_class:
2905        case QUESTION:
2906        case LITERAL_extends:
2907        case LITERAL_super:
2908        case COMMA:
2909        case GT:
2910        case SR:
2911        case BSR:
2912        case LITERAL_void:
2913        case LITERAL_boolean:
2914        case LITERAL_byte:
2915        case LITERAL_char:
2916        case LITERAL_short:
2917        case LITERAL_int:
2918        case LITERAL_float:
2919        case LITERAL_long:
2920        case LITERAL_double:
2921        case LITERAL_any:
2922        case LITERAL_as:
2923        case RPAREN:
2924        case ASSIGN:
2925        case BAND:
2926        case LCURLY:
2927        case RCURLY:
2928        case SEMI:
2929        case NLS:
2930        case LITERAL_default:
2931        case LITERAL_implements:
2932        case LITERAL_this:
2933        case STRING_LITERAL:
2934        case TRIPLE_DOT:
2935        case CLOSURE_OP:
2936        case LOR:
2937        case BOR:
2938        case COLON:
2939        case LITERAL_if:
2940        case LITERAL_else:
2941        case LITERAL_while:
2942        case LITERAL_switch:
2943        case LITERAL_for:
2944        case LITERAL_in:
2945        case PLUS:
2946        case MINUS:
2947        case LITERAL_case:
2948        case LITERAL_try:
2949        case LITERAL_finally:
2950        case LITERAL_catch:
2951        case PLUS_ASSIGN:
2952        case MINUS_ASSIGN:
2953        case STAR_ASSIGN:
2954        case DIV_ASSIGN:
2955        case MOD_ASSIGN:
2956        case SR_ASSIGN:
2957        case BSR_ASSIGN:
2958        case SL_ASSIGN:
2959        case BAND_ASSIGN:
2960        case BXOR_ASSIGN:
2961        case BOR_ASSIGN:
2962        case STAR_STAR_ASSIGN:
2963        case LAND:
2964        case BXOR:
2965        case REGEX_FIND:
2966        case REGEX_MATCH:
2967        case NOT_EQUAL:
2968        case EQUAL:
2969        case COMPARE_TO:
2970        case INC:
2971        case DEC:
2972        case BNOT:
2973        case LNOT:
2974        case DOLLAR:
2975        case STRING_CTOR_START:
2976        case LITERAL_new:
2977        case LITERAL_true:
2978        case LITERAL_false:
2979        case LITERAL_null:
2980        case NUM_INT:
2981        case NUM_FLOAT:
2982        case NUM_LONG:
2983        case NUM_DOUBLE:
2984        case NUM_BIG_INT:
2985        case NUM_BIG_DECIMAL:
2986        {
2987            break;
2988        }
2989        default:
2990        {
2991            throw new NoViableAltException(LT(1), getFilename());
2992        }
2993        }
2994        }
2995        {
2996        _loop38:
2997        do {
2998            if ((LA(1)==DOT) && (LA(2)==IDENT) && (_tokenSet_40.member(LA(3)))) {
2999                AST tmp92_AST = null;
3000                tmp92_AST = astFactory.create(LT(1));
3001                astFactory.makeASTRoot(currentAST, tmp92_AST);
3002                match(DOT);
3003                AST tmp93_AST = null;
3004                tmp93_AST = astFactory.create(LT(1));
3005                astFactory.addASTChild(currentAST, tmp93_AST);
3006                match(IDENT);
3007                {
3008                switch ( LA(1)) {
3009                case LT:
3010                {
3011                    typeArguments();
3012                    astFactory.addASTChild(currentAST, returnAST);
3013                    break;
3014                }
3015                case EOF:
3016                case UNUSED_DO:
3017                case LITERAL_def:
3018                case AT:
3019                case IDENT:
3020                case LBRACK:
3021                case RBRACK:
3022                case DOT:
3023                case LPAREN:
3024                case LITERAL_class:
3025                case QUESTION:
3026                case LITERAL_extends:
3027                case LITERAL_super:
3028                case COMMA:
3029                case GT:
3030                case SR:
3031                case BSR:
3032                case LITERAL_void:
3033                case LITERAL_boolean:
3034                case LITERAL_byte:
3035                case LITERAL_char:
3036                case LITERAL_short:
3037                case LITERAL_int:
3038                case LITERAL_float:
3039                case LITERAL_long:
3040                case LITERAL_double:
3041                case LITERAL_any:
3042                case LITERAL_as:
3043                case RPAREN:
3044                case ASSIGN:
3045                case BAND:
3046                case LCURLY:
3047                case RCURLY:
3048                case SEMI:
3049                case NLS:
3050                case LITERAL_default:
3051                case LITERAL_implements:
3052                case LITERAL_this:
3053                case STRING_LITERAL:
3054                case TRIPLE_DOT:
3055                case CLOSURE_OP:
3056                case LOR:
3057                case BOR:
3058                case COLON:
3059                case LITERAL_if:
3060                case LITERAL_else:
3061                case LITERAL_while:
3062                case LITERAL_switch:
3063                case LITERAL_for:
3064                case LITERAL_in:
3065                case PLUS:
3066                case MINUS:
3067                case LITERAL_case:
3068                case LITERAL_try:
3069                case LITERAL_finally:
3070                case LITERAL_catch:
3071                case PLUS_ASSIGN:
3072                case MINUS_ASSIGN:
3073                case STAR_ASSIGN:
3074                case DIV_ASSIGN:
3075                case MOD_ASSIGN:
3076                case SR_ASSIGN:
3077                case BSR_ASSIGN:
3078                case SL_ASSIGN:
3079                case BAND_ASSIGN:
3080                case BXOR_ASSIGN:
3081                case BOR_ASSIGN:
3082                case STAR_STAR_ASSIGN:
3083                case LAND:
3084                case BXOR:
3085                case REGEX_FIND:
3086                case REGEX_MATCH:
3087                case NOT_EQUAL:
3088                case EQUAL:
3089                case COMPARE_TO:
3090                case INC:
3091                case DEC:
3092                case BNOT:
3093                case LNOT:
3094                case DOLLAR:
3095                case STRING_CTOR_START:
3096                case LITERAL_new:
3097                case LITERAL_true:
3098                case LITERAL_false:
3099                case LITERAL_null:
3100                case NUM_INT:
3101                case NUM_FLOAT:
3102                case NUM_LONG:
3103                case NUM_DOUBLE:
3104                case NUM_BIG_INT:
3105                case NUM_BIG_DECIMAL:
3106                {
3107                    break;
3108                }
3109                default:
3110                {
3111                    throw new NoViableAltException(LT(1), getFilename());
3112                }
3113                }
3114                }
3115            }
3116            else {
3117                break _loop38;
3118            }
3119            
3120        } while (true);
3121        }
3122        if ( inputState.guessing==0 ) {
3123            classOrInterfaceType_AST = (AST)currentAST.root;
3124            
3125            if ( addImagNode ) {
3126            classOrInterfaceType_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(classOrInterfaceType_AST));
3127            }
3128            
3129            currentAST.root = classOrInterfaceType_AST;
3130            currentAST.child = classOrInterfaceType_AST!=null &&classOrInterfaceType_AST.getFirstChild()!=null ?
3131                classOrInterfaceType_AST.getFirstChild() : classOrInterfaceType_AST;
3132            currentAST.advanceChildToEnd();
3133        }
3134        classOrInterfaceType_AST = (AST)currentAST.root;
3135        returnAST = classOrInterfaceType_AST;
3136    }
3137    
3138/** After some type names, where zero or more empty bracket pairs are allowed.
3139 * We use ARRAY_DECLARATOR to represent this.
3140 * TODO: Is there some more Groovy way to view this in terms of the indexed property syntax?
3141 */

3142    public final void declaratorBrackets(
3143        AST typ
3144    ) throws RecognitionException, TokenStreamException {
3145        
3146        returnAST = null;
3147        ASTPair currentAST = new ASTPair();
3148        AST declaratorBrackets_AST = null;
3149        Token lb = null;
3150        AST lb_AST = null;
3151        
3152        if ( inputState.guessing==0 ) {
3153            declaratorBrackets_AST = (AST)currentAST.root;
3154            declaratorBrackets_AST=typ;
3155            currentAST.root = declaratorBrackets_AST;
3156            currentAST.child = declaratorBrackets_AST!=null &&declaratorBrackets_AST.getFirstChild()!=null ?
3157                declaratorBrackets_AST.getFirstChild() : declaratorBrackets_AST;
3158            currentAST.advanceChildToEnd();
3159        }
3160        {
3161        _loop200:
3162        do {
3163            if ((LA(1)==LBRACK) && (LA(2)==RBRACK) && (_tokenSet_41.member(LA(3)))) {
3164                lb = LT(1);
3165                lb_AST = astFactory.create(lb);
3166                astFactory.makeASTRoot(currentAST, lb_AST);
3167                match(LBRACK);
3168                if ( inputState.guessing==0 ) {
3169                    lb_AST.setType(ARRAY_DECLARATOR);
3170                }
3171                match(RBRACK);
3172            }
3173            else {
3174                break _loop200;
3175            }
3176            
3177        } while (true);
3178        }
3179        declaratorBrackets_AST = (AST)currentAST.root;
3180        returnAST = declaratorBrackets_AST;
3181    }
3182    
3183    public final void typeArguments() throws RecognitionException, TokenStreamException {
3184        
3185        returnAST = null;
3186        ASTPair currentAST = new ASTPair();
3187        AST typeArguments_AST = null;
3188        Token first = LT(1);
3189        int currentLtLevel = 0;
3190        
3191        if ( inputState.guessing==0 ) {
3192            currentLtLevel = ltCounter;
3193        }
3194        match(LT);
3195        if ( inputState.guessing==0 ) {
3196            ltCounter++;
3197        }
3198        nls();
3199        typeArgument();
3200        astFactory.addASTChild(currentAST, returnAST);
3201        {
3202        _loop48:
3203        do {
3204            if (((LA(1)==COMMA) && (_tokenSet_42.member(LA(2))) && (_tokenSet_40.member(LA(3))))&&(inputState.guessing !=0 || ltCounter == currentLtLevel + 1)) {
3205                match(COMMA);
3206                nls();
3207                typeArgument();
3208                astFactory.addASTChild(currentAST, returnAST);
3209            }
3210            else {
3211                break _loop48;
3212            }
3213            
3214        } while (true);
3215        }
3216        nls();
3217        {
3218        if (((LA(1) >= GT && LA(1) <= BSR)) && (_tokenSet_41.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
3219            typeArgumentsOrParametersEnd();
3220            astFactory.addASTChild(currentAST, returnAST);
3221        }
3222        else if ((_tokenSet_41.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
3223        }
3224        else {
3225            throw new NoViableAltException(LT(1), getFilename());
3226        }
3227        
3228        }
3229        if (!((currentLtLevel != 0) || ltCounter == currentLtLevel))
3230          throw new SemanticException("(currentLtLevel != 0) || ltCounter == currentLtLevel");
3231        if ( inputState.guessing==0 ) {
3232            typeArguments_AST = (AST)currentAST.root;
3233            typeArguments_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_ARGUMENTS,"TYPE_ARGUMENTS",first,LT(1))).add(typeArguments_AST));
3234            currentAST.root = typeArguments_AST;
3235            currentAST.child = typeArguments_AST!=null &&typeArguments_AST.getFirstChild()!=null ?
3236                typeArguments_AST.getFirstChild() : typeArguments_AST;
3237            currentAST.advanceChildToEnd();
3238        }
3239        typeArguments_AST = (AST)currentAST.root;
3240        returnAST = typeArguments_AST;
3241    }
3242    
3243    public final void typeArgumentSpec() throws RecognitionException, TokenStreamException {
3244        
3245        returnAST = null;
3246        ASTPair currentAST = new ASTPair();
3247        AST typeArgumentSpec_AST = null;
3248        
3249        switch ( LA(1)) {
3250        case IDENT:
3251        {
3252            classTypeSpec(true);
3253            astFactory.addASTChild(currentAST, returnAST);
3254            typeArgumentSpec_AST = (AST)currentAST.root;
3255            break;
3256        }
3257        case LITERAL_void:
3258        case LITERAL_boolean:
3259        case LITERAL_byte:
3260        case LITERAL_char:
3261        case LITERAL_short:
3262        case LITERAL_int:
3263        case LITERAL_float:
3264        case LITERAL_long:
3265        case LITERAL_double:
3266        case LITERAL_any:
3267        {
3268            builtInTypeArraySpec(true);
3269            astFactory.addASTChild(currentAST, returnAST);
3270            typeArgumentSpec_AST = (AST)currentAST.root;
3271            break;
3272        }
3273        default:
3274        {
3275            throw new NoViableAltException(LT(1), getFilename());
3276        }
3277        }
3278        returnAST = typeArgumentSpec_AST;
3279    }
3280    
3281    public final void builtInTypeArraySpec(
3282        boolean addImagNode
3283    ) throws RecognitionException, TokenStreamException {
3284        
3285        returnAST = null;
3286        ASTPair currentAST = new ASTPair();
3287        AST builtInTypeArraySpec_AST = null;
3288        AST bt_AST = null;
3289        Token first = LT(1);
3290        
3291        builtInType();
3292        bt_AST = (AST)returnAST;
3293        {
3294        boolean synPredMatched56 = false;
3295        if (((_tokenSet_41.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3))))) {
3296            int _m56 = mark();
3297            synPredMatched56 = true;
3298            inputState.guessing++;
3299            try {
3300                {
3301                match(LBRACK);
3302                }
3303            }
3304            catch (RecognitionException pe) {
3305                synPredMatched56 = false;
3306            }
3307            rewind(_m56);
3308            inputState.guessing--;
3309        }
3310        if ( synPredMatched56 ) {
3311            declaratorBrackets(bt_AST);
3312            astFactory.addASTChild(currentAST, returnAST);
3313        }
3314        else if ((_tokenSet_41.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
3315            if ( inputState.guessing==0 ) {
3316                require(false,
3317                "primitive type parameters not allowed here",
3318                "use the corresponding wrapper type, such as Integer for int"
3319                );
3320            }
3321        }
3322        else {
3323            throw new NoViableAltException(LT(1), getFilename());
3324        }
3325        
3326        }
3327        if ( inputState.guessing==0 ) {
3328            builtInTypeArraySpec_AST = (AST)currentAST.root;
3329            
3330            if ( addImagNode ) {
3331            builtInTypeArraySpec_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(builtInTypeArraySpec_AST));
3332            }
3333            
3334            currentAST.root = builtInTypeArraySpec_AST;
3335            currentAST.child = builtInTypeArraySpec_AST!=null &&builtInTypeArraySpec_AST.getFirstChild()!=null ?
3336                builtInTypeArraySpec_AST.getFirstChild() : builtInTypeArraySpec_AST;
3337            currentAST.advanceChildToEnd();
3338        }
3339        builtInTypeArraySpec_AST = (AST)currentAST.root;
3340        returnAST = builtInTypeArraySpec_AST;
3341    }
3342    
3343    public final void typeArgument() throws RecognitionException, TokenStreamException {
3344        
3345        returnAST = null;
3346        ASTPair currentAST = new ASTPair();
3347        AST typeArgument_AST = null;
3348        Token first = LT(1);
3349        
3350        {
3351        switch ( LA(1)) {
3352        case IDENT:
3353        case LITERAL_void:
3354        case LITERAL_boolean:
3355        case LITERAL_byte:
3356        case LITERAL_char:
3357        case LITERAL_short:
3358        case LITERAL_int:
3359        case LITERAL_float:
3360        case LITERAL_long:
3361        case LITERAL_double:
3362        case LITERAL_any:
3363        {
3364            typeArgumentSpec();
3365            astFactory.addASTChild(currentAST, returnAST);
3366            break;
3367        }
3368        case QUESTION:
3369        {
3370            wildcardType();
3371            astFactory.addASTChild(currentAST, returnAST);
3372            break;
3373        }
3374        default:
3375        {
3376            throw new NoViableAltException(LT(1), getFilename());
3377        }
3378        }
3379        }
3380        if ( inputState.guessing==0 ) {
3381            typeArgument_AST = (AST)currentAST.root;
3382            typeArgument_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_ARGUMENT,"TYPE_ARGUMENT",first,LT(1))).add(typeArgument_AST));
3383            currentAST.root = typeArgument_AST;
3384            currentAST.child = typeArgument_AST!=null &&typeArgument_AST.getFirstChild()!=null ?
3385                typeArgument_AST.getFirstChild() : typeArgument_AST;
3386            currentAST.advanceChildToEnd();
3387        }
3388        typeArgument_AST = (AST)currentAST.root;
3389        returnAST = typeArgument_AST;
3390    }
3391    
3392    public final void wildcardType() throws RecognitionException, TokenStreamException {
3393        
3394        returnAST = null;
3395        ASTPair currentAST = new ASTPair();
3396        AST wildcardType_AST = null;
3397        Token q = null;
3398        AST q_AST = null;
3399        
3400        q = LT(1);
3401        q_AST = astFactory.create(q);
3402        astFactory.makeASTRoot(currentAST, q_AST);
3403        match(QUESTION);
3404        if ( inputState.guessing==0 ) {
3405            q_AST.setType(WILDCARD_TYPE);
3406        }
3407        {
3408        boolean synPredMatched45 = false;
3409        if (((LA(1)==LITERAL_extends||LA(1)==LITERAL_super) && (LA(2)==IDENT||LA(2)==NLS) && (_tokenSet_40.member(LA(3))))) {
3410            int _m45 = mark();
3411            synPredMatched45 = true;
3412            inputState.guessing++;
3413            try {
3414                {
3415                switch ( LA(1)) {
3416                case LITERAL_extends:
3417                {
3418                    match(LITERAL_extends);
3419                    break;
3420                }
3421                case LITERAL_super:
3422                {
3423                    match(LITERAL_super);
3424                    break;
3425                }
3426                default:
3427                {
3428                    throw new NoViableAltException(LT(1), getFilename());
3429                }
3430                }
3431                }
3432            }
3433            catch (RecognitionException pe) {
3434                synPredMatched45 = false;
3435            }
3436            rewind(_m45);
3437            inputState.guessing--;
3438        }
3439        if ( synPredMatched45 ) {
3440            typeArgumentBounds();
3441            astFactory.addASTChild(currentAST, returnAST);
3442        }
3443        else if ((_tokenSet_41.member(LA(1))) && (_tokenSet_5.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
3444        }
3445        else {
3446            throw new NoViableAltException(LT(1), getFilename());
3447        }
3448        
3449        }
3450        wildcardType_AST = (AST)currentAST.root;
3451        returnAST = wildcardType_AST;
3452    }
3453    
3454    public final void typeArgumentBounds() throws RecognitionException, TokenStreamException {
3455        
3456        returnAST = null;
3457        ASTPair currentAST = new ASTPair();
3458        AST typeArgumentBounds_AST = null;
3459        Token first = LT(1);boolean isUpperBounds = false;
3460        
3461        {
3462        switch ( LA(1)) {
3463        case LITERAL_extends:
3464        {
3465            match(LITERAL_extends);
3466            if ( inputState.guessing==0 ) {
3467                isUpperBounds=true;
3468            }
3469            break;
3470        }
3471        case LITERAL_super:
3472        {
3473            match(LITERAL_super);
3474            break;
3475        }
3476        default:
3477        {
3478            throw new NoViableAltException(LT(1), getFilename());
3479        }
3480        }
3481        }
3482        nls();
3483        classOrInterfaceType(false);
3484        astFactory.addASTChild(currentAST, returnAST);
3485        nls();
3486        if ( inputState.guessing==0 ) {
3487            typeArgumentBounds_AST = (AST)currentAST.root;
3488            
3489            if (isUpperBounds)
3490            {
3491            typeArgumentBounds_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_UPPER_BOUNDS,"TYPE_UPPER_BOUNDS",first,LT(1))).add(typeArgumentBounds_AST));
3492            }
3493            else
3494            {
3495            typeArgumentBounds_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_LOWER_BOUNDS,"TYPE_LOWER_BOUNDS",first,LT(1))).add(typeArgumentBounds_AST));
3496            }
3497            
3498            currentAST.root = typeArgumentBounds_AST;
3499            currentAST.child = typeArgumentBounds_AST!=null &&typeArgumentBounds_AST.getFirstChild()!=null ?
3500                typeArgumentBounds_AST.getFirstChild() : typeArgumentBounds_AST;
3501            currentAST.advanceChildToEnd();
3502        }
3503        typeArgumentBounds_AST = (AST)currentAST.root;
3504        returnAST = typeArgumentBounds_AST;
3505    }
3506    
3507    protected final void typeArgumentsOrParametersEnd() throws RecognitionException, TokenStreamException {
3508        
3509        returnAST = null;
3510        ASTPair currentAST = new ASTPair();
3511        AST typeArgumentsOrParametersEnd_AST = null;
3512        
3513        switch ( LA(1)) {
3514        case GT:
3515        {
3516            match(GT);
3517            if ( inputState.guessing==0 ) {
3518                ltCounter-=1;
3519            }
3520            nls();
3521            typeArgumentsOrParametersEnd_AST = (AST)currentAST.root;
3522            break;
3523        }
3524        case SR:
3525        {
3526            match(SR);
3527            if ( inputState.guessing==0 ) {
3528                ltCounter-=2;
3529            }
3530            nls();
3531            typeArgumentsOrParametersEnd_AST = (AST)currentAST.root;
3532            break;
3533        }
3534        case BSR:
3535        {
3536            match(BSR);
3537            if ( inputState.guessing==0 ) {
3538                ltCounter-=3;
3539            }
3540            nls();
3541            typeArgumentsOrParametersEnd_AST = (AST)currentAST.root;
3542            break;
3543        }
3544        default:
3545        {
3546            throw new NoViableAltException(LT(1), getFilename());
3547        }
3548        }
3549        returnAST = typeArgumentsOrParametersEnd_AST;
3550    }
3551    
3552    public final void type() throws RecognitionException, TokenStreamException {
3553        
3554        returnAST = null;
3555        ASTPair currentAST = new ASTPair();
3556        AST type_AST = null;
3557        
3558        switch ( LA(1)) {
3559        case IDENT:
3560        {
3561            classOrInterfaceType(false);
3562            astFactory.addASTChild(currentAST, returnAST);
3563            type_AST = (AST)currentAST.root;
3564            break;
3565        }
3566        case LITERAL_void:
3567        case LITERAL_boolean:
3568        case LITERAL_byte:
3569        case LITERAL_char:
3570        case LITERAL_short:
3571        case LITERAL_int:
3572        case LITERAL_float:
3573        case LITERAL_long:
3574        case LITERAL_double:
3575        case LITERAL_any:
3576        {
3577            builtInType();
3578            astFactory.addASTChild(currentAST, returnAST);
3579            type_AST = (AST)currentAST.root;
3580            break;
3581        }
3582        default:
3583        {
3584            throw new NoViableAltException(LT(1), getFilename());
3585        }
3586        }
3587        returnAST = type_AST;
3588    }
3589    
3590    public final void modifiersInternal() throws RecognitionException, TokenStreamException {
3591        
3592        returnAST = null;
3593        ASTPair currentAST = new ASTPair();
3594        AST modifiersInternal_AST = null;
3595        int seenDef = 0;
3596        
3597        {
3598        int _cnt69=0;
3599        _loop69:
3600        do {
3601            if (((LA(1)==LITERAL_def))&&(seenDef++ == 0)) {
3602                match(LITERAL_def);
3603                nls();
3604            }
3605            else if ((_tokenSet_43.member(LA(1)))) {
3606                modifier();
3607                astFactory.addASTChild(currentAST, returnAST);
3608                nls();
3609            }
3610            else if (((LA(1)==AT) && (LA(2)==IDENT) && (_tokenSet_44.member(LA(3))))&&(LA(1)==AT && !LT(2).getText().equals("interface"))) {
3611                annotation();
3612                astFactory.addASTChild(currentAST, returnAST);
3613                nls();
3614            }
3615            else {
3616                if ( _cnt69>=1 ) { break _loop69; } else {throw new NoViableAltException(LT(1), getFilename());}
3617            }
3618            
3619            _cnt69++;
3620        } while (true);
3621        }
3622        modifiersInternal_AST = (AST)currentAST.root;
3623        returnAST = modifiersInternal_AST;
3624    }
3625    
3626    public final void annotation() throws RecognitionException, TokenStreamException {
3627        
3628        returnAST = null;
3629        ASTPair currentAST = new ASTPair();
3630        AST annotation_AST = null;
3631        AST i_AST = null;
3632        AST args_AST = null;
3633        Token first = LT(1);
3634        
3635        match(AT);
3636        identifier();
3637        i_AST = (AST)returnAST;
3638        {
3639        switch ( LA(1)) {
3640        case LPAREN:
3641        {
3642            match(LPAREN);
3643            {
3644            switch ( LA(1)) {
3645            case AT:
3646            case IDENT:
3647            case LBRACK:
3648            case LPAREN:
3649            case LITERAL_super:
3650            case LITERAL_void:
3651            case LITERAL_boolean:
3652            case LITERAL_byte:
3653            case LITERAL_char:
3654            case LITERAL_short:
3655            case LITERAL_int:
3656            case LITERAL_float:
3657            case LITERAL_long:
3658            case LITERAL_double:
3659            case LITERAL_any:
3660            case LCURLY:
3661            case LITERAL_this:
3662            case STRING_LITERAL:
3663            case PLUS:
3664            case MINUS:
3665            case INC:
3666            case DEC:
3667            case BNOT:
3668            case LNOT:
3669            case DOLLAR:
3670            case STRING_CTOR_START:
3671            case LITERAL_new:
3672            case LITERAL_true:
3673            case LITERAL_false:
3674            case LITERAL_null:
3675            case NUM_INT:
3676            case NUM_FLOAT:
3677            case NUM_LONG:
3678            case NUM_DOUBLE:
3679            case NUM_BIG_INT:
3680            case NUM_BIG_DECIMAL:
3681            {
3682                annotationArguments();
3683                args_AST = (AST)returnAST;
3684                break;
3685            }
3686            case RPAREN:
3687            {
3688                break;
3689            }
3690            default:
3691            {
3692                throw new NoViableAltException(LT(1), getFilename());
3693            }
3694            }
3695            }
3696            match(RPAREN);
3697            break;
3698        }
3699        case EOF:
3700        case FINAL:
3701        case ABSTRACT:
3702        case STRICTFP:
3703        case LITERAL_package:
3704        case LITERAL_static:
3705        case LITERAL_def:
3706        case AT:
3707        case IDENT:
3708        case RBRACK:
3709        case LITERAL_class:
3710        case LITERAL_interface:
3711        case LITERAL_enum:
3712        case LT:
3713        case COMMA:
3714        case LITERAL_void:
3715        case LITERAL_boolean:
3716        case LITERAL_byte:
3717        case LITERAL_char:
3718        case LITERAL_short:
3719        case LITERAL_int:
3720        case LITERAL_float:
3721        case LITERAL_long:
3722        case LITERAL_double:
3723        case LITERAL_any:
3724        case LITERAL_private:
3725        case LITERAL_public:
3726        case LITERAL_protected:
3727        case LITERAL_transient:
3728        case LITERAL_native:
3729        case LITERAL_threadsafe:
3730        case LITERAL_synchronized:
3731        case LITERAL_volatile:
3732        case RPAREN:
3733        case RCURLY:
3734        case SEMI:
3735        case NLS:
3736        case STRING_LITERAL:
3737        case TRIPLE_DOT:
3738        {
3739            break;
3740        }
3741        default:
3742        {
3743            throw new NoViableAltException(LT(1), getFilename());
3744        }
3745        }
3746        }
3747        if ( inputState.guessing==0 ) {
3748            annotation_AST = (AST)currentAST.root;
3749            annotation_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(ANNOTATION,"ANNOTATION",first,LT(1))).add(i_AST).add(args_AST));
3750            currentAST.root = annotation_AST;
3751            currentAST.child = annotation_AST!=null &&annotation_AST.getFirstChild()!=null ?
3752                annotation_AST.getFirstChild() : annotation_AST;
3753            currentAST.advanceChildToEnd();
3754        }
3755        returnAST = annotation_AST;
3756    }
3757    
3758    public final void annotationArguments() throws RecognitionException, TokenStreamException {
3759        
3760        returnAST = null;
3761        ASTPair currentAST = new ASTPair();
3762        AST annotationArguments_AST = null;
3763        
3764        if ((_tokenSet_45.member(LA(1))) && (_tokenSet_46.member(LA(2)))) {
3765            annotationMemberValueInitializer();
3766            astFactory.addASTChild(currentAST, returnAST);
3767            annotationArguments_AST = (AST)currentAST.root;
3768        }
3769        else if ((LA(1)==IDENT) && (LA(2)==ASSIGN)) {
3770            anntotationMemberValuePairs();
3771            astFactory.addASTChild(currentAST, returnAST);
3772            annotationArguments_AST = (AST)currentAST.root;
3773        }
3774        else {
3775            throw new NoViableAltException(LT(1), getFilename());
3776        }
3777        
3778        returnAST = annotationArguments_AST;
3779    }
3780    
3781    public final void annotationMemberValueInitializer() throws RecognitionException, TokenStreamException {
3782        
3783        returnAST = null;
3784        ASTPair currentAST = new ASTPair();
3785        AST annotationMemberValueInitializer_AST = null;
3786        
3787        switch ( LA(1)) {
3788        case IDENT:
3789        case LBRACK:
3790        case LPAREN:
3791        case LITERAL_super:
3792        case LITERAL_void:
3793        case LITERAL_boolean:
3794        case LITERAL_byte:
3795        case LITERAL_char:
3796        case LITERAL_short:
3797        case LITERAL_int:
3798        case LITERAL_float:
3799        case LITERAL_long:
3800        case LITERAL_double:
3801        case LITERAL_any:
3802        case LCURLY:
3803        case LITERAL_this:
3804        case STRING_LITERAL:
3805        case PLUS:
3806        case MINUS:
3807        case INC:
3808        case DEC:
3809        case BNOT:
3810        case LNOT:
3811        case DOLLAR:
3812        case STRING_CTOR_START:
3813        case LITERAL_new:
3814        case LITERAL_true:
3815        case LITERAL_false:
3816        case LITERAL_null:
3817        case NUM_INT:
3818        case NUM_FLOAT:
3819        case NUM_LONG:
3820        case NUM_DOUBLE:
3821        case NUM_BIG_INT:
3822        case NUM_BIG_DECIMAL:
3823        {
3824            conditionalExpression(0);
3825            astFactory.addASTChild(currentAST, returnAST);
3826            annotationMemberValueInitializer_AST = (AST)currentAST.root;
3827            break;
3828        }
3829        case AT:
3830        {
3831            annotation();
3832            astFactory.addASTChild(currentAST, returnAST);
3833            annotationMemberValueInitializer_AST = (AST)currentAST.root;
3834            break;
3835        }
3836        default:
3837        {
3838            throw new NoViableAltException(LT(1), getFilename());
3839        }
3840        }
3841        returnAST = annotationMemberValueInitializer_AST;
3842    }
3843    
3844    public final void anntotationMemberValuePairs() throws RecognitionException, TokenStreamException {
3845        
3846        returnAST = null;
3847        ASTPair currentAST = new ASTPair();
3848        AST anntotationMemberValuePairs_AST = null;
3849        
3850        annotationMemberValuePair();
3851        astFactory.addASTChild(currentAST, returnAST);
3852        {
3853        _loop83:
3854        do {
3855            if ((LA(1)==COMMA)) {
3856                match(COMMA);
3857                nls();
3858                annotationMemberValuePair();
3859                astFactory.addASTChild(currentAST, returnAST);
3860            }
3861            else {
3862                break _loop83;
3863            }
3864            
3865        } while (true);
3866        }
3867        anntotationMemberValuePairs_AST = (AST)currentAST.root;
3868        returnAST = anntotationMemberValuePairs_AST;
3869    }
3870    
3871    public final void annotationMemberValuePair() throws RecognitionException, TokenStreamException {
3872        
3873        returnAST = null;
3874        ASTPair currentAST = new ASTPair();
3875        AST annotationMemberValuePair_AST = null;
3876        Token i = null;
3877        AST i_AST = null;
3878        AST v_AST = null;
3879        Token first = LT(1);
3880        
3881        i = LT(1);
3882        i_AST = astFactory.create(i);
3883        match(IDENT);
3884        match(ASSIGN);
3885        nls();
3886        annotationMemberValueInitializer();
3887        v_AST = (AST)returnAST;
3888        if ( inputState.guessing==0 ) {
3889            annotationMemberValuePair_AST = (AST)currentAST.root;
3890            annotationMemberValuePair_AST = (AST)astFactory.make( (new ASTArray(3)).add(create(ANNOTATION_MEMBER_VALUE_PAIR,"ANNOTATION_MEMBER_VALUE_PAIR",first,LT(1))).add(i_AST).add(v_AST));
3891            currentAST.root = annotationMemberValuePair_AST;
3892            currentAST.child = annotationMemberValuePair_AST!=null &&annotationMemberValuePair_AST.getFirstChild()!=null ?
3893                annotationMemberValuePair_AST.getFirstChild() : annotationMemberValuePair_AST;
3894            currentAST.advanceChildToEnd();
3895        }
3896        returnAST = annotationMemberValuePair_AST;
3897    }
3898    
3899    public final void conditionalExpression(
3900        int lc_stmt
3901    ) throws RecognitionException, TokenStreamException {
3902        
3903        returnAST = null;
3904        ASTPair currentAST = new ASTPair();
3905        AST conditionalExpression_AST = null;
3906        
3907        logicalOrExpression(lc_stmt);
3908        astFactory.addASTChild(currentAST, returnAST);
3909        {
3910        switch ( LA(1)) {
3911        case QUESTION:
3912        {
3913            AST tmp108_AST = null;
3914            tmp108_AST = astFactory.create(LT(1));
3915            astFactory.makeASTRoot(currentAST, tmp108_AST);
3916            match(QUESTION);
3917            nls();
3918            assignmentExpression(0);
3919            astFactory.addASTChild(currentAST, returnAST);
3920            match(COLON);
3921            nls();
3922            conditionalExpression(0);
3923            astFactory.addASTChild(currentAST, returnAST);
3924            break;
3925        }
3926        case EOF:
3927        case IDENT:
3928        case LBRACK:
3929        case RBRACK:
3930        case LPAREN:
3931        case LITERAL_super:
3932        case COMMA:
3933        case LITERAL_void:
3934        case LITERAL_boolean:
3935        case LITERAL_byte:
3936        case LITERAL_char:
3937        case LITERAL_short:
3938        case LITERAL_int:
3939        case LITERAL_float:
3940        case LITERAL_long:
3941        case LITERAL_double:
3942        case LITERAL_any:
3943        case RPAREN:
3944        case ASSIGN:
3945        case LCURLY:
3946        case RCURLY:
3947        case SEMI:
3948        case NLS:
3949        case LITERAL_default:
3950        case LITERAL_this:
3951        case STRING_LITERAL:
3952        case CLOSURE_OP:
3953        case COLON:
3954        case LITERAL_else:
3955        case PLUS:
3956        case MINUS:
3957        case LITERAL_case:
3958        case PLUS_ASSIGN:
3959        case MINUS_ASSIGN:
3960        case STAR_ASSIGN:
3961        case DIV_ASSIGN:
3962        case MOD_ASSIGN:
3963        case SR_ASSIGN:
3964        case BSR_ASSIGN:
3965        case SL_ASSIGN:
3966        case BAND_ASSIGN:
3967        case BXOR_ASSIGN:
3968        case BOR_ASSIGN:
3969        case STAR_STAR_ASSIGN:
3970        case INC:
3971        case DEC:
3972        case BNOT:
3973        case LNOT:
3974        case DOLLAR:
3975        case STRING_CTOR_START:
3976        case LITERAL_new:
3977        case LITERAL_true:
3978        case LITERAL_false:
3979        case LITERAL_null:
3980        case NUM_INT:
3981        case NUM_FLOAT:
3982        case NUM_LONG:
3983        case NUM_DOUBLE:
3984        case NUM_BIG_INT:
3985        case NUM_BIG_DECIMAL:
3986        {
3987            break;
3988        }
3989        default:
3990        {
3991            throw new NoViableAltException(LT(1), getFilename());
3992        }
3993        }
3994        }
3995        conditionalExpression_AST = (AST)currentAST.root;
3996        returnAST = conditionalExpression_AST;
3997    }
3998    
3999    public final void annotationMemberArrayValueInitializer() throws RecognitionException, TokenStreamException {
4000        
4001        returnAST = null;
4002        ASTPair currentAST = new ASTPair();
4003        AST annotationMemberArrayValueInitializer_AST = null;
4004        
4005        switch ( LA(1)) {
4006        case IDENT:
4007        case LBRACK:
4008        case LPAREN:
4009        case LITERAL_super:
4010        case LITERAL_void:
4011        case LITERAL_boolean:
4012        case LITERAL_byte:
4013        case LITERAL_char:
4014        case LITERAL_short:
4015        case LITERAL_int:
4016        case LITERAL_float:
4017        case LITERAL_long:
4018        case LITERAL_double:
4019        case LITERAL_any:
4020        case LCURLY:
4021        case LITERAL_this:
4022        case STRING_LITERAL:
4023        case PLUS:
4024        case MINUS:
4025        case INC:
4026        case DEC:
4027        case BNOT:
4028        case LNOT:
4029        case DOLLAR:
4030        case STRING_CTOR_START:
4031        case LITERAL_new:
4032        case LITERAL_true:
4033        case LITERAL_false:
4034        case LITERAL_null:
4035        case NUM_INT:
4036        case NUM_FLOAT:
4037        case NUM_LONG:
4038        case NUM_DOUBLE:
4039        case NUM_BIG_INT:
4040        case NUM_BIG_DECIMAL:
4041        {
4042            conditionalExpression(0);
4043            astFactory.addASTChild(currentAST, returnAST);
4044            annotationMemberArrayValueInitializer_AST = (AST)currentAST.root;
4045            break;
4046        }
4047        case AT:
4048        {
4049            annotation();
4050            astFactory.addASTChild(currentAST, returnAST);
4051            nls();
4052            annotationMemberArrayValueInitializer_AST = (AST)currentAST.root;
4053            break;
4054        }
4055        default:
4056        {
4057            throw new NoViableAltException(LT(1), getFilename());
4058        }
4059        }
4060        returnAST = annotationMemberArrayValueInitializer_AST;
4061    }
4062    
4063    public final void superClassClause() throws RecognitionException, TokenStreamException {
4064        
4065        returnAST = null;
4066        ASTPair currentAST = new ASTPair();
4067        AST superClassClause_AST = null;
4068        AST c_AST = null;
4069        Token first = LT(1);
4070        
4071        {
4072        switch ( LA(1)) {
4073        case LITERAL_extends:
4074        {
4075            match(LITERAL_extends);
4076            nls();
4077            classOrInterfaceType(false);
4078            c_AST = (AST)returnAST;
4079            nls();
4080            break;
4081        }
4082        case LCURLY:
4083        case LITERAL_implements:
4084        {
4085            break;
4086        }
4087        default:
4088        {
4089            throw new NoViableAltException(LT(1), getFilename());
4090        }
4091        }
4092        }
4093        if ( inputState.guessing==0 ) {
4094            superClassClause_AST = (AST)currentAST.root;
4095            superClassClause_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXTENDS_CLAUSE,"EXTENDS_CLAUSE",first,LT(1))).add(c_AST));
4096            currentAST.root = superClassClause_AST;
4097            currentAST.child = superClassClause_AST!=null &&superClassClause_AST.getFirstChild()!=null ?
4098                superClassClause_AST.getFirstChild() : superClassClause_AST;
4099            currentAST.advanceChildToEnd();
4100        }
4101        returnAST = superClassClause_AST;
4102    }
4103    
4104    public final void typeParameters() throws RecognitionException, TokenStreamException {
4105        
4106        returnAST = null;
4107        ASTPair currentAST = new ASTPair();
4108        AST typeParameters_AST = null;
4109        Token first = LT(1);int currentLtLevel = 0;
4110        
4111        if ( inputState.guessing==0 ) {
4112            currentLtLevel = ltCounter;
4113        }
4114        match(LT);
4115        if ( inputState.guessing==0 ) {
4116            ltCounter++;
4117        }
4118        nls();
4119        typeParameter();
4120        astFactory.addASTChild(currentAST, returnAST);
4121        {
4122        _loop97:
4123        do {
4124            if ((LA(1)==COMMA)) {
4125                match(COMMA);
4126                nls();
4127                typeParameter();
4128                astFactory.addASTChild(currentAST, returnAST);
4129            }
4130            else {
4131                break _loop97;
4132            }
4133            
4134        } while (true);
4135        }
4136        nls();
4137        {
4138        switch ( LA(1)) {
4139        case GT:
4140        case SR:
4141        case BSR:
4142        {
4143            typeArgumentsOrParametersEnd();
4144            astFactory.addASTChild(currentAST, returnAST);
4145            break;
4146        }
4147        case IDENT:
4148        case LITERAL_extends:
4149        case LITERAL_void:
4150        case LITERAL_boolean:
4151        case LITERAL_byte:
4152        case LITERAL_char:
4153        case LITERAL_short:
4154        case LITERAL_int:
4155        case LITERAL_float:
4156        case LITERAL_long:
4157        case LITERAL_double:
4158        case LITERAL_any:
4159        case LCURLY:
4160        case LITERAL_implements:
4161        {
4162            break;
4163        }
4164        default:
4165        {
4166            throw new NoViableAltException(LT(1), getFilename());
4167        }
4168        }
4169        }
4170        if (!((currentLtLevel != 0) || ltCounter == currentLtLevel))
4171          throw new SemanticException("(currentLtLevel != 0) || ltCounter == currentLtLevel");
4172        if ( inputState.guessing==0 ) {
4173            typeParameters_AST = (AST)currentAST.root;
4174            typeParameters_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_PARAMETERS,"TYPE_PARAMETERS",first,LT(1))).add(typeParameters_AST));
4175            currentAST.root = typeParameters_AST;
4176            currentAST.child = typeParameters_AST!=null &&typeParameters_AST.getFirstChild()!=null ?
4177                typeParameters_AST.getFirstChild() : typeParameters_AST;
4178            currentAST.advanceChildToEnd();
4179        }
4180        typeParameters_AST = (AST)currentAST.root;
4181        returnAST = typeParameters_AST;
4182    }
4183    
4184    public final void implementsClause() throws RecognitionException, TokenStreamException {
4185        
4186        returnAST = null;
4187        ASTPair currentAST = new ASTPair();
4188        AST implementsClause_AST = null;
4189        Token i = null;
4190        AST i_AST = null;
4191        Token first = LT(1);
4192        
4193        {
4194        switch ( LA(1)) {
4195        case LITERAL_implements:
4196        {
4197            i = LT(1);
4198            i_AST = astFactory.create(i);
4199            match(LITERAL_implements);
4200            nls();
4201            classOrInterfaceType(false);
4202            astFactory.addASTChild(currentAST, returnAST);
4203            {
4204            _loop163:
4205            do {
4206                if ((LA(1)==COMMA)) {
4207                    match(COMMA);
4208                    nls();
4209                    classOrInterfaceType(false);
4210                    astFactory.addASTChild(currentAST, returnAST);
4211                }
4212                else {
4213                    break _loop163;
4214                }
4215                
4216            } while (true);
4217            }
4218            nls();
4219            break;
4220        }
4221        case LCURLY:
4222        {
4223            break;
4224        }
4225        default:
4226        {
4227            throw new NoViableAltException(LT(1), getFilename());
4228        }
4229        }
4230        }
4231        if ( inputState.guessing==0 ) {
4232            implementsClause_AST = (AST)currentAST.root;
4233            implementsClause_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(IMPLEMENTS_CLAUSE,"IMPLEMENTS_CLAUSE",first,LT(1))).add(implementsClause_AST));
4234            currentAST.root = implementsClause_AST;
4235            currentAST.child = implementsClause_AST!=null &&implementsClause_AST.getFirstChild()!=null ?
4236                implementsClause_AST.getFirstChild() : implementsClause_AST;
4237            currentAST.advanceChildToEnd();
4238        }
4239        implementsClause_AST = (AST)currentAST.root;
4240        returnAST = implementsClause_AST;
4241    }
4242    
4243    public final void classBlock() throws RecognitionException, TokenStreamException {
4244        
4245        returnAST = null;
4246        ASTPair currentAST = new ASTPair();
4247        AST classBlock_AST = null;
4248        Token first = LT(1);
4249        
4250        match(LCURLY);
4251        {
4252        switch ( LA(1)) {
4253        case FINAL:
4254        case ABSTRACT:
4255        case STRICTFP:
4256        case LITERAL_static:
4257        case LITERAL_def:
4258        case AT:
4259        case IDENT:
4260        case LITERAL_class:
4261        case LITERAL_interface:
4262        case LITERAL_enum:
4263        case LITERAL_void:
4264        case LITERAL_boolean:
4265        case LITERAL_byte:
4266        case LITERAL_char:
4267        case LITERAL_short:
4268        case LITERAL_int:
4269        case LITERAL_float:
4270        case LITERAL_long:
4271        case LITERAL_double:
4272        case LITERAL_any:
4273        case LITERAL_private:
4274        case LITERAL_public:
4275        case LITERAL_protected:
4276        case LITERAL_transient:
4277        case LITERAL_native:
4278        case LITERAL_threadsafe:
4279        case LITERAL_synchronized:
4280        case LITERAL_volatile:
4281        case LCURLY:
4282        {
4283            classField();
4284            astFactory.addASTChild(currentAST, returnAST);
4285            break;
4286        }
4287        case RCURLY:
4288        case SEMI:
4289        case NLS:
4290        {
4291            break;
4292        }
4293        default:
4294        {
4295            throw new NoViableAltException(LT(1), getFilename());
4296        }
4297        }
4298        }
4299        {
4300        _loop109:
4301        do {
4302            if ((LA(1)==SEMI||LA(1)==NLS)) {
4303                sep();
4304                {
4305                switch ( LA(1)) {
4306                case FINAL:
4307                case ABSTRACT:
4308                case STRICTFP:
4309                case LITERAL_static:
4310                case LITERAL_def:
4311                case AT:
4312                case IDENT:
4313                case LITERAL_class:
4314                case LITERAL_interface:
4315                case LITERAL_enum:
4316                case LITERAL_void:
4317                case LITERAL_boolean:
4318                case LITERAL_byte:
4319                case LITERAL_char:
4320                case LITERAL_short:
4321                case LITERAL_int:
4322                case LITERAL_float:
4323                case LITERAL_long:
4324                case LITERAL_double:
4325                case LITERAL_any:
4326                case LITERAL_private:
4327                case LITERAL_public:
4328                case LITERAL_protected:
4329                case LITERAL_transient:
4330                case LITERAL_native:
4331                case LITERAL_threadsafe:
4332                case LITERAL_synchronized:
4333                case LITERAL_volatile:
4334                case LCURLY:
4335                {
4336                    classField();
4337                    astFactory.addASTChild(currentAST, returnAST);
4338                    break;
4339                }
4340                case RCURLY:
4341                case SEMI:
4342                case NLS:
4343                {
4344                    break;
4345                }
4346                default:
4347                {
4348                    throw new NoViableAltException(LT(1), getFilename());
4349                }
4350                }
4351                }
4352            }
4353            else {
4354                break _loop109;
4355            }
4356            
4357        } while (true);
4358        }
4359        match(RCURLY);
4360        if ( inputState.guessing==0 ) {
4361            classBlock_AST = (AST)currentAST.root;
4362            classBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(classBlock_AST));
4363            currentAST.root = classBlock_AST;
4364            currentAST.child = classBlock_AST!=null &&classBlock_AST.getFirstChild()!=null ?
4365                classBlock_AST.getFirstChild() : classBlock_AST;
4366            currentAST.advanceChildToEnd();
4367        }
4368        classBlock_AST = (AST)currentAST.root;
4369        returnAST = classBlock_AST;
4370    }
4371    
4372    public final void interfaceExtends() throws RecognitionException, TokenStreamException {
4373        
4374        returnAST = null;
4375        ASTPair currentAST = new ASTPair();
4376        AST interfaceExtends_AST = null;
4377        Token e = null;
4378        AST e_AST = null;
4379        Token first = LT(1);
4380        
4381        {
4382        switch ( LA(1)) {
4383        case LITERAL_extends:
4384        {
4385            e = LT(1);
4386            e_AST = astFactory.create(e);
4387            match(LITERAL_extends);
4388            nls();
4389            classOrInterfaceType(false);
4390            astFactory.addASTChild(currentAST, returnAST);
4391            {
4392            _loop159:
4393            do {
4394                if ((LA(1)==COMMA)) {
4395                    match(COMMA);
4396                    nls();
4397                    classOrInterfaceType(false);
4398                    astFactory.addASTChild(currentAST, returnAST);
4399                }
4400                else {
4401                    break _loop159;
4402                }
4403                
4404            } while (true);
4405            }
4406            nls();
4407            break;
4408        }
4409        case LCURLY:
4410        {
4411            break;
4412        }
4413        default:
4414        {
4415            throw new NoViableAltException(LT(1), getFilename());
4416        }
4417        }
4418        }
4419        if ( inputState.guessing==0 ) {
4420            interfaceExtends_AST = (AST)currentAST.root;
4421            interfaceExtends_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(EXTENDS_CLAUSE,"EXTENDS_CLAUSE",first,LT(1))).add(interfaceExtends_AST));
4422            currentAST.root = interfaceExtends_AST;
4423            currentAST.child = interfaceExtends_AST!=null &&interfaceExtends_AST.getFirstChild()!=null ?
4424                interfaceExtends_AST.getFirstChild() : interfaceExtends_AST;
4425            currentAST.advanceChildToEnd();
4426        }
4427        interfaceExtends_AST = (AST)currentAST.root;
4428        returnAST = interfaceExtends_AST;
4429    }
4430    
4431    public final void interfaceBlock() throws RecognitionException, TokenStreamException {
4432        
4433        returnAST = null;
4434        ASTPair currentAST = new ASTPair();
4435        AST interfaceBlock_AST = null;
4436        Token first = LT(1);
4437        
4438        match(LCURLY);
4439        {
4440        switch ( LA(1)) {
4441        case FINAL:
4442        case ABSTRACT:
4443        case STRICTFP:
4444        case LITERAL_static:
4445        case LITERAL_def:
4446        case AT:
4447        case IDENT:
4448        case LITERAL_class:
4449        case LITERAL_interface:
4450        case LITERAL_enum:
4451        case LITERAL_void:
4452        case LITERAL_boolean:
4453        case LITERAL_byte:
4454        case LITERAL_char:
4455        case LITERAL_short:
4456        case LITERAL_int:
4457        case LITERAL_float:
4458        case LITERAL_long:
4459        case LITERAL_double:
4460        case LITERAL_any:
4461        case LITERAL_private:
4462        case LITERAL_public:
4463        case LITERAL_protected:
4464        case LITERAL_transient:
4465        case LITERAL_native:
4466        case LITERAL_threadsafe:
4467        case LITERAL_synchronized:
4468        case LITERAL_volatile:
4469        {
4470            interfaceField();
4471            astFactory.addASTChild(currentAST, returnAST);
4472            break;
4473        }
4474        case RCURLY:
4475        case SEMI:
4476        case NLS:
4477        {
4478            break;
4479        }
4480        default:
4481        {
4482            throw new NoViableAltException(LT(1), getFilename());
4483        }
4484        }
4485        }
4486        {
4487        _loop114:
4488        do {
4489            if ((LA(1)==SEMI||LA(1)==NLS)) {
4490                sep();
4491                {
4492                switch ( LA(1)) {
4493                case FINAL:
4494                case ABSTRACT:
4495                case STRICTFP:
4496                case LITERAL_static:
4497                case LITERAL_def:
4498                case AT:
4499                case IDENT:
4500                case LITERAL_class:
4501                case LITERAL_interface:
4502                case LITERAL_enum:
4503                case LITERAL_void:
4504                case LITERAL_boolean:
4505                case LITERAL_byte:
4506                case LITERAL_char:
4507                case LITERAL_short:
4508                case LITERAL_int:
4509                case LITERAL_float:
4510                case LITERAL_long:
4511                case LITERAL_double:
4512                case LITERAL_any:
4513                case LITERAL_private:
4514                case LITERAL_public:
4515                case LITERAL_protected:
4516                case LITERAL_transient:
4517                case LITERAL_native:
4518                case LITERAL_threadsafe:
4519                case LITERAL_synchronized:
4520                case LITERAL_volatile:
4521                {
4522                    interfaceField();
4523                    astFactory.addASTChild(currentAST, returnAST);
4524                    break;
4525                }
4526                case RCURLY:
4527                case SEMI:
4528                case NLS:
4529                {
4530                    break;
4531                }
4532                default:
4533                {
4534                    throw new NoViableAltException(LT(1), getFilename());
4535                }
4536                }
4537                }
4538            }
4539            else {
4540                break _loop114;
4541            }
4542            
4543        } while (true);
4544        }
4545        match(RCURLY);
4546        if ( inputState.guessing==0 ) {
4547            interfaceBlock_AST = (AST)currentAST.root;
4548            interfaceBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(interfaceBlock_AST));
4549            currentAST.root = interfaceBlock_AST;
4550            currentAST.child = interfaceBlock_AST!=null &&interfaceBlock_AST.getFirstChild()!=null ?
4551                interfaceBlock_AST.getFirstChild() : interfaceBlock_AST;
4552            currentAST.advanceChildToEnd();
4553        }
4554        interfaceBlock_AST = (AST)currentAST.root;
4555        returnAST = interfaceBlock_AST;
4556    }
4557    
4558    public final void enumBlock() throws RecognitionException, TokenStreamException {
4559        
4560        returnAST = null;
4561        ASTPair currentAST = new ASTPair();
4562        AST enumBlock_AST = null;
4563        Token first = LT(1);
4564        
4565        match(LCURLY);
4566        {
4567        boolean synPredMatched123 = false;
4568        if (((LA(1)==AT||LA(1)==IDENT) && (_tokenSet_47.member(LA(2))) && (_tokenSet_48.member(LA(3))))) {
4569            int _m123 = mark();
4570            synPredMatched123 = true;
4571            inputState.guessing++;
4572            try {
4573                {
4574                enumConstantsStart();
4575                }
4576            }
4577            catch (RecognitionException pe) {
4578                synPredMatched123 = false;
4579            }
4580            rewind(_m123);
4581            inputState.guessing--;
4582        }
4583        if ( synPredMatched123 ) {
4584            enumConstants();
4585            astFactory.addASTChild(currentAST, returnAST);
4586        }
4587        else if ((_tokenSet_49.member(LA(1))) && (_tokenSet_50.member(LA(2))) && (_tokenSet_18.member(LA(3)))) {
4588            {
4589            switch ( LA(1)) {
4590            case FINAL:
4591            case ABSTRACT:
4592            case STRICTFP:
4593            case LITERAL_static:
4594            case LITERAL_def:
4595            case AT:
4596            case IDENT:
4597            case LITERAL_class:
4598            case LITERAL_interface:
4599            case LITERAL_enum:
4600            case LITERAL_void:
4601            case LITERAL_boolean:
4602            case LITERAL_byte:
4603            case LITERAL_char:
4604            case LITERAL_short:
4605            case LITERAL_int:
4606            case LITERAL_float:
4607            case LITERAL_long:
4608            case LITERAL_double:
4609            case LITERAL_any:
4610            case LITERAL_private:
4611            case LITERAL_public:
4612            case LITERAL_protected:
4613            case LITERAL_transient:
4614            case LITERAL_native:
4615            case LITERAL_threadsafe:
4616            case LITERAL_synchronized:
4617            case LITERAL_volatile:
4618            case LCURLY:
4619            {
4620                classField();
4621                astFactory.addASTChild(currentAST, returnAST);
4622                break;
4623            }
4624            case RCURLY:
4625            case SEMI:
4626            case NLS:
4627            {
4628                break;
4629            }
4630            default:
4631            {
4632                throw new NoViableAltException(LT(1), getFilename());
4633            }
4634            }
4635            }
4636        }
4637        else {
4638            throw new NoViableAltException(LT(1), getFilename());
4639        }
4640        
4641        }
4642        {
4643        _loop127:
4644        do {
4645            if ((LA(1)==SEMI||LA(1)==NLS)) {
4646                sep();
4647                {
4648                switch ( LA(1)) {
4649                case FINAL:
4650                case ABSTRACT:
4651                case STRICTFP:
4652                case LITERAL_static:
4653                case LITERAL_def:
4654                case AT:
4655                case IDENT:
4656                case LITERAL_class:
4657                case LITERAL_interface:
4658                case LITERAL_enum:
4659                case LITERAL_void:
4660                case LITERAL_boolean:
4661                case LITERAL_byte:
4662                case LITERAL_char:
4663                case LITERAL_short:
4664                case LITERAL_int:
4665                case LITERAL_float:
4666                case LITERAL_long:
4667                case LITERAL_double:
4668                case LITERAL_any:
4669                case LITERAL_private:
4670                case LITERAL_public:
4671                case LITERAL_protected:
4672                case LITERAL_transient:
4673                case LITERAL_native:
4674                case LITERAL_threadsafe:
4675                case LITERAL_synchronized:
4676                case LITERAL_volatile:
4677                case LCURLY:
4678                {
4679                    classField();
4680                    astFactory.addASTChild(currentAST, returnAST);
4681                    break;
4682                }
4683                case RCURLY:
4684                case SEMI:
4685                case NLS:
4686                {
4687                    break;
4688                }
4689                default:
4690                {
4691                    throw new NoViableAltException(LT(1), getFilename());
4692                }
4693                }
4694                }
4695            }
4696            else {
4697                break _loop127;
4698            }
4699            
4700        } while (true);
4701        }
4702        match(RCURLY);
4703        if ( inputState.guessing==0 ) {
4704            enumBlock_AST = (AST)currentAST.root;
4705            enumBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(enumBlock_AST));
4706            currentAST.root = enumBlock_AST;
4707            currentAST.child = enumBlock_AST!=null &&enumBlock_AST.getFirstChild()!=null ?
4708                enumBlock_AST.getFirstChild() : enumBlock_AST;
4709            currentAST.advanceChildToEnd();
4710        }
4711        enumBlock_AST = (AST)currentAST.root;
4712        returnAST = enumBlock_AST;
4713    }
4714    
4715    public final void annotationBlock() throws RecognitionException, TokenStreamException {
4716        
4717        returnAST = null;
4718        ASTPair currentAST = new ASTPair();
4719        AST annotationBlock_AST = null;
4720        Token first = LT(1);
4721        
4722        match(LCURLY);
4723        {
4724        switch ( LA(1)) {
4725        case FINAL:
4726        case ABSTRACT:
4727        case STRICTFP:
4728        case LITERAL_static:
4729        case LITERAL_def:
4730        case AT:
4731        case IDENT:
4732        case LITERAL_class:
4733        case LITERAL_interface:
4734        case LITERAL_enum:
4735        case LITERAL_void:
4736        case LITERAL_boolean:
4737        case LITERAL_byte:
4738        case LITERAL_char:
4739        case LITERAL_short:
4740        case LITERAL_int:
4741        case LITERAL_float:
4742        case LITERAL_long:
4743        case LITERAL_double:
4744        case LITERAL_any:
4745        case LITERAL_private:
4746        case LITERAL_public:
4747        case LITERAL_protected:
4748        case LITERAL_transient:
4749        case LITERAL_native:
4750        case LITERAL_threadsafe:
4751        case LITERAL_synchronized:
4752        case LITERAL_volatile:
4753        {
4754            annotationField();
4755            astFactory.addASTChild(currentAST, returnAST);
4756            break;
4757        }
4758        case RCURLY:
4759        case SEMI:
4760        case NLS:
4761        {
4762            break;
4763        }
4764        default:
4765        {
4766            throw new NoViableAltException(LT(1), getFilename());
4767        }
4768        }
4769        }
4770        {
4771        _loop119:
4772        do {
4773            if ((LA(1)==SEMI||LA(1)==NLS)) {
4774                sep();
4775                {
4776                switch ( LA(1)) {
4777                case FINAL:
4778                case ABSTRACT:
4779                case STRICTFP:
4780                case LITERAL_static:
4781                case LITERAL_def:
4782                case AT:
4783                case IDENT:
4784                case LITERAL_class:
4785                case LITERAL_interface:
4786                case LITERAL_enum:
4787                case LITERAL_void:
4788                case LITERAL_boolean:
4789                case LITERAL_byte:
4790                case LITERAL_char:
4791                case LITERAL_short:
4792                case LITERAL_int:
4793                case LITERAL_float:
4794                case LITERAL_long:
4795                case LITERAL_double:
4796                case LITERAL_any:
4797                case LITERAL_private:
4798                case LITERAL_public:
4799                case LITERAL_protected:
4800                case LITERAL_transient:
4801                case LITERAL_native:
4802                case LITERAL_threadsafe:
4803                case LITERAL_synchronized:
4804                case LITERAL_volatile:
4805                {
4806                    annotationField();
4807                    astFactory.addASTChild(currentAST, returnAST);
4808                    break;
4809                }
4810                case RCURLY:
4811                case SEMI:
4812                case NLS:
4813                {
4814                    break;
4815                }
4816                default:
4817                {
4818                    throw new NoViableAltException(LT(1), getFilename());
4819                }
4820                }
4821                }
4822            }
4823            else {
4824                break _loop119;
4825            }
4826            
4827        } while (true);
4828        }
4829        match(RCURLY);
4830        if ( inputState.guessing==0 ) {
4831            annotationBlock_AST = (AST)currentAST.root;
4832            annotationBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(annotationBlock_AST));
4833            currentAST.root = annotationBlock_AST;
4834            currentAST.child = annotationBlock_AST!=null &&annotationBlock_AST.getFirstChild()!=null ?
4835                annotationBlock_AST.getFirstChild() : annotationBlock_AST;
4836            currentAST.advanceChildToEnd();
4837        }
4838        annotationBlock_AST = (AST)currentAST.root;
4839        returnAST = annotationBlock_AST;
4840    }
4841    
4842    public final void typeParameter() throws RecognitionException, TokenStreamException {
4843        
4844        returnAST = null;
4845        ASTPair currentAST = new ASTPair();
4846        AST typeParameter_AST = null;
4847        Token id = null;
4848        AST id_AST = null;
4849        Token first = LT(1);
4850        
4851        {
4852        id = LT(1);
4853        id_AST = astFactory.create(id);
4854        astFactory.addASTChild(currentAST, id_AST);
4855        match(IDENT);
4856        }
4857        {
4858        if ((LA(1)==LITERAL_extends) && (LA(2)==IDENT||LA(2)==NLS) && (_tokenSet_51.member(LA(3)))) {
4859            typeParameterBounds();
4860            astFactory.addASTChild(currentAST, returnAST);
4861        }
4862        else if ((_tokenSet_52.member(LA(1))) && (_tokenSet_53.member(LA(2))) && (_tokenSet_54.member(LA(3)))) {
4863        }
4864        else {
4865            throw new NoViableAltException(LT(1), getFilename());
4866        }
4867        
4868        }
4869        if ( inputState.guessing==0 ) {
4870            typeParameter_AST = (AST)currentAST.root;
4871            typeParameter_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_PARAMETER,"TYPE_PARAMETER",first,LT(1))).add(typeParameter_AST));
4872            currentAST.root = typeParameter_AST;
4873            currentAST.child = typeParameter_AST!=null &&typeParameter_AST.getFirstChild()!=null ?
4874                typeParameter_AST.getFirstChild() : typeParameter_AST;
4875            currentAST.advanceChildToEnd();
4876        }
4877        typeParameter_AST = (AST)currentAST.root;
4878        returnAST = typeParameter_AST;
4879    }
4880    
4881    public final void typeParameterBounds() throws RecognitionException, TokenStreamException {
4882        
4883        returnAST = null;
4884        ASTPair currentAST = new ASTPair();
4885        AST typeParameterBounds_AST = null;
4886        Token first = LT(1);
4887        
4888        match(LITERAL_extends);
4889        nls();
4890        classOrInterfaceType(false);
4891        astFactory.addASTChild(currentAST, returnAST);
4892        {
4893        _loop104:
4894        do {
4895            if ((LA(1)==BAND)) {
4896                match(BAND);
4897                nls();
4898                classOrInterfaceType(false);
4899                astFactory.addASTChild(currentAST, returnAST);
4900            }
4901            else {
4902                break _loop104;
4903            }
4904            
4905        } while (true);
4906        }
4907        if ( inputState.guessing==0 ) {
4908            typeParameterBounds_AST = (AST)currentAST.root;
4909            typeParameterBounds_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(TYPE_UPPER_BOUNDS,"TYPE_UPPER_BOUNDS",first,LT(1))).add(typeParameterBounds_AST));
4910            currentAST.root = typeParameterBounds_AST;
4911            currentAST.child = typeParameterBounds_AST!=null &&typeParameterBounds_AST.getFirstChild()!=null ?
4912                typeParameterBounds_AST.getFirstChild() : typeParameterBounds_AST;
4913            currentAST.advanceChildToEnd();
4914        }
4915        typeParameterBounds_AST = (AST)currentAST.root;
4916        returnAST = typeParameterBounds_AST;
4917    }
4918    
4919    public final void classField() throws RecognitionException, TokenStreamException {
4920        
4921        returnAST = null;
4922        ASTPair currentAST = new ASTPair();
4923        AST classField_AST = null;
4924        AST mc_AST = null;
4925        AST ctor_AST = null;
4926        AST d_AST = null;
4927        AST mods_AST = null;
4928        AST td_AST = null;
4929        AST s3_AST = null;
4930        AST s4_AST = null;
4931        Token first = LT(1);
4932        
4933        boolean synPredMatched166 = false;
4934        if (((_tokenSet_55.member(LA(1))) && (_tokenSet_56.member(LA(2))) && (_tokenSet_57.member(LA(3))))) {
4935            int _m166 = mark();
4936            synPredMatched166 = true;
4937            inputState.guessing++;
4938            try {
4939                {
4940                constructorStart();
4941                }
4942            }
4943            catch (RecognitionException pe) {
4944                synPredMatched166 = false;
4945            }
4946            rewind(_m166);
4947            inputState.guessing--;
4948        }
4949        if ( synPredMatched166 ) {
4950            modifiersOpt();
4951            mc_AST = (AST)returnAST;
4952            constructorDefinition(mc_AST);
4953            ctor_AST = (AST)returnAST;
4954            if ( inputState.guessing==0 ) {
4955                classField_AST = (AST)currentAST.root;
4956                classField_AST = ctor_AST;
4957                currentAST.root = classField_AST;
4958                currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
4959                    classField_AST.getFirstChild() : classField_AST;
4960                currentAST.advanceChildToEnd();
4961            }
4962        }
4963        else {
4964            boolean synPredMatched168 = false;
4965            if (((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2))) && (_tokenSet_58.member(LA(3))))) {
4966                int _m168 = mark();
4967                synPredMatched168 = true;
4968                inputState.guessing++;
4969                try {
4970                    {
4971                    declarationStart();
4972                    }
4973                }
4974                catch (RecognitionException pe) {
4975                    synPredMatched168 = false;
4976                }
4977                rewind(_m168);
4978                inputState.guessing--;
4979            }
4980            if ( synPredMatched168 ) {
4981                declaration();
4982                d_AST = (AST)returnAST;
4983                if ( inputState.guessing==0 ) {
4984                    classField_AST = (AST)currentAST.root;
4985                    classField_AST = d_AST;
4986                    currentAST.root = classField_AST;
4987                    currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
4988                        classField_AST.getFirstChild() : classField_AST;
4989                    currentAST.advanceChildToEnd();
4990                }
4991            }
4992            else {
4993                boolean synPredMatched170 = false;
4994                if (((_tokenSet_21.member(LA(1))) && (_tokenSet_22.member(LA(2))) && (_tokenSet_23.member(LA(3))))) {
4995                    int _m170 = mark();
4996                    synPredMatched170 = true;
4997                    inputState.guessing++;
4998                    try {
4999                        {
5000                        typeDeclarationStart();
5001                        }
5002                    }
5003                    catch (RecognitionException pe) {
5004                        synPredMatched170 = false;
5005                    }
5006                    rewind(_m170);
5007                    inputState.guessing--;
5008                }
5009                if ( synPredMatched170 ) {
5010                    modifiersOpt();
5011                    mods_AST = (AST)returnAST;
5012                    {
5013                    typeDefinitionInternal(mods_AST);
5014                    td_AST = (AST)returnAST;
5015                    if ( inputState.guessing==0 ) {
5016                        classField_AST = (AST)currentAST.root;
5017                        classField_AST = td_AST;
5018                        currentAST.root = classField_AST;
5019                        currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
5020                            classField_AST.getFirstChild() : classField_AST;
5021                        currentAST.advanceChildToEnd();
5022                    }
5023                    }
5024                }
5025                else if ((LA(1)==LITERAL_static) && (LA(2)==LCURLY)) {
5026                    match(LITERAL_static);
5027                    compoundStatement();
5028                    s3_AST = (AST)returnAST;
5029                    if ( inputState.guessing==0 ) {
5030                        classField_AST = (AST)currentAST.root;
5031                        classField_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(STATIC_INIT,"STATIC_INIT",first,LT(1))).add(s3_AST));
5032                        currentAST.root = classField_AST;
5033                        currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
5034                            classField_AST.getFirstChild() : classField_AST;
5035                        currentAST.advanceChildToEnd();
5036                    }
5037                }
5038                else if ((LA(1)==LCURLY)) {
5039                    compoundStatement();
5040                    s4_AST = (AST)returnAST;
5041                    if ( inputState.guessing==0 ) {
5042                        classField_AST = (AST)currentAST.root;
5043                        classField_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(INSTANCE_INIT,"INSTANCE_INIT",first,LT(1))).add(s4_AST));
5044                        currentAST.root = classField_AST;
5045                        currentAST.child = classField_AST!=null &&classField_AST.getFirstChild()!=null ?
5046                            classField_AST.getFirstChild() : classField_AST;
5047                        currentAST.advanceChildToEnd();
5048                    }
5049                }
5050                else {
5051                    throw new NoViableAltException(LT(1), getFilename());
5052                }
5053                }}
5054                returnAST = classField_AST;
5055            }
5056            
5057    public final void interfaceField() throws RecognitionException, TokenStreamException {
5058        
5059        returnAST = null;
5060        ASTPair currentAST = new ASTPair();
5061        AST interfaceField_AST = null;
5062        AST d_AST = null;
5063        AST mods_AST = null;
5064        AST td_AST = null;
5065        
5066        boolean synPredMatched174 = false;
5067        if (((_tokenSet_12.member(LA(1))) && (_tokenSet_13.member(LA(2))) && (_tokenSet_58.member(LA(3))))) {
5068            int _m174 = mark();
5069            synPredMatched174 = true;
5070            inputState.guessing++;
5071            try {
5072                {
5073                declarationStart();
5074                }
5075            }
5076            catch (RecognitionException pe) {
5077                synPredMatched174 = false;
5078            }
5079            rewind(_m174);
5080            inputState.guessing--;
5081        }
5082        if ( synPredMatched174 ) {
5083            declaration();
5084            d_AST = (AST)returnAST;
5085            if ( inputState.guessing==0 ) {
5086                interfaceField_AST = (AST)currentAST.root;
5087                interfaceField_AST = d_AST;
5088                currentAST.root = interfaceField_AST;
5089                currentAST.child = interfaceField_AST!=null &&interfaceField_AST.getFirstChild()!=null ?
5090                    interfaceField_AST.getFirstChild() : interfaceField_AST;
5091                currentAST.advanceChildToEnd();
5092            }
5093        }
5094        else {
5095            boolean synPredMatched176 = false;
5096            if (((_tokenSet_21.member(LA(1))) && (_tokenSet_22.member(LA(2))) && (_tokenSet_23.member(LA(3))))) {
5097                int _m176 = mark();
5098                synPredMatched176 = true;
5099                inputState.guessing++;
5100                try {
5101                    {
5102                    typeDeclarationStart();
5103                    }
5104                }
5105                catch (RecognitionException pe) {
5106                    synPredMatched176 = false;
5107                }
5108                rewind(_m176);
5109                inputState.guessing--;
5110            }
5111            if ( synPredMatched176 ) {
5112                modifiersOpt();
5113                mods_AST = (AST)returnAST;
5114                {
5115                typeDefinitionInternal(mods_AST);
5116                td_AST = (AST)returnAST;
5117                if ( inputState.guessing==0 ) {
5118                    interfaceField_AST = (AST)currentAST.root;
5119                    interfaceField_AST = td_AST;
5120                    currentAST.root = interfaceField_AST;
5121                    currentAST.child = interfaceField_AST!=null &&interfaceField_AST.getFirstChild()!=null ?
5122                        interfaceField_AST.getFirstChild() : interfaceField_AST;
5123                    currentAST.advanceChildToEnd();
5124                }
5125                }
5126            }
5127            else {
5128                throw new NoViableAltException(LT(1), getFilename());
5129            }
5130            }
5131            returnAST = interfaceField_AST;
5132        }
5133        
5134    public final void annotationField() throws RecognitionException, TokenStreamException {
5135        
5136        returnAST = null;
5137        ASTPair currentAST = new ASTPair();
5138        AST annotationField_AST = null;
5139        AST mods_AST = null;
5140        AST td_AST = null;
5141        AST t_AST = null;
5142        Token i = null;
5143        AST i_AST = null;
5144        AST amvi_AST = null;
5145        AST v_AST = null;
5146        Token first = LT(1);
5147        
5148        modifiersOpt();
5149        mods_AST = (AST)returnAST;
5150        {
5151        switch ( LA(1)) {
5152        case AT:
5153        case LITERAL_class:
5154        case LITERAL_interface:
5155        case LITERAL_enum:
5156        {
5157            typeDefinitionInternal(mods_AST);
5158            td_AST = (AST)returnAST;
5159            if ( inputState.guessing==0 ) {
5160                annotationField_AST = (AST)currentAST.root;
5161                annotationField_AST = td_AST;
5162                currentAST.root = annotationField_AST;
5163                currentAST.child = annotationField_AST!=null &&annotationField_AST.getFirstChild()!=null ?
5164                    annotationField_AST.getFirstChild() : annotationField_AST;
5165                currentAST.advanceChildToEnd();
5166            }
5167            break;
5168        }
5169        case IDENT:
5170        case LITERAL_void:
5171        case LITERAL_boolean:
5172        case LITERAL_byte:
5173        case LITERAL_char:
5174        case LITERAL_short:
5175        case LITERAL_int:
5176        case LITERAL_float:
5177        case LITERAL_long:
5178        case LITERAL_double:
5179        case LITERAL_any:
5180        {
5181            typeSpec(false);
5182            t_AST = (AST)returnAST;
5183            {
5184            boolean synPredMatched138 = false;
5185            if (((LA(1)==IDENT) && (LA(2)==LPAREN) && (LA(3)==RPAREN))) {
5186                int _m138 = mark();
5187                synPredMatched138 = true;
5188                inputState.guessing++;
5189                try {
5190                    {
5191                    match(IDENT);
5192                    match(LPAREN);
5193                    }
5194                }
5195                catch (RecognitionException pe) {
5196                    synPredMatched138 = false;
5197                }
5198                rewind(_m138);
5199                inputState.guessing--;
5200            }
5201            if ( synPredMatched138 ) {
5202                i = LT(1);
5203                i_AST = astFactory.create(i);
5204                match(IDENT);
5205                match(LPAREN);
5206                match(RPAREN);
5207                {
5208                switch ( LA(1)) {
5209                case LITERAL_default:
5210                {
5211                    match(LITERAL_default);
5212                    nls();
5213                    annotationMemberValueInitializer();
5214                    amvi_AST = (AST)returnAST;
5215                    break;
5216                }
5217                case RCURLY:
5218                case SEMI:
5219                case NLS:
5220                {
5221                    break;
5222                }
5223                default:
5224                {
5225                    throw new NoViableAltException(LT(1), getFilename());
5226                }
5227                }
5228                }
5229                if ( inputState.guessing==0 ) {
5230                    annotationField_AST = (AST)currentAST.root;
5231                    annotationField_AST =
5232                    (AST)astFactory.make( (new ASTArray(5)).add(create(ANNOTATION_FIELD_DEF,"ANNOTATION_FIELD_DEF",first,LT(1))).add(mods_AST).add((AST)astFactory.make( (new ASTArray(2)).add(create(TYPE,"TYPE",first,LT(1))).add(t_AST))).add(i_AST).add(amvi_AST));
5233                    currentAST.root = annotationField_AST;
5234                    currentAST.child = annotationField_AST!=null &&annotationField_AST.getFirstChild()!=null ?
5235                        annotationField_AST.getFirstChild() : annotationField_AST;
5236                    currentAST.advanceChildToEnd();
5237                }
5238            }
5239            else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (_tokenSet_59.member(LA(2))) && (_tokenSet_60.member(LA(3)))) {
5240                variableDefinitions(mods_AST,t_AST);
5241                v_AST = (AST)returnAST;
5242                if ( inputState.guessing==0 ) {
5243                    annotationField_AST = (AST)currentAST.root;
5244                    annotationField_AST = v_AST;
5245                    currentAST.root = annotationField_AST;
5246                    currentAST.child = annotationField_AST!=null &&annotationField_AST.getFirstChild()!=null ?
5247                        annotationField_AST.getFirstChild() : annotationField_AST;
5248                    currentAST.advanceChildToEnd();
5249                }
5250            }
5251            else {
5252                throw new NoViableAltException(LT(1), getFilename());
5253            }
5254            
5255            }
5256            break;
5257        }
5258        default:
5259        {
5260            throw new NoViableAltException(LT(1), getFilename());
5261        }
5262        }
5263        }
5264        returnAST = annotationField_AST;
5265    }
5266    
5267/** Guard for enumConstants. */
5268    public final void enumConstantsStart() throws RecognitionException, TokenStreamException {
5269        
5270        returnAST = null;
5271        ASTPair currentAST = new ASTPair();
5272        AST enumConstantsStart_AST = null;
5273        
5274        enumConstant();
5275        astFactory.addASTChild(currentAST, returnAST);
5276        {
5277        switch ( LA(1)) {
5278        case COMMA:
5279        {
5280            AST tmp129_AST = null;
5281            tmp129_AST = astFactory.create(LT(1));
5282            astFactory.addASTChild(currentAST, tmp129_AST);
5283            match(COMMA);
5284            break;
5285        }
5286        case SEMI:
5287        {
5288            AST tmp130_AST = null;
5289            tmp130_AST = astFactory.create(LT(1));
5290            astFactory.addASTChild(currentAST, tmp130_AST);
5291            match(SEMI);
5292            break;
5293        }
5294        case NLS:
5295        {
5296            AST tmp131_AST = null;
5297            tmp131_AST = astFactory.create(LT(1));
5298            astFactory.addASTChild(currentAST, tmp131_AST);
5299            match(NLS);
5300            break;
5301        }
5302        case RCURLY:
5303        {
5304            AST tmp132_AST = null;
5305            tmp132_AST = astFactory.create(LT(1));
5306            astFactory.addASTChild(currentAST, tmp132_AST);
5307            match(RCURLY);
5308            break;
5309        }
5310        default:
5311        {
5312            throw new NoViableAltException(LT(1), getFilename());
5313        }
5314        }
5315        }
5316        enumConstantsStart_AST = (AST)currentAST.root;
5317        returnAST = enumConstantsStart_AST;
5318    }
5319    
5320/** Comma-separated list of one or more enum constant definitions. */
5321    public final void enumConstants() throws RecognitionException, TokenStreamException {
5322        
5323        returnAST = null;
5324        ASTPair currentAST = new ASTPair();
5325        AST enumConstants_AST = null;
5326        
5327        enumConstant();
5328        astFactory.addASTChild(currentAST, returnAST);
5329        {
5330        _loop132:
5331        do {
5332            if ((LA(1)==COMMA) && (_tokenSet_61.member(LA(2))) && (_tokenSet_62.member(LA(3)))) {
5333                match(COMMA);
5334                nls();
5335                enumConstant();
5336                astFactory.addASTChild(currentAST, returnAST);
5337            }
5338            else {
5339                break _loop132;
5340            }
5341            
5342        } while (true);
5343        }
5344        {
5345        switch ( LA(1)) {
5346        case COMMA:
5347        {
5348            match(COMMA);
5349            nls();
5350            break;
5351        }
5352        case RCURLY:
5353        case SEMI:
5354        case NLS:
5355        {
5356            break;
5357        }
5358        default:
5359        {
5360            throw new NoViableAltException(LT(1), getFilename());
5361        }
5362        }
5363        }
5364        enumConstants_AST = (AST)currentAST.root;
5365        returnAST = enumConstants_AST;
5366    }
5367    
5368    public final void enumConstant() throws RecognitionException, TokenStreamException {
5369        
5370        returnAST = null;
5371        ASTPair currentAST = new ASTPair();
5372        AST enumConstant_AST = null;
5373        AST an_AST = null;
5374        Token i = null;
5375        AST i_AST = null;
5376        AST a_AST = null;
5377        AST b_AST = null;
5378        Token first = LT(1);
5379        
5380        annotationsOpt();
5381        an_AST = (AST)returnAST;
5382        i = LT(1);
5383        i_AST = astFactory.create(i);
5384        match(IDENT);
5385        {
5386        switch ( LA(1)) {
5387        case LPAREN:
5388        {
5389            match(LPAREN);
5390            argList();
5391            a_AST = (AST)returnAST;
5392            match(RPAREN);
5393            break;
5394        }
5395        case COMMA:
5396        case LCURLY:
5397        case RCURLY:
5398        case SEMI:
5399        case NLS:
5400        {
5401            break;
5402        }
5403        default:
5404        {
5405            throw new NoViableAltException(LT(1), getFilename());
5406        }
5407        }
5408        }
5409        {
5410        switch ( LA(1)) {
5411        case LCURLY:
5412        {
5413            enumConstantBlock();
5414            b_AST = (AST)returnAST;
5415            break;
5416        }
5417        case COMMA:
5418        case RCURLY:
5419        case SEMI:
5420        case NLS:
5421        {
5422            break;
5423        }
5424        default:
5425        {
5426            throw new NoViableAltException(LT(1), getFilename());
5427        }
5428        }
5429        }
5430        if ( inputState.guessing==0 ) {
5431            enumConstant_AST = (AST)currentAST.root;
5432            enumConstant_AST = (AST)astFactory.make( (new ASTArray(5)).add(create(ENUM_CONSTANT_DEF,"ENUM_CONSTANT_DEF",first,LT(1))).add(an_AST).add(i_AST).add(a_AST).add(b_AST));
5433            currentAST.root = enumConstant_AST;
5434            currentAST.child = enumConstant_AST!=null &&enumConstant_AST.getFirstChild()!=null ?
5435                enumConstant_AST.getFirstChild() : enumConstant_AST;
5436            currentAST.advanceChildToEnd();
5437        }
5438        returnAST = enumConstant_AST;
5439    }
5440    
5441    public final void argList() throws RecognitionException, TokenStreamException {
5442        
5443        returnAST = null;
5444        ASTPair currentAST = new ASTPair();
5445        AST argList_AST = null;
5446        Token first = LT(1); boolean hl = false, hl2;
5447        
5448        {
5449        switch ( LA(1)) {
5450        case FINAL:
5451        case ABSTRACT:
5452        case UNUSED_DO:
5453        case STRICTFP:
5454        case LITERAL_static:
5455        case LITERAL_def:
5456        case AT:
5457        case IDENT:
5458        case LBRACK:
5459        case LPAREN:
5460        case LITERAL_class:
5461        case LITERAL_super:
5462        case LITERAL_void:
5463        case LITERAL_boolean:
5464        case LITERAL_byte:
5465        case LITERAL_char:
5466        case LITERAL_short:
5467        case LITERAL_int:
5468        case LITERAL_float:
5469        case LITERAL_long:
5470        case LITERAL_double:
5471        case LITERAL_any:
5472        case STAR:
5473        case LITERAL_as:
5474        case LITERAL_private:
5475        case LITERAL_public:
5476        case LITERAL_protected:
5477        case LITERAL_transient:
5478        case LITERAL_native:
5479        case LITERAL_threadsafe:
5480        case LITERAL_synchronized:
5481        case LITERAL_volatile:
5482        case LCURLY:
5483        case LITERAL_this:
5484        case STRING_LITERAL:
5485        case LITERAL_if:
5486        case LITERAL_else:
5487        case LITERAL_while:
5488        case LITERAL_switch:
5489        case LITERAL_for:
5490        case LITERAL_in:
5491        case LITERAL_return:
5492        case LITERAL_break:
5493        case LITERAL_continue:
5494        case LITERAL_throw:
5495        case LITERAL_assert:
5496        case PLUS:
5497        case MINUS:
5498        case LITERAL_try:
5499        case LITERAL_finally:
5500        case LITERAL_catch:
5501        case INC:
5502        case DEC:
5503        case BNOT:
5504        case LNOT:
5505        case DOLLAR:
5506        case STRING_CTOR_START:
5507        case LITERAL_new:
5508        case LITERAL_true:
5509        case LITERAL_false:
5510        case LITERAL_null:
5511        case NUM_INT:
5512        case NUM_FLOAT:
5513        case NUM_LONG:
5514        case NUM_DOUBLE:
5515        case NUM_BIG_INT:
5516        case NUM_BIG_DECIMAL:
5517        {
5518            hl=argument();
5519            astFactory.addASTChild(currentAST, returnAST);
5520            {
5521            _loop451:
5522            do {
5523                if ((LA(1)==COMMA) && (_tokenSet_63.member(LA(2))) && (_tokenSet_64.member(LA(3)))) {
5524                    match(COMMA);
5525                    hl2=argument();
5526                    astFactory.addASTChild(currentAST, returnAST);
5527                    if ( inputState.guessing==0 ) {
5528                        hl |= hl2;
5529                    }
5530                }
5531                else {
5532                    break _loop451;
5533                }
5534                
5535            } while (true);
5536            }
5537            if ( inputState.guessing==0 ) {
5538                argList_AST = (AST)currentAST.root;
5539                argList_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(ELIST,"ELIST",first,LT(1))).add(argList_AST));
5540                currentAST.root = argList_AST;
5541                currentAST.child = argList_AST!=null &&argList_AST.getFirstChild()!=null ?
5542                    argList_AST.getFirstChild() : argList_AST;
5543                currentAST.advanceChildToEnd();
5544            }
5545            break;
5546        }
5547        case RBRACK:
5548        case COMMA:
5549        case RPAREN:
5550        {
5551            if ( inputState.guessing==0 ) {
5552                argList_AST = (AST)currentAST.root;
5553                argList_AST = create(ELIST,"ELIST",first,LT(1));
5554                currentAST.root = argList_AST;
5555                currentAST.child = argList_AST!=null &&argList_AST.getFirstChild()!=null ?
5556                    argList_AST.getFirstChild() : argList_AST;
5557                currentAST.advanceChildToEnd();
5558            }
5559            break;
5560        }
5561        default:
5562        {
5563            throw new NoViableAltException(LT(1), getFilename());
5564        }
5565        }
5566        }
5567        {
5568        switch ( LA(1)) {
5569        case COMMA:
5570        {
5571            match(COMMA);
5572            break;
5573        }
5574        case RBRACK:
5575        case RPAREN:
5576        {
5577            break;
5578        }
5579        default:
5580        {
5581            throw new NoViableAltException(LT(1), getFilename());
5582        }
5583        }
5584        }
5585        if ( inputState.guessing==0 ) {
5586            argListHasLabels = hl;
5587        }
5588        argList_AST = (AST)currentAST.root;
5589        returnAST = argList_AST;
5590    }
5591    
5592    public final void enumConstantBlock() throws RecognitionException, TokenStreamException {
5593        
5594        returnAST = null;
5595        ASTPair currentAST = new ASTPair();
5596        AST enumConstantBlock_AST = null;
5597        Token first = LT(1);
5598        
5599        match(LCURLY);
5600        {
5601        switch ( LA(1)) {
5602        case FINAL:
5603        case ABSTRACT:
5604        case STRICTFP:
5605        case LITERAL_static:
5606        case LITERAL_def:
5607        case AT:
5608        case IDENT:
5609        case LITERAL_class:
5610        case LITERAL_interface:
5611        case LITERAL_enum:
5612        case LT:
5613        case LITERAL_void:
5614        case LITERAL_boolean:
5615        case LITERAL_byte:
5616        case LITERAL_char:
5617        case LITERAL_short:
5618        case LITERAL_int:
5619        case LITERAL_float:
5620        case LITERAL_long:
5621        case LITERAL_double:
5622        case LITERAL_any:
5623        case LITERAL_private:
5624        case LITERAL_public:
5625        case LITERAL_protected:
5626        case LITERAL_transient:
5627        case LITERAL_native:
5628        case LITERAL_threadsafe:
5629        case LITERAL_synchronized:
5630        case LITERAL_volatile:
5631        case LCURLY:
5632        {
5633            enumConstantField();
5634            astFactory.addASTChild(currentAST, returnAST);
5635            break;
5636        }
5637        case RCURLY:
5638        case SEMI:
5639        case NLS:
5640        {
5641            break;
5642        }
5643        default:
5644        {
5645            throw new NoViableAltException(LT(1), getFilename());
5646        }
5647        }
5648        }
5649        {
5650        _loop147:
5651        do {
5652            if ((LA(1)==SEMI||LA(1)==NLS)) {
5653                sep();
5654                {
5655                switch ( LA(1)) {
5656                case FINAL:
5657                case ABSTRACT:
5658                case STRICTFP:
5659                case LITERAL_static:
5660                case LITERAL_def:
5661                case AT:
5662                case IDENT:
5663                case LITERAL_class:
5664                case LITERAL_interface:
5665                case LITERAL_enum:
5666                case LT:
5667                case LITERAL_void:
5668                case LITERAL_boolean:
5669                case LITERAL_byte:
5670                case LITERAL_char:
5671                case LITERAL_short:
5672                case LITERAL_int:
5673                case LITERAL_float:
5674                case LITERAL_long:
5675                case LITERAL_double:
5676                case LITERAL_any:
5677                case LITERAL_private:
5678                case LITERAL_public:
5679                case LITERAL_protected:
5680                case LITERAL_transient:
5681                case LITERAL_native:
5682                case LITERAL_threadsafe:
5683                case LITERAL_synchronized:
5684                case LITERAL_volatile:
5685                case LCURLY:
5686                {
5687                    enumConstantField();
5688                    astFactory.addASTChild(currentAST, returnAST);
5689                    break;
5690                }
5691                case RCURLY:
5692                case SEMI:
5693                case NLS:
5694                {
5695                    break;
5696                }
5697                default:
5698                {
5699                    throw new NoViableAltException(LT(1), getFilename());
5700                }
5701                }
5702                }
5703            }
5704            else {
5705                break _loop147;
5706            }
5707            
5708        } while (true);
5709        }
5710        match(RCURLY);
5711        if ( inputState.guessing==0 ) {
5712            enumConstantBlock_AST = (AST)currentAST.root;
5713            enumConstantBlock_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(OBJBLOCK,"OBJBLOCK",first,LT(1))).add(enumConstantBlock_AST));
5714            currentAST.root = enumConstantBlock_AST;
5715            currentAST.child = enumConstantBlock_AST!=null &&enumConstantBlock_AST.getFirstChild()!=null ?
5716                enumConstantBlock_AST.getFirstChild() : enumConstantBlock_AST;
5717            currentAST.advanceChildToEnd();
5718        }
5719        enumConstantBlock_AST = (AST)currentAST.root;
5720        returnAST = enumConstantBlock_AST;
5721    }
5722    
5723    public final void enumConstantField() throws RecognitionException, TokenStreamException {
5724        
5725        returnAST = null;
5726        ASTPair currentAST = new ASTPair();
5727        AST enumConstantField_AST = null;
5728        AST mods_AST = null;
5729        AST td_AST = null;
5730        AST tp_AST = null;
5731        AST t_AST = null;
5732        AST param_AST = null;
5733        AST tc_AST = null;
5734        AST s2_AST = null;
5735        AST v_AST = null;
5736        AST s4_AST = null;
5737        Token first = LT(1);
5738        
5739        switch ( LA(1)) {
5740        case FINAL:
5741        case ABSTRACT:
5742        case STRICTFP:
5743        case LITERAL_static:
5744        case LITERAL_def:
5745        case AT:
5746        case IDENT:
5747        case LITERAL_class:
5748        case LITERAL_interface:
5749        case LITERAL_enum:
5750        case LT:
5751        case LITERAL_void:
5752        case LITERAL_boolean:
5753        case LITERAL_byte:
5754        case LITERAL_char:
5755        case LITERAL_short:
5756        case LITERAL_int:
5757        case LITERAL_float:
5758        case LITERAL_long:
5759        case LITERAL_double:
5760        case LITERAL_any:
5761        case LITERAL_private:
5762        case LITERAL_public:
5763        case LITERAL_protected:
5764        case LITERAL_transient:
5765        case LITERAL_native:
5766        case LITERAL_threadsafe:
5767        case LITERAL_synchronized:
5768        case LITERAL_volatile:
5769        {
5770            modifiersOpt();
5771            mods_AST = (AST)returnAST;
5772            {
5773            switch ( LA(1)) {
5774            case AT:
5775            case LITERAL_class:
5776            case LITERAL_interface:
5777            case LITERAL_enum:
5778            {
5779                typeDefinitionInternal(mods_AST);
5780                td_AST = (AST)returnAST;
5781                if ( inputState.guessing==0 ) {
5782                    enumConstantField_AST = (AST)currentAST.root;
5783                    enumConstantField_AST = td_AST;
5784                    currentAST.root = enumConstantField_AST;
5785                    currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
5786                        enumConstantField_AST.getFirstChild() : enumConstantField_AST;
5787                    currentAST.advanceChildToEnd();
5788                }
5789                break;
5790            }
5791            case IDENT:
5792            case LT:
5793            case LITERAL_void:
5794            case LITERAL_boolean:
5795            case LITERAL_byte:
5796            case LITERAL_char:
5797            case LITERAL_short:
5798            case LITERAL_int:
5799            case LITERAL_float:
5800            case LITERAL_long:
5801            case LITERAL_double:
5802            case LITERAL_any:
5803            {
5804                {
5805                switch ( LA(1)) {
5806                case LT:
5807                {
5808                    typeParameters();
5809                    tp_AST = (AST)returnAST;
5810                    break;
5811                }
5812                case IDENT:
5813                case LITERAL_void:
5814                case LITERAL_boolean:
5815                case LITERAL_byte:
5816                case LITERAL_char:
5817                case LITERAL_short:
5818                case LITERAL_int:
5819                case LITERAL_float:
5820                case LITERAL_long:
5821                case LITERAL_double:
5822                case LITERAL_any:
5823                {
5824                    break;
5825                }
5826                default:
5827                {
5828                    throw new NoViableAltException(LT(1), getFilename());
5829                }
5830                }
5831                }
5832                typeSpec(false);
5833                t_AST = (AST)returnAST;
5834                {
5835                boolean synPredMatched153 = false;
5836                if (((LA(1)==IDENT) && (LA(2)==LPAREN) && (_tokenSet_65.member(LA(3))))) {
5837                    int _m153 = mark();
5838                    synPredMatched153 = true;
5839                    inputState.guessing++;
5840                    try {
5841                        {
5842                        match(IDENT);
5843                        match(LPAREN);
5844                        }
5845                    }
5846                    catch (RecognitionException pe) {
5847                        synPredMatched153 = false;
5848                    }
5849                    rewind(_m153);
5850                    inputState.guessing--;
5851                }
5852                if ( synPredMatched153 ) {
5853                    AST tmp141_AST = null;
5854                    tmp141_AST = astFactory.create(LT(1));
5855                    match(IDENT);
5856                    match(LPAREN);
5857                    parameterDeclarationList();
5858                    param_AST = (AST)returnAST;
5859                    match(RPAREN);
5860                    {
5861                    switch ( LA(1)) {
5862                    case LITERAL_throws:
5863                    {
5864                        throwsClause();
5865                        tc_AST = (AST)returnAST;
5866                        break;
5867                    }
5868                    case LCURLY:
5869                    case RCURLY:
5870                    case SEMI:
5871                    case NLS:
5872                    {
5873                        break;
5874                    }
5875                    default:
5876                    {
5877                        throw new NoViableAltException(LT(1), getFilename());
5878                    }
5879                    }
5880                    }
5881                    {
5882                    switch ( LA(1)) {
5883                    case LCURLY:
5884                    {
5885                        compoundStatement();
5886                        s2_AST = (AST)returnAST;
5887                        break;
5888                    }
5889                    case RCURLY:
5890                    case SEMI:
5891                    case NLS:
5892                    {
5893                        break;
5894                    }
5895                    default:
5896                    {
5897                        throw new NoViableAltException(LT(1), getFilename());
5898                    }
5899                    }
5900                    }
5901                    if ( inputState.guessing==0 ) {
5902                        enumConstantField_AST = (AST)currentAST.root;
5903                        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));
5904                        currentAST.root = enumConstantField_AST;
5905                        currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
5906                            enumConstantField_AST.getFirstChild() : enumConstantField_AST;
5907                        currentAST.advanceChildToEnd();
5908                    }
5909                }
5910                else if ((LA(1)==IDENT||LA(1)==STRING_LITERAL) && (_tokenSet_59.member(LA(2))) && (_tokenSet_66.member(LA(3)))) {
5911                    variableDefinitions(mods_AST,t_AST);
5912                    v_AST = (AST)returnAST;
5913                    if ( inputState.guessing==0 ) {
5914                        enumConstantField_AST = (AST)currentAST.root;
5915                        enumConstantField_AST = v_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 {
5923                    throw new NoViableAltException(LT(1), getFilename());
5924                }
5925                
5926                }
5927                break;
5928            }
5929            default:
5930            {
5931                throw new NoViableAltException(LT(1), getFilename());
5932            }
5933            }
5934            }
5935            break;
5936        }
5937        case LCURLY:
5938        {
5939            compoundStatement();
5940            s4_AST = (AST)returnAST;
5941            if ( inputState.guessing==0 ) {
5942                enumConstantField_AST = (AST)currentAST.root;
5943                enumConstantField_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(INSTANCE_INIT,"INSTANCE_INIT",first,LT(1))).add(s4_AST));
5944                currentAST.root = enumConstantField_AST;
5945                currentAST.child = enumConstantField_AST!=null &&enumConstantField_AST.getFirstChild()!=null ?
5946                    enumConstantField_AST.getFirstChild() : enumConstantField_AST;
5947                currentAST.advanceChildToEnd();
5948            }
5949            break;
5950        }
5951        default:
5952        {
5953            throw new NoViableAltException(LT(1), getFilename());
5954        }
5955        }
5956        returnAST = enumConstantField_AST;
5957    }
5958    
5959/** A list of zero or more formal parameters.
5960 * If a parameter is variable length (e.g. String... myArg) it should be
5961 * to the right of any other parameters of the same kind.
5962 * General form: (req, ..., opt, ..., [rest], key, ..., [restKeys], [block]
5963 * This must be sorted out after parsing, since the various declaration forms
5964 * are impossible to tell apart without backtracking.
5965 */

5966    public final void parameterDeclarationList() throws RecognitionException, TokenStreamException {
5967        
5968        returnAST = null;
5969        ASTPair currentAST = new ASTPair();
5970        AST parameterDeclarationList_AST = null;
5971        Token first = LT(1);
5972        
5973        {
5974        switch ( LA(1)) {
5975        case FINAL:
5976        case LITERAL_def:
5977        case AT:
5978        case IDENT:
5979        case LITERAL_void:
5980        case LITERAL_boolean:
5981        case LITERAL_byte:
5982        case LITERAL_char:
5983        case LITERAL_short:
5984        case LITERAL_int:
5985        case LITERAL_float:
5986        case LITERAL_long:
5987        case LITERAL_double:
5988        case LITERAL_any:
5989        case TRIPLE_DOT:
5990        {
5991            parameterDeclaration();
5992            astFactory.addASTChild(currentAST, returnAST);
5993            {
5994            _loop208:
5995            do {
5996                if ((LA(1)==COMMA)) {
5997                    match(COMMA);
5998                    nls();
5999                    parameterDeclaration();
6000                    astFactory.addASTChild(currentAST, returnAST);
6001                }
6002                else {
6003                    break _loop208;
6004                }
6005                
6006            } while (true);
6007            }
6008            break;
6009        }
6010        case RPAREN:
6011        case NLS:
6012        case CLOSURE_OP:
6013        {
6014            break;
6015        }
6016        default:
6017        {
6018            throw new NoViableAltException(LT(1), getFilename());
6019        }
6020        }
6021        }
6022        if ( inputState.guessing==0 ) {
6023            parameterDeclarationList_AST = (AST)currentAST.root;
6024            parameterDeclarationList_AST = (AST)astFactory.make( (new ASTArray(2)).add(create(PARAMETERS,"PARAMETERS",first,LT(1))).add(parameterDeclarationList_AST));
6025            currentAST.root = parameterDeclarationList_AST;
6026            currentAST.child = parameterDeclarationList_AST!=null &&parameterDeclarationList_AST.getFirstChild()!=null ?
6027                parameterDeclarationList_AST.getFirstChild() : parameterDeclarationList_AST;
6028            currentAST.advanceChildToEnd();
6029        }
6030        parameterDeclarationList_AST = (AST)currentAST.root;
6031        returnAST = parameterDeclarationList_AST;
6032    }
6033    
6034    public final void throwsClause() throws RecognitionException, TokenStreamException {
6035        
6036        returnAST = null;
6037        ASTPair currentAST = new ASTPair();
6038        AST throwsClause_AST = null;
6039        
6040        AST tmp145_AST = null;
6041        tmp145_AST = astFactory.create(LT(1));
6042        astFactory.makeASTRoot(currentAST, tmp145_AST);
6043        match(LITERAL_throws);
6044        nls();
6045        identifier();
6046        astFactory.addASTChild(currentAST, returnAST);
6047        {
6048        _loop204:
6049        do {
6050            if ((LA(1)==COMMA)) {
6051                match(COMMA);
6052                nls();
6053                identifier();
6054                astFactory.addASTChild(currentAST, returnAST);
6055            }
6056            else {
6057                break _loop204;
6058            }
6059            
6060        } while (true);
6061        }
6062        nls();
6063        throwsClause_AST = (AST)currentAST.root;
6064        returnAST = throwsClause_AST;
6065    }
6066    
6067    public final void compoundStatement() throws RecognitionException, TokenStreamException {
6068        
6069        returnAST = null;
6070        ASTPair currentAST = new ASTPair();
6071        AST compoundStatement_AST = null;
6072        
6073        openBlock();
6074        astFactory.addASTChild(currentAST, returnAST);
6075        compoundStatement_AST = (AST)currentAST.root;
6076        returnAST = compoundStatement_AST;
6077    }
6078    
6079/** I've split out constructors separately; we could maybe integrate back into variableDefinitions
6080 * later on if we maybe simplified 'def' to be a type declaration?
6081 */

6082    public final void constructorDefinition(
6083        AST mods
6084    ) throws RecognitionException, TokenStreamException {
6085        
6086        returnAST = null;
6087        ASTPair currentAST = new ASTPair();
6088        AST constructorDefinition_AST = null;
6089        Token id = null;
6090        AST id_AST = null;
6091        AST param_AST = null;
6092        AST tc_AST = null;
6093        AST cb_AST = null;
6094        Token first = LT(1);
6095        
6096        id = LT(1);
6097        id_AST = astFactory.create(id);
6098        astFactory.addASTChild(currentAST, id_AST);
6099        match(IDENT);
6100        match(LPAREN);
6101        parameterDeclarationList();
6102        param_AST = (AST)returnAST;
6103        match(RPAREN);
6104        {
6105        switch ( LA(1)) {
6106        case LITERAL_throws:
6107        {
6108            throwsClause();
6109            tc_AST = (AST)returnAST;
6110            break;
6111        }
6112        case LCURLY:
6113        case NLS:
6114        {
6115            break;
6116        }
6117        default:
6118        {
6119            throw new NoViableAltException(LT(1), getFilename());
6120        }
6121        }
6122        }
6123        nlsWarn();
6124        if ( inputState.guessing==0 ) {
6125            isConstructorIdent(id);
6126        }
6127        constructorBody();
6128        cb_AST = (AST)returnAST;
6129        if ( inputState.guessing==0 ) {
6130            constructorDefinition_AST = (AST)currentAST.root;
6131            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));
6132            
6133            currentAST.root = constructorDefinition_AST;
6134            currentAST.child = constructorDefinition_AST!=null &&constructorDefinition_AST.getFirstChild()!=null ?
6135                constructorDefinition_AST.getFirstChild() : constructorDefinition_AST;
6136            currentAST.advanceChildToEnd();
6137        }
6138        constructorDefinition_AST = (AST)currentAST.root;
6139        returnAST = constructorDefinition_AST;
6140    }
6141    
6142    public final void constructorBody() throws RecognitionException, TokenStreamException {
6143        
6144        returnAST = null;
6145        ASTPair currentAST = new ASTPair();
6146        AST constructorBody_AST = null;
6147        Token lc = null;
6148        AST lc_AST = null;
6149        
6150        lc = LT(1);
6151        lc_AST = astFactory.create(lc);
6152        astFactory.makeASTRoot(currentAST, lc_AST);
6153        match(LCURLY);
6154        nls();
6155        if ( inputState.guessing==0 ) {
6156            lc_AST.setType(SLIST);
6157        }
6158        {
6159        boolean synPredMatched181 = false;
6160        if (((_tokenSet_67.member(LA(1))) && (_tokenSet_68.member(LA(2))) && (_tokenSet_69.member(LA(3))))) {
6161            int _m181 = mark();
6162            synPredMatched181 = true;
6163            inputState.guessing++;
6164            try {
6165                {
6166                explicitConstructorInvocation();
6167                }
6168            }
6169            catch (RecognitionException pe) {
6170                synPredMatched181 = false;
6171            }
6172            rewind(_m181);
6173            inputState.guessing--;
6174        }
6175        if ( synPredMatched181 ) {
6176            explicitConstructorInvocation();
6177            astFactory.addASTChild(currentAST, returnAST);
6178            {
6179            switch ( LA(1)) {
6180            case SEMI:
6181            case NLS:
6182            {
6183                sep();
6184                blockBody(sepToken);
6185                astFactory.addASTChild(currentAST, returnAST);
6186                break;
6187            }
6188            case RCURLY:
6189            {
6190                break;
6191            }
6192            default:
6193            {
6194                throw new NoViableAltException(LT(1), getFilename());
6195            }
6196            }
6197            }
6198        }
6199        else if ((_tokenSet_70.member(LA(1))) && (_tokenSet_71.member(LA(2))) && (_tokenSet_18.member(LA(3)))) {
6200            blockBody(EOF);
6201            astFactory.addASTChild(currentAST, returnAST);
6202        }
6203        else {
6204            throw new NoViableAltException(LT(1), getFilename());
6205        }
6206        
6207        }
6208        match(RCURLY);
6209        constructorBody_AST = (AST)currentAST.root;
6210        returnAST = constructorBody_AST;
6211    }
6212    
6213/** Catch obvious constructor calls, but not the expr.super(...) calls */
6214    public final void explicitConstructorInvocation() throws RecognitionException, TokenStreamException {
6215        
6216        returnAST = null;
6217        ASTPair currentAST = new ASTPair();
6218        AST explicitConstructorInvocation_AST = null;
6219        Token lp1 = null;
6220        AST lp1_AST = null;
6221        Token lp2 = null;
6222        AST lp2_AST = null;
6223        
6224        {
6225        switch ( LA(1)) {
6226        case LT:
6227        {
6228            typeArguments();
6229            astFactory.addASTChild(currentAST, returnAST);
6230            break;
6231        }
6232        case LITERAL_super:
6233        case LITERAL_this:
6234        {
6235            break;
6236        }
6237        default:
6238        {
6239            throw new NoViableAltException(LT(1), getFilename());
6240        }
6241        }
6242        }
6243        {
6244        switch ( LA(1)) {
6245        case LITERAL_this:
6246        {
6247            match(LITERAL_this);
6248            lp1 = LT(1);
6249            lp1_AST = astFactory.create(lp1);
6250            astFactory.makeASTRoot(currentAST, lp1_AST);
6251            match(LPAREN);
6252            argList();
6253            astFactory.addASTChild(currentAST, returnAST);
6254            match(RPAREN);
6255            if ( inputState.guessing==0 ) {
6256                lp1_AST.setType(CTOR_CALL);
6257            }
6258            break;
6259        }
6260        case LITERAL_super:
6261        {
6262            match(LITERAL_super);
6263            lp2 = LT(1);
6264            lp2_AST = astFactory.create(lp2);
6265            astFactory.makeASTRoot(currentAST, lp2_AST);
6266            match(LPAREN);
6267            argList();
6268            astFactory.addASTChild(currentAST, returnAST);
6269            match(RPAREN);
6270            if ( inputState.guessing==0 ) {
6271                lp2_AST.setType(SUPER_CTOR_CALL);
6272            }
6273            break;
6274        }
6275        default:
6276        {
6277            throw new NoViableAltException(LT(1), getFilename());
6278        }
6279        }
6280        }
6281        explicitConstructorInvocation_AST = (AST)currentAST.root;
6282        returnAST = explicitConstructorInvocation_AST;
6283    }
6284    
6285/** Declaration of a variable. This can be a class/instance variable,
6286 * or a local variable in a method
6287 * It can also include possible initialization.
6288 */

6289    public final void variableDeclarator(
6290        AST mods, AST t
6291    ) throws RecognitionException, TokenStreamException {
6292        
6293        returnAST = null;
6294        ASTPair currentAST = new ASTPair();
6295        AST variableDeclarator_AST = null;
6296        AST id_AST = null;
6297        AST v_AST = null;
6298        Token first = LT(1);
6299        
6300        variableName();
6301        id_AST = (AST)returnAST;
6302        {
6303        switch ( LA(1)) {
6304        case ASSIGN:
6305        {
6306            varInitializer();
6307            v_AST = (AST)returnAST;
6308            break;
6309        }
6310        case EOF:
6311        case COMMA:
6312        case RCURLY:
6313        case SEMI:
6314        case NLS:
6315        case LITERAL_default:
6316        case LITERAL_else:
6317        case LITERAL_case:
6318        {
6319            break;
6320        }
6321        default:
6322        {
6323            throw new NoViableAltException(LT(1), getFilename());
6324        }
6325        }
6326        }
6327        if ( inputState.guessing==0 ) {
6328            variableDeclarator_AST = (AST)currentAST.root;
6329            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));
6330            currentAST.root = variableDeclarator_AST;
6331            currentAST.child = variableDeclarator_AST!=null &&variableDeclarator_AST.getFirstChild()!=null ?
6332                variableDeclarator_AST.getFirstChild() : variableDeclarator_AST;
6333            currentAST.advanceChildToEnd();
6334        }
6335        returnAST = variableDeclarator_AST;
6336    }
6337    
6338/** Zero or more insignificant newlines, all gobbled up and thrown away,
6339 * but a warning message is left for the user, if there was a newline.
6340 */

6341    public final void nlsWarn() throws RecognitionException, TokenStreamException {
6342        
6343        returnAST = null;
6344        ASTPair currentAST = new ASTPair();
6345        AST nlsWarn_AST = null;
6346        
6347        {
6348        boolean synPredMatched490 = false;
6349        if (((_tokenSet_72.member(LA(1))) && (_tokenSet_20.member(LA(2))) && (_tokenSet_5.member(LA(3))))) {
6350            int _m490 = mark();
6351            synPredMatched490 = true;
6352            inputState.guessing++;
6353            try {
6354                {
6355                match(NLS);
6356                }
6357            }
6358            catch (RecognitionException pe) {
6359                synPredMatched490 = false;
6360            }
6361            rewind(_m490);
6362            inputState.guessing--;
6363        }
6364        if ( synPredMatched490 ) {
6365            if ( inputState.guessing==0 ) {
6366                addWarning(
6367                "A newline at this point does not follow the Groovy Coding Conventions.",
6368                "Keep this statement on one line, or use curly braces to break across multiple lines."
6369                );
6370            }
6371        }
6372        else if ((_tokenSet_72.member(LA(1))) && (_tokenSet_20.member(LA(2))) && (_tokenSet_5.member(LA(3)))) {
6373        }
6374        else {
6375            throw new NoViableAltException(LT(1), getFilename());
6376        }
6377        
6378        }
6379        nls();
6380        returnAST = nlsWarn_AST;
6381    }
6382    
6383/** An open block is not allowed to have closure arguments. */
6384    public final void openBlock() throws RecognitionException, TokenStreamException {
6385        
6386        returnAST = null;
6387        ASTPair currentAST = new ASTPair();
6388        AST openBlock_AST = null;
6389        Token lc = null;
6390        AST lc_AST = null;
6391        
6392        lc = LT(1);
6393        lc_AST = astFactory.create(lc);
6394        astFactory.makeASTRoot(currentAST, lc_AST);
6395        match(LCURLY);
6396        nls();
6397        if ( inputState.guessing==0 ) {
6398            lc_AST.setType(SLIST);
6399        }
6400        blockBody(EOF);
6401        astFactory.addASTChild(currentAST, returnAST);
6402        match(RCURLY);
6403        openBlock_AST = (AST)currentAST.root;
6404        returnAST = openBlock_AST;
6405    }
6406    
6407    public final void variableName() throws RecognitionException, TokenStreamException {
6408        
6409        returnAST = null;
6410        ASTPair currentAST = new ASTPair();
6411        AST variableName_AST = null;
6412        
6413        AST tmp155_AST = null;
6414        tmp155_AST = astFactory.create(LT(1));
6415        astFactory.addASTChild(currentAST, tmp155_AST);
6416        match(IDENT);
6417        variableName_AST = (AST)currentAST.root;
6418        returnAST = variableName_AST;
6419    }
6420    
6421    public final void expression(
6422        int lc_stmt
6423    ) throws RecognitionException, TokenStreamException {
6424        
6425        returnAST = null;
6426        ASTPair currentAST = new ASTPair();
6427        AST expression_AST = null;
6428        
6429        assignmentExpression(lc_stmt);
6430        astFactory.addASTChild(currentAST, returnAST);
6431        expression_AST = (AST)currentAST.root;
6432        returnAST = expression_AST;
6433    }
6434    
6435/** A formal parameter for a method or closure. */
6436    public final void parameterDeclaration() throws RecognitionException, TokenStreamException {
6437        
6438        returnAST = null;
6439        ASTPair currentAST = new ASTPair();
6440        AST parameterDeclaration_AST = null;
6441        AST pm_AST = null;
6442        AST t_AST = null;
6443        Token id = null;
6444        AST id_AST = null;
6445        AST exp_AST = null;
6446        Token first = LT(1);boolean spreadParam = false;
6447        
6448        parameterModifiersOpt();
6449        pm_AST = (AST)returnAST;
6450        {
6451        if ((_tokenSet_26.member(LA(1))) && (_tokenSet_73.member(LA(2))) && (_tokenSet_74.member(LA(3)))) {
6452            typeSpec(false);
6453            t_AST = (AST)returnAST;
6454        }
6455        else if ((LA(1)==IDENT||LA(1)==TRIPLE_DOT) && (_tokenSet_75.member(LA(2))) && (_tokenSet_76.member(LA(3)))) {
6456        }
6457        else {
6458            throw new NoViableAltException(LT(1), getFilename());
6459        }
6460        
6461        }
6462        {
6463        switch ( LA(1)) {
6464        case TRIPLE_DOT:
6465        {
6466            match(TRIPLE_DOT);
6467