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

📄 fuzzyjavalexer.m

📁 antlr最新版本V3源代码
💻 M
📖 第 1 页 / 共 4 页
字号:
		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end ARG- (void) mID{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		// FuzzyJava.gl:80:9: ( ('a'..'z'|'A'..'Z'|'_') ( ('a'..'z'|'A'..'Z'|'_'|'0'..'9'))* ) // ruleBlockSingleAlt		// FuzzyJava.gl: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];		failed = NO;		} else {			if (backtracking > 0) {failed=YES; return ;}			ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input];			[self recover:mse];	@throw mse;		}		do {		    int alt37=2;		    {		    	int 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 :			    // FuzzyJava.gl:80:34: ('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 :			    goto loop37;		    }		} while (YES); loop37: ;		}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end ID- (void) mESC{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		// FuzzyJava.gl:84:7: ( '\\\\' ('\"'|'\\''|'\\\\')) // ruleBlockSingleAlt		// FuzzyJava.gl:84:7: '\\\\' ('\"'|'\\''|'\\\\') // alt		{		[self matchChar:'\\'];		if (failed) return ;		if ([input LA:1]=='"'||[input LA:1]=='\''||[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;		}		}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end ESC- (void) mTokens{    // FuzzyJava.gl:1:25: ( ( IMPORT )=> IMPORT | ( RETURN )=> RETURN | ( CLASS )=> CLASS | ( METHOD )=> METHOD | ( FIELD )=> FIELD | ( STAT )=> STAT | ( CALL )=> CALL | ( COMMENT )=> COMMENT | ( SL_COMMENT )=> SL_COMMENT | ( STRING )=> STRING | ( CHAR )=> CHAR | ( WS )=> WS ) //ruleblock    int alt38=12;    switch ([input LA:1]) {    	case 'i':    		{    			int LA38_1 = [input LA:2];    			if ( [self evaluateSyntacticPredicate:@selector(synpred1)] ) {    				alt38 = 1;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred4)] ) {    				alt38 = 4;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred5)] ) {    				alt38 = 5;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred6)] ) {    				alt38 = 6;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred7)] ) {    				alt38 = 7;    			}    		else {    			if (backtracking > 0) {failed=YES; return ;}    		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:38 state:1 stream:input];    			@throw nvae;    			}    		}    		break;    	case 'r':    		{    			int LA38_2 = [input LA:2];    			if ( [self evaluateSyntacticPredicate:@selector(synpred2)] ) {    				alt38 = 2;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred4)] ) {    				alt38 = 4;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred5)] ) {    				alt38 = 5;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred7)] ) {    				alt38 = 7;    			}    		else {    			if (backtracking > 0) {failed=YES; return ;}    		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:38 state:2 stream:input];    			@throw nvae;    			}    		}    		break;    	case 'c':    		{    			int LA38_3 = [input LA:2];    			if ( [self evaluateSyntacticPredicate:@selector(synpred3)] ) {    				alt38 = 3;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred4)] ) {    				alt38 = 4;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred5)] ) {    				alt38 = 5;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred7)] ) {    				alt38 = 7;    			}    		else {    			if (backtracking > 0) {failed=YES; return ;}    		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:38 state:3 stream:input];    			@throw nvae;    			}    		}    		break;    	case 'w':    		{    			int LA38_4 = [input LA:2];    			if ( [self evaluateSyntacticPredicate:@selector(synpred4)] ) {    				alt38 = 4;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred5)] ) {    				alt38 = 5;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred6)] ) {    				alt38 = 6;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred7)] ) {    				alt38 = 7;    			}    		else {    			if (backtracking > 0) {failed=YES; return ;}    		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:38 state:4 stream:input];    			@throw nvae;    			}    		}    		break;    	case 's':    		{    			int LA38_5 = [input LA:2];    			if ( [self evaluateSyntacticPredicate:@selector(synpred4)] ) {    				alt38 = 4;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred5)] ) {    				alt38 = 5;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred6)] ) {    				alt38 = 6;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred7)] ) {    				alt38 = 7;    			}    		else {    			if (backtracking > 0) {failed=YES; return ;}    		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:38 state:5 stream:input];    			@throw nvae;    			}    		}    		break;    	case 'f':    		{    			int LA38_6 = [input LA:2];    			if ( [self evaluateSyntacticPredicate:@selector(synpred4)] ) {    				alt38 = 4;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred5)] ) {    				alt38 = 5;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred6)] ) {    				alt38 = 6;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred7)] ) {    				alt38 = 7;    			}    		else {    			if (backtracking > 0) {failed=YES; return ;}    		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:38 state:6 stream:input];    			@throw nvae;    			}    		}    		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':    	case '_':    	case 'a':    	case 'b':    	case 'd':    	case 'e':    	case 'g':    	case 'h':    	case 'j':    	case 'k':    	case 'l':    	case 'm':    	case 'n':    	case 'o':    	case 'p':    	case 'q':    	case 't':    	case 'u':    	case 'v':    	case 'x':    	case 'y':    	case 'z':    		{    			int LA38_7 = [input LA:2];    			if ( [self evaluateSyntacticPredicate:@selector(synpred4)] ) {    				alt38 = 4;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred5)] ) {    				alt38 = 5;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred7)] ) {    				alt38 = 7;    			}    		else {    			if (backtracking > 0) {failed=YES; return ;}    		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:38 state:7 stream:input];    			@throw nvae;    			}    		}    		break;    	case '/':    		{    			int LA38_8 = [input LA:2];    			if ( [self evaluateSyntacticPredicate:@selector(synpred8)] ) {    				alt38 = 8;    			}    			else if ( [self evaluateSyntacticPredicate:@selector(synpred9)] ) {    				alt38 = 9;    			}    		else {    			if (backtracking > 0) {failed=YES; return ;}    		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:38 state:8 stream:input];    			@throw nvae;    			}    		}    		break;    	case '"':    		alt38 = 10;    		break;    	case '\'':    		alt38 = 11;    		break;    	case '\t':    	case '\n':    	case ' ':    		alt38 = 12;    		break;    default:     {    	if (backtracking > 0) {failed=YES; return ;}        ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:38 state:0 stream:input];    	@throw nvae;    	}}    switch (alt38) {    	case 1 :    	    // FuzzyJava.gl:1:25: ( IMPORT )=> IMPORT // alt    	    {    	    [self mIMPORT];    	    if (failed) return ;    	    }    	    break;    	case 2 :    	    // FuzzyJava.gl:1:42: ( RETURN )=> RETURN // alt    	    {    	    [self mRETURN];    	    if (failed) return ;    	    }    	    break;    	case 3 :    	    // FuzzyJava.gl:1:59: ( CLASS )=> CLASS // alt    	    {    	    [self mCLASS];    	    if (failed) return ;    	    }    	    break;    	case 4 :    	    // FuzzyJava.gl:1:74: ( METHOD )=> METHOD // alt    	    {    	    [self mMETHOD];    	    if (failed) return ;    	    }    	    break;    	case 5 :    	    // FuzzyJava.gl:1:91: ( FIELD )=> FIELD // alt    	    {    	    [self mFIELD];    	    if (failed) return ;    	    }    	    break;    	case 6 :    	    // FuzzyJava.gl:1:106: ( STAT )=> STAT // alt    	    {    	    [self mSTAT];    	    if (failed) return ;    	    }    	    break;    	case 7 :    	    // FuzzyJava.gl:1:119: ( CALL )=> CALL // alt    	    {    	    [self mCALL];    	    if (failed) return ;    	    }    	    break;    	case 8 :    	    // FuzzyJava.gl:1:132: ( COMMENT )=> COMMENT // alt    	    {    	    [self mCOMMENT];    	    if (failed) return ;    	    }    	    break;    	case 9 :    	    // FuzzyJava.gl:1:151: ( SL_COMMENT )=> SL_COMMENT // alt    	    {    	    [self mSL_COMMENT];    	    if (failed) return ;    	    }    	    break;    	case 10 :    	    // FuzzyJava.gl:1:176: ( STRING )=> STRING // alt    	    {    	    [self mSTRING];    	    if (failed) return ;    	    }    	    break;    	case 11 :    	    // FuzzyJava.gl:1:193: ( CHAR )=> CHAR // alt    	    {    	    [self mCHAR];    	    if (failed) return ;    	    }    	    break;    	case 12 :    	    // FuzzyJava.gl:1:206: ( WS )=> WS // alt    	    {    	    [self mWS];    	    if (failed) return ;    	    }    	    break;    }}- (void) synpred1{    // FuzzyJava.gl:1:25: ( IMPORT ) // ruleBlockSingleAlt    // FuzzyJava.gl:1:26: IMPORT // alt    {    [self mIMPORT];    if (failed) return ;    }}- (void) synpred2{    // FuzzyJava.gl:1:42: ( RETURN ) // ruleBlockSingleAlt    // FuzzyJava.gl:1:43: RETURN // alt    {    [self mRETURN];    if (failed) return ;    }}- (void) synpred3{    // FuzzyJava.gl:1:59: ( CLASS ) // ruleBlockSingleAlt    // FuzzyJava.gl:1:60: CLASS // alt    {    [self mCLASS];    if (failed) return ;    }}- (void) synpred4{    // FuzzyJava.gl:1:74: ( METHOD ) // ruleBlockSingleAlt    // FuzzyJava.gl:1:75: METHOD // alt    {    [self mMETHOD];    if (failed) return ;    }}- (void) synpred5{    // FuzzyJava.gl:1:91: ( FIELD ) // ruleBlockSingleAlt    // FuzzyJava.gl:1:92: FIELD // alt    {    [self mFIELD];    if (failed) return ;    }}- (void) synpred6{    // FuzzyJava.gl:1:106: ( STAT ) // ruleBlockSingleAlt    // FuzzyJava.gl:1:107: STAT // alt    {    [self mSTAT];    if (failed) return ;    }}- (void) synpred7{    // FuzzyJava.gl:1:119: ( CALL ) // ruleBlockSingleAlt    // FuzzyJava.gl:1:120: CALL // alt    {    [self mCALL];    if (failed) return ;    }}- (void) synpred8{    // FuzzyJava.gl:1:132: ( COMMENT ) // ruleBlockSingleAlt    // FuzzyJava.gl:1:133: COMMENT // alt    {    [self mCOMMENT];    if (failed) return ;    }}- (void) synpred9{    // FuzzyJava.gl:1:151: ( SL_COMMENT ) // ruleBlockSingleAlt    // FuzzyJava.gl:1:152: SL_COMMENT // alt    {    [self mSL_COMMENT];    if (failed) return ;    }}@end

⌨️ 快捷键说明

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