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

📄 simpleclexer.m

📁 antlr最新版本V3源代码
💻 M
📖 第 1 页 / 共 2 页
字号:
// $ANTLR 3.0b6 SimpleC.g 2007-02-01 01:27:57#import "SimpleCLexer.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 SimpleCLexer- (id) initWithCharStream:(id<ANTLRCharStream>)anInput{	if (nil!=(self = [super initWithCharStream:anInput])) {	}	return self;}- (void) dealloc{	[super dealloc];}- (NSString *) grammarFileName{	return @"SimpleC.g";}- (void) mT7{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SimpleCLexer_T7;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:7:6: ( ';' ) // ruleBlockSingleAlt		// SimpleC.g:7: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 T7- (void) mT8{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SimpleCLexer_T8;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:8:6: ( '(' ) // ruleBlockSingleAlt		// SimpleC.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 = SimpleCLexer_T9;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:9:6: ( ',' ) // ruleBlockSingleAlt		// SimpleC.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 = SimpleCLexer_T10;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:10:7: ( ')' ) // ruleBlockSingleAlt		// SimpleC.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 = SimpleCLexer_T11;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:11:7: ( 'int' ) // ruleBlockSingleAlt		// SimpleC.g:11: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 T11- (void) mT12{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SimpleCLexer_T12;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:12:7: ( 'char' ) // ruleBlockSingleAlt		// SimpleC.g:12:7: 'char' // alt		{		[self matchString:@"char"];		}		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 = SimpleCLexer_T13;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:13:7: ( 'void' ) // ruleBlockSingleAlt		// SimpleC.g:13:7: 'void' // alt		{		[self matchString:@"void"];		}		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 = SimpleCLexer_T14;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:14:7: ( '{' ) // ruleBlockSingleAlt		// SimpleC.g:14: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 T14- (void) mT15{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SimpleCLexer_T15;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:15:7: ( '}' ) // ruleBlockSingleAlt		// SimpleC.g:15: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 T15- (void) mT16{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SimpleCLexer_T16;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:16:7: ( 'for' ) // ruleBlockSingleAlt		// SimpleC.g:16:7: 'for' // alt		{		[self matchString:@"for"];		}		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 T16- (void) mT17{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SimpleCLexer_T17;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:17:7: ( '=' ) // ruleBlockSingleAlt		// SimpleC.g:17: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 T17- (void) mT18{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SimpleCLexer_T18;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:18:7: ( '==' ) // ruleBlockSingleAlt		// SimpleC.g:18:7: '==' // alt		{		[self matchString:@"=="];		}		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 T18- (void) mT19{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SimpleCLexer_T19;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:19:7: ( '<' ) // ruleBlockSingleAlt		// SimpleC.g:19: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 T19- (void) mT20{	// token labels	// token+rule list labels	// rule labels	// rule list labels	// rule refs in alts with rewrites	@try {		ruleNestingLevel++;		int _type = SimpleCLexer_T20;		int _start = [self charIndex];		int _line = [self line];		int _charPosition = [self charPositionInLine];		int _channel = [ANTLRToken defaultChannel];		// SimpleC.g:20:7: ( '+' ) // ruleBlockSingleAlt		// SimpleC.g:20: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 T20- (void) mID{	// token labels	// token+rule list labels

⌨️ 快捷键说明

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