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 err_syntax12_parse
22 #define yylex err_syntax12_lex
26 #define yyerror err_syntax12_error
30 #define yychar err_syntax12_char
34 #define yyval err_syntax12_val
38 #define yylval err_syntax12_lval
42 #define yydebug err_syntax12_debug
46 #define yynerrs err_syntax12_nerrs
50 #define yyerrflag err_syntax12_errflag
51 #endif /* yyerrflag */
54 #define yylhs err_syntax12_lhs
58 #define yylen err_syntax12_len
62 #define yydefred err_syntax12_defred
66 #define yydgoto err_syntax12_dgoto
70 #define yysindex err_syntax12_sindex
74 #define yyrindex err_syntax12_rindex
78 #define yygindex err_syntax12_gindex
82 #define yytable err_syntax12_table
86 #define yycheck err_syntax12_check
90 #define yyname err_syntax12_name
94 #define yyrule err_syntax12_rule
96 #define YYPREFIX "err_syntax12_"
100 #line 2 "err_syntax12.y"
102 static void yyerror(const char *);
103 #line 104 "err_syntax12.tab.c"
105 #if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
106 /* Default: YYSTYPE is the semantic value type. */
108 # define YYSTYPE_IS_DECLARED 1
111 /* compatibility with bison */
113 /* compatibility with FreeBSD */
114 # ifdef YYPARSE_PARAM_TYPE
115 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
117 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
120 # define YYPARSE_DECL() yyparse(void)
123 /* Parameters sent to lex. */
125 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
126 # define YYLEX yylex(YYLEX_PARAM)
128 # define YYLEX_DECL() yylex(void)
129 # define YYLEX yylex()
132 /* Parameters sent to yyerror. */
134 #define YYERROR_DECL() yyerror(const char *s)
137 #define YYERROR_CALL(msg) yyerror(msg)
140 extern int YYPARSE_DECL();
143 #define YYERRCODE 256
145 static const YYINT err_syntax12_lhs[] = { -1,
148 static const YYINT err_syntax12_len[] = { 2,
151 static const YYINT err_syntax12_defred[] = { 0,
154 static const YYINT err_syntax12_dgoto[] = { 2,
156 static const YYINT err_syntax12_sindex[] = { -256,
159 static const YYINT err_syntax12_rindex[] = { 0,
162 static const YYINT err_syntax12_gindex[] = { 0,
164 #define YYTABLESIZE 0
165 static const YYINT err_syntax12_table[] = { 1,
167 static const YYINT err_syntax12_check[] = { 256,
173 #define YYMAXTOKEN 456
174 #define YYUNDFTOKEN 459
175 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
177 static const char *const err_syntax12_name[] = {
179 "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,
180 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,
181 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,
182 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,
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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
189 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,
190 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"text",0,0,"illegal-symbol",
192 static const char *const err_syntax12_rule[] = {
207 /* define the initial stack-sizes */
210 #define YYMAXDEPTH YYSTACKSIZE
213 #define YYSTACKSIZE YYMAXDEPTH
215 #define YYSTACKSIZE 10000
216 #define YYMAXDEPTH 10000
220 #define YYINITSTACKSIZE 200
230 /* variables for the parser stack */
231 static YYSTACKDATA yystack;
232 #line 12 "err_syntax12.y"
239 printf("yyparse() = %d\n", yyparse());
250 yyerror(const char* s)
254 #line 255 "err_syntax12.tab.c"
257 #include <stdio.h> /* needed for printf */
260 #include <stdlib.h> /* needed for malloc, etc */
261 #include <string.h> /* needed for memset */
263 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
264 static int yygrowstack(YYSTACKDATA *data)
271 if ((newsize = data->stacksize) == 0)
272 newsize = YYINITSTACKSIZE;
273 else if (newsize >= YYMAXDEPTH)
275 else if ((newsize *= 2) > YYMAXDEPTH)
276 newsize = YYMAXDEPTH;
278 i = (int) (data->s_mark - data->s_base);
279 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
283 data->s_base = newss;
284 data->s_mark = newss + i;
286 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
290 data->l_base = newvs;
291 data->l_mark = newvs + i;
293 data->stacksize = newsize;
294 data->s_last = data->s_base + newsize - 1;
298 #if YYPURE || defined(YY_NO_LEAKS)
299 static void yyfreestack(YYSTACKDATA *data)
303 memset(data, 0, sizeof(*data));
306 #define yyfreestack(data) /* nothing */
309 #define YYABORT goto yyabort
310 #define YYREJECT goto yyabort
311 #define YYACCEPT goto yyaccept
312 #define YYERROR goto yyerrlab
317 int yym, yyn, yystate;
321 if ((yys = getenv("YYDEBUG")) != 0)
324 if (yyn >= '0' && yyn <= '9')
337 memset(&yystack, 0, sizeof(yystack));
340 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
341 yystack.s_mark = yystack.s_base;
342 yystack.l_mark = yystack.l_base;
347 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
351 if (yychar < 0) yychar = YYEOF;
355 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
356 printf("%sdebug: state %d, reading %d (%s)\n",
357 YYPREFIX, yystate, yychar, yys);
361 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
362 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
366 printf("%sdebug: state %d, shifting to state %d\n",
367 YYPREFIX, yystate, yytable[yyn]);
369 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
370 yystate = yytable[yyn];
371 *++yystack.s_mark = yytable[yyn];
372 *++yystack.l_mark = yylval;
374 if (yyerrflag > 0) --yyerrflag;
377 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
378 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
383 if (yyerrflag != 0) goto yyinrecovery;
385 YYERROR_CALL("syntax error");
387 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
397 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
398 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
402 printf("%sdebug: state %d, error recovery shifting\
403 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
405 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
406 yystate = yytable[yyn];
407 *++yystack.s_mark = yytable[yyn];
408 *++yystack.l_mark = yylval;
415 printf("%sdebug: error recovery discarding state %d\n",
416 YYPREFIX, *yystack.s_mark);
418 if (yystack.s_mark <= yystack.s_base) goto yyabort;
426 if (yychar == YYEOF) goto yyabort;
430 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
431 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
432 YYPREFIX, yystate, yychar, yys);
442 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
443 YYPREFIX, yystate, yyn, yyrule[yyn]);
447 yyval = yystack.l_mark[1-yym];
449 memset(&yyval, 0, sizeof yyval);
454 yystack.s_mark -= yym;
455 yystate = *yystack.s_mark;
456 yystack.l_mark -= yym;
458 if (yystate == 0 && yym == 0)
462 printf("%sdebug: after reduction, shifting from state 0 to\
463 state %d\n", YYPREFIX, YYFINAL);
466 *++yystack.s_mark = YYFINAL;
467 *++yystack.l_mark = yyval;
471 if (yychar < 0) yychar = YYEOF;
475 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
476 printf("%sdebug: state %d, reading %d (%s)\n",
477 YYPREFIX, YYFINAL, yychar, yys);
481 if (yychar == YYEOF) goto yyaccept;
484 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
485 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
486 yystate = yytable[yyn];
488 yystate = yydgoto[yym];
491 printf("%sdebug: after reduction, shifting from state %d \
492 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
494 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
495 *++yystack.s_mark = (YYINT) yystate;
496 *++yystack.l_mark = yyval;
500 YYERROR_CALL("yacc stack overflow");
503 yyfreestack(&yystack);
507 yyfreestack(&yystack);