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_syntax10_parse
22 #define yylex err_syntax10_lex
26 #define yyerror err_syntax10_error
30 #define yychar err_syntax10_char
34 #define yyval err_syntax10_val
38 #define yylval err_syntax10_lval
42 #define yydebug err_syntax10_debug
46 #define yynerrs err_syntax10_nerrs
50 #define yyerrflag err_syntax10_errflag
51 #endif /* yyerrflag */
54 #define yylhs err_syntax10_lhs
58 #define yylen err_syntax10_len
62 #define yydefred err_syntax10_defred
66 #define yydgoto err_syntax10_dgoto
70 #define yysindex err_syntax10_sindex
74 #define yyrindex err_syntax10_rindex
78 #define yygindex err_syntax10_gindex
82 #define yytable err_syntax10_table
86 #define yycheck err_syntax10_check
90 #define yyname err_syntax10_name
94 #define yyrule err_syntax10_rule
96 #define YYPREFIX "err_syntax10_"
100 #line 2 "err_syntax10.y"
102 static void yyerror(const char *);
103 #line 104 "err_syntax10.tab.c"
105 /* compatibility with bison */
107 /* compatibility with FreeBSD */
108 # ifdef YYPARSE_PARAM_TYPE
109 # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
111 # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
114 # define YYPARSE_DECL() yyparse(void)
117 /* Parameters sent to lex. */
119 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
120 # define YYLEX yylex(YYLEX_PARAM)
122 # define YYLEX_DECL() yylex(void)
123 # define YYLEX yylex()
126 /* Parameters sent to yyerror. */
128 #define YYERROR_DECL() yyerror(const char *s)
131 #define YYERROR_CALL(msg) yyerror(msg)
134 extern int YYPARSE_DECL();
136 #define YYERRCODE 256
138 static const YYINT err_syntax10_lhs[] = { -1,
141 static const YYINT err_syntax10_len[] = { 2,
144 static const YYINT err_syntax10_defred[] = { 0,
147 static const YYINT err_syntax10_dgoto[] = { 2,
149 static const YYINT err_syntax10_sindex[] = { -256,
152 static const YYINT err_syntax10_rindex[] = { 0,
155 static const YYINT err_syntax10_gindex[] = { 0,
157 #define YYTABLESIZE 0
158 static const YYINT err_syntax10_table[] = { 1,
160 static const YYINT err_syntax10_check[] = { 256,
166 #define YYMAXTOKEN 256
167 #define YYUNDFTOKEN 259
168 #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
170 static const char *const err_syntax10_name[] = {
172 "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,
173 0,0,0,0,"'&'",0,"'('",0,"'*'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
174 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
175 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
176 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
177 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
178 0,0,0,0,0,0,0,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",
180 static const char *const err_syntax10_rule[] = {
195 /* define the initial stack-sizes */
198 #define YYMAXDEPTH YYSTACKSIZE
201 #define YYSTACKSIZE YYMAXDEPTH
203 #define YYSTACKSIZE 10000
204 #define YYMAXDEPTH 10000
208 #define YYINITSTACKSIZE 200
218 /* variables for the parser stack */
219 static YYSTACKDATA yystack;
220 #line 12 "err_syntax10.y"
227 printf("yyparse() = %d\n", yyparse());
238 yyerror(const char* s)
242 #line 243 "err_syntax10.tab.c"
245 #include <stdio.h> /* needed for printf */
248 #include <stdlib.h> /* needed for malloc, etc */
249 #include <string.h> /* needed for memset */
251 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
252 static int yygrowstack(YYSTACKDATA *data)
259 if ((newsize = data->stacksize) == 0)
260 newsize = YYINITSTACKSIZE;
261 else if (newsize >= YYMAXDEPTH)
263 else if ((newsize *= 2) > YYMAXDEPTH)
264 newsize = YYMAXDEPTH;
266 i = (int) (data->s_mark - data->s_base);
267 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
271 data->s_base = newss;
272 data->s_mark = newss + i;
274 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
278 data->l_base = newvs;
279 data->l_mark = newvs + i;
281 data->stacksize = newsize;
282 data->s_last = data->s_base + newsize - 1;
286 #if YYPURE || defined(YY_NO_LEAKS)
287 static void yyfreestack(YYSTACKDATA *data)
291 memset(data, 0, sizeof(*data));
294 #define yyfreestack(data) /* nothing */
297 #define YYABORT goto yyabort
298 #define YYREJECT goto yyabort
299 #define YYACCEPT goto yyaccept
300 #define YYERROR goto yyerrlab
305 int yym, yyn, yystate;
309 if ((yys = getenv("YYDEBUG")) != 0)
312 if (yyn >= '0' && yyn <= '9')
323 memset(&yystack, 0, sizeof(yystack));
326 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
327 yystack.s_mark = yystack.s_base;
328 yystack.l_mark = yystack.l_base;
333 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
336 if ((yychar = YYLEX) < 0) yychar = YYEOF;
340 yys = yyname[YYTRANSLATE(yychar)];
341 printf("%sdebug: state %d, reading %d (%s)\n",
342 YYPREFIX, yystate, yychar, yys);
346 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
347 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
351 printf("%sdebug: state %d, shifting to state %d\n",
352 YYPREFIX, yystate, yytable[yyn]);
354 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
358 yystate = yytable[yyn];
359 *++yystack.s_mark = yytable[yyn];
360 *++yystack.l_mark = yylval;
362 if (yyerrflag > 0) --yyerrflag;
365 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
366 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
371 if (yyerrflag) goto yyinrecovery;
373 YYERROR_CALL("syntax error");
386 if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
387 yyn <= YYTABLESIZE && yycheck[yyn] == 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)
398 yystate = yytable[yyn];
399 *++yystack.s_mark = yytable[yyn];
400 *++yystack.l_mark = yylval;
407 printf("%sdebug: error recovery discarding state %d\n",
408 YYPREFIX, *yystack.s_mark);
410 if (yystack.s_mark <= yystack.s_base) goto yyabort;
418 if (yychar == YYEOF) goto yyabort;
422 yys = yyname[YYTRANSLATE(yychar)];
423 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
424 YYPREFIX, yystate, yychar, yys);
434 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
435 YYPREFIX, yystate, yyn, yyrule[yyn]);
439 yyval = yystack.l_mark[1-yym];
441 memset(&yyval, 0, sizeof yyval);
445 yystack.s_mark -= yym;
446 yystate = *yystack.s_mark;
447 yystack.l_mark -= yym;
449 if (yystate == 0 && yym == 0)
453 printf("%sdebug: after reduction, shifting from state 0 to\
454 state %d\n", YYPREFIX, YYFINAL);
457 *++yystack.s_mark = YYFINAL;
458 *++yystack.l_mark = yyval;
461 if ((yychar = YYLEX) < 0) yychar = YYEOF;
465 yys = yyname[YYTRANSLATE(yychar)];
466 printf("%sdebug: state %d, reading %d (%s)\n",
467 YYPREFIX, YYFINAL, yychar, yys);
471 if (yychar == YYEOF) goto yyaccept;
474 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
475 yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
476 yystate = yytable[yyn];
478 yystate = yydgoto[yym];
481 printf("%sdebug: after reduction, shifting from state %d \
482 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
484 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
488 *++yystack.s_mark = (YYINT) yystate;
489 *++yystack.l_mark = yyval;
493 YYERROR_CALL("yacc stack overflow");
496 yyfreestack(&yystack);
500 yyfreestack(&yystack);