| /** \file |
| * This OBJC source file was generated by $ANTLR version 3.2 Aug 20, 2010 13:39:32 |
| * |
| * - From the grammar source file : /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g |
| * - On : 2010-08-20 13:40:15 |
| * - for the lexer : FuzzyLexer * |
| * Editing it, at least manually, is not wise. |
| * |
| * C language generator and runtime by Jim Idle, jimi|hereisanat|idle|dotgoeshere|ws. |
| * |
| * |
| */ |
| // [The "BSD licence"] |
| // Copyright (c) 2010 Alan Condit |
| // |
| // All rights reserved. |
| // |
| // Redistribution and use in source and binary forms, with or without |
| // modification, are permitted provided that the following conditions |
| // are met: |
| // 1. Redistributions of source code must retain the above copyright |
| // notice, this list of conditions and the following disclaimer. |
| // 2. Redistributions in binary form must reproduce the above copyright |
| // notice, this list of conditions and the following disclaimer in the |
| // documentation and/or other materials provided with the distribution. |
| // 3. The name of the author may not be used to endorse or promote products |
| // derived from this software without specific prior written permission. |
| // |
| // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| // OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| // IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| // NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| |
| // $ANTLR 3.2 Aug 20, 2010 13:39:32 /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g 2010-08-20 13:40:15 |
| |
| /* ----------------------------------------- |
| * Include the ANTLR3 generated header file. |
| */ |
| #import "Fuzzy.h" |
| /* ----------------------------------------- */ |
| |
| |
| /* ============================================================================= */ |
| |
| /* ============================================================================= |
| * Start of recognizer |
| */ |
| |
| #pragma mark Cyclic DFA implementation start DFA38 |
| @implementation DFA38 |
| const static NSInteger dfa38_eot[19] = |
| {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; |
| const static NSInteger dfa38_eof[19] = |
| {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}; |
| const static unichar dfa38_min[19] = |
| {9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; |
| const static unichar dfa38_max[19] = |
| {122,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; |
| const static NSInteger dfa38_accept[19] = |
| {-1,-1,4,5,7,-1,2,-1,8,9,-1,3,-1,1,6,10,-1,12,11}; |
| const static NSInteger dfa38_special[19] = |
| {-1,0,-1,-1,-1,1,-1,2,-1,-1,3,-1,4,-1,-1,-1,5,-1,-1}; |
| const static NSInteger dfa38_transition[] = {}; |
| const static NSInteger dfa38_transition0[] = {17, 17, -1, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 17, -1, |
| 15, -1, -1, -1, -1, 18, -1, -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, -1, |
| -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 1, 1, 1, 1, |
| 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, |
| 1, -1, 1, 1, 10, 1, 1, 16, 1, 1, 12, 1, 1, 1, 1, 1, 1, 1, 1, 5, 16, 1, |
| 1, 1, 16, 1, 1, 1}; |
| const static NSInteger dfa38_transition1[] = {-1}; |
| |
| |
| + () newDFA38WithRecognizer:(ANTLRBaseRecognizer *)aRecognizer |
| { |
| return [[[DFA38 alloc] initWithRecognizer:aRecognizer] retain]; |
| } |
| |
| - (id) initWithRecognizer:(ANTLRBaseRecognizer *) theRecognizer |
| { |
| if ((self = [super initWithRecognizer:theRecognizer]) != nil) { |
| decisionNumber = 38; |
| eot = dfa38_eot; |
| eof = dfa38_eof; |
| min = dfa38_min; |
| max = dfa38_max; |
| accept = dfa38_accept; |
| special = dfa38_special; |
| if (!(transition = calloc(19, sizeof(void*)))) { |
| [self release]; |
| return nil; |
| } |
| len = 19; |
| transition[0] = dfa38_transition0; |
| transition[1] = dfa38_transition1; |
| transition[2] = dfa38_transition; |
| transition[3] = dfa38_transition; |
| transition[4] = dfa38_transition; |
| transition[5] = dfa38_transition1; |
| transition[6] = dfa38_transition; |
| transition[7] = dfa38_transition1; |
| transition[8] = dfa38_transition; |
| transition[9] = dfa38_transition; |
| transition[10] = dfa38_transition1; |
| transition[11] = dfa38_transition; |
| transition[12] = dfa38_transition1; |
| transition[13] = dfa38_transition; |
| transition[14] = dfa38_transition; |
| transition[15] = dfa38_transition; |
| transition[16] = dfa38_transition1; |
| transition[17] = dfa38_transition; |
| transition[18] = dfa38_transition; |
| } |
| return self; |
| } |
| |
| /* start dfa.specialStateSTs */ |
| - (NSInteger) specialStateTransition:(NSInteger)s Stream:(id<ANTLRIntStream>)anInput |
| { |
| id<ANTLRIntStream> input = anInput; |
| switch (s) { |
| case 0 : ; |
| /* cyclicDFAState */ |
| NSInteger LA38_1 = [input LA:1]; |
| |
| |
| NSInteger index38_1 = [input getIndex]; |
| [input rewind]; |
| s = -1; |
| /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred4_Fuzzy_fragment)]) { s = 2;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred5_Fuzzy_fragment)]) { s = 3;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred7_Fuzzy_fragment)]) { s = 4;} |
| |
| |
| [input seek:index38_1]; |
| if ( s >= 0 ) |
| return s; |
| break; |
| case 1 : ; |
| /* cyclicDFAState */ |
| NSInteger LA38_5 = [input LA:1]; |
| |
| |
| NSInteger index38_5 = [input getIndex]; |
| [input rewind]; |
| s = -1; |
| /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred2_Fuzzy_fragment)]) { s = 6;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred4_Fuzzy_fragment)]) { s = 2;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred5_Fuzzy_fragment)]) { s = 3;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred7_Fuzzy_fragment)]) { s = 4;} |
| |
| |
| [input seek:index38_5]; |
| if ( s >= 0 ) |
| return s; |
| break; |
| case 2 : ; |
| /* cyclicDFAState */ |
| NSInteger LA38_7 = [input LA:1]; |
| |
| |
| NSInteger index38_7 = [input getIndex]; |
| [input rewind]; |
| s = -1; |
| /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred8_Fuzzy_fragment)]) { s = 8;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred9_Fuzzy_fragment)]) { s = 9;} |
| |
| |
| [input seek:index38_7]; |
| if ( s >= 0 ) |
| return s; |
| break; |
| case 3 : ; |
| /* cyclicDFAState */ |
| NSInteger LA38_10 = [input LA:1]; |
| |
| |
| NSInteger index38_10 = [input getIndex]; |
| [input rewind]; |
| s = -1; |
| /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred3_Fuzzy_fragment)]) { s = 11;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred4_Fuzzy_fragment)]) { s = 2;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred5_Fuzzy_fragment)]) { s = 3;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred7_Fuzzy_fragment)]) { s = 4;} |
| |
| |
| [input seek:index38_10]; |
| if ( s >= 0 ) |
| return s; |
| break; |
| case 4 : ; |
| /* cyclicDFAState */ |
| NSInteger LA38_12 = [input LA:1]; |
| |
| |
| NSInteger index38_12 = [input getIndex]; |
| [input rewind]; |
| s = -1; |
| /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred1_Fuzzy_fragment)]) { s = 13;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred4_Fuzzy_fragment)]) { s = 2;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred5_Fuzzy_fragment)]) { s = 3;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred6_Fuzzy_fragment)]) { s = 14;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred7_Fuzzy_fragment)]) { s = 4;} |
| |
| |
| [input seek:index38_12]; |
| if ( s >= 0 ) |
| return s; |
| break; |
| case 5 : ; |
| /* cyclicDFAState */ |
| NSInteger LA38_16 = [input LA:1]; |
| |
| |
| NSInteger index38_16 = [input getIndex]; |
| [input rewind]; |
| s = -1; |
| /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred4_Fuzzy_fragment)]) { s = 2;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred5_Fuzzy_fragment)]) { s = 3;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred6_Fuzzy_fragment)]) { s = 14;} |
| |
| else /* cyclicDFAEdge */ |
| if ([self evaluateSyntacticPredicate:@selector(synpred7_Fuzzy_fragment)]) { s = 4;} |
| |
| |
| [input seek:index38_16]; |
| if ( s >= 0 ) |
| return s; |
| break; |
| } |
| if ( [recognizer getBacktrackingLevel] > 0 ) { [recognizer setFailed:YES]; return -1; } |
| ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException newANTLRNoViableAltException:38 state:s stream:[recognizer getInput]]; |
| /* [self error:nvae]; */ |
| @throw nvae; |
| } |
| |
| /* end dfa.specialStateSTs */ |
| - (void) dealloc |
| { |
| free(transition); |
| [super dealloc]; |
| } |
| |
| - (NSString *) description |
| { |
| return @"1:1: Tokens options {k=1; backtrack=true; } : ( IMPORT | RETURN | CLASS | METHOD | FIELD | STAT | CALL | COMMENT | SL_COMMENT | STRING | CHAR | WS );"; |
| } |
| |
| |
| @end |
| #pragma mark Cyclic DFA implementation end DFA38 |
| |
| |
| |
| /** As per Terence: No returns for lexer rules! |
| #pragma mark Rule return scopes start |
| #pragma mark Rule return scopes end |
| */ |
| @implementation Fuzzy // line 330 |
| |
| + (void) initialize |
| { |
| [ANTLRBaseRecognizer setGrammarFileName:@"/usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g"]; |
| } |
| |
| + (NSString *) tokenNameForType:(NSInteger)aTokenType |
| { |
| return [[self getTokenNames] objectAtIndex:aTokenType]; |
| } |
| |
| + (Fuzzy *)newFuzzy:(id<ANTLRCharStream>)anInput |
| { |
| return [[Fuzzy alloc] initWithCharStream:anInput]; |
| } |
| |
| - (id) initWithCharStream:(id<ANTLRCharStream>)anInput |
| { |
| if ((self = [super initWithCharStream:anInput State:[ANTLRRecognizerSharedState newANTLRRecognizerSharedStateWithRuleLen:30+1]]) != nil) { |
| SEL synpred9_FuzzySelector = @selector(synpred9_Fuzzy_fragment); |
| |
| SEL synpred2_FuzzySelector = @selector(synpred2_Fuzzy_fragment); |
| |
| SEL synpred7_FuzzySelector = @selector(synpred7_Fuzzy_fragment); |
| |
| SEL synpred4_FuzzySelector = @selector(synpred4_Fuzzy_fragment); |
| |
| SEL synpred8_FuzzySelector = @selector(synpred8_Fuzzy_fragment); |
| |
| SEL synpred6_FuzzySelector = @selector(synpred6_Fuzzy_fragment); |
| |
| SEL synpred5_FuzzySelector = @selector(synpred5_Fuzzy_fragment); |
| |
| SEL synpred3_FuzzySelector = @selector(synpred3_Fuzzy_fragment); |
| |
| SEL synpred1_FuzzySelector = @selector(synpred1_Fuzzy_fragment); |
| |
| dfa38 = [DFA38 newDFA38WithRecognizer:self]; |
| } |
| return self; |
| } |
| |
| - (void) dealloc |
| { |
| [dfa38 release]; |
| [super dealloc]; |
| } |
| |
| // Start of actions.lexer.methods |
| // start methods() |
| |
| - (id<ANTLRToken>) nextToken |
| { |
| while (YES) { |
| if ( [input LA:1] == ANTLRCharStreamEOF ) { |
| return [ANTLRCommonToken eofToken]; // should really be a +eofToken call here -> go figure |
| } |
| state.token = nil; |
| state.channel = ANTLRTokenChannelDefault; |
| state.tokenStartCharIndex = [input getIndex]; |
| state.tokenStartCharPositionInLine = [input getCharPositionInLine]; |
| state.tokenStartLine = [input getLine]; |
| state.text = nil; |
| @try { |
| NSInteger m = [input mark]; |
| state.backtracking = 1; /* means we won't throw slow exception */ |
| state.failed = NO; |
| [self mTokens]; |
| state.backtracking = 0; |
| /* mTokens backtracks with synpred at backtracking==2 |
| and we set the synpredgate to allow actions at level 1. */ |
| if ( state.failed == YES ) { |
| [input rewind:m]; |
| [input consume]; /* advance one char and try again */ |
| } else { |
| [self emit]; |
| return state.token; |
| } |
| } |
| @catch (ANTLRRecognitionException *re) { |
| // shouldn't happen in backtracking mode, but... |
| [self reportError:re]; |
| [self recover:re]; |
| } |
| } |
| } |
| |
| - (void)memoize:(id<ANTLRIntStream>)anInput |
| RuleIndex:(NSInteger)ruleIndex |
| StartIndex:(NSInteger)ruleStartIndex |
| { |
| if ( state.backtracking > 1 ) [super memoize:anInput RuleIndex:ruleIndex StartIndex:ruleStartIndex]; |
| } |
| |
| - (BOOL)alreadyParsedRule:(id<ANTLRIntStream>)anInput RuleIndex:(NSInteger)ruleIndex |
| { |
| if ( state.backtracking > 1 ) return [super alreadyParsedRule:anInput RuleIndex:ruleIndex]; |
| return NO; |
| } |
| // Start of Rules |
| // $ANTLR start "IMPORT" |
| - (void) mIMPORT |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = IMPORT; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| id<ANTLRToken> name=nil; |
| |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:5:2: ( 'import' WS name= QIDStar ( WS )? ';' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:5:4: 'import' WS name= QIDStar ( WS )? ';' // alt |
| { |
| [self matchString:@"import"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| NSInteger nameStart31 = [self getIndex]; |
| [self mQIDStar]; if ( state.failed == YES ) return ; |
| |
| name = [[ANTLRCommonToken newANTLRCommonToken:input Type:ANTLRTokenTypeInvalid Channel:ANTLRTokenChannelDefault Start:nameStart31 Stop:[self getIndex]-1] retain]; |
| [name setLine:[self getLine]]; /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:5:29: ( WS )? // block |
| NSInteger alt1=2; |
| NSInteger LA1_0 = [input LA:1]; |
| |
| if ( ((LA1_0>='\t' && LA1_0<='\n')||LA1_0==' ') ) { |
| alt1=1; |
| } |
| switch (alt1) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:5:29: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self matchChar:';']; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "IMPORT" |
| |
| // $ANTLR start "RETURN" |
| - (void) mRETURN |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = RETURN; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:10:2: ( 'return' ( options {greedy=false; } : . )* ';' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:10:4: 'return' ( options {greedy=false; } : . )* ';' // alt |
| { |
| [self matchString:@"return"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| do { |
| NSInteger alt2=2; |
| NSInteger LA2_0 = [input LA:1]; |
| if ( (LA2_0==';') ) { |
| alt2=2; |
| } |
| else if ( ((LA2_0>=0x0000 && LA2_0<=':')||(LA2_0>='<' && LA2_0<=0xFFFF)) ) { |
| alt2=1; |
| } |
| |
| |
| switch (alt2) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:10:38: . // alt |
| { |
| [self matchAny]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop2; |
| } |
| } while (YES); |
| loop2: ; |
| /* element() */ |
| [self matchChar:';']; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "RETURN" |
| |
| // $ANTLR start "CLASS" |
| - (void) mCLASS |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = CLASS; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| id<ANTLRToken> name=nil; |
| |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:14:2: ( 'class' WS name= ID ( WS )? ( 'extends' WS QID ( WS )? )? ( 'implements' WS QID ( WS )? ( ',' ( WS )? QID ( WS )? )* )? '{' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:14:4: 'class' WS name= ID ( WS )? ( 'extends' WS QID ( WS )? )? ( 'implements' WS QID ( WS )? ( ',' ( WS )? QID ( WS )? )* )? '{' // alt |
| { |
| [self matchString:@"class"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| NSInteger nameStart81 = [self getIndex]; |
| [self mID]; if ( state.failed == YES ) return ; |
| |
| name = [[ANTLRCommonToken newANTLRCommonToken:input Type:ANTLRTokenTypeInvalid Channel:ANTLRTokenChannelDefault Start:nameStart81 Stop:[self getIndex]-1] retain]; |
| [name setLine:[self getLine]]; /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:14:23: ( WS )? // block |
| NSInteger alt3=2; |
| NSInteger LA3_0 = [input LA:1]; |
| |
| if ( ((LA3_0>='\t' && LA3_0<='\n')||LA3_0==' ') ) { |
| alt3=1; |
| } |
| switch (alt3) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:14:23: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:14:27: ( 'extends' WS QID ( WS )? )? // block |
| NSInteger alt5=2; |
| NSInteger LA5_0 = [input LA:1]; |
| |
| if ( (LA5_0=='e') ) { |
| alt5=1; |
| } |
| switch (alt5) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:14:28: 'extends' WS QID ( WS )? // alt |
| { |
| [self matchString:@"extends"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mQID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:14:45: ( WS )? // block |
| NSInteger alt4=2; |
| NSInteger LA4_0 = [input LA:1]; |
| |
| if ( ((LA4_0>='\t' && LA4_0<='\n')||LA4_0==' ') ) { |
| alt4=1; |
| } |
| switch (alt4) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:14:45: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:15:3: ( 'implements' WS QID ( WS )? ( ',' ( WS )? QID ( WS )? )* )? // block |
| NSInteger alt10=2; |
| NSInteger LA10_0 = [input LA:1]; |
| |
| if ( (LA10_0=='i') ) { |
| alt10=1; |
| } |
| switch (alt10) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:15:4: 'implements' WS QID ( WS )? ( ',' ( WS )? QID ( WS )? )* // alt |
| { |
| [self matchString:@"implements"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mQID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:15:24: ( WS )? // block |
| NSInteger alt6=2; |
| NSInteger LA6_0 = [input LA:1]; |
| |
| if ( ((LA6_0>='\t' && LA6_0<='\n')||LA6_0==' ') ) { |
| alt6=1; |
| } |
| switch (alt6) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:15:24: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| do { |
| NSInteger alt9=2; |
| NSInteger LA9_0 = [input LA:1]; |
| if ( (LA9_0==',') ) { |
| alt9=1; |
| } |
| |
| |
| switch (alt9) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:15:29: ',' ( WS )? QID ( WS )? // alt |
| { |
| [self matchChar:',']; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:15:33: ( WS )? // block |
| NSInteger alt7=2; |
| NSInteger LA7_0 = [input LA:1]; |
| |
| if ( ((LA7_0>='\t' && LA7_0<='\n')||LA7_0==' ') ) { |
| alt7=1; |
| } |
| switch (alt7) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:15:33: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self mQID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:15:41: ( WS )? // block |
| NSInteger alt8=2; |
| NSInteger LA8_0 = [input LA:1]; |
| |
| if ( ((LA8_0>='\t' && LA8_0<='\n')||LA8_0==' ') ) { |
| alt8=1; |
| } |
| switch (alt8) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:15:41: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop9; |
| } |
| } while (YES); |
| loop9: ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self matchChar:'{']; if ( state.failed == YES ) return ; |
| /* element() */ |
| if ( state.backtracking == 1 ) { |
| NSLog(@"found class %@", (name!=nil?[name getText]:0)); |
| } /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "CLASS" |
| |
| // $ANTLR start "METHOD" |
| - (void) mMETHOD |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = METHOD; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| id<ANTLRToken> name=nil; |
| |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:5: ( TYPE WS name= ID ( WS )? '(' ( ARG ( WS )? ( ',' ( WS )? ARG ( WS )? )* )? ')' ( WS )? ( 'throws' WS QID ( WS )? ( ',' ( WS )? QID ( WS )? )* )? '{' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:9: TYPE WS name= ID ( WS )? '(' ( ARG ( WS )? ( ',' ( WS )? ARG ( WS )? )* )? ')' ( WS )? ( 'throws' WS QID ( WS )? ( ',' ( WS )? QID ( WS )? )* )? '{' // alt |
| { |
| [self mTYPE]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| NSInteger nameStart158 = [self getIndex]; |
| [self mID]; if ( state.failed == YES ) return ; |
| |
| name = [[ANTLRCommonToken newANTLRCommonToken:input Type:ANTLRTokenTypeInvalid Channel:ANTLRTokenChannelDefault Start:nameStart158 Stop:[self getIndex]-1] retain]; |
| [name setLine:[self getLine]]; /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:25: ( WS )? // block |
| NSInteger alt11=2; |
| NSInteger LA11_0 = [input LA:1]; |
| |
| if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0==' ') ) { |
| alt11=1; |
| } |
| switch (alt11) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:25: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self matchChar:'(']; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:33: ( ARG ( WS )? ( ',' ( WS )? ARG ( WS )? )* )? // block |
| NSInteger alt16=2; |
| NSInteger LA16_0 = [input LA:1]; |
| |
| if ( ((LA16_0>='A' && LA16_0<='Z')||LA16_0=='_'||(LA16_0>='a' && LA16_0<='z')) ) { |
| alt16=1; |
| } |
| switch (alt16) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:35: ARG ( WS )? ( ',' ( WS )? ARG ( WS )? )* // alt |
| { |
| [self mARG]; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:39: ( WS )? // block |
| NSInteger alt12=2; |
| NSInteger LA12_0 = [input LA:1]; |
| |
| if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0==' ') ) { |
| alt12=1; |
| } |
| switch (alt12) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:39: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| do { |
| NSInteger alt15=2; |
| NSInteger LA15_0 = [input LA:1]; |
| if ( (LA15_0==',') ) { |
| alt15=1; |
| } |
| |
| |
| switch (alt15) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:44: ',' ( WS )? ARG ( WS )? // alt |
| { |
| [self matchChar:',']; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:48: ( WS )? // block |
| NSInteger alt13=2; |
| NSInteger LA13_0 = [input LA:1]; |
| |
| if ( ((LA13_0>='\t' && LA13_0<='\n')||LA13_0==' ') ) { |
| alt13=1; |
| } |
| switch (alt13) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:48: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self mARG]; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:56: ( WS )? // block |
| NSInteger alt14=2; |
| NSInteger LA14_0 = [input LA:1]; |
| |
| if ( ((LA14_0>='\t' && LA14_0<='\n')||LA14_0==' ') ) { |
| alt14=1; |
| } |
| switch (alt14) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:56: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop15; |
| } |
| } while (YES); |
| loop15: ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self matchChar:')']; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:69: ( WS )? // block |
| NSInteger alt17=2; |
| NSInteger LA17_0 = [input LA:1]; |
| |
| if ( ((LA17_0>='\t' && LA17_0<='\n')||LA17_0==' ') ) { |
| alt17=1; |
| } |
| switch (alt17) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:20:69: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:21:8: ( 'throws' WS QID ( WS )? ( ',' ( WS )? QID ( WS )? )* )? // block |
| NSInteger alt22=2; |
| NSInteger LA22_0 = [input LA:1]; |
| |
| if ( (LA22_0=='t') ) { |
| alt22=1; |
| } |
| switch (alt22) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:21:9: 'throws' WS QID ( WS )? ( ',' ( WS )? QID ( WS )? )* // alt |
| { |
| [self matchString:@"throws"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mQID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:21:25: ( WS )? // block |
| NSInteger alt18=2; |
| NSInteger LA18_0 = [input LA:1]; |
| |
| if ( ((LA18_0>='\t' && LA18_0<='\n')||LA18_0==' ') ) { |
| alt18=1; |
| } |
| switch (alt18) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:21:25: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| do { |
| NSInteger alt21=2; |
| NSInteger LA21_0 = [input LA:1]; |
| if ( (LA21_0==',') ) { |
| alt21=1; |
| } |
| |
| |
| switch (alt21) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:21:30: ',' ( WS )? QID ( WS )? // alt |
| { |
| [self matchChar:',']; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:21:34: ( WS )? // block |
| NSInteger alt19=2; |
| NSInteger LA19_0 = [input LA:1]; |
| |
| if ( ((LA19_0>='\t' && LA19_0<='\n')||LA19_0==' ') ) { |
| alt19=1; |
| } |
| switch (alt19) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:21:34: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self mQID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:21:42: ( WS )? // block |
| NSInteger alt20=2; |
| NSInteger LA20_0 = [input LA:1]; |
| |
| if ( ((LA20_0>='\t' && LA20_0<='\n')||LA20_0==' ') ) { |
| alt20=1; |
| } |
| switch (alt20) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:21:42: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop21; |
| } |
| } while (YES); |
| loop21: ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self matchChar:'{']; if ( state.failed == YES ) return ; |
| /* element() */ |
| if ( state.backtracking == 1 ) { |
| NSLog(@"found method %@", (name!=nil?[name getText]:0)); |
| } /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "METHOD" |
| |
| // $ANTLR start "FIELD" |
| - (void) mFIELD |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = FIELD; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| id<ANTLRToken> name=nil; |
| |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:26:5: ( TYPE WS name= ID ( '[]' )? ( WS )? ( ';' | '=' ) ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:26:9: TYPE WS name= ID ( '[]' )? ( WS )? ( ';' | '=' ) // alt |
| { |
| [self mTYPE]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| NSInteger nameStart261 = [self getIndex]; |
| [self mID]; if ( state.failed == YES ) return ; |
| |
| name = [[ANTLRCommonToken newANTLRCommonToken:input Type:ANTLRTokenTypeInvalid Channel:ANTLRTokenChannelDefault Start:nameStart261 Stop:[self getIndex]-1] retain]; |
| [name setLine:[self getLine]]; /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:26:25: ( '[]' )? // block |
| NSInteger alt23=2; |
| NSInteger LA23_0 = [input LA:1]; |
| |
| if ( (LA23_0=='[') ) { |
| alt23=1; |
| } |
| switch (alt23) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:26:25: '[]' // alt |
| { |
| [self matchString:@"[]"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:26:31: ( WS )? // block |
| NSInteger alt24=2; |
| NSInteger LA24_0 = [input LA:1]; |
| |
| if ( ((LA24_0>='\t' && LA24_0<='\n')||LA24_0==' ') ) { |
| alt24=1; |
| } |
| switch (alt24) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:26:31: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| if ([input LA:1] == ';'||[input LA:1] == '=') { |
| [input consume]; |
| state.failed = NO; |
| |
| } else { |
| if ( state.backtracking > 0 ) { state.failed = YES; return ; } |
| ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input]; |
| [self recover:mse]; |
| @throw mse;} |
| /* element() */ |
| if ( state.backtracking == 1 ) { |
| NSLog(@"found var %@", (name!=nil?[name getText]:0)); |
| } /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "FIELD" |
| |
| // $ANTLR start "STAT" |
| - (void) mSTAT |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = STAT; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:30:5: ( ( 'if' | 'while' | 'switch' | 'for' ) ( WS )? '(' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:30:7: ( 'if' | 'while' | 'switch' | 'for' ) ( WS )? '(' // alt |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:30:7: ( 'if' | 'while' | 'switch' | 'for' ) // block |
| NSInteger alt25=4; |
| switch ([input LA:1]) { |
| case 'i': ; |
| { |
| alt25=1; |
| } |
| break; |
| case 'w': ; |
| { |
| alt25=2; |
| } |
| break; |
| case 's': ; |
| { |
| alt25=3; |
| } |
| break; |
| case 'f': ; |
| { |
| alt25=4; |
| } |
| break; |
| |
| default: ; |
| if ( state.backtracking > 0 ) { state.failed = YES; return ; } |
| ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException newANTLRNoViableAltException:25 state:0 stream:input]; |
| @throw nvae; |
| } |
| |
| switch (alt25) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:30:8: 'if' // alt |
| { |
| [self matchString:@"if"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 2 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:30:13: 'while' // alt |
| { |
| [self matchString:@"while"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 3 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:30:21: 'switch' // alt |
| { |
| [self matchString:@"switch"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 4 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:30:30: 'for' // alt |
| { |
| [self matchString:@"for"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:30:37: ( WS )? // block |
| NSInteger alt26=2; |
| NSInteger LA26_0 = [input LA:1]; |
| |
| if ( ((LA26_0>='\t' && LA26_0<='\n')||LA26_0==' ') ) { |
| alt26=1; |
| } |
| switch (alt26) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:30:37: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self matchChar:'(']; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "STAT" |
| |
| // $ANTLR start "CALL" |
| - (void) mCALL |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = CALL; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| id<ANTLRToken> name=nil; |
| |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:33:5: (name= QID ( WS )? '(' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:33:9: name= QID ( WS )? '(' // alt |
| { |
| NSInteger nameStart326 = [self getIndex]; |
| [self mQID]; if ( state.failed == YES ) return ; |
| |
| name = [[ANTLRCommonToken newANTLRCommonToken:input Type:ANTLRTokenTypeInvalid Channel:ANTLRTokenChannelDefault Start:nameStart326 Stop:[self getIndex]-1] retain]; |
| [name setLine:[self getLine]]; /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:33:18: ( WS )? // block |
| NSInteger alt27=2; |
| NSInteger LA27_0 = [input LA:1]; |
| |
| if ( ((LA27_0>='\t' && LA27_0<='\n')||LA27_0==' ') ) { |
| alt27=1; |
| } |
| switch (alt27) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:33:18: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| [self matchChar:'(']; if ( state.failed == YES ) return ; |
| /* element() */ |
| if ( state.backtracking == 1 ) { |
| /*ignore if this/super */ NSLog(@"found call %@",(name!=nil?[name getText]:0)); |
| } /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "CALL" |
| |
| // $ANTLR start "COMMENT" |
| - (void) mCOMMENT |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = COMMENT; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:38:5: ( '/*' ( options {greedy=false; } : . )* '*/' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:38:9: '/*' ( options {greedy=false; } : . )* '*/' // alt |
| { |
| [self matchString:@"/*"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| do { |
| NSInteger alt28=2; |
| NSInteger LA28_0 = [input LA:1]; |
| if ( (LA28_0=='*') ) { |
| NSInteger LA28_1 = [input LA:2]; |
| if ( (LA28_1=='/') ) { |
| alt28=2; |
| } |
| else if ( ((LA28_1>=0x0000 && LA28_1<='.')||(LA28_1>='0' && LA28_1<=0xFFFF)) ) { |
| alt28=1; |
| } |
| |
| |
| } |
| else if ( ((LA28_0>=0x0000 && LA28_0<=')')||(LA28_0>='+' && LA28_0<=0xFFFF)) ) { |
| alt28=1; |
| } |
| |
| |
| switch (alt28) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:38:41: . // alt |
| { |
| [self matchAny]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop28; |
| } |
| } while (YES); |
| loop28: ; |
| /* element() */ |
| [self matchString:@"*/"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| if ( state.backtracking == 1 ) { |
| NSLog(@"found comment %@", [self getText]); |
| } /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "COMMENT" |
| |
| // $ANTLR start "SL_COMMENT" |
| - (void) mSL_COMMENT |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = SL_COMMENT; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:43:5: ( '//' ( options {greedy=false; } : . )* '\\n' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:43:9: '//' ( options {greedy=false; } : . )* '\\n' // alt |
| { |
| [self matchString:@"//"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| do { |
| NSInteger alt29=2; |
| NSInteger LA29_0 = [input LA:1]; |
| if ( (LA29_0=='\n') ) { |
| alt29=2; |
| } |
| else if ( ((LA29_0>=0x0000 && LA29_0<='\t')||(LA29_0>=0x000B && LA29_0<=0xFFFF)) ) { |
| alt29=1; |
| } |
| |
| |
| switch (alt29) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:43:41: . // alt |
| { |
| [self matchAny]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop29; |
| } |
| } while (YES); |
| loop29: ; |
| /* element() */ |
| [self matchChar:'\n']; if ( state.failed == YES ) return ; |
| /* element() */ |
| if ( state.backtracking == 1 ) { |
| NSLog(@"found // comment %@", [self getText]); |
| } /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "SL_COMMENT" |
| |
| // $ANTLR start "STRING" |
| - (void) mSTRING |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = STRING; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:48:2: ( '\"' ( options {greedy=false; } : ESC | . )* '\"' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:48:4: '\"' ( options {greedy=false; } : ESC | . )* '\"' // alt |
| { |
| [self matchChar:'"']; if ( state.failed == YES ) return ; |
| /* element() */ |
| do { |
| NSInteger alt30=3; |
| NSInteger LA30_0 = [input LA:1]; |
| if ( (LA30_0=='"') ) { |
| alt30=3; |
| } |
| else if ( (LA30_0=='\\') ) { |
| NSInteger LA30_2 = [input LA:2]; |
| if ( (LA30_2=='"') ) { |
| alt30=1; |
| } |
| else if ( (LA30_2=='\\') ) { |
| alt30=1; |
| } |
| else if ( (LA30_2=='\'') ) { |
| alt30=1; |
| } |
| else if ( ((LA30_2>=0x0000 && LA30_2<='!')||(LA30_2>='#' && LA30_2<='&')||(LA30_2>='(' && LA30_2<='[')||(LA30_2>=']' && LA30_2<=0xFFFF)) ) { |
| alt30=2; |
| } |
| |
| |
| } |
| else if ( ((LA30_0>=0x0000 && LA30_0<='!')||(LA30_0>='#' && LA30_0<='[')||(LA30_0>=']' && LA30_0<=0xFFFF)) ) { |
| alt30=2; |
| } |
| |
| |
| switch (alt30) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:48:34: ESC // alt |
| { |
| [self mESC]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 2 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:48:40: . // alt |
| { |
| [self matchAny]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop30; |
| } |
| } while (YES); |
| loop30: ; |
| /* element() */ |
| [self matchChar:'"']; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "STRING" |
| |
| // $ANTLR start "CHAR" |
| - (void) mCHAR |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = CHAR; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:52:2: ( '\\'' ( options {greedy=false; } : ESC | . )* '\\'' ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:52:4: '\\'' ( options {greedy=false; } : ESC | . )* '\\'' // alt |
| { |
| [self matchChar:'\'']; if ( state.failed == YES ) return ; |
| /* element() */ |
| do { |
| NSInteger alt31=3; |
| NSInteger LA31_0 = [input LA:1]; |
| if ( (LA31_0=='\'') ) { |
| alt31=3; |
| } |
| else if ( (LA31_0=='\\') ) { |
| NSInteger LA31_2 = [input LA:2]; |
| if ( (LA31_2=='\'') ) { |
| alt31=1; |
| } |
| else if ( (LA31_2=='\\') ) { |
| alt31=1; |
| } |
| else if ( (LA31_2=='"') ) { |
| alt31=1; |
| } |
| else if ( ((LA31_2>=0x0000 && LA31_2<='!')||(LA31_2>='#' && LA31_2<='&')||(LA31_2>='(' && LA31_2<='[')||(LA31_2>=']' && LA31_2<=0xFFFF)) ) { |
| alt31=2; |
| } |
| |
| |
| } |
| else if ( ((LA31_0>=0x0000 && LA31_0<='&')||(LA31_0>='(' && LA31_0<='[')||(LA31_0>=']' && LA31_0<=0xFFFF)) ) { |
| alt31=2; |
| } |
| |
| |
| switch (alt31) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:52:35: ESC // alt |
| { |
| [self mESC]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 2 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:52:41: . // alt |
| { |
| [self matchAny]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop31; |
| } |
| } while (YES); |
| loop31: ; |
| /* element() */ |
| [self matchChar:'\'']; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "CHAR" |
| |
| // $ANTLR start "WS" |
| - (void) mWS |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| NSInteger _type = WS; |
| NSInteger _channel = ANTLRTokenChannelDefault; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:55:5: ( ( ' ' | '\\t' | '\\n' )+ ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:55:9: ( ' ' | '\\t' | '\\n' )+ // alt |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:55:9: ( ' ' | '\\t' | '\\n' )+ // positiveClosureBlock |
| NSInteger cnt32=0; |
| do { |
| NSInteger alt32=2; |
| NSInteger LA32_0 = [input LA:1]; |
| if ( ((LA32_0>='\t' && LA32_0<='\n')||LA32_0==' ') ) { |
| alt32=1; |
| } |
| |
| |
| switch (alt32) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g: // alt |
| { |
| if ((([input LA:1] >= '\t') && ([input LA:1] <= '\n'))||[input LA:1] == ' ') { |
| [input consume]; |
| state.failed = NO; |
| |
| } else { |
| if ( state.backtracking > 0 ) { state.failed = YES; return ; } |
| ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input]; |
| [self recover:mse]; |
| @throw mse;} |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| if ( cnt32 >= 1 ) |
| goto loop32; |
| if ( state.backtracking > 0 ) { state.failed = YES; return ; } ANTLREarlyExitException *eee = [ANTLREarlyExitException exceptionWithStream:input decisionNumber:32]; |
| @throw eee; |
| } |
| cnt32++; |
| } while (YES); |
| loop32: ; |
| /* element() */ |
| /* elements */ |
| } |
| |
| // token+rule list labels |
| |
| [state setType:_type]; |
| |
| state.channel = _channel; |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "WS" |
| |
| // $ANTLR start "QID" |
| - (void) mQID |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:59:5: ( ID ( '.' ID )* ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:59:7: ID ( '.' ID )* // alt |
| { |
| [self mID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| do { |
| NSInteger alt33=2; |
| NSInteger LA33_0 = [input LA:1]; |
| if ( (LA33_0=='.') ) { |
| alt33=1; |
| } |
| |
| |
| switch (alt33) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:59:11: '.' ID // alt |
| { |
| [self matchChar:'.']; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop33; |
| } |
| } while (YES); |
| loop33: ; |
| /* element() */ |
| /* elements */ |
| } |
| |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "QID" |
| |
| // $ANTLR start "QIDStar" |
| - (void) mQIDStar |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:68:2: ( ID ( '.' ID )* ( '.*' )? ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:68:4: ID ( '.' ID )* ( '.*' )? // alt |
| { |
| [self mID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| do { |
| NSInteger alt34=2; |
| NSInteger LA34_0 = [input LA:1]; |
| if ( (LA34_0=='.') ) { |
| NSInteger LA34_1 = [input LA:2]; |
| if ( ((LA34_1>='A' && LA34_1<='Z')||LA34_1=='_'||(LA34_1>='a' && LA34_1<='z')) ) { |
| alt34=1; |
| } |
| |
| |
| } |
| |
| |
| switch (alt34) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:68:8: '.' ID // alt |
| { |
| [self matchChar:'.']; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop34; |
| } |
| } while (YES); |
| loop34: ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:68:17: ( '.*' )? // block |
| NSInteger alt35=2; |
| NSInteger LA35_0 = [input LA:1]; |
| |
| if ( (LA35_0=='.') ) { |
| alt35=1; |
| } |
| switch (alt35) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:68:17: '.*' // alt |
| { |
| [self matchString:@".*"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| /* elements */ |
| } |
| |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "QIDStar" |
| |
| // $ANTLR start "TYPE" |
| - (void) mTYPE |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:72:5: ( QID ( '[]' )? ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:72:9: QID ( '[]' )? // alt |
| { |
| [self mQID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:72:13: ( '[]' )? // block |
| NSInteger alt36=2; |
| NSInteger LA36_0 = [input LA:1]; |
| |
| if ( (LA36_0=='[') ) { |
| alt36=1; |
| } |
| switch (alt36) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:72:13: '[]' // alt |
| { |
| [self matchString:@"[]"]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| /* element() */ |
| /* elements */ |
| } |
| |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "TYPE" |
| |
| // $ANTLR start "ARG" |
| - (void) mARG |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:76:5: ( TYPE WS ID ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:76:9: TYPE WS ID // alt |
| { |
| [self mTYPE]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| [self mID]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "ARG" |
| |
| // $ANTLR start "ID" |
| - (void) mID |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:80:5: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:80:9: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* // alt |
| { |
| if ((([input LA:1] >= 'A') && ([input LA:1] <= 'Z'))||[input LA:1] == '_'||(([input LA:1] >= 'a') && ([input LA:1] <= 'z'))) { |
| [input consume]; |
| state.failed = NO; |
| |
| } else { |
| if ( state.backtracking > 0 ) { state.failed = YES; return ; } |
| ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input]; |
| [self recover:mse]; |
| @throw mse;} |
| /* element() */ |
| do { |
| NSInteger alt37=2; |
| NSInteger LA37_0 = [input LA:1]; |
| if ( ((LA37_0>='0' && LA37_0<='9')||(LA37_0>='A' && LA37_0<='Z')||LA37_0=='_'||(LA37_0>='a' && LA37_0<='z')) ) { |
| alt37=1; |
| } |
| |
| |
| switch (alt37) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g: // alt |
| { |
| 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'))) { |
| [input consume]; |
| state.failed = NO; |
| |
| } else { |
| if ( state.backtracking > 0 ) { state.failed = YES; return ; } |
| ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input]; |
| [self recover:mse]; |
| @throw mse;} |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| default : |
| goto loop37; |
| } |
| } while (YES); |
| loop37: ; |
| /* element() */ |
| /* elements */ |
| } |
| |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "ID" |
| |
| // $ANTLR start "ESC" |
| - (void) mESC |
| { |
| // |
| // ruleScopeSetUp |
| |
| @try { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:84:5: ( '\\\\' ( '\"' | '\\'' | '\\\\' ) ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:84:7: '\\\\' ( '\"' | '\\'' | '\\\\' ) // alt |
| { |
| [self matchChar:'\\']; if ( state.failed == YES ) return ; |
| /* element() */ |
| if ([input LA:1] == '"'||[input LA:1] == '\''||[input LA:1] == '\\') { |
| [input consume]; |
| state.failed = NO; |
| |
| } else { |
| if ( state.backtracking > 0 ) { state.failed = YES; return ; } |
| ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input]; |
| [self recover:mse]; |
| @throw mse;} |
| /* element() */ |
| /* elements */ |
| } |
| |
| } |
| @finally { |
| // |
| } |
| return; |
| } |
| // $ANTLR end "ESC" |
| |
| - (void) mTokens |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:39: ( IMPORT | RETURN | CLASS | METHOD | FIELD | STAT | CALL | COMMENT | SL_COMMENT | STRING | CHAR | WS ) //ruleblock |
| NSInteger alt38=12; |
| alt38 = [dfa38 predict:input]; |
| switch (alt38) { |
| case 1 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:41: IMPORT // alt |
| { |
| [self mIMPORT]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 2 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:48: RETURN // alt |
| { |
| [self mRETURN]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 3 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:55: CLASS // alt |
| { |
| [self mCLASS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 4 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:61: METHOD // alt |
| { |
| [self mMETHOD]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 5 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:68: FIELD // alt |
| { |
| [self mFIELD]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 6 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:74: STAT // alt |
| { |
| [self mSTAT]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 7 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:79: CALL // alt |
| { |
| [self mCALL]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 8 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:84: COMMENT // alt |
| { |
| [self mCOMMENT]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 9 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:92: SL_COMMENT // alt |
| { |
| [self mSL_COMMENT]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 10 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:103: STRING // alt |
| { |
| [self mSTRING]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 11 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:110: CHAR // alt |
| { |
| [self mCHAR]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| case 12 : ; |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:115: WS // alt |
| { |
| [self mWS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| break; |
| |
| } |
| |
| } |
| |
| // $ANTLR start synpred1_Fuzzy_fragment |
| - (void) synpred1_Fuzzy_fragment |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:41: ( IMPORT ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:41: IMPORT // alt |
| { |
| [self mIMPORT]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| } // $ANTLR end synpred1_Fuzzy_fragment |
| |
| // $ANTLR start synpred2_Fuzzy_fragment |
| - (void) synpred2_Fuzzy_fragment |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:48: ( RETURN ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:48: RETURN // alt |
| { |
| [self mRETURN]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| } // $ANTLR end synpred2_Fuzzy_fragment |
| |
| // $ANTLR start synpred3_Fuzzy_fragment |
| - (void) synpred3_Fuzzy_fragment |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:55: ( CLASS ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:55: CLASS // alt |
| { |
| [self mCLASS]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| } // $ANTLR end synpred3_Fuzzy_fragment |
| |
| // $ANTLR start synpred4_Fuzzy_fragment |
| - (void) synpred4_Fuzzy_fragment |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:61: ( METHOD ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:61: METHOD // alt |
| { |
| [self mMETHOD]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| } // $ANTLR end synpred4_Fuzzy_fragment |
| |
| // $ANTLR start synpred5_Fuzzy_fragment |
| - (void) synpred5_Fuzzy_fragment |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:68: ( FIELD ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:68: FIELD // alt |
| { |
| [self mFIELD]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| } // $ANTLR end synpred5_Fuzzy_fragment |
| |
| // $ANTLR start synpred6_Fuzzy_fragment |
| - (void) synpred6_Fuzzy_fragment |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:74: ( STAT ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:74: STAT // alt |
| { |
| [self mSTAT]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| } // $ANTLR end synpred6_Fuzzy_fragment |
| |
| // $ANTLR start synpred7_Fuzzy_fragment |
| - (void) synpred7_Fuzzy_fragment |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:79: ( CALL ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:79: CALL // alt |
| { |
| [self mCALL]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| } // $ANTLR end synpred7_Fuzzy_fragment |
| |
| // $ANTLR start synpred8_Fuzzy_fragment |
| - (void) synpred8_Fuzzy_fragment |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:84: ( COMMENT ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:84: COMMENT // alt |
| { |
| [self mCOMMENT]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| } // $ANTLR end synpred8_Fuzzy_fragment |
| |
| // $ANTLR start synpred9_Fuzzy_fragment |
| - (void) synpred9_Fuzzy_fragment |
| { |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:92: ( SL_COMMENT ) // ruleBlockSingleAlt |
| // /usr/local/ANTLR3-ObjC2.0-Runtime/Framework/examples/fuzzy/Fuzzy.g:1:92: SL_COMMENT // alt |
| { |
| [self mSL_COMMENT]; if ( state.failed == YES ) return ; |
| /* element() */ |
| /* elements */ |
| } |
| } // $ANTLR end synpred9_Fuzzy_fragment |
| |
| @end // end of Fuzzy implementation // line 397 |
| |
| /* End of code |
| * ============================================================================= |
| */ |