📄 dlg_a.c
字号:
/* parser.dlg -- DLG Description of scanner * * Generated from: dlg_p.g * * Terence Parr, Will Cohen, and Hank Dietz: 1989-1998 * Purdue University Electrical Engineering * With AHPCRC, University of Minnesota * ANTLR Version 1.33MR14 */#define ANTLR_VERSION 13314#include "pcctscfg.h"#include PCCTS_STDIO_H#include <ctype.h>#include "dlg.h"#ifdef MEMCHK#include "trax.h"#endif#include "antlr.h"#include "tokens.h"#include "dlgdef.h"LOOKAHEADvoid zzerraction(){ (*zzerr)("invalid token"); zzadvance(); zzskip();}/* * D L G tables * * Generated from: parser.dlg * * 1989-1998 by Will Cohen, Terence Parr, and Hank Dietz * Purdue University Electrical Engineering * DLG Version 1.33MR14 */#include "mode.h"int func_action; /* should actions be turned into functions?*/int lex_mode_counter = 0; /* keeps track of the number of %%names *//* MR1 *//* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class *//* MR1 via <<%%lexmember...>> *//* MR1 */int lexMember = 0; /* <<%%lexmemeber ...>> MR1 */int lexAction = 0; /* <<%%lexaction ...>> MR1 */int parserClass = 0; /* <<%%parserclass ...>> MR1 */int lexPrefix = 0; /* <<%%lexprefix ...>> MR1 */char theClassName[100]; /* MR11 */char *pClassName=theClassName; /* MR11 */int firstLexMember=1; /* MR1 */#ifdef __USE_PROTOSvoid xxputc(int c) { /* MR1 */#else void xxputc(c) /* MR1 */ int c; /* MR1 */ { /* MR1 */#endif if (parserClass) { /* MR1 */ *pClassName++=c; /* MR1 */ *pClassName=0; /* MR1 */ } else if (lexMember || lexPrefix) { /* MR1 */ if (class_stream != NULL) fputc(c,class_stream); /* MR1 */ } else { /* MR1 */ fputc(c,OUT); /* MR1 */ }; /* MR1 */ } /* MR1 */ #ifdef __USE_PROTOS void xxprintf(char *format,char *string) { /* MR1 */#else void xxprintf(format,string) /* MR1 */ char *format; /* MR1 */ char *string; /* MR1 */ { /* MR1 */#endif if (lexMember || lexPrefix || parserClass) { /* MR1 */ if (class_stream != NULL) /* MR1 */ fprintf(class_stream,format,string); /* MR1 */ } else { /* MR1 */ fprintf(OUT,format,string); /* MR1 */ }; /* MR1 */ } /* MR1 */static void act1(){ NLA = 1; }static void act2(){ NLA = 2; zzskip(); }static void act3(){ NLA = 3; zzline++; zzskip(); DAWDLE; }static void act4(){ NLA = L_EOF; }static void act5(){ NLA = PER_PER; }static void act6(){ NLA = NAME_PER_PER; p_mode_def(&zzlextext[2],lex_mode_counter++); }static void act7(){ NLA = LEXMEMBER; lexMember=1; /* MR1 */ if (firstLexMember != 0) { /* MR1 */ firstLexMember=0; /* MR1 */ p_class_def1(); /* MR1 */ }; /* MR1 */ zzmode(ACT); /* MR1 */ }static void act8(){ NLA = LEXACTION; lexAction=1;zzmode(ACT); }static void act9(){ NLA = PARSERCLASS; parserClass=1; /* MR1 */ zzmode(ACT); /* MR1 */ }static void act10(){ NLA = LEXPREFIX; lexPrefix=1;zzmode(ACT); }static void act11(){ NLA = ACTION; if (func_action) fprintf(OUT,"\n%s %sact%d()\n{ ", gen_cpp?"ANTLRTokenType":"static void", gen_cpp?ClassName("::"):"", ++action_no); zzmode(ACT); zzskip(); }static void act12(){ NLA = GREAT_GREAT; }static void act13(){ NLA = L_BRACE; }static void act14(){ NLA = R_BRACE; }static void act15(){ NLA = L_PAR; }static void act16(){ NLA = R_PAR; }static void act17(){ NLA = L_BRACK; }static void act18(){ NLA = R_BRACK; }static void act19(){ NLA = ZERO_MORE; }static void act20(){ NLA = ONE_MORE; }static void act21(){ NLA = OR; }static void act22(){ NLA = RANGE; }static void act23(){ NLA = NOT; }static void act24(){ NLA = OCTAL_VALUE; {int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;} }static void act25(){ NLA = HEX_VALUE; {int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;} }static void act26(){ NLA = DEC_VALUE; {int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;} }static void act27(){ NLA = TAB; zzlextext[0] = '\t'; }static void act28(){ NLA = NL; zzlextext[0] = '\n'; }static void act29(){ NLA = CR; zzlextext[0] = '\r'; }static void act30(){ NLA = BS; zzlextext[0] = '\b'; }static void act31(){ NLA = CONTINUATION; zzline++; zzskip(); }static void act32(){ NLA = LIT; zzlextext[0] = zzlextext[1]; }static void act33(){ NLA = REGCHAR; }static unsigned char shift0[257] = { 0, 40, 40, 40, 40, 40, 40, 40, 40, 40, 1, 2, 40, 40, 1, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 1, 40, 40, 40, 40, 4, 40, 40, 30, 31, 34, 35, 40, 37, 40, 40, 23, 24, 24, 24, 24, 24, 24, 24, 25, 25, 40, 40, 26, 40, 27, 40, 3, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 20, 22, 22, 32, 39, 33, 40, 22, 40, 11, 9, 12, 21, 6, 19, 22, 22, 14, 22, 22, 5, 8, 16, 15, 17, 22, 10, 18, 13, 22, 22, 22, 7, 22, 22, 28, 36, 29, 38, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40};static void act34(){ NLA = 1; error("unterminated action", zzline); zzmode(START); }static void act35(){ NLA = ACTION; if (func_action) fprintf(OUT,"}\n\n"); zzmode(START); /* MR1 */ /* MR1 11-Apr-97 Provide mechanism for inserting code into DLG class */ /* MR1 via <<%%lexmember ...>> */ /* MR1 This is a consequence of not saving actions */ /* MR1 */ /* MR1 */ parserClass=0; /* MR1 */ lexPrefix=0; /* MR1 */ lexAction=0; /* MR1 */ lexMember=0; }static void act36(){ NLA = 34; xxputc(zzlextext[0]); zzskip(); }static void act37(){ NLA = 35; xxputc('>'); zzskip(); }static void act38(){ NLA = 36; xxputc('\\'); zzskip(); }static void act39(){ NLA = 37; xxputc(zzlextext[0]); ++zzline; zzskip(); }static void act40(){ NLA = 38; zzmode(ACTION_COMMENTS); /* MR1 */ xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ }static void act41(){ NLA = 39; zzmode(ACTION_CPP_COMMENTS); /* MR1 */ xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ }static void act42(){ NLA = 40; xxputc(zzlextext[0]); zzskip(); }static unsigned char shift1[257] = { 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 3, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6};static void act43(){ NLA = 1; }static void act44(){ NLA = 41; zzmode(ACT); /* MR1 */ xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ }static void act45(){ NLA = 42; zzline++; xxputc(zzlextext[0]); zzskip(); }static void act46(){ NLA = 43; xxputc(zzlextext[0]); zzskip(); }static unsigned char shift2[257] = { 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 4, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4};static void act47(){ NLA = 1; }static void act48(){ NLA = 44; zzmode(ACT); zzline++; /* MR1 */ xxprintf("%s", &(zzlextext[0])); zzskip(); /* MR1 */ }static void act49(){ NLA = 45; xxputc(zzlextext[0]); zzskip(); }static unsigned char shift3[257] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2};#define DfaStates 94typedef unsigned char DfaState;static DfaState st0[42] = { 1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 6, 94};static DfaState st1[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st2[42] = { 94, 21, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st3[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st4[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st5[42] = { 94, 94, 94, 94, 22, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st6[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st7[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 23, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st8[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 24, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st9[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st10[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st11[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st12[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st13[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st14[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st15[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st16[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st17[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};static DfaState st18[42] = { 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -