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