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

📄 grammarfilterlexer.m

📁 antlr最新版本V3源代码
💻 M
📖 第 1 页 / 共 3 页
字号:
// $ANTLR 3.0b5 /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g 2006-11-12 20:15:18#import "GrammarFilterLexer.h"#pragma mark Cyclic DFAs@implementation GrammarFilterLexerDFA13const static int GrammarFilterLexerdfa13_eot[24] =    {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,     -1};const static int GrammarFilterLexerdfa13_eof[24] =    {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,     -1};const static unichar GrammarFilterLexerdfa13_min[24] =    {9,9,0,42,9,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,0,0};const static unichar GrammarFilterLexerdfa13_max[24] =    {125,125,0,47,122,0,0,0,122,122,122,122,122,122,122,122,122,61,122,122,     122,59,0,0};const static int GrammarFilterLexerdfa13_accept[24] =    {-1,-1,5,-1,-1,4,2,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,3};const static int GrammarFilterLexerdfa13_special[24] =    {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,     -1};const static int GrammarFilterLexerdfa13_transition[] = {};const static int GrammarFilterLexerdfa13_transition0[] = {5, 5, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 5, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 16, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5};const static int GrammarFilterLexerdfa13_transition1[] = {21, 21, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 21, -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, 22};const static int GrammarFilterLexerdfa13_transition2[] = {5, 5, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 5, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 9, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5};const static int GrammarFilterLexerdfa13_transition3[] = {5, 5, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 5, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 13, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5};const static int GrammarFilterLexerdfa13_transition4[] = {6, -1, -1, -1, 	-1, 7};const static int GrammarFilterLexerdfa13_transition5[] = {19, 19, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 	20, 20, 20, 20, 20, 20, 20, 20, 20, -1, -1, -1, -1, -1, -1, -1, 20, 20, 	20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 	20, 20, 20, 20, 20, 20, -1, -1, -1, -1, 20, -1, 20, 20, 20, 20, 20, 20, 	20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 	20, 20};const static int GrammarFilterLexerdfa13_transition6[] = {5, 5, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 5, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 12, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5};const static int GrammarFilterLexerdfa13_transition7[] = {5, 5, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 5, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 8, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5};const static int GrammarFilterLexerdfa13_transition8[] = {5, 5, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 5, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 5, 14, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5};const static int GrammarFilterLexerdfa13_transition9[] = {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, 3, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 5, 5, 	5, 5, 5, 5, -1, -1, 2};const static int GrammarFilterLexerdfa13_transition10[] = {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, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 5, 5, 	5, 5, 5, 5, -1, -1, 2};const static int GrammarFilterLexerdfa13_transition11[] = {-1};const static int GrammarFilterLexerdfa13_transition12[] = {5, 5, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 5, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 11, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5};const static int GrammarFilterLexerdfa13_transition13[] = {5, 5, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 5, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 15, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5};const static int GrammarFilterLexerdfa13_transition14[] = {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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 18, -1, -1, -1, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 	-1, 5, -1, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5};const static int GrammarFilterLexerdfa13_transition15[] = {21, 21, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 20, 	20, 20, 20, 20, 20, 20, 20, 20, 20, -1, 22, -1, -1, -1, -1, -1, 20, 20, 	20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 	20, 20, 20, 20, 20, 20, -1, -1, -1, -1, 20, -1, 20, 20, 20, 20, 20, 20, 	20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 	20, 20};const static int GrammarFilterLexerdfa13_transition16[] = {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, -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, 18};const static int GrammarFilterLexerdfa13_transition17[] = {5, 5, -1, -1, 	-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 	-1, 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, 5, -1, -1, -1, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, -1, -1, -1, -1, 	5, -1, 5, 5, 5, 5, 10, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 	5, 5, 5, 5, 5};- (id) initWithRecognizer:(ANTLRBaseRecognizer *) theRecognizer{	if ((self = [super initWithRecognizer:theRecognizer]) != nil) {		eot = GrammarFilterLexerdfa13_eot;		eof = GrammarFilterLexerdfa13_eof;		min = GrammarFilterLexerdfa13_min;		max = GrammarFilterLexerdfa13_max;		accept = GrammarFilterLexerdfa13_accept;		special = GrammarFilterLexerdfa13_special;		if (!(transition = calloc(24, sizeof(void*)))) {			[self release];			return nil;		}		transition[0] = GrammarFilterLexerdfa13_transition9;		transition[1] = GrammarFilterLexerdfa13_transition10;		transition[2] = GrammarFilterLexerdfa13_transition;		transition[3] = GrammarFilterLexerdfa13_transition4;		transition[4] = GrammarFilterLexerdfa13_transition7;		transition[5] = GrammarFilterLexerdfa13_transition;		transition[6] = GrammarFilterLexerdfa13_transition;		transition[7] = GrammarFilterLexerdfa13_transition;		transition[8] = GrammarFilterLexerdfa13_transition2;		transition[9] = GrammarFilterLexerdfa13_transition17;		transition[10] = GrammarFilterLexerdfa13_transition12;		transition[11] = GrammarFilterLexerdfa13_transition6;		transition[12] = GrammarFilterLexerdfa13_transition3;		transition[13] = GrammarFilterLexerdfa13_transition8;		transition[14] = GrammarFilterLexerdfa13_transition13;		transition[15] = GrammarFilterLexerdfa13_transition0;		transition[16] = GrammarFilterLexerdfa13_transition14;		transition[17] = GrammarFilterLexerdfa13_transition16;		transition[18] = GrammarFilterLexerdfa13_transition5;		transition[19] = GrammarFilterLexerdfa13_transition5;		transition[20] = GrammarFilterLexerdfa13_transition15;		transition[21] = GrammarFilterLexerdfa13_transition1;		transition[22] = GrammarFilterLexerdfa13_transition11;		transition[23] = GrammarFilterLexerdfa13_transition;	}	return self;}- (int) specialStateTransition:(int) s{	int _s = s;	switch ( s ) { 				case 0 :  				[[recognizer input] rewind]; 				s = -1; 				if ( ([self evaluateSyntacticPredicate:@selector(synpred3)]) ) {s = 23;} 				else if ( (YES) ) {s = 5;} 				if ( s>=0 ) return s; 				break;	}	if ([recognizer isBacktracking]) {		[recognizer setIsFailed:YES];		return -1;	}	ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:13 state:_s stream:[recognizer input]]; 	@throw nvae;}- (void) dealloc{	free(transition);	[super dealloc];}- (NSString *) description{	return @"()* loopback of 39:3: ( ( ( WS )? '//' )=> SL_COMMENT | ( ( WS )? '/*' )=> COMMENT | ( ( WS )? 'tokenVocab' )=> ( WS )? 'tokenVocab' ( WS )? '=' ( WS )? tokenVocab= ID ( WS )? ';' | ( WS )? ID ( WS )? '=' ( WS )? ID ( WS )? ';' )*";}@end/** As per Terence: No returns for lexer rules!#pragma mark Rule return scopes start#pragma mark Rule return scopes end*/@implementation GrammarFilterLexer- (void) setDelegate:(id)theDelegate{	delegate = theDelegate;	// not retained, will always be the object creating this lexer!}- (id) initWithCharStream:(id<ANTLRCharStream>)anInput{	if (nil!=(self = [super initWithCharStream:anInput])) {		dfa13 = [[GrammarFilterLexerDFA13 alloc] initWithRecognizer:self];	}	return self;}- (void) dealloc{	[dfa13 release];	[super dealloc];}- (ANTLRToken *) nextToken{	[self setToken:nil];    tokenStartCharIndex = [self charIndex];    while (YES) {        if ( [input LA:1] == ANTLRCharStreamEOF ) {            return nil; // should really be a +eofToken call here -> go figure        }        @try {            int m = [input mark];            backtracking = 1;            failed = NO;            [self mTokens];            backtracking = 0;            [input rewind:m];            if ( failed ) {                [input consume];             } else {                [self mTokens];                return token;            }        }        @catch (ANTLRRecognitionException *re) {            // shouldn't happen in backtracking mode, but...            [self reportError:re];            [self recover:re];        }    }}- (void) mGRAMMAR{	ANTLRToken * _grammarType = nil;	ANTLRToken * _grammarName = nil;	@try {		int _type = GrammarFilterLexer_GRAMMAR;		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:25:4: ( (grammarType= GRAMMAR_TYPE WS | ) 'grammar' WS grammarName= ID ( WS )? ';' ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:25:4: (grammarType= GRAMMAR_TYPE WS | ) 'grammar' WS grammarName= ID ( WS )? ';' // alt		{		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:25:4: (grammarType= GRAMMAR_TYPE WS | ) // block		int alt1=2;		{			int LA1_0 = [input LA:1];			if ( LA1_0=='l'||LA1_0=='p'||LA1_0=='t' ) {				alt1 = 1;			}			else if ( LA1_0=='g' ) {				alt1 = 2;			}		else {			if (failed) return ;		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:1 state:0 stream:input];			@throw nvae;			}		}		switch (alt1) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:25:6: grammarType= GRAMMAR_TYPE WS // alt			    {			    int _grammarTypeStart = [self charIndex];			    [self mGRAMMAR_TYPE];			    if (failed) return ;			    _grammarType = [[ANTLRCommonToken alloc] initWithInput:input tokenType:ANTLRTokenTypeInvalid channel:ANTLRTokenChannelDefault start:_grammarTypeStart stop:[self charIndex]];			    [_grammarType setLine:[self line]];			    if ( backtracking==1 ) {			      [delegate setGrammarType:[_grammarType text]]; 			    }			    [self mWS];			    if (failed) return ;			    }			    break;			case 2 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:26:53:  // alt			    {			    if ( backtracking==1 ) {			      [delegate setGrammarType:@"parser"]; [delegate setIsCombinedGrammar:NO]; 			    }			    }			    break;		}		[self matchString:@"grammar"];		if (failed) return ;		[self mWS];		if (failed) return ;		int _grammarNameStart = [self charIndex];		[self mID];		if (failed) return ;		_grammarName = [[ANTLRCommonToken alloc] initWithInput:input tokenType:ANTLRTokenTypeInvalid channel:ANTLRTokenChannelDefault start:_grammarNameStart stop:[self charIndex]];		[_grammarName setLine:[self line]];		if ( backtracking==1 ) {		   [delegate setGrammarName:[_grammarName text]]; 		}		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:28:80: ( WS )? // block		int alt2=2;		{			int LA2_0 = [input LA:1];			if ( (LA2_0>='\t' && LA2_0<='\n')||LA2_0==' ' ) {				alt2 = 1;			}		}		switch (alt2) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:28:80: 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		[_grammarType release];		[_grammarName release];		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end GRAMMAR- (void) mGRAMMAR_TYPE{	@try {		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:33:5: ( ( 'lexer' | 'parser' | 'tree' ) ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:33:5: ( 'lexer' | 'parser' | 'tree' ) // alt		{		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:33:5: ( 'lexer' | 'parser' | 'tree' ) // block		int alt3=3;		switch ([input LA:1]) {			case 'l':				alt3 = 1;				break;			case 'p':				alt3 = 2;				break;			case 't':				alt3 = 3;				break;		default:		 {			if (failed) return ;		    ANTLRNoViableAltException *nvae = [ANTLRNoViableAltException exceptionWithDecision:3 state:0 stream:input];			@throw nvae;			}}		switch (alt3) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:33:6: 'lexer' // alt			    {			    [self matchString:@"lexer"];			    if (failed) return ;			    }			    break;			case 2 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:33:14: 'parser' // alt			    {			    [self matchString:@"parser"];			    if (failed) return ;			    }			    break;			case 3 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:33:23: 'tree' // alt			    {			    [self matchString:@"tree"];			    if (failed) return ;			    }			    break;		}		}	}	@finally {        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites		if ( backtracking == 0 ) {		}	}	return;}// $ANTLR end GRAMMAR_TYPE- (void) mOPTIONS{	ANTLRToken * _tokenVocab = nil;	@try {		int _type = GrammarFilterLexer_OPTIONS;		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:38:4: ( 'options' ( WS )? '{' ( ( ( WS )? '//' )=> SL_COMMENT | ( ( WS )? '/*' )=> COMMENT | ( ( WS )? 'tokenVocab' )=> ( WS )? 'tokenVocab' ( WS )? '=' ( WS )? tokenVocab= ID ( WS )? ';' | ( WS )? ID ( WS )? '=' ( WS )? ID ( WS )? ';' )* ( WS )? '}' ) // ruleBlockSingleAlt		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:38:4: 'options' ( WS )? '{' ( ( ( WS )? '//' )=> SL_COMMENT | ( ( WS )? '/*' )=> COMMENT | ( ( WS )? 'tokenVocab' )=> ( WS )? 'tokenVocab' ( WS )? '=' ( WS )? tokenVocab= ID ( WS )? ';' | ( WS )? ID ( WS )? '=' ( WS )? ID ( WS )? ';' )* ( WS )? '}' // alt		{		[self matchString:@"options"];		if (failed) return ;		// /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:38:14: ( WS )? // block		int alt4=2;		{			int LA4_0 = [input LA:1];			if ( (LA4_0>='\t' && LA4_0<='\n')||LA4_0==' ' ) {				alt4 = 1;			}		}		switch (alt4) {			case 1 :			    // /Users/kroepke/Projects/antlr3/code/antlr/main/lib/ObjC/Xcode plugin/GrammarFilter.g:38:14: WS // alt			    {			    [self mWS];			    if (failed) return ;			    }			    break;		}

⌨️ 快捷键说明

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