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

📄 symboltablelexer.m

📁 antlr最新版本V3源代码
💻 M
📖 第 1 页 / 共 2 页
字号:
// $ANTLR 3.0b6 SymbolTable.g 2007-02-01 01:28:00#import "SymbolTableLexer.h"#pragma mark Cyclic DFAs/** As per Terence: No returns for lexer rules!#pragma mark Rule return scopes start#pragma mark Rule return scopes end*/@implementation SymbolTableLexer- (id) initWithCharStream:(id<ANTLRCharStream>)anInput{	if (nil!=(self = [super initWithCharStream:anInput])) {	}	return self;}- (void) dealloc{	[super dealloc];}- (NSString *) grammarFileName{	return @"SymbolTable.g";}- (void) mT7{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SymbolTableLexer_T7;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SymbolTable.g:7:6: ( 'method' ) // ruleBlockSingleAlt		// SymbolTable.g:7:6: 'method' // alt		{		[self matchString:@"method"];		}		if ( token == nil && ruleNestingLevel == 1) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites	}	return;}// $ANTLR end T7- (void) mT8{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SymbolTableLexer_T8;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SymbolTable.g:8:6: ( '(' ) // ruleBlockSingleAlt		// SymbolTable.g:8:6: '(' // alt		{		[self matchChar:'('];		}		if ( token == nil && ruleNestingLevel == 1) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites	}	return;}// $ANTLR end T8- (void) mT9{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SymbolTableLexer_T9;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SymbolTable.g:9:6: ( ')' ) // ruleBlockSingleAlt		// SymbolTable.g:9:6: ')' // alt		{		[self matchChar:')'];		}		if ( token == nil && ruleNestingLevel == 1) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites	}	return;}// $ANTLR end T9- (void) mT10{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SymbolTableLexer_T10;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SymbolTable.g:10:7: ( '{' ) // ruleBlockSingleAlt		// SymbolTable.g:10:7: '{' // alt		{		[self matchChar:'{'];		}		if ( token == nil && ruleNestingLevel == 1) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites	}	return;}// $ANTLR end T10- (void) mT11{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SymbolTableLexer_T11;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SymbolTable.g:11:7: ( '}' ) // ruleBlockSingleAlt		// SymbolTable.g:11:7: '}' // alt		{		[self matchChar:'}'];		}		if ( token == nil && ruleNestingLevel == 1) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites	}	return;}// $ANTLR end T11- (void) mT12{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SymbolTableLexer_T12;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SymbolTable.g:12:7: ( '=' ) // ruleBlockSingleAlt		// SymbolTable.g:12:7: '=' // alt		{		[self matchChar:'='];		}		if ( token == nil && ruleNestingLevel == 1) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites	}	return;}// $ANTLR end T12- (void) mT13{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SymbolTableLexer_T13;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SymbolTable.g:13:7: ( ';' ) // ruleBlockSingleAlt		// SymbolTable.g:13:7: ';' // alt		{		[self matchChar:';'];		}		if ( token == nil && ruleNestingLevel == 1) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites	}	return;}// $ANTLR end T13- (void) mT14{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SymbolTableLexer_T14;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SymbolTable.g:14:7: ( 'int' ) // ruleBlockSingleAlt		// SymbolTable.g:14:7: 'int' // alt		{		[self matchString:@"int"];		}		if ( token == nil && ruleNestingLevel == 1) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}	}	@finally {		ruleNestingLevel--;        // rule cleanup		// token labels		// token+rule list labels		// rule labels		// rule refs in alts with rewrites	}	return;}// $ANTLR end T14- (void) mID{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SymbolTableLexer_ID;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SymbolTable.g:66:9: ( ( 'a' .. 'z' )+ ) // ruleBlockSingleAlt		// SymbolTable.g:66:9: ( 'a' .. 'z' )+ // alt		{		// SymbolTable.g:66:9: ( 'a' .. 'z' )+	// positiveClosureBlock		int cnt1=0;		do {		    int alt1=2;		    {		    	int LA1_0 = [input LA:1];		    	if ( (LA1_0>='a' && LA1_0<='z') ) {		    		alt1 = 1;		    	}		    }		    switch (alt1) {			case 1 :			    // SymbolTable.g:66:10: 'a' .. 'z' // alt			    {			    [self matchRangeFromChar:'a' to:'z'];			    }			    break;			default :			    if ( cnt1 >= 1 )  goto loop1;					ANTLREarlyExitException *eee = [ANTLREarlyExitException exceptionWithStream:input decisionNumber:1];					@throw eee;		    }		    cnt1++;		} while (YES); loop1: ;		}		if ( token == nil && ruleNestingLevel == 1) { [self emitTokenWithType:_type line:_line charPosition:_charPosition channel:_channel start:_start stop:[self charIndex]];}

⌨️ 快捷键说明

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