3 /* The definition of yysccsid in the banner should be replaced with */
4 /* a #pragma ident directive if the target C compiler supports */
5 /* #pragma ident directives. */
7 /* If the skeleton is changed, the banner should be changed so that */
8 /* the altered version can be easily distinguished from the original. */
10 /* The #defines included with the banner are there because they are */
11 /* useful in subsequent code. The macros #defined in the header or */
12 /* the body either are not useful outside of semantic actions or */
13 /* are conditional. */
18 "static char yysccsid[] = \"@(#)yaccpar 1.9 (Berkeley) 02/21/93\";",
23 "#define yyclearin (yychar=(-1))",
24 "#define yyerrok (yyerrflag=0)",
25 "#define YYRECOVERING (yyerrflag!=0)",
32 "extern short yylhs[];",
33 "extern short yylen[];",
34 "extern short yydefred[];",
35 "extern short yydgoto[];",
36 "extern short yysindex[];",
37 "extern short yyrindex[];",
38 "extern short yygindex[];",
39 "extern short yytable[];",
40 "extern short yycheck[];",
42 "extern char *yyname[];",
43 "extern char *yyrule[];",
53 "#define YYMAXDEPTH YYSTACKSIZE",
56 "#define YYSTACKSIZE YYMAXDEPTH",
58 "#define YYSTACKSIZE 500",
59 "#define YYMAXDEPTH 500",
70 "short yyss[YYSTACKSIZE];",
71 "YYSTYPE yyvs[YYSTACKSIZE];",
72 "#define yystacksize YYSTACKSIZE",
79 "#define YYABORT goto yyabort",
80 "#define YYREJECT goto yyabort",
81 "#define YYACCEPT goto yyaccept",
82 "#define YYERROR goto yyerrlab",
86 " register int yym, yyn, yystate;",
88 " register char *yys;",
89 " extern char *getenv();",
91 " if (yys = getenv(\"YYDEBUG\"))",
94 " if (yyn >= '0' && yyn <= '9')",
95 " yydebug = yyn - '0';",
105 " *yyssp = yystate = 0;",
108 " if (yyn = yydefred[yystate]) goto yyreduce;",
111 " if ((yychar = yylex()) < 0) yychar = 0;",
116 " if (yychar <= YYMAXTOKEN) yys = yyname[yychar];",
117 " if (!yys) yys = \"illegal-symbol\";",
118 " printf(\"%sdebug: state %d, reading %d (%s)\\n\",",
119 " YYPREFIX, yystate, yychar, yys);",
123 " if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&",
124 " yyn <= YYTABLESIZE && yycheck[yyn] == yychar)",
128 " printf(\"%sdebug: state %d, shifting to state %d\\n\",",
129 " YYPREFIX, yystate, yytable[yyn]);",
131 " if (yyssp >= yyss + yystacksize - 1)",
135 " *++yyssp = yystate = yytable[yyn];",
136 " *++yyvsp = yylval;",
138 " if (yyerrflag > 0) --yyerrflag;",
141 " if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&",
142 " yyn <= YYTABLESIZE && yycheck[yyn] == yychar)",
144 " yyn = yytable[yyn];",
147 " if (yyerrflag) goto yyinrecovery;",
152 " yyerror(\"syntax error\");",
159 " if (yyerrflag < 3)",
164 " if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&",
165 " yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)",
169 " printf(\"%sdebug: state %d, error recovery shifting\\",
170 " to state %d\\n\", YYPREFIX, *yyssp, yytable[yyn]);",
172 " if (yyssp >= yyss + yystacksize - 1)",
176 " *++yyssp = yystate = yytable[yyn];",
177 " *++yyvsp = yylval;",
184 " printf(\"%sdebug: error recovery discarding state %d\
186 " YYPREFIX, *yyssp);",
188 " if (yyssp <= yyss) goto yyabort;",
196 " if (yychar == 0) goto yyabort;",
201 " if (yychar <= YYMAXTOKEN) yys = yyname[yychar];",
202 " if (!yys) yys = \"illegal-symbol\";",
203 " printf(\"%sdebug: state %d, error recovery discards token %d\
205 " YYPREFIX, yystate, yychar, yys);",
214 " printf(\"%sdebug: state %d, reducing by rule %d (%s)\\n\",",
215 " YYPREFIX, yystate, yyn, yyrule[yyn]);",
217 " yym = yylen[yyn];",
218 " yyval = yyvsp[1-yym];",
229 " yystate = *yyssp;",
231 " yym = yylhs[yyn];",
232 " if (yystate == 0 && yym == 0)",
236 " printf(\"%sdebug: after reduction, shifting from state 0 to\\",
237 " state %d\\n\", YYPREFIX, YYFINAL);",
239 " yystate = YYFINAL;",
240 " *++yyssp = YYFINAL;",
241 " *++yyvsp = yyval;",
244 " if ((yychar = yylex()) < 0) yychar = 0;",
249 " if (yychar <= YYMAXTOKEN) yys = yyname[yychar];",
250 " if (!yys) yys = \"illegal-symbol\";",
251 " printf(\"%sdebug: state %d, reading %d (%s)\\n\",",
252 " YYPREFIX, YYFINAL, yychar, yys);",
256 " if (yychar == 0) goto yyaccept;",
259 " if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&",
260 " yyn <= YYTABLESIZE && yycheck[yyn] == yystate)",
261 " yystate = yytable[yyn];",
263 " yystate = yydgoto[yym];",
266 " printf(\"%sdebug: after reduction, shifting from state %d \\",
267 "to state %d\\n\", YYPREFIX, *yyssp, yystate);",
269 " if (yyssp >= yyss + yystacksize - 1)",
273 " *++yyssp = yystate;",
274 " *++yyvsp = yyval;",
277 " yyerror(\"yacc stack overflow\");",
287 write_section(section
)
296 for (i
= 0; s
= section
[i
]; ++i
)