⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 grammarfilterlexer.m

📁 antlr最新版本V3源代码
💻 M
📖 第 1 页 / 共 3 页
字号:
			    if (failed) return ;			    }			    break;			default :			    goto loop19;		    }		} while (YES); loop19: ;		[self matchChar:'\n'];		if (failed) return ;		}		if ( token == nil ) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end SL_COMMENT- (void) mACTION{	@try {		int _type = GrammarFilterLexer_ACTION;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:63:4: ( '{' ( options {greedy=false; } : . )* '}' ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:63:4: '{' ( options {greedy=false; } : . )* '}' // alt		{		[self matchChar:'{'];		if (failed) return ;		do {		    int alt20=2;		    {		    	int LA20_0 = [input LA:1];		    	if ( LA20_0=='}' ) {		    		alt20 = 2;		    	}		    	else if ( (LA20_0>=0x0000 && LA20_0<='|')||(LA20_0>='~' && LA20_0<=0xFFFE) ) {		    		alt20 = 1;		    	}		    }		    switch (alt20) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:63:35: . // alt			    {			    [self matchAny];			    if (failed) return ;			    }			    break;			default :			    goto loop20;		    }		} while (YES); loop20: ;		[self matchChar:'}'];		if (failed) return ;		}		if ( token == nil ) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end ACTION- (void) mSTRING{	@try {		int _type = GrammarFilterLexer_STRING;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:67:4: ( '\\'' ( options {greedy=false; } : . )* '\\'' ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:67:4: '\\'' ( options {greedy=false; } : . )* '\\'' // alt		{		[self matchChar:'\''];		if (failed) return ;		do {		    int alt21=2;		    {		    	int LA21_0 = [input LA:1];		    	if ( LA21_0=='\'' ) {		    		alt21 = 2;		    	}		    	else if ( (LA21_0>=0x0000 && LA21_0<='&')||(LA21_0>='(' && LA21_0<=0xFFFE) ) {		    		alt21 = 1;		    	}		    }		    switch (alt21) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:67:36: . // alt			    {			    [self matchAny];			    if (failed) return ;			    }			    break;			default :			    goto loop21;		    }		} while (YES); loop21: ;		[self matchChar:'\''];		if (failed) return ;		}		if ( token == nil ) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end STRING- (void) mID{	@try {		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:71:9: ( ( ('a'..'z'|'A'..'Z'|'_'|'0'..'9'))+ ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:71:9: ( ('a'..'z'|'A'..'Z'|'_'|'0'..'9'))+ // alt		{		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:71:9: ( ('a'..'z'|'A'..'Z'|'_'|'0'..'9'))+	// positiveClosureBlock		int cnt22=0;		do {		    int alt22=2;		    {		    	int LA22_0 = [input LA:1];		    	if ( (LA22_0>='0' && LA22_0<='9')||(LA22_0>='A' && LA22_0<='Z')||LA22_0=='_'||(LA22_0>='a' && LA22_0<='z') ) {		    		alt22 = 1;		    	}		    }		    switch (alt22) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:71:10: ('a'..'z'|'A'..'Z'|'_'|'0'..'9') // 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];			    failed = NO;			    } else {			    	if (backtracking > 0) {failed=YES; return ;}			    	ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input];			    	[self recover:mse];	@throw mse;			    }			    }			    break;			default :			    if ( cnt22 >= 1 )  goto loop22;		            if (backtracking > 0) {failed=YES; return ;}					ANTLREarlyExitException *eee = [ANTLREarlyExitException exceptionWithStream:input decisionNumber:22];					@throw eee;		    }		    cnt22++;		} while (YES); loop22: ;		}	}	@finally {        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end ID- (void) mWS{	@try {		int _type = GrammarFilterLexer_WS;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:74:9: ( ( (' '|'\\t'|'\\n'))+ ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:74:9: ( (' '|'\\t'|'\\n'))+ // alt		{		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:74:9: ( (' '|'\\t'|'\\n'))+	// positiveClosureBlock		int cnt23=0;		do {		    int alt23=2;		    {		    	int LA23_0 = [input LA:1];		    	if ( (LA23_0>='\t' && LA23_0<='\n')||LA23_0==' ' ) {		    		alt23 = 1;		    	}		    }		    switch (alt23) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:74:10: (' '|'\\t'|'\\n') // alt			    {			    if (([input LA:1]>='\t' && [input LA:1]<='\n')||[input LA:1]==' ') {			    	[input consume];			    failed = NO;			    } else {			    	if (backtracking > 0) {failed=YES; return ;}			    	ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input];			    	[self recover:mse];	@throw mse;			    }			    }			    break;			default :			    if ( cnt23 >= 1 )  goto loop23;		            if (backtracking > 0) {failed=YES; return ;}					ANTLREarlyExitException *eee = [ANTLREarlyExitException exceptionWithStream:input decisionNumber:23];					@throw eee;		    }		    cnt23++;		} while (YES); loop23: ;		}		if ( token == nil ) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end WS- (void) mTokens{    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:25: ( ( GRAMMAR )=> GRAMMAR | ( OPTIONS )=> OPTIONS | ( LEXER_RULE )=> LEXER_RULE | ( COMMENT )=> COMMENT | ( SL_COMMENT )=> SL_COMMENT | ( ACTION )=> ACTION | ( STRING )=> STRING | ( WS )=> WS ) //ruleblock    int alt24=8;    switch ([input LA:1]) {    	case 'g':    	case 'l':    	case 'p':    	case 't':    		alt24 = 1;    		break;    	case 'o':    		alt24 = 2;    		break;    	case 'A':    	case 'B':    	case 'C':    	case 'D':    	case 'E':    	case 'F':    	case 'G':    	case 'H':    	case 'I':    	case 'J':    	case 'K':    	case 'L':    	case 'M':    	case 'N':    	case 'O':    	case 'P':    	case 'Q':    	case 'R':    	case 'S':    	case 'T':    	case 'U':    	case 'V':    	case 'W':    	case 'X':    	case 'Y':    	case 'Z':    		alt24 = 3;    		break;    	case '/':    		{    			int LA24_7 = [input LA:2];    			if ( [self evaluateSyntacticPredicate:@selector(synpred7)] ) {    				alt24 = 4;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred8)] ) {    				alt24 = 5;    			}    		else {    			if (failed) return ;    		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:24 state:7 stream:input];    			@throw nvae;    			}    		}    		break;    	case '{':    		alt24 = 6;    		break;    	case '\'':    		alt24 = 7;    		break;    	case '\t':    	case '\n':    	case ' ':    		alt24 = 8;    		break;    default:     {    	if (failed) return ;        ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:24 state:0 stream:input];    	@throw nvae;    	}}    switch (alt24) {    	case 1 :    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:25: ( GRAMMAR )=> GRAMMAR // alt    	    {    	    [self mGRAMMAR];    	    if (failed) return ;    	    }    	    break;    	case 2 :    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:44: ( OPTIONS )=> OPTIONS // alt    	    {    	    [self mOPTIONS];    	    if (failed) return ;    	    }    	    break;    	case 3 :    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:63: ( LEXER_RULE )=> LEXER_RULE // alt    	    {    	    [self mLEXER_RULE];    	    if (failed) return ;    	    }    	    break;    	case 4 :    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:88: ( COMMENT )=> COMMENT // alt    	    {    	    [self mCOMMENT];    	    if (failed) return ;    	    }    	    break;    	case 5 :    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:107: ( SL_COMMENT )=> SL_COMMENT // alt    	    {    	    [self mSL_COMMENT];    	    if (failed) return ;    	    }    	    break;    	case 6 :    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:132: ( ACTION )=> ACTION // alt    	    {    	    [self mACTION];    	    if (failed) return ;    	    }    	    break;    	case 7 :    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:149: ( STRING )=> STRING // alt    	    {    	    [self mSTRING];    	    if (failed) return ;    	    }    	    break;    	case 8 :    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:166: ( WS )=> WS // alt    	    {    	    [self mWS];    	    if (failed) return ;    	    }    	    break;    }}- (void) synpred3{    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:5: ( ( WS )? 'tokenVocab' ) // ruleBlockSingleAlt    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:6: ( WS )? 'tokenVocab' // alt    {    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:6: ( WS )? // block    int alt27=2;    {    	int LA27_0 = [input LA:1];    	if ( (LA27_0>='\t' && LA27_0<='\n')||LA27_0==' ' ) {    		alt27 = 1;    	}    }    switch (alt27) {    	case 1 :    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:6: WS // alt    	    {    	    [self mWS];    	    if (failed) return ;    	    }    	    break;    }    [self matchString:@"tokenVocab"];    if (failed) return ;    }}- (void) synpred7{    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:88: ( COMMENT ) // ruleBlockSingleAlt    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:89: COMMENT // alt    {    [self mCOMMENT];    if (failed) return ;    }}- (void) synpred8{    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:107: ( SL_COMMENT ) // ruleBlockSingleAlt    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:1:108: SL_COMMENT // alt    {    [self mSL_COMMENT];    if (failed) return ;    }}@end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -