📄 simplectp.m
字号:
return ;}// $ANTLR end declaration// $ANTLR start variable// SimpleCTP.gtp:18:1: variable : ^( VAR_DEF type declarator ) ;- (void) variable{ // token labels // token+rule list labels // rule labels // rule list labels // rule refs in alts with rewrites @try { // SimpleCTP.gtp:19:9: ( ^( VAR_DEF type declarator ) ) // ruleBlockSingleAlt // SimpleCTP.gtp:19:9: ^( VAR_DEF type declarator ) // alt { [self match:input tokenType:SimpleCTP_VAR_DEF follow:FOLLOW_SimpleCTP_VAR_DEF_in_variable113]; [self match:input tokenType:ANTLRTokenTypeDOWN follow:nil]; [following addObject:FOLLOW_type_in_variable115]; [self type]; [following removeLastObject]; [following addObject:FOLLOW_declarator_in_variable117]; [self declarator]; [following removeLastObject]; [self match:input tokenType:ANTLRTokenTypeUP follow:nil]; } } @catch (ANTLRRecognitionException *re) { [self reportError:re]; [self recover:input exception:re]; } @finally { // token labels // token+rule list labels // rule labels // rule refs in alts with rewrites } return ;}// $ANTLR end variable// $ANTLR start declarator// SimpleCTP.gtp:22:1: declarator : ID ;- (void) declarator{ // token labels // token+rule list labels // rule labels // rule list labels // rule refs in alts with rewrites @try { // SimpleCTP.gtp:23:9: ( ID ) // ruleBlockSingleAlt // SimpleCTP.gtp:23:9: ID // alt { [self match:input tokenType:SimpleCTP_ID follow:FOLLOW_SimpleCTP_ID_in_declarator137]; } } @catch (ANTLRRecognitionException *re) { [self reportError:re]; [self recover:input exception:re]; } @finally { // token labels // token+rule list labels // rule labels // rule refs in alts with rewrites } return ;}// $ANTLR end declarator// $ANTLR start functionHeader// SimpleCTP.gtp:26:1: functionHeader : ^( FUNC_HDR type ID ( formalParameter )+ ) ;- (void) functionHeader{ // token labels // token+rule list labels // rule labels // rule list labels // rule refs in alts with rewrites @try { // SimpleCTP.gtp:27:9: ( ^( FUNC_HDR type ID ( formalParameter )+ ) ) // ruleBlockSingleAlt // SimpleCTP.gtp:27:9: ^( FUNC_HDR type ID ( formalParameter )+ ) // alt { [self match:input tokenType:SimpleCTP_FUNC_HDR follow:FOLLOW_SimpleCTP_FUNC_HDR_in_functionHeader158]; [self match:input tokenType:ANTLRTokenTypeDOWN follow:nil]; [following addObject:FOLLOW_type_in_functionHeader160]; [self type]; [following removeLastObject]; [self match:input tokenType:SimpleCTP_ID follow:FOLLOW_SimpleCTP_ID_in_functionHeader162]; // SimpleCTP.gtp:27:28: ( formalParameter )+ // positiveClosureBlock int cnt3=0; do { int alt3=2; { int LA3_0 = [input LA:1]; if ( LA3_0==SimpleCTP_ARG_DEF ) { alt3 = 1; } } switch (alt3) { case 1 : // SimpleCTP.gtp:27:28: formalParameter // alt { [following addObject:FOLLOW_formalParameter_in_functionHeader164]; [self formalParameter]; [following removeLastObject]; } break; default : if ( cnt3 >= 1 ) goto loop3; ANTLREarlyExitException *eee = [ANTLREarlyExitException exceptionWithStream:input decisionNumber:3]; @throw eee; } cnt3++; } while (YES); loop3: ; [self match:input tokenType:ANTLRTokenTypeUP follow:nil]; } } @catch (ANTLRRecognitionException *re) { [self reportError:re]; [self recover:input exception:re]; } @finally { // token labels // token+rule list labels // rule labels // rule refs in alts with rewrites } return ;}// $ANTLR end functionHeader// $ANTLR start formalParameter// SimpleCTP.gtp:30:1: formalParameter : ^( ARG_DEF type declarator ) ;- (void) formalParameter{ // token labels // token+rule list labels // rule labels // rule list labels // rule refs in alts with rewrites @try { // SimpleCTP.gtp:31:9: ( ^( ARG_DEF type declarator ) ) // ruleBlockSingleAlt // SimpleCTP.gtp:31:9: ^( ARG_DEF type declarator ) // alt { [self match:input tokenType:SimpleCTP_ARG_DEF follow:FOLLOW_SimpleCTP_ARG_DEF_in_formalParameter186]; [self match:input tokenType:ANTLRTokenTypeDOWN follow:nil]; [following addObject:FOLLOW_type_in_formalParameter188]; [self type]; [following removeLastObject]; [following addObject:FOLLOW_declarator_in_formalParameter190]; [self declarator]; [following removeLastObject]; [self match:input tokenType:ANTLRTokenTypeUP follow:nil]; } } @catch (ANTLRRecognitionException *re) { [self reportError:re]; [self recover:input exception:re]; } @finally { // token labels // token+rule list labels // rule labels // rule refs in alts with rewrites } return ;}// $ANTLR end formalParameter// $ANTLR start type// SimpleCTP.gtp:34:1: type : ('int'|'char'|'void'|ID);- (void) type{ // token labels // token+rule list labels // rule labels // rule list labels // rule refs in alts with rewrites @try { // SimpleCTP.gtp:35:5: ( ('int'|'char'|'void'|ID)) // ruleBlockSingleAlt // SimpleCTP.gtp:35:9: ('int'|'char'|'void'|ID) // alt { if ([input LA:1]==SimpleCTP_ID||([input LA:1]>=SimpleCTP_INT_TYPE && [input LA:1]<=SimpleCTP_VOID)) { [input consume]; errorRecovery = NO; } else { ANTLRMismatchedSetException *mse = [ANTLRMismatchedSetException exceptionWithSet:nil stream:input]; [self recoverFromMismatchedSet:input exception:mse follow:FOLLOW_set_in_type210]; @throw mse; } } } @catch (ANTLRRecognitionException *re) { [self reportError:re]; [self recover:input exception:re]; } @finally { // token labels // token+rule list labels // rule labels // rule refs in alts with rewrites } return ;}// $ANTLR end type// $ANTLR start block// SimpleCTP.gtp:41:1: block : ^( BLOCK ( variable )* ( stat )* ) ;- (void) block{ // token labels // token+rule list labels // rule labels // rule list labels // rule refs in alts with rewrites @try { // SimpleCTP.gtp:42:9: ( ^( BLOCK ( variable )* ( stat )* ) ) // ruleBlockSingleAlt // SimpleCTP.gtp:42:9: ^( BLOCK ( variable )* ( stat )* ) // alt { [self match:input tokenType:SimpleCTP_BLOCK follow:FOLLOW_SimpleCTP_BLOCK_in_block273]; if ( [input LA:1] == ANTLRTokenTypeDOWN ) { [self match:input tokenType:ANTLRTokenTypeDOWN follow:nil]; do { int alt4=2; { int LA4_0 = [input LA:1]; if ( LA4_0==SimpleCTP_VAR_DEF ) { alt4 = 1; } } switch (alt4) { case 1 : // SimpleCTP.gtp:42:17: variable // alt { [following addObject:FOLLOW_variable_in_block275]; [self variable]; [following removeLastObject]; } break; default : goto loop4; } } while (YES); loop4: ; do { int alt5=2; { int LA5_0 = [input LA:1]; if ( (LA5_0>=SimpleCTP_BLOCK && LA5_0<=SimpleCTP_FOR)||(LA5_0>=SimpleCTP_EQEQ && LA5_0<=SimpleCTP_PLUS) ) { alt5 = 1; } } switch (alt5) { case 1 : // SimpleCTP.gtp:42:27: stat // alt { [following addObject:FOLLOW_stat_in_block278]; [self stat]; [following removeLastObject]; } break; default : goto loop5; } } while (YES); loop5: ; [self match:input tokenType:ANTLRTokenTypeUP follow:nil]; } } } @catch (ANTLRRecognitionException *re) { [self reportError:re]; [self recover:input exception:re]; } @finally { // token labels // token+rule list labels // rule labels // rule refs in alts with rewrites
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -