3 /* The banner used here should be replaced with an #ident directive */
4 /* if the target C compiler supports #ident directives. */
6 /* If the skeleton is changed, the banner should be changed so that */
7 /* the altered version can easily be distinguished from the original. */
12 "static char yysccsid[] = \"@(#)yaccpar 1.8 (Berkeley) 01/20/90\";",
21 "extern short yylhs[];",
22 "extern short yylen[];",
23 "extern short yydefred[];",
24 "extern short yydgoto[];",
25 "extern short yysindex[];",
26 "extern short yyrindex[];",
27 "extern short yygindex[];",
28 "extern short yytable[];",
29 "extern short yycheck[];",
31 "extern char *yyname[];",
32 "extern char *yyrule[];",
40 "#define yyclearin (yychar=(-1))",
41 "#define yyerrok (yyerrflag=0)",
44 "#define YYMAXDEPTH YYSTACKSIZE",
48 "#define YYSTACKSIZE YYMAXDEPTH",
50 "#define YYSTACKSIZE 200", /* ACK mod: Changed from 600 to 200 */
51 "#define YYMAXDEPTH 200", /* ACK mod: Changed from 600 to 200 */
62 "short yyss[YYSTACKSIZE];",
63 "YYSTYPE yyvs[YYSTACKSIZE];",
64 "#define yystacksize YYSTACKSIZE",
71 "#define YYABORT goto yyabort",
72 "#define YYACCEPT goto yyaccept",
73 "#define YYERROR goto yyerrlab",
77 " register int yym, yyn, yystate;",
78 " register short *yyssp;", /* ACK mod: made this a local */
79 " register YYSTYPE *yyvsp;", /* ACK mod: made this a local */
81 " register char *yys;",
82 " extern char *getenv();",
84 " if (yys = getenv(\"YYDEBUG\"))",
87 " if (yyn >= '0' && yyn <= '9')",
88 " yydebug = yyn - '0';",
98 " *yyssp = yystate = 0;",
101 " if (yyn = yydefred[yystate]) goto yyreduce;",
104 " if ((yychar = yylex()) < 0) yychar = 0;",
109 " if (yychar <= YYMAXTOKEN) yys = yyname[yychar];",
110 " if (!yys) yys = \"illegal-symbol\";",
111 " printf(\"yydebug: state %d, reading %d (%s)\\n\", yystate,",
116 " if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&",
117 " yyn <= YYTABLESIZE && yycheck[yyn] == yychar)",
121 " printf(\"yydebug: state %d, shifting to state %d\\n\",",
122 " yystate, yytable[yyn]);",
124 " if (yyssp >= yyss + yystacksize - 1)",
128 " *++yyssp = yystate = yytable[yyn];",
129 " *++yyvsp = yylval;",
131 " if (yyerrflag > 0) --yyerrflag;",
134 " if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&",
135 " yyn <= YYTABLESIZE && yycheck[yyn] == yychar)",
137 " yyn = yytable[yyn];",
140 " if (yyerrflag) goto yyinrecovery;",
145 " yyerror(\"syntax error\");",
152 " if (yyerrflag < 3)",
157 " if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&",
158 " yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)",
162 " printf(\"yydebug: state %d, error recovery shifting\\",
163 " to state %d\\n\", *yyssp, yytable[yyn]);",
165 " if (yyssp >= yyss + yystacksize - 1)",
169 " *++yyssp = yystate = yytable[yyn];",
170 " *++yyvsp = yylval;",
177 " printf(\"yydebug: error recovery discarding state %d\
181 " if (yyssp <= yyss) goto yyabort;",
189 " if (yychar == 0) goto yyabort;",
194 " if (yychar <= YYMAXTOKEN) yys = yyname[yychar];",
195 " if (!yys) yys = \"illegal-symbol\";",
196 " printf(\"yydebug: state %d, error recovery discards token %d\
198 " yystate, yychar, yys);",
207 " printf(\"yydebug: state %d, reducing by rule %d (%s)\\n\",",
208 " yystate, yyn, yyrule[yyn]);",
210 " yym = yylen[yyn];",
211 " yyval = yyvsp[1-yym];",
222 " yystate = *yyssp;",
224 " yym = yylhs[yyn];",
225 " if (yystate == 0 && yym == 0)",
229 " printf(\"yydebug: after reduction, shifting from state 0 to\\",
230 " state %d\\n\", YYFINAL);",
232 " yystate = YYFINAL;",
233 " *++yyssp = YYFINAL;",
234 " *++yyvsp = yyval;",
237 " if ((yychar = yylex()) < 0) yychar = 0;",
242 " if (yychar <= YYMAXTOKEN) yys = yyname[yychar];",
243 " if (!yys) yys = \"illegal-symbol\";",
244 " printf(\"yydebug: state %d, reading %d (%s)\\n\",",
245 " YYFINAL, yychar, yys);",
249 " if (yychar == 0) goto yyaccept;",
252 " if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&",
253 " yyn <= YYTABLESIZE && yycheck[yyn] == yystate)",
254 " yystate = yytable[yyn];",
256 " yystate = yydgoto[yym];",
259 " printf(\"yydebug: after reduction, shifting from state %d \\",
260 "to state %d\\n\", *yyssp, yystate);",
262 " if (yyssp >= yyss + yystacksize - 1)",
266 " *++yyssp = yystate;",
267 " *++yyvsp = yyval;",
270 " yyerror(\"yacc stack overflow\");",
280 write_section(section)
287 for (i = 0; section[i]; ++i)
290 fprintf(fp, "%s\n", section[i]);