5 int yyerror; /* Yyerror and yycost are set by guards. */
6 int yycost; /* If yyerror is set to a nonzero value by a */
7 /* guard, the reduction with which the guard */
8 /* is associated is not performed, and the */
9 /* error recovery mechanism is invoked. */
10 /* Yycost indicates the cost of performing */
11 /* the reduction given the attributes of the */
15 /* YYMAXDEPTH indicates the size of the parser's state and value */
19 #define YYMAXDEPTH 500
22 /* YYMAXRULES must be at least as large as the number of rules that */
23 /* could be placed in the rule queue. That number could be determined */
24 /* from the grammar and the size of the stack, but, as yet, it is not. */
27 #define YYMAXRULES 100
31 #define YYMAXBACKUP 100
35 short yyss[YYMAXDEPTH]; /* the state stack */
36 YYSTYPE yyvs[YYMAXDEPTH]; /* the semantic value stack */
37 YYLTYPE yyls[YYMAXDEPTH]; /* the location stack */
38 short yyrq[YYMAXRULES]; /* the rule queue */
39 int yychar; /* the lookahead symbol */
41 YYSTYPE yylval; /* the semantic value of the */
42 /* lookahead symbol */
44 YYSTYPE yytval; /* the semantic value for the state */
45 /* at the top of the state stack. */
47 YYSTYPE yyval; /* the variable used to return */
48 /* semantic values from the action */
51 YYLTYPE yylloc; /* location data for the lookahead */
54 YYLTYPE yytloc; /* location data for the state at the */
55 /* top of the state stack */
59 short yyunchar[YYMAXBACKUP];
60 YYSTYPE yyunval[YYMAXBACKUP];
61 YYLTYPE yyunloc[YYMAXBACKUP];
63 short *yygssp; /* a pointer to the top of the state */
64 /* stack; only set during error */
67 YYSTYPE *yygvsp; /* a pointer to the top of the value */
68 /* stack; only set during error */
71 YYLTYPE *yyglsp; /* a pointer to the top of the */
72 /* location stack; only set during */
76 /* Yyget is an interface between the parser and the lexical analyzer. */
77 /* It is costly to provide such an interface, but it avoids requiring */
78 /* the lexical analyzer to be able to back up the scan. */
85 yychar = yyunchar[yynunlexed];
86 yylval = yyunval[yynunlexed];
87 yylloc = yyunloc[yynunlexed];
96 else yychar = YYTRANSLATE(yychar);
102 yyunlex(chr, val, loc)
107 yyunchar[yynunlexed] = chr;
108 yyunval[yynunlexed] = val;
109 yyunloc[yynunlexed] = loc;
115 yyrestore(first, last)
116 register short *first;
117 register short *last;
123 register int tvalsaved;
126 yyunlex(yychar, yylval, yylloc);
129 while (first != last)
131 symbol = yystos[*ssp];
132 if (symbol < YYNTBASE)
134 yyunlex(symbol, yytval, yytloc);
142 first = yyrq + YYMAXRULES;
146 for (rp = yyrhs + yyprhs[*first]; symbol = *rp; rp++)
148 if (symbol < YYNTBASE)
149 state = yytable[yypact[*ssp] + symbol];
152 state = yypgoto[symbol - YYNTBASE] + *ssp;
154 if (state >= 0 && state <= YYLAST && yycheck[state] == *ssp)
155 state = yytable[state];
157 state = yydefgoto[symbol - YYNTBASE];
164 if ( ! tvalsaved && ssp > yyss)
166 yyunlex(yystos[*ssp], yytval, yytloc);
178 register int yystate;
180 register short *yyssp;
181 register short *yyrq0;
182 register short *yyptr;
183 register YYSTYPE *yyvsp;
201 else yychar = YYTRANSLATE(yychar);
205 if (yyssp >= yyss + YYMAXDEPTH - 1)
207 yyabort("Parser Stack Overflow");
215 yyn = yypact[yystate];
220 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar)
235 while (yyptr != yyrq1)
242 yyguard(yyn, yyvsp, yylsp);
246 yyaction(yyn, yyvsp, yylsp);
252 yylsp->timestamp = timeclock;
253 yylsp->first_line = yytloc.first_line;
254 yylsp->first_column = yytloc.first_column;
255 yylsp->last_line = (yylsp-1)->last_line;
256 yylsp->last_column = (yylsp-1)->last_column;
261 yylsp->last_line = (yylsp+yylen-1)->last_line;
262 yylsp->last_column = (yylsp+yylen-1)->last_column;
265 if (yyptr == yyrq + YYMAXRULES)
269 if (yystate == YYFINAL)
285 yyn = yydefact[yystate];
293 if (yyrq0 == yyrq + YYMAXRULES)
298 yyabort("Parser Rule Queue Overflow");
305 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
306 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
307 yystate = yytable[yystate];
309 yystate = yydefgoto[yyn - YYNTBASE];
323 yyrestore(yyrq0, yyrq2);