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

📄 grammarfilterlexer.m

📁 antlr最新版本V3源代码
💻 M
📖 第 1 页 / 共 3 页
字号:
		[self matchChar:'{'];		if (failed) return ;		do {		    int alt13=5;		    alt13 = [dfa13 predict];		    switch (alt13) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:39:5: ( ( WS )? '//' )=> SL_COMMENT // alt			    {			    [self mSL_COMMENT];			    if (failed) return ;			    }			    break;			case 2 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:40:5: ( ( WS )? '/*' )=> COMMENT // alt			    {			    [self mCOMMENT];			    if (failed) return ;			    }			    break;			case 3 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:5: ( ( WS )? 'tokenVocab' )=> ( WS )? 'tokenVocab' ( WS )? '=' ( WS )? tokenVocab= ID ( WS )? ';' // alt			    {			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:27: ( WS )? // block			    int alt5=2;			    {			    	int LA5_0 = [input LA:1];			    	if ( (LA5_0>='\t' && LA5_0<='\n')||LA5_0==' ' ) {			    		alt5 = 1;			    	}			    }			    switch (alt5) {			    	case 1 :			    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:27: WS // alt			    	    {			    	    [self mWS];			    	    if (failed) return ;			    	    }			    	    break;			    }			    [self matchString:@"tokenVocab"];			    if (failed) return ;			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:44: ( WS )? // block			    int alt6=2;			    {			    	int LA6_0 = [input LA:1];			    	if ( (LA6_0>='\t' && LA6_0<='\n')||LA6_0==' ' ) {			    		alt6 = 1;			    	}			    }			    switch (alt6) {			    	case 1 :			    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:44: WS // alt			    	    {			    	    [self mWS];			    	    if (failed) return ;			    	    }			    	    break;			    }			    [self matchChar:'='];			    if (failed) return ;			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:52: ( WS )? // block			    int alt7=2;			    {			    	int LA7_0 = [input LA:1];			    	if ( (LA7_0>='\t' && LA7_0<='\n')||LA7_0==' ' ) {			    		alt7 = 1;			    	}			    }			    switch (alt7) {			    	case 1 :			    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:52: WS // alt			    	    {			    	    [self mWS];			    	    if (failed) return ;			    	    }			    	    break;			    }			    int _tokenVocabStart = [self charIndex];			    [self mID];			    if (failed) return ;			    _tokenVocab = [[ANTLRCommonToken alloc] initWithInput:input tokenType:ANTLRTokenTypeInvalid channel:ANTLRTokenChannelDefault start:_tokenVocabStart stop:[self charIndex]];			    [_tokenVocab setLine:[self line]];			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:70: ( WS )? // block			    int alt8=2;			    {			    	int LA8_0 = [input LA:1];			    	if ( (LA8_0>='\t' && LA8_0<='\n')||LA8_0==' ' ) {			    		alt8 = 1;			    	}			    }			    switch (alt8) {			    	case 1 :			    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:41:70: WS // alt			    	    {			    	    [self mWS];			    	    if (failed) return ;			    	    }			    	    break;			    }			    [self matchChar:';'];			    if (failed) return ;			    if ( backtracking==1 ) {			       [delegate setDependsOnVocab:[_tokenVocab text]]; 			    }			    }			    break;			case 4 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:42:5: ( WS )? ID ( WS )? '=' ( WS )? ID ( WS )? ';' // alt			    {			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:42:5: ( WS )? // block			    int alt9=2;			    {			    	int LA9_0 = [input LA:1];			    	if ( (LA9_0>='\t' && LA9_0<='\n')||LA9_0==' ' ) {			    		alt9 = 1;			    	}			    }			    switch (alt9) {			    	case 1 :			    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:42:5: WS // alt			    	    {			    	    [self mWS];			    	    if (failed) return ;			    	    }			    	    break;			    }			    [self mID];			    if (failed) return ;			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:42:12: ( WS )? // block			    int alt10=2;			    {			    	int LA10_0 = [input LA:1];			    	if ( (LA10_0>='\t' && LA10_0<='\n')||LA10_0==' ' ) {			    		alt10 = 1;			    	}			    }			    switch (alt10) {			    	case 1 :			    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:42:12: WS // alt			    	    {			    	    [self mWS];			    	    if (failed) return ;			    	    }			    	    break;			    }			    [self matchChar:'='];			    if (failed) return ;			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:42:20: ( WS )? // block			    int alt11=2;			    {			    	int LA11_0 = [input LA:1];			    	if ( (LA11_0>='\t' && LA11_0<='\n')||LA11_0==' ' ) {			    		alt11 = 1;			    	}			    }			    switch (alt11) {			    	case 1 :			    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:42:20: WS // alt			    	    {			    	    [self mWS];			    	    if (failed) return ;			    	    }			    	    break;			    }			    [self mID];			    if (failed) return ;			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:42:27: ( WS )? // block			    int alt12=2;			    {			    	int LA12_0 = [input LA:1];			    	if ( (LA12_0>='\t' && LA12_0<='\n')||LA12_0==' ' ) {			    		alt12 = 1;			    	}			    }			    switch (alt12) {			    	case 1 :			    	    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:42:27: WS // alt			    	    {			    	    [self mWS];			    	    if (failed) return ;			    	    }			    	    break;			    }			    [self matchChar:';'];			    if (failed) return ;			    }			    break;			default :			    goto loop13;		    }		} while (YES); loop13: ;		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:44:3: ( WS )? // block		int alt14=2;		{			int LA14_0 = [input LA:1];			if ( (LA14_0>='\t' && LA14_0<='\n')||LA14_0==' ' ) {				alt14 = 1;			}		}		switch (alt14) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:44:3: WS // alt			    {			    [self mWS];			    if (failed) return ;			    }			    break;		}		[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		[_tokenVocab release];		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end OPTIONS- (void) mLEXER_RULE{	@try {		int _type = GrammarFilterLexer_LEXER_RULE;		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:49:4: ( ( 'A' .. 'Z' ) ( ID )? ( WS )? ':' ( options {greedy=false; } : . )* ';' ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:49:4: ( 'A' .. 'Z' ) ( ID )? ( WS )? ':' ( options {greedy=false; } : . )* ';' // alt		{		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:49:4: ( 'A' .. 'Z' ) // blockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:49:5: 'A' .. 'Z' // alt		{		[self matchRangeFromChar:'A' to:'Z'];if (failed) return ;		}		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:49:15: ( ID )? // block		int alt15=2;		{			int LA15_0 = [input LA:1];			if ( (LA15_0>='0' && LA15_0<='9')||(LA15_0>='A' && LA15_0<='Z')||LA15_0=='_'||(LA15_0>='a' && LA15_0<='z') ) {				alt15 = 1;			}		}		switch (alt15) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:49:15: ID // alt			    {			    [self mID];			    if (failed) return ;			    }			    break;		}		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:49:19: ( WS )? // block		int alt16=2;		{			int LA16_0 = [input LA:1];			if ( (LA16_0>='\t' && LA16_0<='\n')||LA16_0==' ' ) {				alt16 = 1;			}		}		switch (alt16) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:49:19: WS // alt			    {			    [self mWS];			    if (failed) return ;			    }			    break;		}		[self matchChar:':'];		if (failed) return ;		do {		    int alt17=2;		    {		    	int LA17_0 = [input LA:1];		    	if ( LA17_0==';' ) {		    		alt17 = 2;		    	}		    	else if ( (LA17_0>=0x0000 && LA17_0<=':')||(LA17_0>='<' && LA17_0<=0xFFFE) ) {		    		alt17 = 1;		    	}		    }		    switch (alt17) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:49:54: . // alt			    {			    [self matchAny];			    if (failed) return ;			    }			    break;			default :			    goto loop17;		    }		} while (YES); loop17: ;		[self matchChar:';'];		if (failed) return ;		if ( backtracking==1 ) {		   [delegate setIsCombinedGrammar:YES]; 		}		}		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 LEXER_RULE- (void) mCOMMENT{	@try {		int _type = GrammarFilterLexer_COMMENT;		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:54:9: ( '/*' ( options {greedy=false; } : . )* '*/' ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:54:9: '/*' ( options {greedy=false; } : . )* '*/' // alt		{		[self matchString:@"/*"];		if (failed) return ;		do {		    int alt18=2;		    {		    	int LA18_0 = [input LA:1];		    	if ( LA18_0=='*' ) {		    		{		    			int LA18_1 = [input LA:2];		    			if ( LA18_1=='/' ) {		    				alt18 = 2;		    			}		    			else if ( (LA18_1>=0x0000 && LA18_1<='.')||(LA18_1>='0' && LA18_1<=0xFFFE) ) {		    				alt18 = 1;		    			}		    		}		    	}		    	else if ( (LA18_0>=0x0000 && LA18_0<=')')||(LA18_0>='+' && LA18_0<=0xFFFE) ) {		    		alt18 = 1;		    	}		    }		    switch (alt18) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:54:41: . // alt			    {			    [self matchAny];			    if (failed) return ;			    }			    break;			default :			    goto loop18;		    }		} while (YES); loop18: ;		[self matchString:@"*/"];		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 COMMENT- (void) mSL_COMMENT{	@try {		int _type = GrammarFilterLexer_SL_COMMENT;		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:58:9: ( '//' ( options {greedy=false; } : . )* '\\n' ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:58:9: '//' ( options {greedy=false; } : . )* '\\n' // alt		{		[self matchString:@"//"];		if (failed) return ;		do {		    int alt19=2;		    {		    	int LA19_0 = [input LA:1];		    	if ( LA19_0=='\n' ) {		    		alt19 = 2;		    	}		    	else if ( (LA19_0>=0x0000 && LA19_0<='\t')||(LA19_0>=0x000B && LA19_0<=0xFFFE) ) {		    		alt19 = 1;		    	}		    }		    switch (alt19) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:58:41: . // alt			    {			    [self matchAny];

⌨️ 快捷键说明

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