1/** \file 2 * This OBJC source file was generated by $ANTLR version 3.4 3 * 4 * - From the grammar source file : /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g 5 * - On : 2012-02-16 17:39:19 6 * - for the lexer : SimpleCLexerLexer 7 * 8 * Editing it, at least manually, is not wise. 9 * 10 * ObjC language generator and runtime by Alan Condit, acondit|hereisanat|ipns|dotgoeshere|com. 11 * 12 * 13*/ 14// $ANTLR 3.4 /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g 2012-02-16 17:39:19 15 16 17/* ----------------------------------------- 18 * Include the ANTLR3 generated header file. 19 */ 20#import "SimpleCLexer.h" 21/* ----------------------------------------- */ 22 23 24/* ============================================================================= */ 25/* ============================================================================= 26 * Start of recognizer 27 */ 28 29/** As per Terence: No returns for lexer rules! */ 30@implementation SimpleCLexer // line 330 31 32+ (void) initialize 33{ 34 [BaseRecognizer setGrammarFileName:@"/Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g"]; 35} 36 37+ (NSString *) tokenNameForType:(NSInteger)aTokenType 38{ 39 return [[self getTokenNames] objectAtIndex:aTokenType]; 40} 41 42+ (SimpleCLexer *)newSimpleCLexerWithCharStream:(id<CharStream>)anInput 43{ 44 return [[SimpleCLexer alloc] initWithCharStream:anInput]; 45} 46 47- (id) initWithCharStream:(id<CharStream>)anInput 48{ 49 self = [super initWithCharStream:anInput State:[RecognizerSharedState newRecognizerSharedStateWithRuleLen:18+1]]; 50 if ( self != nil ) { 51 } 52 return self; 53} 54 55- (void) dealloc 56{ 57 [super dealloc]; 58} 59 60/* ObjC Start of actions.lexer.methods */ 61/* ObjC end of actions.lexer.methods */ 62/* ObjC start methods() */ 63/* ObjC end methods() */ 64 65/* Start of Rules */ 66// $ANTLR start "T__7" 67- (void) mT__7 68{ 69 // 70 /* ruleScopeSetUp */ 71 72 /* ruleDeclarations */ 73 74 @try { 75 NSInteger _type = T__7; 76 NSInteger _channel = TokenChannelDefault; 77 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:7:6: ( '(' ) // ruleBlockSingleAlt 78 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:7:8: '(' // alt 79 { 80 81 82 [self matchChar:'(']; 83 84 85 } 86 87 /* token+rule list labels */ 88 89 state.type = _type; 90 state.channel = _channel; 91 } 92 @finally { 93 // 94 /* ruleScopeCleanUp */ 95 96 } 97 return; 98} 99/* $ANTLR end "T__7" */ 100// $ANTLR start "T__8" 101- (void) mT__8 102{ 103 // 104 /* ruleScopeSetUp */ 105 106 /* ruleDeclarations */ 107 108 @try { 109 NSInteger _type = T__8; 110 NSInteger _channel = TokenChannelDefault; 111 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:8:6: ( ')' ) // ruleBlockSingleAlt 112 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:8:8: ')' // alt 113 { 114 115 116 [self matchChar:')']; 117 118 119 } 120 121 /* token+rule list labels */ 122 123 state.type = _type; 124 state.channel = _channel; 125 } 126 @finally { 127 // 128 /* ruleScopeCleanUp */ 129 130 } 131 return; 132} 133/* $ANTLR end "T__8" */ 134// $ANTLR start "T__9" 135- (void) mT__9 136{ 137 // 138 /* ruleScopeSetUp */ 139 140 /* ruleDeclarations */ 141 142 @try { 143 NSInteger _type = T__9; 144 NSInteger _channel = TokenChannelDefault; 145 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:9:6: ( '+' ) // ruleBlockSingleAlt 146 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:9:8: '+' // alt 147 { 148 149 150 [self matchChar:'+']; 151 152 153 } 154 155 /* token+rule list labels */ 156 157 state.type = _type; 158 state.channel = _channel; 159 } 160 @finally { 161 // 162 /* ruleScopeCleanUp */ 163 164 } 165 return; 166} 167/* $ANTLR end "T__9" */ 168// $ANTLR start "T__10" 169- (void) mT__10 170{ 171 // 172 /* ruleScopeSetUp */ 173 174 /* ruleDeclarations */ 175 176 @try { 177 NSInteger _type = T__10; 178 NSInteger _channel = TokenChannelDefault; 179 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:10:7: ( ',' ) // ruleBlockSingleAlt 180 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:10:9: ',' // alt 181 { 182 183 184 [self matchChar:',']; 185 186 187 } 188 189 /* token+rule list labels */ 190 191 state.type = _type; 192 state.channel = _channel; 193 } 194 @finally { 195 // 196 /* ruleScopeCleanUp */ 197 198 } 199 return; 200} 201/* $ANTLR end "T__10" */ 202// $ANTLR start "T__11" 203- (void) mT__11 204{ 205 // 206 /* ruleScopeSetUp */ 207 208 /* ruleDeclarations */ 209 210 @try { 211 NSInteger _type = T__11; 212 NSInteger _channel = TokenChannelDefault; 213 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:11:7: ( ';' ) // ruleBlockSingleAlt 214 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:11:9: ';' // alt 215 { 216 217 218 [self matchChar:';']; 219 220 221 } 222 223 /* token+rule list labels */ 224 225 state.type = _type; 226 state.channel = _channel; 227 } 228 @finally { 229 // 230 /* ruleScopeCleanUp */ 231 232 } 233 return; 234} 235/* $ANTLR end "T__11" */ 236// $ANTLR start "T__12" 237- (void) mT__12 238{ 239 // 240 /* ruleScopeSetUp */ 241 242 /* ruleDeclarations */ 243 244 @try { 245 NSInteger _type = T__12; 246 NSInteger _channel = TokenChannelDefault; 247 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:12:7: ( '<' ) // ruleBlockSingleAlt 248 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:12:9: '<' // alt 249 { 250 251 252 [self matchChar:'<']; 253 254 255 } 256 257 /* token+rule list labels */ 258 259 state.type = _type; 260 state.channel = _channel; 261 } 262 @finally { 263 // 264 /* ruleScopeCleanUp */ 265 266 } 267 return; 268} 269/* $ANTLR end "T__12" */ 270// $ANTLR start "T__13" 271- (void) mT__13 272{ 273 // 274 /* ruleScopeSetUp */ 275 276 /* ruleDeclarations */ 277 278 @try { 279 NSInteger _type = T__13; 280 NSInteger _channel = TokenChannelDefault; 281 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:13:7: ( '=' ) // ruleBlockSingleAlt 282 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:13:9: '=' // alt 283 { 284 285 286 [self matchChar:'=']; 287 288 289 } 290 291 /* token+rule list labels */ 292 293 state.type = _type; 294 state.channel = _channel; 295 } 296 @finally { 297 // 298 /* ruleScopeCleanUp */ 299 300 } 301 return; 302} 303/* $ANTLR end "T__13" */ 304// $ANTLR start "T__14" 305- (void) mT__14 306{ 307 // 308 /* ruleScopeSetUp */ 309 310 /* ruleDeclarations */ 311 312 @try { 313 NSInteger _type = T__14; 314 NSInteger _channel = TokenChannelDefault; 315 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:14:7: ( '==' ) // ruleBlockSingleAlt 316 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:14:9: '==' // alt 317 { 318 319 320 [self matchString:@"=="]; 321 322 323 324 } 325 326 /* token+rule list labels */ 327 328 state.type = _type; 329 state.channel = _channel; 330 } 331 @finally { 332 // 333 /* ruleScopeCleanUp */ 334 335 } 336 return; 337} 338/* $ANTLR end "T__14" */ 339// $ANTLR start "T__15" 340- (void) mT__15 341{ 342 // 343 /* ruleScopeSetUp */ 344 345 /* ruleDeclarations */ 346 347 @try { 348 NSInteger _type = T__15; 349 NSInteger _channel = TokenChannelDefault; 350 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:15:7: ( 'char' ) // ruleBlockSingleAlt 351 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:15:9: 'char' // alt 352 { 353 354 355 [self matchString:@"char"]; 356 357 358 359 } 360 361 /* token+rule list labels */ 362 363 state.type = _type; 364 state.channel = _channel; 365 } 366 @finally { 367 // 368 /* ruleScopeCleanUp */ 369 370 } 371 return; 372} 373/* $ANTLR end "T__15" */ 374// $ANTLR start "T__16" 375- (void) mT__16 376{ 377 // 378 /* ruleScopeSetUp */ 379 380 /* ruleDeclarations */ 381 382 @try { 383 NSInteger _type = T__16; 384 NSInteger _channel = TokenChannelDefault; 385 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:16:7: ( 'for' ) // ruleBlockSingleAlt 386 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:16:9: 'for' // alt 387 { 388 389 390 [self matchString:@"for"]; 391 392 393 394 } 395 396 /* token+rule list labels */ 397 398 state.type = _type; 399 state.channel = _channel; 400 } 401 @finally { 402 // 403 /* ruleScopeCleanUp */ 404 405 } 406 return; 407} 408/* $ANTLR end "T__16" */ 409// $ANTLR start "T__17" 410- (void) mT__17 411{ 412 // 413 /* ruleScopeSetUp */ 414 415 /* ruleDeclarations */ 416 417 @try { 418 NSInteger _type = T__17; 419 NSInteger _channel = TokenChannelDefault; 420 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:17:7: ( 'int' ) // ruleBlockSingleAlt 421 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:17:9: 'int' // alt 422 { 423 424 425 [self matchString:@"int"]; 426 427 428 429 } 430 431 /* token+rule list labels */ 432 433 state.type = _type; 434 state.channel = _channel; 435 } 436 @finally { 437 // 438 /* ruleScopeCleanUp */ 439 440 } 441 return; 442} 443/* $ANTLR end "T__17" */ 444// $ANTLR start "T__18" 445- (void) mT__18 446{ 447 // 448 /* ruleScopeSetUp */ 449 450 /* ruleDeclarations */ 451 452 @try { 453 NSInteger _type = T__18; 454 NSInteger _channel = TokenChannelDefault; 455 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:18:7: ( 'void' ) // ruleBlockSingleAlt 456 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:18:9: 'void' // alt 457 { 458 459 460 [self matchString:@"void"]; 461 462 463 464 } 465 466 /* token+rule list labels */ 467 468 state.type = _type; 469 state.channel = _channel; 470 } 471 @finally { 472 // 473 /* ruleScopeCleanUp */ 474 475 } 476 return; 477} 478/* $ANTLR end "T__18" */ 479// $ANTLR start "T__19" 480- (void) mT__19 481{ 482 // 483 /* ruleScopeSetUp */ 484 485 /* ruleDeclarations */ 486 487 @try { 488 NSInteger _type = T__19; 489 NSInteger _channel = TokenChannelDefault; 490 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:19:7: ( '{' ) // ruleBlockSingleAlt 491 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:19:9: '{' // alt 492 { 493 494 495 [self matchChar:'{']; 496 497 498 } 499 500 /* token+rule list labels */ 501 502 state.type = _type; 503 state.channel = _channel; 504 } 505 @finally { 506 // 507 /* ruleScopeCleanUp */ 508 509 } 510 return; 511} 512/* $ANTLR end "T__19" */ 513// $ANTLR start "T__20" 514- (void) mT__20 515{ 516 // 517 /* ruleScopeSetUp */ 518 519 /* ruleDeclarations */ 520 521 @try { 522 NSInteger _type = T__20; 523 NSInteger _channel = TokenChannelDefault; 524 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:20:7: ( '}' ) // ruleBlockSingleAlt 525 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:20:9: '}' // alt 526 { 527 528 529 [self matchChar:'}']; 530 531 532 } 533 534 /* token+rule list labels */ 535 536 state.type = _type; 537 state.channel = _channel; 538 } 539 @finally { 540 // 541 /* ruleScopeCleanUp */ 542 543 } 544 return; 545} 546/* $ANTLR end "T__20" */ 547// $ANTLR start "ID" 548- (void) mID 549{ 550 // 551 /* ruleScopeSetUp */ 552 553 /* ruleDeclarations */ 554 555 @try { 556 NSInteger _type = ID; 557 NSInteger _channel = TokenChannelDefault; 558 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:94:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* ) // ruleBlockSingleAlt 559 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:94:9: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | '_' )* // alt 560 { 561 562 if ((([input LA:1] >= 'A') && ([input LA:1] <= 'Z'))||[input LA:1] == '_'||(([input LA:1] >= 'a') && ([input LA:1] <= 'z'))) { 563 [input consume]; 564 } else { 565 MismatchedSetException *mse = [MismatchedSetException newException:nil stream:input]; 566 [self recover:mse]; 567 @throw mse; 568 } 569 570 571 572 do { 573 NSInteger alt1=2; 574 NSInteger LA1_0 = [input LA:1]; 575 if ( ((LA1_0 >= '0' && LA1_0 <= '9')||(LA1_0 >= 'A' && LA1_0 <= 'Z')||LA1_0=='_'||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) { 576 alt1=1; 577 } 578 579 580 switch (alt1) { 581 case 1 : ; 582 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g: // alt 583 { 584 585 if ((([input LA:1] >= '0') && ([input LA:1] <= '9'))||(([input LA:1] >= 'A') && ([input LA:1] <= 'Z'))||[input LA:1] == '_'||(([input LA:1] >= 'a') && ([input LA:1] <= 'z'))) { 586 [input consume]; 587 } else { 588 MismatchedSetException *mse = [MismatchedSetException newException:nil stream:input]; 589 [self recover:mse]; 590 @throw mse; 591 } 592 593 594 } 595 break; 596 597 default : 598 goto loop1; 599 } 600 } while (YES); 601 loop1: ; 602 603 604 } 605 606 /* token+rule list labels */ 607 608 state.type = _type; 609 state.channel = _channel; 610 } 611 @finally { 612 // 613 /* ruleScopeCleanUp */ 614 615 } 616 return; 617} 618/* $ANTLR end "ID" */ 619// $ANTLR start "INT" 620- (void) mINT 621{ 622 // 623 /* ruleScopeSetUp */ 624 625 /* ruleDeclarations */ 626 627 @try { 628 NSInteger _type = INT; 629 NSInteger _channel = TokenChannelDefault; 630 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:97:5: ( ( '0' .. '9' )+ ) // ruleBlockSingleAlt 631 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:97:7: ( '0' .. '9' )+ // alt 632 { 633 634 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:97:7: ( '0' .. '9' )+ // positiveClosureBlock 635 NSInteger cnt2 = 0; 636 do { 637 NSInteger alt2 = 2; 638 NSInteger LA2_0 = [input LA:1]; 639 if ( ((LA2_0 >= '0' && LA2_0 <= '9')) ) { 640 alt2=1; 641 } 642 643 644 switch (alt2) { 645 case 1 : ; 646 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g: // alt 647 { 648 649 if ((([input LA:1] >= '0') && ([input LA:1] <= '9'))) { 650 [input consume]; 651 } else { 652 MismatchedSetException *mse = [MismatchedSetException newException:nil stream:input]; 653 [self recover:mse]; 654 @throw mse; 655 } 656 657 658 } 659 break; 660 661 default : 662 if ( cnt2 >= 1 ) 663 goto loop2; 664 EarlyExitException *eee = 665 [EarlyExitException newException:input decisionNumber:2]; 666 @throw eee; 667 } 668 cnt2++; 669 } while (YES); 670 loop2: ; 671 672 673 } 674 675 /* token+rule list labels */ 676 677 state.type = _type; 678 state.channel = _channel; 679 } 680 @finally { 681 // 682 /* ruleScopeCleanUp */ 683 684 } 685 return; 686} 687/* $ANTLR end "INT" */ 688// $ANTLR start "WS" 689- (void) mWS 690{ 691 // 692 /* ruleScopeSetUp */ 693 694 /* ruleDeclarations */ 695 696 @try { 697 NSInteger _type = WS; 698 NSInteger _channel = TokenChannelDefault; 699 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:100:5: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) // ruleBlockSingleAlt 700 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:100:9: ( ' ' | '\\t' | '\\r' | '\\n' )+ // alt 701 { 702 703 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:100:9: ( ' ' | '\\t' | '\\r' | '\\n' )+ // positiveClosureBlock 704 NSInteger cnt3 = 0; 705 do { 706 NSInteger alt3 = 2; 707 NSInteger LA3_0 = [input LA:1]; 708 if ( ((LA3_0 >= '\t' && LA3_0 <= '\n')||LA3_0=='\r'||LA3_0==' ') ) { 709 alt3=1; 710 } 711 712 713 switch (alt3) { 714 case 1 : ; 715 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g: // alt 716 { 717 718 if ((([input LA:1] >= '\t') && ([input LA:1] <= '\n'))||[input LA:1] == '\r'||[input LA:1] == ' ') { 719 [input consume]; 720 } else { 721 MismatchedSetException *mse = [MismatchedSetException newException:nil stream:input]; 722 [self recover:mse]; 723 @throw mse; 724 } 725 726 727 } 728 break; 729 730 default : 731 if ( cnt3 >= 1 ) 732 goto loop3; 733 EarlyExitException *eee = 734 [EarlyExitException newException:input decisionNumber:3]; 735 @throw eee; 736 } 737 cnt3++; 738 } while (YES); 739 loop3: ; 740 741 742 743 _channel=HIDDEN; 744 745 746 } 747 748 /* token+rule list labels */ 749 750 state.type = _type; 751 state.channel = _channel; 752 } 753 @finally { 754 // 755 /* ruleScopeCleanUp */ 756 757 } 758 return; 759} 760/* $ANTLR end "WS" */ 761- (void) mTokens 762{ 763 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:8: ( T__7 | T__8 | T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | ID | INT | WS ) //ruleblock 764 NSInteger alt4=17; 765 unichar charLA4 = [input LA:1]; 766 switch (charLA4) { 767 case '(': ; 768 { 769 alt4=1; 770 } 771 break; 772 case ')': ; 773 { 774 alt4=2; 775 } 776 break; 777 case '+': ; 778 { 779 alt4=3; 780 } 781 break; 782 case ',': ; 783 { 784 alt4=4; 785 } 786 break; 787 case ';': ; 788 { 789 alt4=5; 790 } 791 break; 792 case '<': ; 793 { 794 alt4=6; 795 } 796 break; 797 case '=': ; 798 { 799 NSInteger LA4_7 = [input LA:2]; 800 801 if ( (LA4_7=='=') ) { 802 alt4=8; 803 } 804 else { 805 alt4 = 7; 806 } 807 } 808 break; 809 case 'c': ; 810 { 811 NSInteger LA4_8 = [input LA:2]; 812 813 if ( (LA4_8=='h') ) { 814 NSInteger LA4_19 = [input LA:3]; 815 816 if ( (LA4_19=='a') ) { 817 NSInteger LA4_23 = [input LA:4]; 818 819 if ( (LA4_23=='r') ) { 820 NSInteger LA4_27 = [input LA:5]; 821 822 if ( ((LA4_27 >= '0' && LA4_27 <= '9')||(LA4_27 >= 'A' && LA4_27 <= 'Z')||LA4_27=='_'||(LA4_27 >= 'a' && LA4_27 <= 'z')) ) { 823 alt4=15; 824 } 825 else { 826 alt4 = 9; 827 } 828 } 829 else { 830 alt4 = 15; 831 } 832 } 833 else { 834 alt4 = 15; 835 } 836 } 837 else { 838 alt4 = 15; 839 } 840 } 841 break; 842 case 'f': ; 843 { 844 NSInteger LA4_9 = [input LA:2]; 845 846 if ( (LA4_9=='o') ) { 847 NSInteger LA4_20 = [input LA:3]; 848 849 if ( (LA4_20=='r') ) { 850 NSInteger LA4_24 = [input LA:4]; 851 852 if ( ((LA4_24 >= '0' && LA4_24 <= '9')||(LA4_24 >= 'A' && LA4_24 <= 'Z')||LA4_24=='_'||(LA4_24 >= 'a' && LA4_24 <= 'z')) ) { 853 alt4=15; 854 } 855 else { 856 alt4 = 10; 857 } 858 } 859 else { 860 alt4 = 15; 861 } 862 } 863 else { 864 alt4 = 15; 865 } 866 } 867 break; 868 case 'i': ; 869 { 870 NSInteger LA4_10 = [input LA:2]; 871 872 if ( (LA4_10=='n') ) { 873 NSInteger LA4_21 = [input LA:3]; 874 875 if ( (LA4_21=='t') ) { 876 NSInteger LA4_25 = [input LA:4]; 877 878 if ( ((LA4_25 >= '0' && LA4_25 <= '9')||(LA4_25 >= 'A' && LA4_25 <= 'Z')||LA4_25=='_'||(LA4_25 >= 'a' && LA4_25 <= 'z')) ) { 879 alt4=15; 880 } 881 else { 882 alt4 = 11; 883 } 884 } 885 else { 886 alt4 = 15; 887 } 888 } 889 else { 890 alt4 = 15; 891 } 892 } 893 break; 894 case 'v': ; 895 { 896 NSInteger LA4_11 = [input LA:2]; 897 898 if ( (LA4_11=='o') ) { 899 NSInteger LA4_22 = [input LA:3]; 900 901 if ( (LA4_22=='i') ) { 902 NSInteger LA4_26 = [input LA:4]; 903 904 if ( (LA4_26=='d') ) { 905 NSInteger LA4_30 = [input LA:5]; 906 907 if ( ((LA4_30 >= '0' && LA4_30 <= '9')||(LA4_30 >= 'A' && LA4_30 <= 'Z')||LA4_30=='_'||(LA4_30 >= 'a' && LA4_30 <= 'z')) ) { 908 alt4=15; 909 } 910 else { 911 alt4 = 12; 912 } 913 } 914 else { 915 alt4 = 15; 916 } 917 } 918 else { 919 alt4 = 15; 920 } 921 } 922 else { 923 alt4 = 15; 924 } 925 } 926 break; 927 case '{': ; 928 { 929 alt4=13; 930 } 931 break; 932 case '}': ; 933 { 934 alt4=14; 935 } 936 break; 937 case 'A': ; 938 case 'B': ; 939 case 'C': ; 940 case 'D': ; 941 case 'E': ; 942 case 'F': ; 943 case 'G': ; 944 case 'H': ; 945 case 'I': ; 946 case 'J': ; 947 case 'K': ; 948 case 'L': ; 949 case 'M': ; 950 case 'N': ; 951 case 'O': ; 952 case 'P': ; 953 case 'Q': ; 954 case 'R': ; 955 case 'S': ; 956 case 'T': ; 957 case 'U': ; 958 case 'V': ; 959 case 'W': ; 960 case 'X': ; 961 case 'Y': ; 962 case 'Z': ; 963 case '_': ; 964 case 'a': ; 965 case 'b': ; 966 case 'd': ; 967 case 'e': ; 968 case 'g': ; 969 case 'h': ; 970 case 'j': ; 971 case 'k': ; 972 case 'l': ; 973 case 'm': ; 974 case 'n': ; 975 case 'o': ; 976 case 'p': ; 977 case 'q': ; 978 case 'r': ; 979 case 's': ; 980 case 't': ; 981 case 'u': ; 982 case 'w': ; 983 case 'x': ; 984 case 'y': ; 985 case 'z': ; 986 { 987 alt4=15; 988 } 989 break; 990 case '0': ; 991 case '1': ; 992 case '2': ; 993 case '3': ; 994 case '4': ; 995 case '5': ; 996 case '6': ; 997 case '7': ; 998 case '8': ; 999 case '9': ; 1000 { 1001 alt4=16; 1002 } 1003 break; 1004 case '\t': ; 1005 case '\n': ; 1006 case '\r': ; 1007 case ' ': ; 1008 { 1009 alt4=17; 1010 } 1011 break; 1012 1013 default: ; 1014 NoViableAltException *nvae = [NoViableAltException newException:4 state:0 stream:input]; 1015 nvae.c = charLA4; 1016 @throw nvae; 1017 1018 } 1019 1020 switch (alt4) { 1021 case 1 : ; 1022 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:10: T__7 // alt 1023 { 1024 1025 1026 [self mT__7]; 1027 1028 1029 1030 } 1031 break; 1032 case 2 : ; 1033 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:15: T__8 // alt 1034 { 1035 1036 1037 [self mT__8]; 1038 1039 1040 1041 } 1042 break; 1043 case 3 : ; 1044 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:20: T__9 // alt 1045 { 1046 1047 1048 [self mT__9]; 1049 1050 1051 1052 } 1053 break; 1054 case 4 : ; 1055 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:25: T__10 // alt 1056 { 1057 1058 1059 [self mT__10]; 1060 1061 1062 1063 } 1064 break; 1065 case 5 : ; 1066 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:31: T__11 // alt 1067 { 1068 1069 1070 [self mT__11]; 1071 1072 1073 1074 } 1075 break; 1076 case 6 : ; 1077 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:37: T__12 // alt 1078 { 1079 1080 1081 [self mT__12]; 1082 1083 1084 1085 } 1086 break; 1087 case 7 : ; 1088 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:43: T__13 // alt 1089 { 1090 1091 1092 [self mT__13]; 1093 1094 1095 1096 } 1097 break; 1098 case 8 : ; 1099 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:49: T__14 // alt 1100 { 1101 1102 1103 [self mT__14]; 1104 1105 1106 1107 } 1108 break; 1109 case 9 : ; 1110 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:55: T__15 // alt 1111 { 1112 1113 1114 [self mT__15]; 1115 1116 1117 1118 } 1119 break; 1120 case 10 : ; 1121 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:61: T__16 // alt 1122 { 1123 1124 1125 [self mT__16]; 1126 1127 1128 1129 } 1130 break; 1131 case 11 : ; 1132 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:67: T__17 // alt 1133 { 1134 1135 1136 [self mT__17]; 1137 1138 1139 1140 } 1141 break; 1142 case 12 : ; 1143 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:73: T__18 // alt 1144 { 1145 1146 1147 [self mT__18]; 1148 1149 1150 1151 } 1152 break; 1153 case 13 : ; 1154 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:79: T__19 // alt 1155 { 1156 1157 1158 [self mT__19]; 1159 1160 1161 1162 } 1163 break; 1164 case 14 : ; 1165 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:85: T__20 // alt 1166 { 1167 1168 1169 [self mT__20]; 1170 1171 1172 1173 } 1174 break; 1175 case 15 : ; 1176 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:91: ID // alt 1177 { 1178 1179 1180 [self mID]; 1181 1182 1183 1184 } 1185 break; 1186 case 16 : ; 1187 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:94: INT // alt 1188 { 1189 1190 1191 [self mINT]; 1192 1193 1194 1195 } 1196 break; 1197 case 17 : ; 1198 // /Users/acondit/source/antlr/code/antlr3/runtime/ObjC/Framework/examples/LL-star/SimpleC.g:1:98: WS // alt 1199 { 1200 1201 1202 [self mWS]; 1203 1204 1205 1206 } 1207 break; 1208 1209 } 1210 1211} 1212 1213@end /* end of SimpleCLexer implementation line 397 */