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[] = {
209 /* define the initial stack-sizes */
212 #define YYMAXDEPTH YYSTACKSIZE
215 #define YYSTACKSIZE YYMAXDEPTH
217 #define YYSTACKSIZE 10000
218 #define YYMAXDEPTH 10000
222 #define YYINITSTACKSIZE 200
232 /* variables for the parser stack */
233 static YYSTACKDATA yystack;
234 #line 12 "err_syntax12.y"
241 printf("yyparse() = %d\n", yyparse());
252 yyerror(const char* s)
256 #line 257 "err_syntax12.tab.c"
259 #include <stdio.h> /* needed for printf */
262 #include <stdlib.h> /* needed for malloc, etc */
263 #include <string.h> /* needed for memset */
265 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
266 static int yygrowstack(YYSTACKDATA *data)
273 if ((newsize = data->stacksize) == 0)
274 newsize = YYINITSTACKSIZE;
275 else if (newsize >= YYMAXDEPTH)
277 else if ((newsize *= 2) > YYMAXDEPTH)
278 newsize = YYMAXDEPTH;
280 i = (int) (data->s_mark - data->s_base);
281 newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
285 data->s_base = newss;
286 data->s_mark = newss + i;
288 newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
292 data->l_base = newvs;
293 data->l_mark = newvs + i;
295 data->stacksize = newsize;
296 data->s_last = data->s_base + newsize - 1;
300 #if YYPURE || defined(YY_NO_LEAKS)
301 static void yyfreestack(YYSTACKDATA *data)
305 memset(data, 0, sizeof(*data));
308 #define yyfreestack(data) /* nothing */
311 #define YYABORT goto yyabort
312 #define YYREJECT goto yyabort
313 #define YYACCEPT goto yyaccept
314 #define YYERROR goto yyerrlab
319 int yym, yyn, yystate;
323 if ((yys = getenv("YYDEBUG")) != 0)
326 if (yyn >= '0' && yyn <= '9')
339 memset(&yystack, 0, sizeof(yystack));
342 if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
343 yystack.s_mark = yystack.s_base;
344 yystack.l_mark = yystack.l_base;
349 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
353 if (yychar < 0) yychar = YYEOF;
357 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
358 printf("%sdebug: state %d, reading %d (%s)\n",
359 YYPREFIX, yystate, yychar, yys);
363 if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
364 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
368 printf("%sdebug: state %d, shifting to state %d\n",
369 YYPREFIX, yystate, yytable[yyn]);
371 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
372 yystate = yytable[yyn];
373 *++yystack.s_mark = yytable[yyn];
374 *++yystack.l_mark = yylval;
376 if (yyerrflag > 0) --yyerrflag;
379 if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
380 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
385 if (yyerrflag != 0) goto yyinrecovery;
387 YYERROR_CALL("syntax error");
389 goto yyerrlab; /* redundant goto avoids 'unused label' warning */
399 if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
400 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
404 printf("%sdebug: state %d, error recovery shifting\
405 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
407 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
408 yystate = yytable[yyn];
409 *++yystack.s_mark = yytable[yyn];
410 *++yystack.l_mark = yylval;
417 printf("%sdebug: error recovery discarding state %d\n",
418 YYPREFIX, *yystack.s_mark);
420 if (yystack.s_mark <= yystack.s_base) goto yyabort;
428 if (yychar == YYEOF) goto yyabort;
432 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
433 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
434 YYPREFIX, yystate, yychar, yys);
444 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
445 YYPREFIX, yystate, yyn, yyrule[yyn]);
449 yyval = yystack.l_mark[1-yym];
451 memset(&yyval, 0, sizeof yyval);
456 yystack.s_mark -= yym;
457 yystate = *yystack.s_mark;
458 yystack.l_mark -= yym;
460 if (yystate == 0 && yym == 0)
464 printf("%sdebug: after reduction, shifting from state 0 to\
465 state %d\n", YYPREFIX, YYFINAL);
468 *++yystack.s_mark = YYFINAL;
469 *++yystack.l_mark = yyval;
473 if (yychar < 0) yychar = YYEOF;
477 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
478 printf("%sdebug: state %d, reading %d (%s)\n",
479 YYPREFIX, YYFINAL, yychar, yys);
483 if (yychar == YYEOF) goto yyaccept;
486 if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
487 yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
488 yystate = yytable[yyn];
490 yystate = yydgoto[yym];
493 printf("%sdebug: after reduction, shifting from state %d \
494 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
496 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
497 *++yystack.s_mark = (YYINT) yystate;
498 *++yystack.l_mark = yyval;
502 YYERROR_CALL("yacc stack overflow");
505 yyfreestack(&yystack);
509 yyfreestack(&yystack);