1 /* original parser id follows */
2 /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
3 /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
8 #define YYCHECK "yyyymmdd"
11 #define yyclearin (yychar = YYEMPTY)
12 #define yyerrok (yyerrflag = 0)
13 #define YYRECOVERING() (yyerrflag != 0)
18 #define yyparse empty_parse
22 #define yylex empty_lex
26 #define yyerror empty_error
30 #define yychar empty_char
34 #define yyval empty_val
38 #define yylval empty_lval
42 #define yydebug empty_debug
46 #define yynerrs empty_nerrs
50 #define yyerrflag empty_errflag
51 #endif /* yyerrflag */
54 #define yylhs empty_lhs
58 #define yylen empty_len
62 #define yydefred empty_defred
66 #define yydgoto empty_dgoto
70 #define yysindex empty_sindex
74 #define yyrindex empty_rindex
78 #define yygindex empty_gindex
82 #define yytable empty_table
86 #define yycheck empty_check
90 #define yyname empty_name
94 #define yyrule empty_rule
96 #define YYPREFIX "empty_"
102 #define YYLEX_DECL() yylex(void)
103 #define YYERROR_DECL() yyerror(const char *s)
104 static int YYLEX_DECL();
105 static void YYERROR_DECL();
107 #line 108 "empty.tab.c"
109 #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
110 /* Default: YYSTYPE is the semantic value type. */
112 # define YYSTYPE_IS_DECLARED 1
115 /* compatibility with bison */
117 /* compatibility with FreeBSD */
118 # ifdef YYPARSE_PARAM_TYPE
119 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
121 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
124 # define YYPARSE_DECL() yyparse(void)
127 /* Parameters sent to lex. */
129 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
130 # define YYLEX yylex(YYLEX_PARAM)
132 # define YYLEX_DECL() yylex(void)
133 # define YYLEX yylex()
136 /* Parameters sent to yyerror. */
138 #define YYERROR_DECL() yyerror(const char *s)
141 #define YYERROR_CALL(msg) yyerror(msg)
144 extern int YYPARSE_DECL();
146 #define YYERRCODE 256
148 static const YYINT empty_lhs[] = { -1,
151 static const YYINT empty_len[] = { 2,
154 static const YYINT empty_defred[] = { 1,
157 static const YYINT empty_dgoto[] = { 1,
159 static const YYINT empty_sindex[] = { 0,
162 static const YYINT empty_rindex[] = { 0,
165 static const YYINT empty_gindex[] = { 0,
167 #define YYTABLESIZE 0
168 static const YYINT empty_table[] = { 0,
170 static const YYINT empty_check[] = { -1,
176 #define YYMAXTOKEN 256
177 #define YYUNDFTOKEN 259
178 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
180 static const char *const empty_name[] = {
182 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
183 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
184 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
185 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
186 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
187 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
188 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol",
190 static const char *const empty_rule[] = {
205 /* define the initial stack-sizes */
208 #define YYMAXDEPTH YYSTACKSIZE
211 #define YYSTACKSIZE YYMAXDEPTH
213 #define YYSTACKSIZE 10000
214 #define YYMAXDEPTH 10000
218 #define YYINITSTACKSIZE 200
228 /* variables for the parser stack */
229 static YYSTACKDATA yystack;
243 #line 244 "empty.tab.c"
246 #include <stdio.h> /* needed for printf */
249 #include <stdlib.h> /* needed for malloc, etc */
250 #include <string.h> /* needed for memset */
252 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
253 static int yygrowstack(YYSTACKDATA *data)
260 if ((newsize = data->stacksize) == 0)
261 newsize = YYINITSTACKSIZE;
262 else if (newsize >= YYMAXDEPTH)
264 else if ((newsize *= 2) > YYMAXDEPTH)
265 newsize = YYMAXDEPTH;
267 i = (int) (data->s_mark - data->s_base);
268 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
272 data->s_base = newss;
273 data->s_mark = newss + i;
275 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
279 data->l_base = newvs;
280 data->l_mark = newvs + i;
282 data->stacksize = newsize;
283 data->s_last = data->s_base + newsize - 1;
287 #if YYPURE || defined(YY_NO_LEAKS)
288 static void yyfreestack(YYSTACKDATA *data)
292 memset(data, 0, sizeof(*data));
295 #define yyfreestack(data) /* nothing */
298 #define YYABORT goto yyabort
299 #define YYREJECT goto yyabort
300 #define YYACCEPT goto yyaccept
301 #define YYERROR goto yyerrlab
306 int yym, yyn, yystate;
310 if ((yys = getenv("YYDEBUG")) != 0)
313 if (yyn >= '0' && yyn <= '9')
326 memset(&yystack, 0, sizeof(yystack));
329 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
330 yystack.s_mark = yystack.s_base;
331 yystack.l_mark = yystack.l_base;
336 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
340 if (yychar < 0) yychar = YYEOF;
344 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
345 printf("%sdebug: state %d, reading %d (%s)\n",
346 YYPREFIX, yystate, yychar, yys);
350 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
351 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
355 printf("%sdebug: state %d, shifting to state %d\n",
356 YYPREFIX, yystate, yytable[yyn]);
358 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
359 yystate = yytable[yyn];
360 *++yystack.s_mark = yytable[yyn];
361 *++yystack.l_mark = yylval;
363 if (yyerrflag > 0) --yyerrflag;
366 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
367 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
372 if (yyerrflag != 0) goto yyinrecovery;
374 YYERROR_CALL("syntax error");
376 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
386 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
387 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
391 printf("%sdebug: state %d, error recovery shifting\
392 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
394 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
395 yystate = yytable[yyn];
396 *++yystack.s_mark = yytable[yyn];
397 *++yystack.l_mark = yylval;
404 printf("%sdebug: error recovery discarding state %d\n",
405 YYPREFIX, *yystack.s_mark);
407 if (yystack.s_mark <= yystack.s_base) goto yyabort;
415 if (yychar == YYEOF) goto yyabort;
419 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
420 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
421 YYPREFIX, yystate, yychar, yys);
431 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
432 YYPREFIX, yystate, yyn, yyrule[yyn]);
436 yyval = yystack.l_mark[1-yym];
438 memset(&yyval, 0, sizeof yyval);
443 yystack.s_mark -= yym;
444 yystate = *yystack.s_mark;
445 yystack.l_mark -= yym;
447 if (yystate == 0 && yym == 0)
451 printf("%sdebug: after reduction, shifting from state 0 to\
452 state %d\n", YYPREFIX, YYFINAL);
455 *++yystack.s_mark = YYFINAL;
456 *++yystack.l_mark = yyval;
460 if (yychar < 0) yychar = YYEOF;
464 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
465 printf("%sdebug: state %d, reading %d (%s)\n",
466 YYPREFIX, YYFINAL, yychar, yys);
470 if (yychar == YYEOF) goto yyaccept;
473 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
474 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
475 yystate = yytable[yyn];
477 yystate = yydgoto[yym];
480 printf("%sdebug: after reduction, shifting from state %d \
481 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
483 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
484 *++yystack.s_mark = (YYINT) yystate;
485 *++yystack.l_mark = yyval;
489 YYERROR_CALL("yacc stack overflow");
492 yyfreestack(&yystack);
496 yyfreestack(&yystack);