📄 rvsdpprs.c
字号:
#endif
#ifndef FIRST_COLUMN
#define FIRST_COLUMN 1
#endif
#ifndef PARSER_STACK_OVERFLOW
#define PARSER_STACK_OVERFLOW {fprintf(stderr, \
"\nParser stack overflow, line %d, column %d\n",\
(PCB).line, (PCB).column);}
#endif
#ifndef REDUCTION_TOKEN_ERROR
#define REDUCTION_TOKEN_ERROR {fprintf(stderr, \
"\nReduction token error, line %d, column %d\n", \
(PCB).line, (PCB).column);}
#endif
#ifndef INPUT_CODE
#define INPUT_CODE(T) (T)
#endif
typedef enum
{ag_accept_key, ag_set_key, ag_jmp_key, ag_end_key, ag_no_match_key,
ag_cf_accept_key, ag_cf_set_key, ag_cf_end_key} key_words;
static void ag_get_key_word(PCB_DECL, int ag_k) {
int ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
const unsigned char *ag_p;
int ag_ch;
while (1) {
switch (ag_key_act[ag_k]) {
case ag_cf_end_key: {
const unsigned char *sp = ag_key_ends + ag_key_jmp[ag_k];
do {
if ((ag_ch = *sp++) == 0) {
int ag_k1 = ag_key_parm[ag_k];
int ag_k2 = ag_key_pt[ag_k1];
if (ag_key_itt[ag_k2 + CONVERT_CASE(*(PCB).la_ptr)]) goto ag_fail;
(PCB).token_number = (rvSdpParser_token_type) ag_key_pt[ag_k1 + 1];
return;
}
} while (CONVERT_CASE(*(PCB).la_ptr++) == ag_ch);
goto ag_fail;
}
case ag_end_key: {
const unsigned char *sp = ag_key_ends + ag_key_jmp[ag_k];
do {
if ((ag_ch = *sp++) == 0) {
(PCB).token_number = (rvSdpParser_token_type) ag_key_parm[ag_k];
return;
}
} while (CONVERT_CASE(*(PCB).la_ptr++) == ag_ch);
}
case ag_no_match_key:
ag_fail:
(PCB).la_ptr = (PCB).pointer + ag_save;
return;
case ag_cf_set_key: {
int ag_k1 = ag_key_parm[ag_k];
int ag_k2 = ag_key_pt[ag_k1];
ag_k = ag_key_jmp[ag_k];
if (ag_key_itt[ag_k2 + CONVERT_CASE(*(PCB).la_ptr)]) break;
ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
(PCB).token_number = (rvSdpParser_token_type) ag_key_pt[ag_k1+1];
break;
}
case ag_set_key:
ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
(PCB).token_number = (rvSdpParser_token_type) ag_key_parm[ag_k];
case ag_jmp_key:
ag_k = ag_key_jmp[ag_k];
break;
case ag_accept_key:
(PCB).token_number = (rvSdpParser_token_type) ag_key_parm[ag_k];
return;
case ag_cf_accept_key: {
int ag_k1 = ag_key_parm[ag_k];
int ag_k2 = ag_key_pt[ag_k1];
if (ag_key_itt[ag_k2 + CONVERT_CASE(*(PCB).la_ptr)])
(PCB).la_ptr = (PCB).pointer + ag_save;
else (PCB).token_number = (rvSdpParser_token_type) ag_key_pt[ag_k1+1];
return;
}
}
ag_ch = CONVERT_CASE(*(PCB).la_ptr++);
ag_p = &ag_key_ch[ag_k];
while (*ag_p < ag_ch) ag_p++;
if (*ag_p != ag_ch) {
(PCB).la_ptr = (PCB).pointer + ag_save;
return;
}
ag_k = (int) (ag_p - ag_key_ch);
}
}
#ifndef AG_NEWLINE
#define AG_NEWLINE 10
#endif
#ifndef AG_RETURN
#define AG_RETURN 13
#endif
#ifndef AG_FORMFEED
#define AG_FORMFEED 12
#endif
#ifndef AG_TABCHAR
#define AG_TABCHAR 9
#endif
static void ag_track(PCB_DECL) {
int ag_k = (int) ((PCB).la_ptr - (PCB).pointer);
while (ag_k--) {
switch (*(PCB).pointer++) {
case AG_NEWLINE:
(PCB).column = 1, (PCB).line++;
case AG_RETURN:
case AG_FORMFEED:
break;
case AG_TABCHAR:
(PCB).column += (TAB_SPACING) - ((PCB).column - 1) % (TAB_SPACING);
break;
default:
(PCB).column++;
}
}
}
static void ag_prot(PCB_DECL) {
int ag_k = 46 - ++(PCB).btsx;
if (ag_k <= (PCB).ssx) {
(PCB).exit_flag = AG_STACK_ERROR_CODE;
PARSER_STACK_OVERFLOW;
return;
}
(PCB).bts[(PCB).btsx] = (PCB).sn;
(PCB).bts[ag_k] = (PCB).ssx;
(PCB).vs[ag_k] = (PCB).vs[(PCB).ssx];
(PCB).ss[ag_k] = (PCB).ss[(PCB).ssx];
}
static void ag_undo(PCB_DECL) {
if ((PCB).drt == -1) return;
while ((PCB).btsx) {
int ag_k = 46 - (PCB).btsx;
(PCB).sn = (PCB).bts[(PCB).btsx--];
(PCB).ssx = (PCB).bts[ag_k];
(PCB).vs[(PCB).ssx] = (PCB).vs[ag_k];
(PCB).ss[(PCB).ssx] = (PCB).ss[ag_k];
}
(PCB).token_number = (rvSdpParser_token_type) (PCB).drt;
(PCB).ssx = (PCB).dssx;
(PCB).sn = (PCB).dsn;
(PCB).drt = -1;
}
static const unsigned short ag_tstt[] = {
91,0,1,58,
48,0,47,
392,200,178,167,141,138,106,104,102,100,99,98,93,57,56,55,34,27,0,59,60,
403,15,13,12,11,10,9,0,17,92,
48,0,47,
392,200,178,167,141,138,106,104,102,100,99,98,57,56,55,34,27,0,61,62,
403,15,13,12,11,10,9,0,18,
392,27,0,30,31,32,
409,408,407,406,405,404,403,401,400,399,397,396,337,333,316,218,217,200,178,
167,161,154,141,138,57,56,48,46,36,15,13,12,11,10,9,0,94,249,
48,0,47,
392,200,178,167,141,138,106,104,102,100,99,57,56,55,34,27,0,63,64,
403,15,13,12,11,10,9,0,
392,0,32,
409,408,407,406,405,404,403,401,400,399,397,396,337,333,316,218,217,200,178,
167,161,154,141,138,57,56,48,46,36,15,13,12,11,10,9,0,
34,0,33,
411,410,409,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,
337,333,316,218,217,200,178,167,161,154,141,138,57,56,48,46,44,42,40,38,
36,34,15,13,12,11,10,9,0,2,3,5,
48,0,47,
392,200,178,167,141,138,106,104,102,100,57,56,55,34,27,0,65,66,
407,403,178,138,15,13,12,11,10,9,0,95,229,231,
411,410,409,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,
337,333,316,218,217,200,178,167,161,154,141,138,57,56,48,46,44,42,40,38,
36,34,15,13,12,11,10,9,0,
392,27,0,30,31,32,
411,410,409,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,
337,333,316,218,217,200,178,167,161,154,141,138,57,56,48,46,44,42,40,38,
36,34,15,13,12,11,10,9,0,2,3,5,
48,0,47,
392,200,178,167,141,138,106,104,102,57,56,55,34,27,0,67,68,69,70,
407,403,178,138,15,13,12,11,10,9,0,
34,0,33,
392,27,0,30,31,32,
408,407,337,200,178,167,161,154,141,138,0,101,287,293,
48,0,47,
102,0,67,68,
392,200,178,167,141,138,106,104,57,56,55,34,27,0,71,72,73,74,
403,15,13,12,11,10,9,0,18,96,232,
408,407,406,403,402,401,400,399,396,395,337,316,304,288,218,217,200,178,167,
161,154,141,138,56,40,38,15,13,12,11,10,9,0,136,137,301,303,
288,0,
392,27,0,30,31,32,
411,409,408,407,406,405,404,403,401,400,399,398,397,396,395,394,337,333,316,
282,218,217,200,178,167,161,154,141,138,57,56,48,46,36,34,15,13,12,11,
10,9,0,19,25,103,250,251,254,265,266,
48,0,47,
104,0,71,72,
392,200,178,167,141,138,106,57,56,55,34,27,0,75,76,
403,15,13,12,11,10,9,0,
34,0,33,
407,403,178,138,15,13,12,11,10,9,0,
408,407,406,403,402,401,400,399,396,395,337,316,304,218,217,200,178,167,161,
154,141,138,56,40,38,15,13,12,11,10,9,0,136,301,
408,407,406,403,402,401,400,399,396,395,392,337,316,304,297,295,290,218,217,
200,178,167,161,154,141,138,56,40,38,27,15,13,12,11,10,9,0,136,289,294,
296,301,305,306,
411,408,407,405,403,401,400,399,398,397,395,394,392,337,333,316,255,252,218,
217,200,178,167,161,154,141,138,57,48,44,38,36,34,27,15,13,12,11,10,9,0,
268,269,270,
411,409,408,407,406,405,404,403,402,401,400,399,398,397,395,394,393,337,333,
316,282,280,218,217,200,178,167,161,154,141,138,57,56,48,46,44,42,40,38,
36,34,15,13,12,11,10,9,0,273,283,284,286,
409,408,407,406,405,404,403,401,400,399,397,396,394,337,333,316,218,217,200,
178,167,161,154,141,138,57,56,48,46,42,40,36,34,15,13,12,11,10,9,0,22,
23,24,
255,252,0,256,257,258,
411,409,408,407,406,405,404,403,401,400,399,398,397,396,395,394,337,333,316,
255,252,218,217,200,178,167,161,154,141,138,57,56,48,46,42,36,34,15,13,
12,11,10,9,0,
252,0,
42,0,41,
38,0,37,
392,27,0,30,31,32,
409,408,407,406,405,404,403,401,400,399,397,396,394,337,333,316,297,218,217,
200,178,167,161,154,141,138,57,56,48,46,36,34,15,13,12,11,10,9,0,19,25,
105,307,
48,0,47,
392,200,178,167,141,138,57,56,55,34,27,0,77,78,
112,111,110,109,50,0,97,
407,403,178,138,15,13,12,11,10,9,0,
408,407,406,403,402,401,400,399,396,395,337,316,304,297,218,217,200,178,167,
161,154,141,138,56,40,38,15,13,12,11,10,9,0,136,301,305,
295,0,
295,0,
392,290,27,0,292,
411,408,407,405,403,401,400,399,398,397,395,394,337,333,316,218,217,200,178,
167,161,154,141,138,57,48,36,34,15,13,12,11,10,9,0,268,
411,410,409,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,
392,337,333,316,218,217,200,178,167,161,154,141,138,57,56,48,46,44,42,
40,38,36,34,27,15,13,12,11,10,9,0,
282,0,
409,408,407,406,405,404,403,401,400,399,397,396,394,337,333,316,218,217,200,
178,167,161,154,141,138,57,56,48,46,36,34,15,13,12,11,10,9,0,22,
411,408,407,405,403,401,400,399,398,397,395,394,337,333,316,282,218,217,200,
178,167,161,154,141,138,57,48,36,34,15,13,12,11,10,9,0,25,254,265,266,
255,0,256,
411,408,407,405,403,401,400,399,398,397,395,394,392,337,333,316,255,252,218,
217,200,178,167,161,154,141,138,57,48,44,38,36,34,27,15,13,12,11,10,9,0,
268,269,270,
409,408,407,406,405,404,403,401,400,399,397,396,394,337,333,316,218,217,200,
178,167,161,154,141,138,57,56,48,46,42,40,36,34,15,13,12,11,10,9,0,22,
23,24,
411,408,407,405,403,401,400,399,398,397,395,394,337,333,316,271,218,217,200,
178,167,161,154,141,138,57,48,36,34,15,13,12,11,10,9,0,25,253,259,263,
264,265,
411,408,407,405,403,401,400,399,398,397,395,394,337,333,316,282,218,217,200,
178,167,161,154,141,138,57,48,36,34,15,13,12,11,10,9,0,25,250,251,254,
265,266,
409,408,407,406,405,404,403,401,400,399,397,396,394,337,333,316,218,217,200,
178,167,161,154,141,138,57,56,48,46,36,34,15,13,12,11,10,9,0,19,25,
409,408,407,406,405,404,403,401,400,399,397,396,394,337,333,316,218,217,200,
178,167,161,154,141,138,57,56,48,46,36,34,15,13,12,11,10,9,0,
403,15,13,12,10,9,0,
42,0,41,
38,0,37,
392,27,0,30,31,32,
112,111,110,109,50,0,97,
48,0,47,
392,200,178,167,141,57,56,55,34,27,0,79,80,143,144,
34,0,33,
34,0,33,
34,0,33,
34,0,33,
34,0,33,
392,27,0,30,31,32,
408,407,406,403,402,401,400,399,396,395,392,337,316,304,297,295,290,218,217,
200,178,167,161,154,141,138,56,40,38,27,15,13,12,11,10,9,0,136,289,294,
296,301,305,306,
408,407,406,403,402,401,400,399,396,395,392,337,316,304,297,295,290,218,217,
200,178,167,161,154,141,138,56,40,38,27,15,13,12,11,10,9,0,136,289,294,
296,301,305,306,
408,407,406,403,402,401,400,399,396,395,337,316,304,218,217,200,178,167,161,
154,141,138,56,40,38,15,13,12,11,10,9,0,136,137,291,301,
411,408,407,405,403,401,400,399,398,397,395,394,337,333,316,218,217,200,178,
167,161,154,141,138,57,48,36,34,15,13,12,11,10,9,0,
411,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,337,333,
316,280,277,218,217,200,178,167,161,154,141,138,57,56,48,46,44,42,40,38,
36,34,15,13,12,11,10,9,0,272,273,274,275,276,279,
392,255,44,38,27,0,260,261,262,
44,0,43,
40,0,39,
403,392,50,44,38,34,27,15,13,12,11,10,9,0,308,309,310,
297,0,307,
409,408,407,406,405,404,403,401,400,399,397,396,394,337,333,316,218,217,200,
178,167,161,154,141,138,57,56,48,46,36,34,15,13,12,11,10,9,0,19,25,
392,27,0,30,31,32,
408,407,403,337,333,218,200,178,167,161,154,141,138,15,13,12,11,10,9,0,139,
227,228,
48,0,47,
392,200,178,167,161,141,57,56,55,34,27,0,143,145,146,
392,200,178,167,57,56,55,34,27,0,81,82,
119,117,115,113,109,50,0,107,
337,124,109,50,0,107,126,135,
122,120,109,50,0,107,
109,50,0,107,
109,50,0,107,
408,407,406,403,402,401,400,399,396,395,392,337,316,304,297,218,217,200,178,
167,161,154,141,138,56,40,38,27,15,13,12,11,10,9,0,136,298,301,
411,408,407,406,405,404,403,402,401,400,399,398,397,396,395,394,393,337,333,
316,280,218,217,200,178,167,161,154,141,138,57,56,48,46,44,42,40,38,36,
34,15,13,12,11,10,9,0,272,273,274,279,
277,0,
411,408,407,405,403,401,400,399,398,397,395,394,337,333,316,271,218,217,200,
178,167,161,154,141,138,57,48,36,34,15,13,12,11,10,9,0,25,259,263,264,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -