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