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