1 3 package antlr.actions.cpp; 4 5 import java.io.InputStream ; 6 import antlr.TokenStreamException; 7 import antlr.TokenStreamIOException; 8 import antlr.TokenStreamRecognitionException; 9 import antlr.CharStreamException; 10 import antlr.CharStreamIOException; 11 import antlr.ANTLRException; 12 import java.io.Reader ; 13 import java.util.Hashtable ; 14 import antlr.CharScanner; 15 import antlr.InputBuffer; 16 import antlr.ByteBuffer; 17 import antlr.CharBuffer; 18 import antlr.Token; 19 import antlr.CommonToken; 20 import antlr.RecognitionException; 21 import antlr.NoViableAltForCharException; 22 import antlr.MismatchedCharException; 23 import antlr.TokenStream; 24 import antlr.ANTLRHashString; 25 import antlr.LexerSharedInputState; 26 import antlr.collections.impl.BitSet; 27 import antlr.SemanticException; 28 29 import java.io.StringReader ; 30 import antlr.collections.impl.Vector; 31 32 52 public class ActionLexer extends antlr.CharScanner implements ActionLexerTokenTypes, TokenStream 53 { 54 55 protected RuleBlock currentRule; 56 protected CodeGenerator generator; 57 protected int lineOffset = 0; 58 private Tool antlrTool; ActionTransInfo transInfo; 60 61 public ActionLexer(String s, RuleBlock currentRule, 62 CodeGenerator generator, 63 ActionTransInfo transInfo ) 64 { 65 this(new StringReader (s)); 66 this.currentRule = currentRule; 67 this.generator = generator; 68 this.transInfo = transInfo; 69 } 70 71 public void setLineOffset(int lineOffset) 72 { 73 setLine(lineOffset); 74 } 75 76 public void setTool(Tool tool) 77 { 78 this.antlrTool = tool; 79 } 80 81 public void reportError(RecognitionException e) 82 { 83 antlrTool.error("Syntax error in action: "+e,getFilename(),getLine(),getColumn()); 84 } 85 86 public void reportError(String s) 87 { 88 antlrTool.error(s,getFilename(),getLine(),getColumn()); 89 } 90 91 public void reportWarning(String s) 92 { 93 if ( getFilename()==null ) 94 antlrTool.warning(s); 95 else 96 antlrTool.warning(s,getFilename(),getLine(),getColumn()); 97 } 98 public ActionLexer(InputStream in) { 99 this(new ByteBuffer(in)); 100 } 101 public ActionLexer(Reader in) { 102 this(new CharBuffer(in)); 103 } 104 public ActionLexer(InputBuffer ib) { 105 this(new LexerSharedInputState(ib)); 106 } 107 public ActionLexer(LexerSharedInputState state) { 108 super(state); 109 caseSensitiveLiterals = true; 110 setCaseSensitive(true); 111 literals = new Hashtable (); 112 } 113 114 public Token nextToken() throws TokenStreamException { 115 Token theRetToken=null; 116 tryAgain: 117 for (;;) { 118 Token _token = null; 119 int _ttype = Token.INVALID_TYPE; 120 resetText(); 121 try { try { if (((LA(1) >= '\u0003' && LA(1) <= '~'))) { 124 mACTION(true); 125 theRetToken=_returnToken; 126 } 127 else { 128 if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} 129 else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 130 } 131 132 if ( _returnToken==null ) continue tryAgain; _ttype = _returnToken.getType(); 134 _returnToken.setType(_ttype); 135 return _returnToken; 136 } 137 catch (RecognitionException e) { 138 throw new TokenStreamRecognitionException(e); 139 } 140 } 141 catch (CharStreamException cse) { 142 if ( cse instanceof CharStreamIOException ) { 143 throw new TokenStreamIOException(((CharStreamIOException)cse).io); 144 } 145 else { 146 throw new TokenStreamException(cse.getMessage()); 147 } 148 } 149 } 150 } 151 152 public final void mACTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 153 int _ttype; Token _token=null; int _begin=text.length(); 154 _ttype = ACTION; 155 int _saveIndex; 156 157 { 158 int _cnt3=0; 159 _loop3: 160 do { 161 switch ( LA(1)) { 162 case '\u0003': case '\u0004': case '\u0005': case '\u0006': 163 case '\u0007': case '\u0008': case '\t': case '\n': 164 case '\u000b': case '\u000c': case '\r': case '\u000e': 165 case '\u000f': case '\u0010': case '\u0011': case '\u0012': 166 case '\u0013': case '\u0014': case '\u0015': case '\u0016': 167 case '\u0017': case '\u0018': case '\u0019': case '\u001a': 168 case '\u001b': case '\u001c': case '\u001d': case '\u001e': 169 case '\u001f': case ' ': case '!': case '"': 170 case '%': case '&': case '\'': case '(': 171 case ')': case '*': case '+': case ',': 172 case '-': case '.': case '/': case '0': 173 case '1': case '2': case '3': case '4': 174 case '5': case '6': case '7': case '8': 175 case '9': case ':': case ';': case '<': 176 case '=': case '>': case '?': case '@': 177 case 'A': case 'B': case 'C': case 'D': 178 case 'E': case 'F': case 'G': case 'H': 179 case 'I': case 'J': case 'K': case 'L': 180 case 'M': case 'N': case 'O': case 'P': 181 case 'Q': case 'R': case 'S': case 'T': 182 case 'U': case 'V': case 'W': case 'X': 183 case 'Y': case 'Z': case '[': case '\\': 184 case ']': case '^': case '_': case '`': 185 case 'a': case 'b': case 'c': case 'd': 186 case 'e': case 'f': case 'g': case 'h': 187 case 'i': case 'j': case 'k': case 'l': 188 case 'm': case 'n': case 'o': case 'p': 189 case 'q': case 'r': case 's': case 't': 190 case 'u': case 'v': case 'w': case 'x': 191 case 'y': case 'z': case '{': case '|': 192 case '}': case '~': 193 { 194 mSTUFF(false); 195 break; 196 } 197 case '#': 198 { 199 mAST_ITEM(false); 200 break; 201 } 202 case '$': 203 { 204 mTEXT_ITEM(false); 205 break; 206 } 207 default: 208 { 209 if ( _cnt3>=1 ) { break _loop3; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 210 } 211 } 212 _cnt3++; 213 } while (true); 214 } 215 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 216 _token = makeToken(_ttype); 217 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 218 } 219 _returnToken = _token; 220 } 221 222 225 protected final void mSTUFF(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 226 int _ttype; Token _token=null; int _begin=text.length(); 227 _ttype = STUFF; 228 int _saveIndex; 229 230 switch ( LA(1)) { 231 case '"': 232 { 233 mSTRING(false); 234 break; 235 } 236 case '\'': 237 { 238 mCHAR(false); 239 break; 240 } 241 case '\n': 242 { 243 match('\n'); 244 newline(); 245 break; 246 } 247 default: 248 if ((LA(1)=='/') && (LA(2)=='*'||LA(2)=='/')) { 249 mCOMMENT(false); 250 } 251 else if ((LA(1)=='\r') && (LA(2)=='\n')) { 252 match("\r\n"); 253 newline(); 254 } 255 else if ((LA(1)=='\\') && (LA(2)=='#')) { 256 match('\\'); 257 match('#'); 258 text.setLength(_begin); text.append("#"); 259 } 260 else if ((LA(1)=='/') && (_tokenSet_0.member(LA(2)))) { 261 match('/'); 262 { 263 match(_tokenSet_0); 264 } 265 } 266 else if ((LA(1)=='\r') && (true)) { 267 match('\r'); 268 newline(); 269 } 270 else if ((_tokenSet_1.member(LA(1))) && (true)) { 271 { 272 match(_tokenSet_1); 273 } 274 } 275 else { 276 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 277 } 278 } 279 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 280 _token = makeToken(_ttype); 281 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 282 } 283 _returnToken = _token; 284 } 285 286 protected final void mAST_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 287 int _ttype; Token _token=null; int _begin=text.length(); 288 _ttype = AST_ITEM; 289 int _saveIndex; 290 Token t=null; 291 Token id=null; 292 Token ctor=null; 293 294 if ((LA(1)=='#') && (LA(2)=='(')) { 295 _saveIndex=text.length(); 296 match('#'); 297 text.setLength(_saveIndex); 298 mTREE(true); 299 t=_returnToken; 300 } 301 else if ((LA(1)=='#') && (_tokenSet_2.member(LA(2)))) { 302 _saveIndex=text.length(); 303 match('#'); 304 text.setLength(_saveIndex); 305 { 306 switch ( LA(1)) { 307 case '\t': case '\n': case '\r': case ' ': 308 { 309 mWS(false); 310 break; 311 } 312 case ':': case 'A': case 'B': case 'C': 313 case 'D': case 'E': case 'F': case 'G': 314 case 'H': case 'I': case 'J': case 'K': 315 case 'L': case 'M': case 'N': case 'O': 316 case 'P': case 'Q': case 'R': case 'S': 317 case 'T': case 'U': case 'V': case 'W': 318 case 'X': case 'Y': case 'Z': case '_': 319 case 'a': case 'b': case 'c': case 'd': 320 case 'e': case 'f': case 'g': case 'h': 321 case 'i': case 'j': case 'k': case 'l': 322 case 'm': case 'n': case 'o': case 'p': 323 case 'q': case 'r': case 's': case 't': 324 case 'u': case 'v': case 'w': case 'x': 325 case 'y': case 'z': 326 { 327 break; 328 } 329 default: 330 { 331 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 332 } 333 } 334 } 335 mID(true); 336 id=_returnToken; 337 338 String idt = id.getText(); 339 String mapped = generator.mapTreeId(id.getText(), transInfo); 340 341 if( ! idt.equals( mapped ) ) 343 { 344 text.setLength(_begin); text.append(mapped); 345 } 346 else 347 { 348 if(idt.equals("if") || 349 idt.equals("define") || 350 idt.equals("ifdef") || 351 idt.equals("ifndef") || 352 idt.equals("else") || 353 idt.equals("elif") || 354 idt.equals("endif") || 355 idt.equals("warning") || 356 idt.equals("error") || 357 idt.equals("ident") || 358 idt.equals("pragma") || 359 idt.equals("include")) 360 { 361 text.setLength(_begin); text.append("#"+idt); 362 } 363 } 364 365 { 366 if ((_tokenSet_3.member(LA(1))) && (true)) { 367 mWS(false); 368 } 369 else { 370 } 371 372 } 373 { 374 if ((LA(1)=='=') && (true)) { 375 mVAR_ASSIGN(false); 376 } 377 else { 378 } 379 380 } 381 } 382 else if ((LA(1)=='#') && (LA(2)=='[')) { 383 _saveIndex=text.length(); 384 match('#'); 385 text.setLength(_saveIndex); 386 mAST_CONSTRUCTOR(true); 387 ctor=_returnToken; 388 } 389 else if ((LA(1)=='#') && (LA(2)=='#')) { 390 match("##"); 391 392 if( currentRule != null ) 393 { 394 String r = currentRule.getRuleName()+"_AST"; 395 text.setLength(_begin); text.append(r); 396 397 if ( transInfo!=null ) { 398 transInfo.refRuleRoot=r; } 400 } 401 else 402 { 403 reportWarning("\"##\" not valid in this context"); 404 text.setLength(_begin); text.append("##"); 405 } 406 407 { 408 if ((_tokenSet_3.member(LA(1))) && (true)) { 409 mWS(false); 410 } 411 else { 412 } 413 414 } 415 { 416 if ((LA(1)=='=') && (true)) { 417 mVAR_ASSIGN(false); 418 } 419 else { 420 } 421 422 } 423 } 424 else { 425 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 426 } 427 428 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 429 _token = makeToken(_ttype); 430 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 431 } 432 _returnToken = _token; 433 } 434 435 protected final void mTEXT_ITEM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 436 int _ttype; Token _token=null; int _begin=text.length(); 437 _ttype = TEXT_ITEM; 438 int _saveIndex; 439 Token a1=null; 440 Token a2=null; 441 Token a3=null; 442 Token a4=null; 443 444 if ((LA(1)=='$') && (LA(2)=='a')) { 445 match("$append"); 446 { 447 switch ( LA(1)) { 448 case '\t': case '\n': case '\r': case ' ': 449 { 450 mWS(false); 451 break; 452 } 453 case '(': 454 { 455 break; 456 } 457 default: 458 { 459 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 460 } 461 } 462 } 463 match('('); 464 mTEXT_ARG(true); 465 a1=_returnToken; 466 match(')'); 467 468 String t = "text += "+a1.getText(); 469 text.setLength(_begin); text.append(t); 470 471 } 472 else if ((LA(1)=='$') && (LA(2)=='s')) { 473 match("$set"); 474 { 475 if ((LA(1)=='T') && (LA(2)=='e')) { 476 match("Text"); 477 { 478 switch ( LA(1)) { 479 case '\t': case '\n': case '\r': case ' ': 480 { 481 mWS(false); 482 break; 483 } 484 case '(': 485 { 486 break; 487 } 488 default: 489 { 490 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 491 } 492 } 493 } 494 match('('); 495 mTEXT_ARG(true); 496 a2=_returnToken; 497 match(')'); 498 499 String t; 500 t = "{ text.erase(_begin); text += "+a2.getText()+"; }"; 501 text.setLength(_begin); text.append(t); 502 503 } 504 else if ((LA(1)=='T') && (LA(2)=='o')) { 505 match("Token"); 506 { 507 switch ( LA(1)) { 508 case '\t': case '\n': case '\r': case ' ': 509 { 510 mWS(false); 511 break; 512 } 513 case '(': 514 { 515 break; 516 } 517 default: 518 { 519 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 520 } 521 } 522 } 523 match('('); 524 mTEXT_ARG(true); 525 a3=_returnToken; 526 match(')'); 527 528 String t="_token = "+a3.getText(); 529 text.setLength(_begin); text.append(t); 530 531 } 532 else if ((LA(1)=='T') && (LA(2)=='y')) { 533 match("Type"); 534 { 535 switch ( LA(1)) { 536 case '\t': case '\n': case '\r': case ' ': 537 { 538 mWS(false); 539 break; 540 } 541 case '(': 542 { 543 break; 544 } 545 default: 546 { 547 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 548 } 549 } 550 } 551 match('('); 552 mTEXT_ARG(true); 553 a4=_returnToken; 554 match(')'); 555 556 String t="_ttype = "+a4.getText(); 557 text.setLength(_begin); text.append(t); 558 559 } 560 else { 561 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 562 } 563 564 } 565 } 566 else if ((LA(1)=='$') && (LA(2)=='g')) { 567 match("$getText"); 568 569 text.setLength(_begin); text.append("text.substr(_begin,text.length()-_begin)"); 570 571 } 572 else if ((LA(1)=='$') && (LA(2)=='F')) { 573 match("$FOLLOW"); 574 575 if (transInfo != null && transInfo.lookaheadSetName != null) 576 { 577 text.setLength(_begin); text.append(transInfo.lookaheadSetName); 578 } 579 else 580 { 581 reportError("\"$FOLLOW\" not valid in this context"); 583 } 584 585 } 586 else { 587 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 588 } 589 590 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 591 _token = makeToken(_ttype); 592 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 593 } 594 _returnToken = _token; 595 } 596 597 protected final void mCOMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 598 int _ttype; Token _token=null; int _begin=text.length(); 599 _ttype = COMMENT; 600 int _saveIndex; 601 602 if ((LA(1)=='/') && (LA(2)=='/')) { 603 mSL_COMMENT(false); 604 } 605 else if ((LA(1)=='/') && (LA(2)=='*')) { 606 mML_COMMENT(false); 607 } 608 else { 609 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 610 } 611 612 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 613 _token = makeToken(_ttype); 614 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 615 } 616 _returnToken = _token; 617 } 618 619 protected final void mSTRING(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 620 int _ttype; Token _token=null; int _begin=text.length(); 621 _ttype = STRING; 622 int _saveIndex; 623 624 match('"'); 625 { 626 _loop96: 627 do { 628 switch ( LA(1)) { 629 case '\\': 630 { 631 mESC(false); 632 break; 633 } 634 case '\u0003': case '\u0004': case '\u0005': case '\u0006': 635 case '\u0007': case '\u0008': case '\t': case '\n': 636 case '\u000b': case '\u000c': case '\r': case '\u000e': 637 case '\u000f': case '\u0010': case '\u0011': case '\u0012': 638 case '\u0013': case '\u0014': case '\u0015': case '\u0016': 639 case '\u0017': case '\u0018': case '\u0019': case '\u001a': 640 case '\u001b': case '\u001c': case '\u001d': case '\u001e': 641 case '\u001f': case ' ': case '!': case '#': 642 case '$': case '%': case '&': case '\'': 643 case '(': case ')': case '*': case '+': 644 case ',': case '-': case '.': case '/': 645 case '0': case '1': case '2': case '3': 646 case '4': case '5': case '6': case '7': 647 case '8': case '9': case ':': case ';': 648 case '<': case '=': case '>': case '?': 649 case '@': case 'A': case 'B': case 'C': 650 case 'D': case 'E': case 'F': case 'G': 651 case 'H': case 'I': case 'J': case 'K': 652 case 'L': case 'M': case 'N': case 'O': 653 case 'P': case 'Q': case 'R': case 'S': 654 case 'T': case 'U': case 'V': case 'W': 655 case 'X': case 'Y': case 'Z': case '[': 656 case ']': case '^': case '_': case '`': 657 case 'a': case 'b': case 'c': case 'd': 658 case 'e': case 'f': case 'g': case 'h': 659 case 'i': case 'j': case 'k': case 'l': 660 case 'm': case 'n': case 'o': case 'p': 661 case 'q': case 'r': case 's': case 't': 662 case 'u': case 'v': case 'w': case 'x': 663 case 'y': case 'z': case '{': case '|': 664 case '}': case '~': 665 { 666 matchNot('"'); 667 break; 668 } 669 default: 670 { 671 break _loop96; 672 } 673 } 674 } while (true); 675 } 676 match('"'); 677 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 678 _token = makeToken(_ttype); 679 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 680 } 681 _returnToken = _token; 682 } 683 684 protected final void mCHAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 685 int _ttype; Token _token=null; int _begin=text.length(); 686 _ttype = CHAR; 687 int _saveIndex; 688 689 match('\''); 690 { 691 switch ( LA(1)) { 692 case '\\': 693 { 694 mESC(false); 695 break; 696 } 697 case '\u0003': case '\u0004': case '\u0005': case '\u0006': 698 case '\u0007': case '\u0008': case '\t': case '\n': 699 case '\u000b': case '\u000c': case '\r': case '\u000e': 700 case '\u000f': case '\u0010': case '\u0011': case '\u0012': 701 case '\u0013': case '\u0014': case '\u0015': case '\u0016': 702 case '\u0017': case '\u0018': case '\u0019': case '\u001a': 703 case '\u001b': case '\u001c': case '\u001d': case '\u001e': 704 case '\u001f': case ' ': case '!': case '"': 705 case '#': case '$': case '%': case '&': 706 case '(': case ')': case '*': case '+': 707 case ',': case '-': case '.': case '/': 708 case '0': case '1': case '2': case '3': 709 case '4': case '5': case '6': case '7': 710 case '8': case '9': case ':': case ';': 711 case '<': case '=': case '>': case '?': 712 case '@': case 'A': case 'B': case 'C': 713 case 'D': case 'E': case 'F': case 'G': 714 case 'H': case 'I': case 'J': case 'K': 715 case 'L': case 'M': case 'N': case 'O': 716 case 'P': case 'Q': case 'R': case 'S': 717 case 'T': case 'U': case 'V': case 'W': 718 case 'X': case 'Y': case 'Z': case '[': 719 case ']': case '^': case '_': case '`': 720 case 'a': case 'b': case 'c': case 'd': 721 case 'e': case 'f': case 'g': case 'h': 722 case 'i': case 'j': case 'k': case 'l': 723 case 'm': case 'n': case 'o': case 'p': 724 case 'q': case 'r': case 's': case 't': 725 case 'u': case 'v': case 'w': case 'x': 726 case 'y': case 'z': case '{': case '|': 727 case '}': case '~': 728 { 729 matchNot('\''); 730 break; 731 } 732 default: 733 { 734 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 735 } 736 } 737 } 738 match('\''); 739 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 740 _token = makeToken(_ttype); 741 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 742 } 743 _returnToken = _token; 744 } 745 746 protected final void mTREE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 747 int _ttype; Token _token=null; int _begin=text.length(); 748 _ttype = TREE; 749 int _saveIndex; 750 Token t=null; 751 Token t2=null; 752 753 StringBuffer buf = new StringBuffer (); 754 int n=0; 755 Vector terms = new Vector(10); 756 757 758 _saveIndex=text.length(); 759 match('('); 760 text.setLength(_saveIndex); 761 { 762 switch ( LA(1)) { 763 case '\t': case '\n': case '\r': case ' ': 764 { 765 _saveIndex=text.length(); 766 mWS(false); 767 text.setLength(_saveIndex); 768 break; 769 } 770 case '"': case '#': case '(': case ':': 771 case 'A': case 'B': case 'C': case 'D': 772 case 'E': case 'F': case 'G': case 'H': 773 case 'I': case 'J': case 'K': case 'L': 774 case 'M': case 'N': case 'O': case 'P': 775 case 'Q': case 'R': case 'S': case 'T': 776 case 'U': case 'V': case 'W': case 'X': 777 case 'Y': case 'Z': case '[': case '_': 778 case 'a': case 'b': case 'c': case 'd': 779 case 'e': case 'f': case 'g': case 'h': 780 case 'i': case 'j': case 'k': case 'l': 781 case 'm': case 'n': case 'o': case 'p': 782 case 'q': case 'r': case 's': case 't': 783 case 'u': case 'v': case 'w': case 'x': 784 case 'y': case 'z': 785 { 786 break; 787 } 788 default: 789 { 790 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 791 } 792 } 793 } 794 _saveIndex=text.length(); 795 mTREE_ELEMENT(true); 796 text.setLength(_saveIndex); 797 t=_returnToken; 798 799 terms.appendElement( 800 generator.processStringForASTConstructor(t.getText()) 801 ); 802 803 { 804 switch ( LA(1)) { 805 case '\t': case '\n': case '\r': case ' ': 806 { 807 _saveIndex=text.length(); 808 mWS(false); 809 text.setLength(_saveIndex); 810 break; 811 } 812 case ')': case ',': 813 { 814 break; 815 } 816 default: 817 { 818 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 819 } 820 } 821 } 822 { 823 _loop25: 824 do { 825 if ((LA(1)==',')) { 826 _saveIndex=text.length(); 827 match(','); 828 text.setLength(_saveIndex); 829 { 830 switch ( LA(1)) { 831 case '\t': case '\n': case '\r': case ' ': 832 { 833 _saveIndex=text.length(); 834 mWS(false); 835 text.setLength(_saveIndex); 836 break; 837 } 838 case '"': case '#': case '(': case ':': 839 case 'A': case 'B': case 'C': case 'D': 840 case 'E': case 'F': case 'G': case 'H': 841 case 'I': case 'J': case 'K': case 'L': 842 case 'M': case 'N': case 'O': case 'P': 843 case 'Q': case 'R': case 'S': case 'T': 844 case 'U': case 'V': case 'W': case 'X': 845 case 'Y': case 'Z': case '[': case '_': 846 case 'a': case 'b': case 'c': case 'd': 847 case 'e': case 'f': case 'g': case 'h': 848 case 'i': case 'j': case 'k': case 'l': 849 case 'm': case 'n': case 'o': case 'p': 850 case 'q': case 'r': case 's': case 't': 851 case 'u': case 'v': case 'w': case 'x': 852 case 'y': case 'z': 853 { 854 break; 855 } 856 default: 857 { 858 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 859 } 860 } 861 } 862 _saveIndex=text.length(); 863 mTREE_ELEMENT(true); 864 text.setLength(_saveIndex); 865 t2=_returnToken; 866 867 terms.appendElement( 868 generator.processStringForASTConstructor(t2.getText()) 869 ); 870 871 { 872 switch ( LA(1)) { 873 case '\t': case '\n': case '\r': case ' ': 874 { 875 _saveIndex=text.length(); 876 mWS(false); 877 text.setLength(_saveIndex); 878 break; 879 } 880 case ')': case ',': 881 { 882 break; 883 } 884 default: 885 { 886 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 887 } 888 } 889 } 890 } 891 else { 892 break _loop25; 893 } 894 895 } while (true); 896 } 897 text.setLength(_begin); text.append(generator.getASTCreateString(terms)); 898 _saveIndex=text.length(); 899 match(')'); 900 text.setLength(_saveIndex); 901 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 902 _token = makeToken(_ttype); 903 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 904 } 905 _returnToken = _token; 906 } 907 908 protected final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 909 int _ttype; Token _token=null; int _begin=text.length(); 910 _ttype = WS; 911 int _saveIndex; 912 913 { 914 int _cnt116=0; 915 _loop116: 916 do { 917 if ((LA(1)=='\r') && (LA(2)=='\n')) { 918 match('\r'); 919 match('\n'); 920 newline(); 921 } 922 else if ((LA(1)==' ') && (true)) { 923 match(' '); 924 } 925 else if ((LA(1)=='\t') && (true)) { 926 match('\t'); 927 } 928 else if ((LA(1)=='\r') && (true)) { 929 match('\r'); 930 newline(); 931 } 932 else if ((LA(1)=='\n') && (true)) { 933 match('\n'); 934 newline(); 935 } 936 else { 937 if ( _cnt116>=1 ) { break _loop116; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 938 } 939 940 _cnt116++; 941 } while (true); 942 } 943 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 944 _token = makeToken(_ttype); 945 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 946 } 947 _returnToken = _token; 948 } 949 950 protected final void mID(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 951 int _ttype; Token _token=null; int _begin=text.length(); 952 _ttype = ID; 953 int _saveIndex; 954 955 { 956 switch ( LA(1)) { 957 case 'a': case 'b': case 'c': case 'd': 958 case 'e': case 'f': case 'g': case 'h': 959 case 'i': case 'j': case 'k': case 'l': 960 case 'm': case 'n': case 'o': case 'p': 961 case 'q': case 'r': case 's': case 't': 962 case 'u': case 'v': case 'w': case 'x': 963 case 'y': case 'z': 964 { 965 matchRange('a','z'); 966 break; 967 } 968 case 'A': case 'B': case 'C': case 'D': 969 case 'E': case 'F': case 'G': case 'H': 970 case 'I': case 'J': case 'K': case 'L': 971 case 'M': case 'N': case 'O': case 'P': 972 case 'Q': case 'R': case 'S': case 'T': 973 case 'U': case 'V': case 'W': case 'X': 974 case 'Y': case 'Z': 975 { 976 matchRange('A','Z'); 977 break; 978 } 979 case '_': 980 { 981 match('_'); 982 break; 983 } 984 case ':': 985 { 986 match("::"); 987 break; 988 } 989 default: 990 { 991 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 992 } 993 } 994 } 995 { 996 _loop82: 997 do { 998 if ((_tokenSet_4.member(LA(1))) && (true)) { 999 { 1000 switch ( LA(1)) { 1001 case 'a': case 'b': case 'c': case 'd': 1002 case 'e': case 'f': case 'g': case 'h': 1003 case 'i': case 'j': case 'k': case 'l': 1004 case 'm': case 'n': case 'o': case 'p': 1005 case 'q': case 'r': case 's': case 't': 1006 case 'u': case 'v': case 'w': case 'x': 1007 case 'y': case 'z': 1008 { 1009 matchRange('a','z'); 1010 break; 1011 } 1012 case 'A': case 'B': case 'C': case 'D': 1013 case 'E': case 'F': case 'G': case 'H': 1014 case 'I': case 'J': case 'K': case 'L': 1015 case 'M': case 'N': case 'O': case 'P': 1016 case 'Q': case 'R': case 'S': case 'T': 1017 case 'U': case 'V': case 'W': case 'X': 1018 case 'Y': case 'Z': 1019 { 1020 matchRange('A','Z'); 1021 break; 1022 } 1023 case '0': case '1': case '2': case '3': 1024 case '4': case '5': case '6': case '7': 1025 case '8': case '9': 1026 { 1027 matchRange('0','9'); 1028 break; 1029 } 1030 case '_': 1031 { 1032 match('_'); 1033 break; 1034 } 1035 case ':': 1036 { 1037 match("::"); 1038 break; 1039 } 1040 default: 1041 { 1042 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1043 } 1044 } 1045 } 1046 } 1047 else { 1048 break _loop82; 1049 } 1050 1051 } while (true); 1052 } 1053 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1054 _token = makeToken(_ttype); 1055 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1056 } 1057 _returnToken = _token; 1058 } 1059 1060 protected final void mVAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1061 int _ttype; Token _token=null; int _begin=text.length(); 1062 _ttype = VAR_ASSIGN; 1063 int _saveIndex; 1064 1065 match('='); 1066 1067 if ( LA(1)!='=' && transInfo!=null && transInfo.refRuleRoot!=null ) { 1070 transInfo.assignToRoot=true; 1071 } 1072 1073 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1074 _token = makeToken(_ttype); 1075 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1076 } 1077 _returnToken = _token; 1078 } 1079 1080 protected final void mAST_CONSTRUCTOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1081 int _ttype; Token _token=null; int _begin=text.length(); 1082 _ttype = AST_CONSTRUCTOR; 1083 int _saveIndex; 1084 Token x=null; 1085 Token y=null; 1086 1087 _saveIndex=text.length(); 1088 match('['); 1089 text.setLength(_saveIndex); 1090 { 1091 switch ( LA(1)) { 1092 case '\t': case '\n': case '\r': case ' ': 1093 { 1094 _saveIndex=text.length(); 1095 mWS(false); 1096 text.setLength(_saveIndex); 1097 break; 1098 } 1099 case '"': case '#': case '(': case '0': 1100 case '1': case '2': case '3': case '4': 1101 case '5': case '6': case '7': case '8': 1102 case '9': case ':': case 'A': case 'B': 1103 case 'C': case 'D': case 'E': case 'F': 1104 case 'G': case 'H': case 'I': case 'J': 1105 case 'K': case 'L': case 'M': case 'N': 1106 case 'O': case 'P': case 'Q': case 'R': 1107 case 'S': case 'T': case 'U': case 'V': 1108 case 'W': case 'X': case 'Y': case 'Z': 1109 case '[': case '_': case 'a': case 'b': 1110 case 'c': case 'd': case 'e': case 'f': 1111 case 'g': case 'h': case 'i': case 'j': 1112 case 'k': case 'l': case 'm': case 'n': 1113 case 'o': case 'p': case 'q': case 'r': 1114 case 's': case 't': case 'u': case 'v': 1115 case 'w': case 'x': case 'y': case 'z': 1116 { 1117 break; 1118 } 1119 default: 1120 { 1121 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1122 } 1123 } 1124 } 1125 _saveIndex=text.length(); 1126 mAST_CTOR_ELEMENT(true); 1127 text.setLength(_saveIndex); 1128 x=_returnToken; 1129 { 1130 switch ( LA(1)) { 1131 case '\t': case '\n': case '\r': case ' ': 1132 { 1133 _saveIndex=text.length(); 1134 mWS(false); 1135 text.setLength(_saveIndex); 1136 break; 1137 } 1138 case ',': case ']': 1139 { 1140 break; 1141 } 1142 default: 1143 { 1144 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1145 } 1146 } 1147 } 1148 { 1149 switch ( LA(1)) { 1150 case ',': 1151 { 1152 _saveIndex=text.length(); 1153 match(','); 1154 text.setLength(_saveIndex); 1155 { 1156 switch ( LA(1)) { 1157 case '\t': case '\n': case '\r': case ' ': 1158 { 1159 _saveIndex=text.length(); 1160 mWS(false); 1161 text.setLength(_saveIndex); 1162 break; 1163 } 1164 case '"': case '#': case '(': case '0': 1165 case '1': case '2': case '3': case '4': 1166 case '5': case '6': case '7': case '8': 1167 case '9': case ':': case 'A': case 'B': 1168 case 'C': case 'D': case 'E': case 'F': 1169 case 'G': case 'H': case 'I': case 'J': 1170 case 'K': case 'L': case 'M': case 'N': 1171 case 'O': case 'P': case 'Q': case 'R': 1172 case 'S': case 'T': case 'U': case 'V': 1173 case 'W': case 'X': case 'Y': case 'Z': 1174 case '[': case '_': case 'a': case 'b': 1175 case 'c': case 'd': case 'e': case 'f': 1176 case 'g': case 'h': case 'i': case 'j': 1177 case 'k': case 'l': case 'm': case 'n': 1178 case 'o': case 'p': case 'q': case 'r': 1179 case 's': case 't': case 'u': case 'v': 1180 case 'w': case 'x': case 'y': case 'z': 1181 { 1182 break; 1183 } 1184 default: 1185 { 1186 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1187 } 1188 } 1189 } 1190 _saveIndex=text.length(); 1191 mAST_CTOR_ELEMENT(true); 1192 text.setLength(_saveIndex); 1193 y=_returnToken; 1194 { 1195 switch ( LA(1)) { 1196 case '\t': case '\n': case '\r': case ' ': 1197 { 1198 _saveIndex=text.length(); 1199 mWS(false); 1200 text.setLength(_saveIndex); 1201 break; 1202 } 1203 case ']': 1204 { 1205 break; 1206 } 1207 default: 1208 { 1209 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1210 } 1211 } 1212 } 1213 break; 1214 } 1215 case ']': 1216 { 1217 break; 1218 } 1219 default: 1220 { 1221 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1222 } 1223 } 1224 } 1225 _saveIndex=text.length(); 1226 match(']'); 1227 text.setLength(_saveIndex); 1228 1229 String ys = generator.processStringForASTConstructor(x.getText()); 1232 1233 if ( y!=null ) 1236 ys += ","+y.getText(); 1237 1238 text.setLength(_begin); text.append( generator.getASTCreateString(null,ys) ); 1239 1240 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1241 _token = makeToken(_ttype); 1242 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1243 } 1244 _returnToken = _token; 1245 } 1246 1247 protected final void mTEXT_ARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1248 int _ttype; Token _token=null; int _begin=text.length(); 1249 _ttype = TEXT_ARG; 1250 int _saveIndex; 1251 1252 { 1253 switch ( LA(1)) { 1254 case '\t': case '\n': case '\r': case ' ': 1255 { 1256 mWS(false); 1257 break; 1258 } 1259 case '"': case '$': case '\'': case '+': 1260 case '0': case '1': case '2': case '3': 1261 case '4': case '5': case '6': case '7': 1262 case '8': case '9': case ':': case 'A': 1263 case 'B': case 'C': case 'D': case 'E': 1264 case 'F': case 'G': case 'H': case 'I': 1265 case 'J': case 'K': case 'L': case 'M': 1266 case 'N': case 'O': case 'P': case 'Q': 1267 case 'R': case 'S': case 'T': case 'U': 1268 case 'V': case 'W': case 'X': case 'Y': 1269 case 'Z': case '_': case 'a': case 'b': 1270 case 'c': case 'd': case 'e': case 'f': 1271 case 'g': case 'h': case 'i': case 'j': 1272 case 'k': case 'l': case 'm': case 'n': 1273 case 'o': case 'p': case 'q': case 'r': 1274 case 's': case 't': case 'u': case 'v': 1275 case 'w': case 'x': case 'y': case 'z': 1276 { 1277 break; 1278 } 1279 default: 1280 { 1281 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1282 } 1283 } 1284 } 1285 { 1286 int _cnt56=0; 1287 _loop56: 1288 do { 1289 if ((_tokenSet_5.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 1290 mTEXT_ARG_ELEMENT(false); 1291 { 1292 if ((_tokenSet_3.member(LA(1))) && (_tokenSet_6.member(LA(2)))) { 1293 mWS(false); 1294 } 1295 else if ((_tokenSet_6.member(LA(1))) && (true)) { 1296 } 1297 else { 1298 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1299 } 1300 1301 } 1302 } 1303 else { 1304 if ( _cnt56>=1 ) { break _loop56; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 1305 } 1306 1307 _cnt56++; 1308 } while (true); 1309 } 1310 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1311 _token = makeToken(_ttype); 1312 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1313 } 1314 _returnToken = _token; 1315 } 1316 1317 protected final void mTREE_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1318 int _ttype; Token _token=null; int _begin=text.length(); 1319 _ttype = TREE_ELEMENT; 1320 int _saveIndex; 1321 Token id=null; 1322 boolean was_mapped; 1323 1324 switch ( LA(1)) { 1325 case '(': 1326 { 1327 mTREE(false); 1328 break; 1329 } 1330 case '[': 1331 { 1332 mAST_CONSTRUCTOR(false); 1333 break; 1334 } 1335 case ':': case 'A': case 'B': case 'C': 1336 case 'D': case 'E': case 'F': case 'G': 1337 case 'H': case 'I': case 'J': case 'K': 1338 case 'L': case 'M': case 'N': case 'O': 1339 case 'P': case 'Q': case 'R': case 'S': 1340 case 'T': case 'U': case 'V': case 'W': 1341 case 'X': case 'Y': case 'Z': case '_': 1342 case 'a': case 'b': case 'c': case 'd': 1343 case 'e': case 'f': case 'g': case 'h': 1344 case 'i': case 'j': case 'k': case 'l': 1345 case 'm': case 'n': case 'o': case 'p': 1346 case 'q': case 'r': case 's': case 't': 1347 case 'u': case 'v': case 'w': case 'x': 1348 case 'y': case 'z': 1349 { 1350 mID_ELEMENT(false); 1351 break; 1352 } 1353 case '"': 1354 { 1355 mSTRING(false); 1356 break; 1357 } 1358 default: 1359 if ((LA(1)=='#') && (LA(2)=='(')) { 1360 _saveIndex=text.length(); 1361 match('#'); 1362 text.setLength(_saveIndex); 1363 mTREE(false); 1364 } 1365 else if ((LA(1)=='#') && (LA(2)=='[')) { 1366 _saveIndex=text.length(); 1367 match('#'); 1368 text.setLength(_saveIndex); 1369 mAST_CONSTRUCTOR(false); 1370 } 1371 else if ((LA(1)=='#') && (_tokenSet_7.member(LA(2)))) { 1372 _saveIndex=text.length(); 1373 match('#'); 1374 text.setLength(_saveIndex); 1375 was_mapped=mID_ELEMENT(true); 1376 id=_returnToken; 1377 if ( ! was_mapped ) 1379 { 1380 String t = generator.mapTreeId(id.getText(), null); 1381 text.setLength(_begin); text.append(t); 1383 } 1384 1385 } 1386 else if ((LA(1)=='#') && (LA(2)=='#')) { 1387 match("##"); 1388 1389 if( currentRule != null ) 1390 { 1391 String t = currentRule.getRuleName()+"_AST"; 1392 text.setLength(_begin); text.append(t); 1393 } 1394 else 1395 { 1396 reportError("\"##\" not valid in this context"); 1397 text.setLength(_begin); text.append("##"); 1398 } 1399 1400 } 1401 else { 1402 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1403 } 1404 } 1405 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1406 _token = makeToken(_ttype); 1407 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1408 } 1409 _returnToken = _token; 1410 } 1411 1412 1415 protected final boolean mID_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1416 boolean mapped=false; 1417 int _ttype; Token _token=null; int _begin=text.length(); 1418 _ttype = ID_ELEMENT; 1419 int _saveIndex; 1420 Token id=null; 1421 1422 mID(true); 1423 id=_returnToken; 1424 { 1425 if ((_tokenSet_3.member(LA(1))) && (_tokenSet_8.member(LA(2)))) { 1426 _saveIndex=text.length(); 1427 mWS(false); 1428 text.setLength(_saveIndex); 1429 } 1430 else if ((_tokenSet_8.member(LA(1))) && (true)) { 1431 } 1432 else { 1433 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1434 } 1435 1436 } 1437 { 1438 switch ( LA(1)) { 1439 case '(': case '<': 1440 { 1441 { 1442 switch ( LA(1)) { 1443 case '<': 1444 { 1445 match('<'); 1446 { 1447 _loop39: 1448 do { 1449 if ((_tokenSet_9.member(LA(1)))) { 1450 matchNot('>'); 1451 } 1452 else { 1453 break _loop39; 1454 } 1455 1456 } while (true); 1457 } 1458 match('>'); 1459 break; 1460 } 1461 case '(': 1462 { 1463 break; 1464 } 1465 default: 1466 { 1467 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1468 } 1469 } 1470 } 1471 match('('); 1472 { 1473 if ((_tokenSet_3.member(LA(1))) && (_tokenSet_10.member(LA(2)))) { 1474 _saveIndex=text.length(); 1475 mWS(false); 1476 text.setLength(_saveIndex); 1477 } 1478 else if ((_tokenSet_10.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 1479 } 1480 else { 1481 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1482 } 1483 1484 } 1485 { 1486 switch ( LA(1)) { 1487 case '"': case '#': case '\'': case '(': 1488 case '0': case '1': case '2': case '3': 1489 case '4': case '5': case '6': case '7': 1490 case '8': case '9': case ':': case 'A': 1491 case 'B': case 'C': case 'D': case 'E': 1492 case 'F': case 'G': case 'H': case 'I': 1493 case 'J': case 'K': case 'L': case 'M': 1494 case 'N': case 'O': case 'P': case 'Q': 1495 case 'R': case 'S': case 'T': case 'U': 1496 case 'V': case 'W': case 'X': case 'Y': 1497 case 'Z': case '[': case '_': case 'a': 1498 case 'b': case 'c': case 'd': case 'e': 1499 case 'f': case 'g': case 'h': case 'i': 1500 case 'j': case 'k': case 'l': case 'm': 1501 case 'n': case 'o': case 'p': case 'q': 1502 case 'r': case 's': case 't': case 'u': 1503 case 'v': case 'w': case 'x': case 'y': 1504 case 'z': 1505 { 1506 mARG(false); 1507 { 1508 _loop44: 1509 do { 1510 if ((LA(1)==',')) { 1511 match(','); 1512 { 1513 switch ( LA(1)) { 1514 case '\t': case '\n': case '\r': case ' ': 1515 { 1516 _saveIndex=text.length(); 1517 mWS(false); 1518 text.setLength(_saveIndex); 1519 break; 1520 } 1521 case '"': case '#': case '\'': case '(': 1522 case '0': case '1': case '2': case '3': 1523 case '4': case '5': case '6': case '7': 1524 case '8': case '9': case ':': case 'A': 1525 case 'B': case 'C': case 'D': case 'E': 1526 case 'F': case 'G': case 'H': case 'I': 1527 case 'J': case 'K': case 'L': case 'M': 1528 case 'N': case 'O': case 'P': case 'Q': 1529 case 'R': case 'S': case 'T': case 'U': 1530 case 'V': case 'W': case 'X': case 'Y': 1531 case 'Z': case '[': case '_': case 'a': 1532 case 'b': case 'c': case 'd': case 'e': 1533 case 'f': case 'g': case 'h': case 'i': 1534 case 'j': case 'k': case 'l': case 'm': 1535 case 'n': case 'o': case 'p': case 'q': 1536 case 'r': case 's': case 't': case 'u': 1537 case 'v': case 'w': case 'x': case 'y': 1538 case 'z': 1539 { 1540 break; 1541 } 1542 default: 1543 { 1544 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1545 } 1546 } 1547 } 1548 mARG(false); 1549 } 1550 else { 1551 break _loop44; 1552 } 1553 1554 } while (true); 1555 } 1556 break; 1557 } 1558 case '\t': case '\n': case '\r': case ' ': 1559 case ')': 1560 { 1561 break; 1562 } 1563 default: 1564 { 1565 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1566 } 1567 } 1568 } 1569 { 1570 switch ( LA(1)) { 1571 case '\t': case '\n': case '\r': case ' ': 1572 { 1573 _saveIndex=text.length(); 1574 mWS(false); 1575 text.setLength(_saveIndex); 1576 break; 1577 } 1578 case ')': 1579 { 1580 break; 1581 } 1582 default: 1583 { 1584 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1585 } 1586 } 1587 } 1588 match(')'); 1589 break; 1590 } 1591 case '[': 1592 { 1593 { 1594 int _cnt49=0; 1595 _loop49: 1596 do { 1597 if ((LA(1)=='[')) { 1598 match('['); 1599 { 1600 switch ( LA(1)) { 1601 case '\t': case '\n': case '\r': case ' ': 1602 { 1603 _saveIndex=text.length(); 1604 mWS(false); 1605 text.setLength(_saveIndex); 1606 break; 1607 } 1608 case '"': case '#': case '\'': case '(': 1609 case '0': case '1': case '2': case '3': 1610 case '4': case '5': case '6': case '7': 1611 case '8': case '9': case ':': case 'A': 1612 case 'B': case 'C': case 'D': case 'E': 1613 case 'F': case 'G': case 'H': case 'I': 1614 case 'J': case 'K': case 'L': case 'M': 1615 case 'N': case 'O': case 'P': case 'Q': 1616 case 'R': case 'S': case 'T': case 'U': 1617 case 'V': case 'W': case 'X': case 'Y': 1618 case 'Z': case '[': case '_': case 'a': 1619 case 'b': case 'c': case 'd': case 'e': 1620 case 'f': case 'g': case 'h': case 'i': 1621 case 'j': case 'k': case 'l': case 'm': 1622 case 'n': case 'o': case 'p': case 'q': 1623 case 'r': case 's': case 't': case 'u': 1624 case 'v': case 'w': case 'x': case 'y': 1625 case 'z': 1626 { 1627 break; 1628 } 1629 default: 1630 { 1631 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1632 } 1633 } 1634 } 1635 mARG(false); 1636 { 1637 switch ( LA(1)) { 1638 case '\t': case '\n': case '\r': case ' ': 1639 { 1640 _saveIndex=text.length(); 1641 mWS(false); 1642 text.setLength(_saveIndex); 1643 break; 1644 } 1645 case ']': 1646 { 1647 break; 1648 } 1649 default: 1650 { 1651 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1652 } 1653 } 1654 } 1655 match(']'); 1656 } 1657 else { 1658 if ( _cnt49>=1 ) { break _loop49; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 1659 } 1660 1661 _cnt49++; 1662 } while (true); 1663 } 1664 break; 1665 } 1666 case '.': 1667 { 1668 match('.'); 1669 mID_ELEMENT(false); 1670 break; 1671 } 1672 case ':': 1673 { 1674 match("::"); 1675 mID_ELEMENT(false); 1676 break; 1677 } 1678 default: 1679 if ((LA(1)=='-') && (LA(2)=='>')) { 1680 match("->"); 1681 mID_ELEMENT(false); 1682 } 1683 else if ((_tokenSet_11.member(LA(1))) && (true)) { 1684 1685 mapped = true; 1686 String t = generator.mapTreeId(id.getText(), transInfo); 1687 text.setLength(_begin); text.append(t); 1689 1690 { 1691 if (((_tokenSet_12.member(LA(1))) && (_tokenSet_11.member(LA(2))))&&(transInfo!=null && transInfo.refRuleRoot!=null)) { 1692 { 1693 switch ( LA(1)) { 1694 case '\t': case '\n': case '\r': case ' ': 1695 { 1696 mWS(false); 1697 break; 1698 } 1699 case '=': 1700 { 1701 break; 1702 } 1703 default: 1704 { 1705 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1706 } 1707 } 1708 } 1709 mVAR_ASSIGN(false); 1710 } 1711 else if ((_tokenSet_13.member(LA(1))) && (true)) { 1712 } 1713 else { 1714 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1715 } 1716 1717 } 1718 } 1719 else { 1720 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1721 } 1722 } 1723 } 1724 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1725 _token = makeToken(_ttype); 1726 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1727 } 1728 _returnToken = _token; 1729 return mapped; 1730 } 1731 1732 1735 protected final void mAST_CTOR_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1736 int _ttype; Token _token=null; int _begin=text.length(); 1737 _ttype = AST_CTOR_ELEMENT; 1738 int _saveIndex; 1739 1740 if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 1741 mSTRING(false); 1742 } 1743 else if ((_tokenSet_14.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 1744 mTREE_ELEMENT(false); 1745 } 1746 else if (((LA(1) >= '0' && LA(1) <= '9'))) { 1747 mINT(false); 1748 } 1749 else { 1750 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1751 } 1752 1753 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1754 _token = makeToken(_ttype); 1755 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1756 } 1757 _returnToken = _token; 1758 } 1759 1760 protected final void mINT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1761 int _ttype; Token _token=null; int _begin=text.length(); 1762 _ttype = INT; 1763 int _saveIndex; 1764 1765 { 1766 int _cnt107=0; 1767 _loop107: 1768 do { 1769 if (((LA(1) >= '0' && LA(1) <= '9'))) { 1770 mDIGIT(false); 1771 } 1772 else { 1773 if ( _cnt107>=1 ) { break _loop107; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 1774 } 1775 1776 _cnt107++; 1777 } while (true); 1778 } 1779 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1780 _token = makeToken(_ttype); 1781 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1782 } 1783 _returnToken = _token; 1784 } 1785 1786 protected final void mARG(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1787 int _ttype; Token _token=null; int _begin=text.length(); 1788 _ttype = ARG; 1789 int _saveIndex; 1790 1791 { 1792 switch ( LA(1)) { 1793 case '\'': 1794 { 1795 mCHAR(false); 1796 break; 1797 } 1798 case '0': case '1': case '2': case '3': 1799 case '4': case '5': case '6': case '7': 1800 case '8': case '9': 1801 { 1802 mINT_OR_FLOAT(false); 1803 break; 1804 } 1805 default: 1806 if ((_tokenSet_14.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 1807 mTREE_ELEMENT(false); 1808 } 1809 else if ((LA(1)=='"') && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 1810 mSTRING(false); 1811 } 1812 else { 1813 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1814 } 1815 } 1816 } 1817 { 1818 _loop77: 1819 do { 1820 if ((_tokenSet_15.member(LA(1))) && (_tokenSet_16.member(LA(2)))) { 1821 { 1822 switch ( LA(1)) { 1823 case '\t': case '\n': case '\r': case ' ': 1824 { 1825 mWS(false); 1826 break; 1827 } 1828 case '*': case '+': case '-': case '/': 1829 { 1830 break; 1831 } 1832 default: 1833 { 1834 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1835 } 1836 } 1837 } 1838 { 1839 switch ( LA(1)) { 1840 case '+': 1841 { 1842 match('+'); 1843 break; 1844 } 1845 case '-': 1846 { 1847 match('-'); 1848 break; 1849 } 1850 case '*': 1851 { 1852 match('*'); 1853 break; 1854 } 1855 case '/': 1856 { 1857 match('/'); 1858 break; 1859 } 1860 default: 1861 { 1862 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1863 } 1864 } 1865 } 1866 { 1867 switch ( LA(1)) { 1868 case '\t': case '\n': case '\r': case ' ': 1869 { 1870 mWS(false); 1871 break; 1872 } 1873 case '"': case '#': case '\'': case '(': 1874 case '0': case '1': case '2': case '3': 1875 case '4': case '5': case '6': case '7': 1876 case '8': case '9': case ':': case 'A': 1877 case 'B': case 'C': case 'D': case 'E': 1878 case 'F': case 'G': case 'H': case 'I': 1879 case 'J': case 'K': case 'L': case 'M': 1880 case 'N': case 'O': case 'P': case 'Q': 1881 case 'R': case 'S': case 'T': case 'U': 1882 case 'V': case 'W': case 'X': case 'Y': 1883 case 'Z': case '[': case '_': case 'a': 1884 case 'b': case 'c': case 'd': case 'e': 1885 case 'f': case 'g': case 'h': case 'i': 1886 case 'j': case 'k': case 'l': case 'm': 1887 case 'n': case 'o': case 'p': case 'q': 1888 case 'r': case 's': case 't': case 'u': 1889 case 'v': case 'w': case 'x': case 'y': 1890 case 'z': 1891 { 1892 break; 1893 } 1894 default: 1895 { 1896 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1897 } 1898 } 1899 } 1900 mARG(false); 1901 } 1902 else { 1903 break _loop77; 1904 } 1905 1906 } while (true); 1907 } 1908 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1909 _token = makeToken(_ttype); 1910 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1911 } 1912 _returnToken = _token; 1913 } 1914 1915 protected final void mTEXT_ARG_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1916 int _ttype; Token _token=null; int _begin=text.length(); 1917 _ttype = TEXT_ARG_ELEMENT; 1918 int _saveIndex; 1919 1920 switch ( LA(1)) { 1921 case ':': case 'A': case 'B': case 'C': 1922 case 'D': case 'E': case 'F': case 'G': 1923 case 'H': case 'I': case 'J': case 'K': 1924 case 'L': case 'M': case 'N': case 'O': 1925 case 'P': case 'Q': case 'R': case 'S': 1926 case 'T': case 'U': case 'V': case 'W': 1927 case 'X': case 'Y': case 'Z': case '_': 1928 case 'a': case 'b': case 'c': case 'd': 1929 case 'e': case 'f': case 'g': case 'h': 1930 case 'i': case 'j': case 'k': case 'l': 1931 case 'm': case 'n': case 'o': case 'p': 1932 case 'q': case 'r': case 's': case 't': 1933 case 'u': case 'v': case 'w': case 'x': 1934 case 'y': case 'z': 1935 { 1936 mTEXT_ARG_ID_ELEMENT(false); 1937 break; 1938 } 1939 case '"': 1940 { 1941 mSTRING(false); 1942 break; 1943 } 1944 case '\'': 1945 { 1946 mCHAR(false); 1947 break; 1948 } 1949 case '0': case '1': case '2': case '3': 1950 case '4': case '5': case '6': case '7': 1951 case '8': case '9': 1952 { 1953 mINT_OR_FLOAT(false); 1954 break; 1955 } 1956 case '$': 1957 { 1958 mTEXT_ITEM(false); 1959 break; 1960 } 1961 case '+': 1962 { 1963 match('+'); 1964 break; 1965 } 1966 default: 1967 { 1968 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1969 } 1970 } 1971 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 1972 _token = makeToken(_ttype); 1973 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 1974 } 1975 _returnToken = _token; 1976 } 1977 1978 protected final void mTEXT_ARG_ID_ELEMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 1979 int _ttype; Token _token=null; int _begin=text.length(); 1980 _ttype = TEXT_ARG_ID_ELEMENT; 1981 int _saveIndex; 1982 Token id=null; 1983 1984 mID(true); 1985 id=_returnToken; 1986 { 1987 if ((_tokenSet_3.member(LA(1))) && (_tokenSet_17.member(LA(2)))) { 1988 _saveIndex=text.length(); 1989 mWS(false); 1990 text.setLength(_saveIndex); 1991 } 1992 else if ((_tokenSet_17.member(LA(1))) && (true)) { 1993 } 1994 else { 1995 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 1996 } 1997 1998 } 1999 { 2000 switch ( LA(1)) { 2001 case '(': 2002 { 2003 match('('); 2004 { 2005 if ((_tokenSet_3.member(LA(1))) && (_tokenSet_18.member(LA(2)))) { 2006 _saveIndex=text.length(); 2007 mWS(false); 2008 text.setLength(_saveIndex); 2009 } 2010 else if ((_tokenSet_18.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2011 } 2012 else { 2013 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2014 } 2015 2016 } 2017 { 2018 _loop65: 2019 do { 2020 if ((_tokenSet_19.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2021 mTEXT_ARG(false); 2022 { 2023 _loop64: 2024 do { 2025 if ((LA(1)==',')) { 2026 match(','); 2027 mTEXT_ARG(false); 2028 } 2029 else { 2030 break _loop64; 2031 } 2032 2033 } while (true); 2034 } 2035 } 2036 else { 2037 break _loop65; 2038 } 2039 2040 } while (true); 2041 } 2042 { 2043 switch ( LA(1)) { 2044 case '\t': case '\n': case '\r': case ' ': 2045 { 2046 _saveIndex=text.length(); 2047 mWS(false); 2048 text.setLength(_saveIndex); 2049 break; 2050 } 2051 case ')': 2052 { 2053 break; 2054 } 2055 default: 2056 { 2057 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2058 } 2059 } 2060 } 2061 match(')'); 2062 break; 2063 } 2064 case '[': 2065 { 2066 { 2067 int _cnt70=0; 2068 _loop70: 2069 do { 2070 if ((LA(1)=='[')) { 2071 match('['); 2072 { 2073 if ((_tokenSet_3.member(LA(1))) && (_tokenSet_19.member(LA(2)))) { 2074 _saveIndex=text.length(); 2075 mWS(false); 2076 text.setLength(_saveIndex); 2077 } 2078 else if ((_tokenSet_19.member(LA(1))) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2079 } 2080 else { 2081 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2082 } 2083 2084 } 2085 mTEXT_ARG(false); 2086 { 2087 switch ( LA(1)) { 2088 case '\t': case '\n': case '\r': case ' ': 2089 { 2090 _saveIndex=text.length(); 2091 mWS(false); 2092 text.setLength(_saveIndex); 2093 break; 2094 } 2095 case ']': 2096 { 2097 break; 2098 } 2099 default: 2100 { 2101 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2102 } 2103 } 2104 } 2105 match(']'); 2106 } 2107 else { 2108 if ( _cnt70>=1 ) { break _loop70; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 2109 } 2110 2111 _cnt70++; 2112 } while (true); 2113 } 2114 break; 2115 } 2116 case '.': 2117 { 2118 match('.'); 2119 mTEXT_ARG_ID_ELEMENT(false); 2120 break; 2121 } 2122 case '-': 2123 { 2124 match("->"); 2125 mTEXT_ARG_ID_ELEMENT(false); 2126 break; 2127 } 2128 default: 2129 if ((LA(1)==':') && (LA(2)==':')) { 2130 match("::"); 2131 mTEXT_ARG_ID_ELEMENT(false); 2132 } 2133 else if ((_tokenSet_6.member(LA(1))) && (true)) { 2134 } 2135 else { 2136 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2137 } 2138 } 2139 } 2140 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 2141 _token = makeToken(_ttype); 2142 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 2143 } 2144 _returnToken = _token; 2145 } 2146 2147 protected final void mINT_OR_FLOAT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 2148 int _ttype; Token _token=null; int _begin=text.length(); 2149 _ttype = INT_OR_FLOAT; 2150 int _saveIndex; 2151 2152 { 2153 int _cnt110=0; 2154 _loop110: 2155 do { 2156 if (((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_20.member(LA(2)))) { 2157 mDIGIT(false); 2158 } 2159 else { 2160 if ( _cnt110>=1 ) { break _loop110; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} 2161 } 2162 2163 _cnt110++; 2164 } while (true); 2165 } 2166 { 2167 if ((LA(1)=='L') && (_tokenSet_21.member(LA(2)))) { 2168 match('L'); 2169 } 2170 else if ((LA(1)=='l') && (_tokenSet_21.member(LA(2)))) { 2171 match('l'); 2172 } 2173 else if ((LA(1)=='.')) { 2174 match('.'); 2175 { 2176 _loop113: 2177 do { 2178 if (((LA(1) >= '0' && LA(1) <= '9')) && (_tokenSet_21.member(LA(2)))) { 2179 mDIGIT(false); 2180 } 2181 else { 2182 break _loop113; 2183 } 2184 2185 } while (true); 2186 } 2187 } 2188 else if ((_tokenSet_21.member(LA(1))) && (true)) { 2189 } 2190 else { 2191 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2192 } 2193 2194 } 2195 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 2196 _token = makeToken(_ttype); 2197 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 2198 } 2199 _returnToken = _token; 2200 } 2201 2202 protected final void mSL_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 2203 int _ttype; Token _token=null; int _begin=text.length(); 2204 _ttype = SL_COMMENT; 2205 int _saveIndex; 2206 2207 match("//"); 2208 { 2209 _loop87: 2210 do { 2211 if ((LA(1)=='\n'||LA(1)=='\r') && (true)) break _loop87; 2213 if (((LA(1) >= '\u0003' && LA(1) <= '~')) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2214 matchNot(EOF_CHAR); 2215 } 2216 else { 2217 break _loop87; 2218 } 2219 2220 } while (true); 2221 } 2222 { 2223 if ((LA(1)=='\r') && (LA(2)=='\n')) { 2224 match("\r\n"); 2225 } 2226 else if ((LA(1)=='\n')) { 2227 match('\n'); 2228 } 2229 else if ((LA(1)=='\r') && (true)) { 2230 match('\r'); 2231 } 2232 else { 2233 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2234 } 2235 2236 } 2237 newline(); 2238 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 2239 _token = makeToken(_ttype); 2240 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 2241 } 2242 _returnToken = _token; 2243 } 2244 2245 protected final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 2246 int _ttype; Token _token=null; int _begin=text.length(); 2247 _ttype = ML_COMMENT; 2248 int _saveIndex; 2249 2250 match("/*"); 2251 { 2252 _loop91: 2253 do { 2254 if ((LA(1)=='*') && (LA(2)=='/')) break _loop91; 2256 if ((LA(1)=='\r') && (LA(2)=='\n')) { 2257 match('\r'); 2258 match('\n'); 2259 newline(); 2260 } 2261 else if ((LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2262 match('\r'); 2263 newline(); 2264 } 2265 else if ((LA(1)=='\n') && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2266 match('\n'); 2267 newline(); 2268 } 2269 else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2270 matchNot(EOF_CHAR); 2271 } 2272 else { 2273 break _loop91; 2274 } 2275 2276 } while (true); 2277 } 2278 match("*/"); 2279 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 2280 _token = makeToken(_ttype); 2281 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 2282 } 2283 _returnToken = _token; 2284 } 2285 2286 protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 2287 int _ttype; Token _token=null; int _begin=text.length(); 2288 _ttype = ESC; 2289 int _saveIndex; 2290 2291 match('\\'); 2292 { 2293 switch ( LA(1)) { 2294 case 'n': 2295 { 2296 match('n'); 2297 break; 2298 } 2299 case 'r': 2300 { 2301 match('r'); 2302 break; 2303 } 2304 case 't': 2305 { 2306 match('t'); 2307 break; 2308 } 2309 case 'b': 2310 { 2311 match('b'); 2312 break; 2313 } 2314 case 'f': 2315 { 2316 match('f'); 2317 break; 2318 } 2319 case '"': 2320 { 2321 match('"'); 2322 break; 2323 } 2324 case '\'': 2325 { 2326 match('\''); 2327 break; 2328 } 2329 case '\\': 2330 { 2331 match('\\'); 2332 break; 2333 } 2334 case '0': case '1': case '2': case '3': 2335 { 2336 { 2337 matchRange('0','3'); 2338 } 2339 { 2340 if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2341 mDIGIT(false); 2342 { 2343 if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2344 mDIGIT(false); 2345 } 2346 else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) { 2347 } 2348 else { 2349 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2350 } 2351 2352 } 2353 } 2354 else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) { 2355 } 2356 else { 2357 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2358 } 2359 2360 } 2361 break; 2362 } 2363 case '4': case '5': case '6': case '7': 2364 { 2365 { 2366 matchRange('4','7'); 2367 } 2368 { 2369 if (((LA(1) >= '0' && LA(1) <= '9')) && ((LA(2) >= '\u0003' && LA(2) <= '~'))) { 2370 mDIGIT(false); 2371 } 2372 else if (((LA(1) >= '\u0003' && LA(1) <= '~')) && (true)) { 2373 } 2374 else { 2375 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2376 } 2377 2378 } 2379 break; 2380 } 2381 default: 2382 { 2383 throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); 2384 } 2385 } 2386 } 2387 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 2388 _token = makeToken(_ttype); 2389 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 2390 } 2391 _returnToken = _token; 2392 } 2393 2394 protected final void mDIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { 2395 int _ttype; Token _token=null; int _begin=text.length(); 2396 _ttype = DIGIT; 2397 int _saveIndex; 2398 2399 matchRange('0','9'); 2400 if ( _createToken && _token==null && _ttype!=Token.SKIP ) { 2401 _token = makeToken(_ttype); 2402 _token.setText(new String (text.getBuffer(), _begin, text.length()-_begin)); 2403 } 2404 _returnToken = _token; 2405 } 2406 2407 2408 private static final long _tokenSet_0_data_[] = { -145135534866440L, 9223372036854775807L, 0L, 0L }; 2409 public static final BitSet _tokenSet_0 = new BitSet(_tokenSet_0_data_); 2410 private static final long _tokenSet_1_data_[] = { -141407503262728L, 9223372036854775807L, 0L, 0L }; 2411 public static final BitSet _tokenSet_1 = new BitSet(_tokenSet_1_data_); 2412 private static final long _tokenSet_2_data_[] = { 288230380446688768L, 576460745995190270L, 0L, 0L }; 2413 public static final BitSet _tokenSet_2 = new BitSet(_tokenSet_2_data_); 2414 private static final long _tokenSet_3_data_[] = { 4294977024L, 0L, 0L }; 2415 public static final BitSet _tokenSet_3 = new BitSet(_tokenSet_3_data_); 2416 private static final long _tokenSet_4_data_[] = { 576179277326712832L, 576460745995190270L, 0L, 0L }; 2417 public static final BitSet _tokenSet_4 = new BitSet(_tokenSet_4_data_); 2418 private static final long _tokenSet_5_data_[] = { 576188709074894848L, 576460745995190270L, 0L, 0L }; 2419 public static final BitSet _tokenSet_5 = new BitSet(_tokenSet_5_data_); 2420 private static final long _tokenSet_6_data_[] = { 576208504579171840L, 576460746532061182L, 0L, 0L }; 2421 public static final BitSet _tokenSet_6 = new BitSet(_tokenSet_6_data_); 2422 private static final long _tokenSet_7_data_[] = { 288230376151711744L, 576460745995190270L, 0L, 0L }; 2423 public static final BitSet _tokenSet_7 = new BitSet(_tokenSet_7_data_); 2424 private static final long _tokenSet_8_data_[] = { 3747275269732312576L, 671088640L, 0L, 0L }; 2425 public static final BitSet _tokenSet_8 = new BitSet(_tokenSet_8_data_); 2426 private static final long _tokenSet_9_data_[] = { -4611686018427387912L, 9223372036854775807L, 0L, 0L }; 2427 public static final BitSet _tokenSet_9 = new BitSet(_tokenSet_9_data_); 2428 private static final long _tokenSet_10_data_[] = { 576183181451994624L, 576460746129407998L, 0L, 0L }; 2429 public static final BitSet _tokenSet_10 = new BitSet(_tokenSet_10_data_); 2430 private static final long _tokenSet_11_data_[] = { 2306051920717948416L, 536870912L, 0L, 0L }; 2431 public static final BitSet _tokenSet_11 = new BitSet(_tokenSet_11_data_); 2432 private static final long _tokenSet_12_data_[] = { 2305843013508670976L, 0L, 0L }; 2433 public static final BitSet _tokenSet_12 = new BitSet(_tokenSet_12_data_); 2434 private static final long _tokenSet_13_data_[] = { 208911504254464L, 536870912L, 0L, 0L }; 2435 public static final BitSet _tokenSet_13 = new BitSet(_tokenSet_13_data_); 2436 private static final long _tokenSet_14_data_[] = { 288231527202947072L, 576460746129407998L, 0L, 0L }; 2437 public static final BitSet _tokenSet_14 = new BitSet(_tokenSet_14_data_); 2438 private static final long _tokenSet_15_data_[] = { 189120294954496L, 0L, 0L }; 2439 public static final BitSet _tokenSet_15 = new BitSet(_tokenSet_15_data_); 2440 private static final long _tokenSet_16_data_[] = { 576370098428716544L, 576460746129407998L, 0L, 0L }; 2441 public static final BitSet _tokenSet_16 = new BitSet(_tokenSet_16_data_); 2442 private static final long _tokenSet_17_data_[] = { 576315157207066112L, 576460746666278910L, 0L, 0L }; 2443 public static final BitSet _tokenSet_17 = new BitSet(_tokenSet_17_data_); 2444 private static final long _tokenSet_18_data_[] = { 576190912393127424L, 576460745995190270L, 0L, 0L }; 2445 public static final BitSet _tokenSet_18 = new BitSet(_tokenSet_18_data_); 2446 private static final long _tokenSet_19_data_[] = { 576188713369871872L, 576460745995190270L, 0L, 0L }; 2447 public static final BitSet _tokenSet_19 = new BitSet(_tokenSet_19_data_); 2448 private static final long _tokenSet_20_data_[] = { 576459193230304768L, 576460746532061182L, 0L, 0L }; 2449 public static final BitSet _tokenSet_20 = new BitSet(_tokenSet_20_data_); 2450 private static final long _tokenSet_21_data_[] = { 576388824486127104L, 576460746532061182L, 0L, 0L }; 2451 public static final BitSet _tokenSet_21 = new BitSet(_tokenSet_21_data_); 2452 2453 } 2454
| Popular Tags
|