📄 simplecparser.m
字号:
// $ANTLR 3.0b6 SimpleC.g 2007-02-01 01:28:01#import "SimpleCParser.h"#import <ANTLR/ANTLR.h>#pragma mark Cyclic DFA@implementation SimpleCParserDFA2const static int SimpleCParserdfa2_eot[13] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};const static int SimpleCParserdfa2_eof[13] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};const static unichar SimpleCParserdfa2_min[13] = {10,10,21,10,0,10,21,23,0,0,10,10,23};const static unichar SimpleCParserdfa2_max[13] = {16,10,22,24,0,10,25,24,0,0,16,10,24};const static int SimpleCParserdfa2_accept[13] = {-1,-1,-1,-1,1,-1,-1,-1,3,2,-1,-1,-1};const static int SimpleCParserdfa2_special[13] = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};const static int SimpleCParserdfa2_transition[] = {};const static int SimpleCParserdfa2_transition0[] = {2};const static int SimpleCParserdfa2_transition1[] = {4, 3};const static int SimpleCParserdfa2_transition2[] = {10, 6};const static int SimpleCParserdfa2_transition3[] = {1, -1, -1, -1, 1, 1, 1};const static int SimpleCParserdfa2_transition4[] = {7};const static int SimpleCParserdfa2_transition5[] = {12};const static int SimpleCParserdfa2_transition6[] = {5, -1, -1, -1, 5, 5, 5, -1, -1, -1, -1, -1, -1, -1, 6};const static int SimpleCParserdfa2_transition7[] = {11, -1, -1, -1, 11, 11, 11};const static int SimpleCParserdfa2_transition8[] = {9, -1, -1, -1, 8};- (id) initWithRecognizer:(ANTLRBaseRecognizer *) theRecognizer{ if ((self = [super initWithRecognizer:theRecognizer]) != nil) { eot = SimpleCParserdfa2_eot; eof = SimpleCParserdfa2_eof; min = SimpleCParserdfa2_min; max = SimpleCParserdfa2_max; accept = SimpleCParserdfa2_accept; special = SimpleCParserdfa2_special; if (!(transition = calloc(13, sizeof(void*)))) { [self release]; return nil; } transition[0] = SimpleCParserdfa2_transition3; transition[1] = SimpleCParserdfa2_transition0; transition[2] = SimpleCParserdfa2_transition1; transition[3] = SimpleCParserdfa2_transition6; transition[4] = SimpleCParserdfa2_transition; transition[5] = SimpleCParserdfa2_transition4; transition[6] = SimpleCParserdfa2_transition8; transition[7] = SimpleCParserdfa2_transition2; transition[8] = SimpleCParserdfa2_transition; transition[9] = SimpleCParserdfa2_transition; transition[10] = SimpleCParserdfa2_transition7; transition[11] = SimpleCParserdfa2_transition5; transition[12] = SimpleCParserdfa2_transition2; } return self;}- (void) dealloc{ free(transition); [super dealloc];}- (NSString *) description{ return @"20:1: declaration : ( variable | functionHeader ';' -> ^( FUNC_DECL functionHeader ) | functionHeader block -> ^( FUNC_DEF functionHeader block ) );";}@end#pragma mark Bitsetsconst static unsigned long long FOLLOW_declaration_in_program85_data[] = {0x000000000001C402LL};static ANTLRBitSet *FOLLOW_declaration_in_program85;const static unsigned long long FOLLOW_variable_in_declaration105_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_variable_in_declaration105;const static unsigned long long FOLLOW_functionHeader_in_declaration115_data[] = {0x0000000000200000LL};static ANTLRBitSet *FOLLOW_functionHeader_in_declaration115;const static unsigned long long FOLLOW_21_in_declaration117_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_21_in_declaration117;const static unsigned long long FOLLOW_functionHeader_in_declaration135_data[] = {0x0000000002000000LL};static ANTLRBitSet *FOLLOW_functionHeader_in_declaration135;const static unsigned long long FOLLOW_block_in_declaration137_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_block_in_declaration137;const static unsigned long long FOLLOW_type_in_variable166_data[] = {0x0000000000000400LL};static ANTLRBitSet *FOLLOW_type_in_variable166;const static unsigned long long FOLLOW_declarator_in_variable168_data[] = {0x0000000000200000LL};static ANTLRBitSet *FOLLOW_declarator_in_variable168;const static unsigned long long FOLLOW_21_in_variable170_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_21_in_variable170;const static unsigned long long FOLLOW_SimpleCParser_ID_in_declarator199_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_SimpleCParser_ID_in_declarator199;const static unsigned long long FOLLOW_type_in_functionHeader219_data[] = {0x0000000000000400LL};static ANTLRBitSet *FOLLOW_type_in_functionHeader219;const static unsigned long long FOLLOW_SimpleCParser_ID_in_functionHeader221_data[] = {0x0000000000400000LL};static ANTLRBitSet *FOLLOW_SimpleCParser_ID_in_functionHeader221;const static unsigned long long FOLLOW_22_in_functionHeader223_data[] = {0x000000000101C400LL};static ANTLRBitSet *FOLLOW_22_in_functionHeader223;const static unsigned long long FOLLOW_formalParameter_in_functionHeader227_data[] = {0x0000000001800000LL};static ANTLRBitSet *FOLLOW_formalParameter_in_functionHeader227;const static unsigned long long FOLLOW_23_in_functionHeader231_data[] = {0x000000000001C400LL};static ANTLRBitSet *FOLLOW_23_in_functionHeader231;const static unsigned long long FOLLOW_formalParameter_in_functionHeader233_data[] = {0x0000000001800000LL};static ANTLRBitSet *FOLLOW_formalParameter_in_functionHeader233;const static unsigned long long FOLLOW_24_in_functionHeader241_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_24_in_functionHeader241;const static unsigned long long FOLLOW_type_in_formalParameter281_data[] = {0x0000000000000400LL};static ANTLRBitSet *FOLLOW_type_in_formalParameter281;const static unsigned long long FOLLOW_declarator_in_formalParameter283_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_declarator_in_formalParameter283;const static unsigned long long FOLLOW_set_in_type312_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_set_in_type312;const static unsigned long long FOLLOW_25_in_block376_data[] = {0x000000000661F400LL};static ANTLRBitSet *FOLLOW_25_in_block376;const static unsigned long long FOLLOW_variable_in_block390_data[] = {0x000000000661F400LL};static ANTLRBitSet *FOLLOW_variable_in_block390;const static unsigned long long FOLLOW_stat_in_block405_data[] = {0x0000000006603400LL};static ANTLRBitSet *FOLLOW_stat_in_block405;const static unsigned long long FOLLOW_26_in_block416_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_26_in_block416;const static unsigned long long FOLLOW_forStat_in_stat449_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_forStat_in_stat449;const static unsigned long long FOLLOW_expr_in_stat457_data[] = {0x0000000000200000LL};static ANTLRBitSet *FOLLOW_expr_in_stat457;const static unsigned long long FOLLOW_21_in_stat459_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_21_in_stat459;const static unsigned long long FOLLOW_block_in_stat468_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_block_in_stat468;const static unsigned long long FOLLOW_assignStat_in_stat476_data[] = {0x0000000000200000LL};static ANTLRBitSet *FOLLOW_assignStat_in_stat476;const static unsigned long long FOLLOW_21_in_stat478_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_21_in_stat478;const static unsigned long long FOLLOW_21_in_stat487_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_21_in_stat487;const static unsigned long long FOLLOW_SimpleCParser_FOR_in_forStat507_data[] = {0x0000000000400000LL};static ANTLRBitSet *FOLLOW_SimpleCParser_FOR_in_forStat507;const static unsigned long long FOLLOW_22_in_forStat509_data[] = {0x0000000000000400LL};static ANTLRBitSet *FOLLOW_22_in_forStat509;const static unsigned long long FOLLOW_assignStat_in_forStat513_data[] = {0x0000000000200000LL};static ANTLRBitSet *FOLLOW_assignStat_in_forStat513;const static unsigned long long FOLLOW_21_in_forStat515_data[] = {0x0000000000401400LL};static ANTLRBitSet *FOLLOW_21_in_forStat515;const static unsigned long long FOLLOW_expr_in_forStat517_data[] = {0x0000000000200000LL};static ANTLRBitSet *FOLLOW_expr_in_forStat517;const static unsigned long long FOLLOW_21_in_forStat519_data[] = {0x0000000000000400LL};static ANTLRBitSet *FOLLOW_21_in_forStat519;const static unsigned long long FOLLOW_assignStat_in_forStat523_data[] = {0x0000000001000000LL};static ANTLRBitSet *FOLLOW_assignStat_in_forStat523;const static unsigned long long FOLLOW_24_in_forStat525_data[] = {0x0000000002000000LL};static ANTLRBitSet *FOLLOW_24_in_forStat525;const static unsigned long long FOLLOW_block_in_forStat527_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_block_in_forStat527;const static unsigned long long FOLLOW_SimpleCParser_ID_in_assignStat570_data[] = {0x0000000000000800LL};static ANTLRBitSet *FOLLOW_SimpleCParser_ID_in_assignStat570;const static unsigned long long FOLLOW_SimpleCParser_EQ_in_assignStat572_data[] = {0x0000000000401400LL};static ANTLRBitSet *FOLLOW_SimpleCParser_EQ_in_assignStat572;const static unsigned long long FOLLOW_expr_in_assignStat574_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_expr_in_assignStat574;const static unsigned long long FOLLOW_condExpr_in_expr598_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_condExpr_in_expr598;const static unsigned long long FOLLOW_aexpr_in_condExpr617_data[] = {0x0000000000060002LL};static ANTLRBitSet *FOLLOW_aexpr_in_condExpr617;const static unsigned long long FOLLOW_SimpleCParser_EQEQ_in_condExpr622_data[] = {0x0000000000401400LL};static ANTLRBitSet *FOLLOW_SimpleCParser_EQEQ_in_condExpr622;const static unsigned long long FOLLOW_SimpleCParser_LT_in_condExpr627_data[] = {0x0000000000401400LL};static ANTLRBitSet *FOLLOW_SimpleCParser_LT_in_condExpr627;const static unsigned long long FOLLOW_aexpr_in_condExpr631_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_aexpr_in_condExpr631;const static unsigned long long FOLLOW_atom_in_aexpr653_data[] = {0x0000000000080002LL};static ANTLRBitSet *FOLLOW_atom_in_aexpr653;const static unsigned long long FOLLOW_SimpleCParser_PLUS_in_aexpr657_data[] = {0x0000000000401400LL};static ANTLRBitSet *FOLLOW_SimpleCParser_PLUS_in_aexpr657;const static unsigned long long FOLLOW_atom_in_aexpr660_data[] = {0x0000000000080002LL};static ANTLRBitSet *FOLLOW_atom_in_aexpr660;const static unsigned long long FOLLOW_SimpleCParser_ID_in_atom680_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_SimpleCParser_ID_in_atom680;const static unsigned long long FOLLOW_SimpleCParser_INT_in_atom694_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_SimpleCParser_INT_in_atom694;const static unsigned long long FOLLOW_22_in_atom708_data[] = {0x0000000000401400LL};static ANTLRBitSet *FOLLOW_22_in_atom708;const static unsigned long long FOLLOW_expr_in_atom710_data[] = {0x0000000001000000LL};static ANTLRBitSet *FOLLOW_expr_in_atom710;const static unsigned long long FOLLOW_24_in_atom712_data[] = {0x0000000000000002LL};static ANTLRBitSet *FOLLOW_24_in_atom712;#pragma mark Dynamic Global Scopes#pragma mark Dynamic Rule Scopes#pragma mark Rule return scopes start@implementation SimpleCParser_program_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_declaration_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_variable_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_declarator_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_functionHeader_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_formalParameter_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_type_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_block_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_stat_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_forStat_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_assignStat_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_expr_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_condExpr_return- (id) tree{ return tree;}- (void) setTree:(id)aTree{ if (tree != aTree) { [aTree retain]; [tree release]; tree = aTree; }}@end@implementation SimpleCParser_aexpr_return- (id) tree{ return tree;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -