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_syntax11_parse
22 #define yylex err_syntax11_lex
26 #define yyerror err_syntax11_error
30 #define yychar err_syntax11_char
34 #define yyval err_syntax11_val
38 #define yylval err_syntax11_lval
42 #define yydebug err_syntax11_debug
46 #define yynerrs err_syntax11_nerrs
50 #define yyerrflag err_syntax11_errflag
51 #endif /* yyerrflag */
54 #define yylhs err_syntax11_lhs
58 #define yylen err_syntax11_len
62 #define yydefred err_syntax11_defred
66 #define yydgoto err_syntax11_dgoto
70 #define yysindex err_syntax11_sindex
74 #define yyrindex err_syntax11_rindex
78 #define yygindex err_syntax11_gindex
82 #define yytable err_syntax11_table
86 #define yycheck err_syntax11_check
90 #define yyname err_syntax11_name
94 #define yyrule err_syntax11_rule
96 #define YYPREFIX "err_syntax11_"
100 #line 2 "err_syntax11.y"
102 static void yyerror(const char *);
103 #line 104 "err_syntax11.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();
142 #define YYERRCODE 256
144 static const YYINT err_syntax11_lhs[] = { -1,
147 static const YYINT err_syntax11_len[] = { 2,
150 static const YYINT err_syntax11_defred[] = { 0,
153 static const YYINT err_syntax11_dgoto[] = { 2,
155 static const YYINT err_syntax11_sindex[] = { -256,
158 static const YYINT err_syntax11_rindex[] = { 0,
161 static const YYINT err_syntax11_gindex[] = { 0,
163 #define YYTABLESIZE 0
164 static const YYINT err_syntax11_table[] = { 1,
166 static const YYINT err_syntax11_check[] = { 256,
172 #define YYMAXTOKEN 256
173 #define YYUNDFTOKEN 259
174 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
176 static const char *const err_syntax11_name[] = {
178 "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,
179 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,
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,"illegal-symbol",
186 static const char *const err_syntax11_rule[] = {
201 /* define the initial stack-sizes */
204 #define YYMAXDEPTH YYSTACKSIZE
207 #define YYSTACKSIZE YYMAXDEPTH
209 #define YYSTACKSIZE 10000
210 #define YYMAXDEPTH 10000
214 #define YYINITSTACKSIZE 200
224 /* variables for the parser stack */
225 static YYSTACKDATA yystack;
226 #line 12 "err_syntax11.y"
233 printf("yyparse() = %d\n", yyparse());
244 yyerror(const char* s)
248 #line 249 "err_syntax11.tab.c"
251 #include <stdio.h> /* needed for printf */
254 #include <stdlib.h> /* needed for malloc, etc */
255 #include <string.h> /* needed for memset */
257 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
258 static int yygrowstack(YYSTACKDATA *data)
265 if ((newsize = data->stacksize) == 0)
266 newsize = YYINITSTACKSIZE;
267 else if (newsize >= YYMAXDEPTH)
269 else if ((newsize *= 2) > YYMAXDEPTH)
270 newsize = YYMAXDEPTH;
272 i = (int) (data->s_mark - data->s_base);
273 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
277 data->s_base = newss;
278 data->s_mark = newss + i;
280 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
284 data->l_base = newvs;
285 data->l_mark = newvs + i;
287 data->stacksize = newsize;
288 data->s_last = data->s_base + newsize - 1;
292 #if YYPURE || defined(YY_NO_LEAKS)
293 static void yyfreestack(YYSTACKDATA *data)
297 memset(data, 0, sizeof(*data));
300 #define yyfreestack(data) /* nothing */
303 #define YYABORT goto yyabort
304 #define YYREJECT goto yyabort
305 #define YYACCEPT goto yyaccept
306 #define YYERROR goto yyerrlab
311 int yym, yyn, yystate;
315 if ((yys = getenv("YYDEBUG")) != 0)
318 if (yyn >= '0' && yyn <= '9')
331 memset(&yystack, 0, sizeof(yystack));
334 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
335 yystack.s_mark = yystack.s_base;
336 yystack.l_mark = yystack.l_base;
341 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
345 if (yychar < 0) yychar = YYEOF;
349 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
350 printf("%sdebug: state %d, reading %d (%s)\n",
351 YYPREFIX, yystate, yychar, yys);
355 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
356 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
360 printf("%sdebug: state %d, shifting to state %d\n",
361 YYPREFIX, yystate, yytable[yyn]);
363 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
364 yystate = yytable[yyn];
365 *++yystack.s_mark = yytable[yyn];
366 *++yystack.l_mark = yylval;
368 if (yyerrflag > 0) --yyerrflag;
371 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
372 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
377 if (yyerrflag != 0) goto yyinrecovery;
379 YYERROR_CALL("syntax error");
381 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
391 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
392 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
396 printf("%sdebug: state %d, error recovery shifting\
397 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
399 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
400 yystate = yytable[yyn];
401 *++yystack.s_mark = yytable[yyn];
402 *++yystack.l_mark = yylval;
409 printf("%sdebug: error recovery discarding state %d\n",
410 YYPREFIX, *yystack.s_mark);
412 if (yystack.s_mark <= yystack.s_base) goto yyabort;
420 if (yychar == YYEOF) goto yyabort;
424 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
425 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
426 YYPREFIX, yystate, yychar, yys);
436 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
437 YYPREFIX, yystate, yyn, yyrule[yyn]);
441 yyval = yystack.l_mark[1-yym];
443 memset(&yyval, 0, sizeof yyval);
448 yystack.s_mark -= yym;
449 yystate = *yystack.s_mark;
450 yystack.l_mark -= yym;
452 if (yystate == 0 && yym == 0)
456 printf("%sdebug: after reduction, shifting from state 0 to\
457 state %d\n", YYPREFIX, YYFINAL);
460 *++yystack.s_mark = YYFINAL;
461 *++yystack.l_mark = yyval;
465 if (yychar < 0) yychar = YYEOF;
469 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
470 printf("%sdebug: state %d, reading %d (%s)\n",
471 YYPREFIX, YYFINAL, yychar, yys);
475 if (yychar == YYEOF) goto yyaccept;
478 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
479 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
480 yystate = yytable[yyn];
482 yystate = yydgoto[yym];
485 printf("%sdebug: after reduction, shifting from state %d \
486 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
488 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
489 *++yystack.s_mark = (YYINT) yystate;
490 *++yystack.l_mark = yyval;
494 YYERROR_CALL("yacc stack overflow");
497 yyfreestack(&yystack);
501 yyfreestack(&yystack);