]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - tools/regression/usr.bin/yacc/regress.00.out
Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.
[FreeBSD/stable/10.git] / tools / regression / usr.bin / yacc / regress.00.out
1 #ifndef lint
2 static const char yysccsid[] = "@(#)yaccpar     1.9 (Berkeley) 02/21/93";
3 #endif
4
5 #define YYBYACC 1
6 #define YYMAJOR 1
7 #define YYMINOR 9
8
9 #define YYEMPTY        (-1)
10 #define yyclearin      (yychar = YYEMPTY)
11 #define yyerrok        (yyerrflag = 0)
12 #define YYRECOVERING() (yyerrflag != 0)
13
14 #define YYPREFIX "yy"
15
16 #define YYPURE 0
17
18
19 /* compatibility with bison */
20 #ifdef YYPARSE_PARAM
21 /* compatibility with FreeBSD */
22 # ifdef YYPARSE_PARAM_TYPE
23 #  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
24 # else
25 #  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
26 # endif
27 #else
28 # define YYPARSE_DECL() yyparse(void)
29 #endif
30
31 /* Parameters sent to lex. */
32 #ifdef YYLEX_PARAM
33 # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
34 # define YYLEX yylex(YYLEX_PARAM)
35 #else
36 # define YYLEX_DECL() yylex(void)
37 # define YYLEX yylex()
38 #endif
39
40 /* Parameters sent to yyerror. */
41 #ifndef YYERROR_DECL
42 #define YYERROR_DECL() yyerror(const char *s)
43 #endif
44 #ifndef YYERROR_CALL
45 #define YYERROR_CALL(msg) yyerror(msg)
46 #endif
47
48 extern int YYPARSE_DECL();
49
50 #define YYERRCODE 256
51 static const short yylhs[] = {                           -1,
52     0,
53 };
54 static const short yylen[] = {                            2,
55     0,
56 };
57 static const short yydefred[] = {                         1,
58     0,
59 };
60 static const short yydgoto[] = {                          1,
61 };
62 static const short yysindex[] = {                         0,
63     0,
64 };
65 static const short yyrindex[] = {                         0,
66     0,
67 };
68 static const short yygindex[] = {                         0,
69 };
70 #define YYTABLESIZE 0
71 static const short yytable[] = {                          0,
72 };
73 static const short yycheck[] = {                         -1,
74 };
75 #define YYFINAL 1
76 #ifndef YYDEBUG
77 #define YYDEBUG 0
78 #endif
79 #define YYMAXTOKEN 0
80 #if YYDEBUG
81 static const char *yyname[] = {
82
83 "end-of-file",
84 };
85 static const char *yyrule[] = {
86 "$accept : rule",
87 "rule :",
88
89 };
90 #endif
91
92 int      yydebug;
93 int      yynerrs;
94
95 int      yyerrflag;
96 int      yychar;
97 YYSTYPE  yyval;
98 YYSTYPE  yylval;
99
100 /* define the initial stack-sizes */
101 #ifdef YYSTACKSIZE
102 #undef YYMAXDEPTH
103 #define YYMAXDEPTH  YYSTACKSIZE
104 #else
105 #ifdef YYMAXDEPTH
106 #define YYSTACKSIZE YYMAXDEPTH
107 #else
108 #define YYSTACKSIZE 500
109 #define YYMAXDEPTH  500
110 #endif
111 #endif
112
113 #define YYINITSTACKSIZE 500
114
115 typedef struct {
116     unsigned stacksize;
117     short    *s_base;
118     short    *s_mark;
119     short    *s_last;
120     YYSTYPE  *l_base;
121     YYSTYPE  *l_mark;
122 } YYSTACKDATA;
123 /* variables for the parser stack */
124 static YYSTACKDATA yystack;
125
126 #if YYDEBUG
127 #include <stdio.h>              /* needed for printf */
128 #endif
129
130 #include <stdlib.h>     /* needed for malloc, etc */
131 #include <string.h>     /* needed for memset */
132
133 /* allocate initial stack or double stack size, up to YYMAXDEPTH */
134 static int yygrowstack(YYSTACKDATA *data)
135 {
136     int i;
137     unsigned newsize;
138     short *newss;
139     YYSTYPE *newvs;
140
141     if ((newsize = data->stacksize) == 0)
142         newsize = YYINITSTACKSIZE;
143     else if (newsize >= YYMAXDEPTH)
144         return -1;
145     else if ((newsize *= 2) > YYMAXDEPTH)
146         newsize = YYMAXDEPTH;
147
148     i = data->s_mark - data->s_base;
149     newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
150     if (newss == 0)
151         return -1;
152
153     data->s_base = newss;
154     data->s_mark = newss + i;
155
156     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
157     if (newvs == 0)
158         return -1;
159
160     data->l_base = newvs;
161     data->l_mark = newvs + i;
162
163     data->stacksize = newsize;
164     data->s_last = data->s_base + newsize - 1;
165     return 0;
166 }
167
168 #if YYPURE || defined(YY_NO_LEAKS)
169 static void yyfreestack(YYSTACKDATA *data)
170 {
171     free(data->s_base);
172     free(data->l_base);
173     memset(data, 0, sizeof(*data));
174 }
175 #else
176 #define yyfreestack(data) /* nothing */
177 #endif
178
179 #define YYABORT  goto yyabort
180 #define YYREJECT goto yyabort
181 #define YYACCEPT goto yyaccept
182 #define YYERROR  goto yyerrlab
183
184 int
185 YYPARSE_DECL()
186 {
187     int yym, yyn, yystate;
188 #if YYDEBUG
189     const char *yys;
190
191     if ((yys = getenv("YYDEBUG")) != 0)
192     {
193         yyn = *yys;
194         if (yyn >= '0' && yyn <= '9')
195             yydebug = yyn - '0';
196     }
197 #endif
198
199     yynerrs = 0;
200     yyerrflag = 0;
201     yychar = YYEMPTY;
202     yystate = 0;
203
204 #if YYPURE
205     memset(&yystack, 0, sizeof(yystack));
206 #endif
207
208     if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
209     yystack.s_mark = yystack.s_base;
210     yystack.l_mark = yystack.l_base;
211     yystate = 0;
212     *yystack.s_mark = 0;
213
214 yyloop:
215     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
216     if (yychar < 0)
217     {
218         if ((yychar = YYLEX) < 0) yychar = 0;
219 #if YYDEBUG
220         if (yydebug)
221         {
222             yys = 0;
223             if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
224             if (!yys) yys = "illegal-symbol";
225             printf("%sdebug: state %d, reading %d (%s)\n",
226                     YYPREFIX, yystate, yychar, yys);
227         }
228 #endif
229     }
230     if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
231             yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
232     {
233 #if YYDEBUG
234         if (yydebug)
235             printf("%sdebug: state %d, shifting to state %d\n",
236                     YYPREFIX, yystate, yytable[yyn]);
237 #endif
238         if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
239         {
240             goto yyoverflow;
241         }
242         yystate = yytable[yyn];
243         *++yystack.s_mark = yytable[yyn];
244         *++yystack.l_mark = yylval;
245         yychar = YYEMPTY;
246         if (yyerrflag > 0)  --yyerrflag;
247         goto yyloop;
248     }
249     if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
250             yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
251     {
252         yyn = yytable[yyn];
253         goto yyreduce;
254     }
255     if (yyerrflag) goto yyinrecovery;
256
257     yyerror("syntax error");
258
259     goto yyerrlab;
260
261 yyerrlab:
262     ++yynerrs;
263
264 yyinrecovery:
265     if (yyerrflag < 3)
266     {
267         yyerrflag = 3;
268         for (;;)
269         {
270             if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
271                     yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
272             {
273 #if YYDEBUG
274                 if (yydebug)
275                     printf("%sdebug: state %d, error recovery shifting\
276  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
277 #endif
278                 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
279                 {
280                     goto yyoverflow;
281                 }
282                 yystate = yytable[yyn];
283                 *++yystack.s_mark = yytable[yyn];
284                 *++yystack.l_mark = yylval;
285                 goto yyloop;
286             }
287             else
288             {
289 #if YYDEBUG
290                 if (yydebug)
291                     printf("%sdebug: error recovery discarding state %d\n",
292                             YYPREFIX, *yystack.s_mark);
293 #endif
294                 if (yystack.s_mark <= yystack.s_base) goto yyabort;
295                 --yystack.s_mark;
296                 --yystack.l_mark;
297             }
298         }
299     }
300     else
301     {
302         if (yychar == 0) goto yyabort;
303 #if YYDEBUG
304         if (yydebug)
305         {
306             yys = 0;
307             if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
308             if (!yys) yys = "illegal-symbol";
309             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
310                     YYPREFIX, yystate, yychar, yys);
311         }
312 #endif
313         yychar = YYEMPTY;
314         goto yyloop;
315     }
316
317 yyreduce:
318 #if YYDEBUG
319     if (yydebug)
320         printf("%sdebug: state %d, reducing by rule %d (%s)\n",
321                 YYPREFIX, yystate, yyn, yyrule[yyn]);
322 #endif
323     yym = yylen[yyn];
324     if (yym)
325         yyval = yystack.l_mark[1-yym];
326     else
327         memset(&yyval, 0, sizeof yyval);
328     switch (yyn)
329     {
330     }
331     yystack.s_mark -= yym;
332     yystate = *yystack.s_mark;
333     yystack.l_mark -= yym;
334     yym = yylhs[yyn];
335     if (yystate == 0 && yym == 0)
336     {
337 #if YYDEBUG
338         if (yydebug)
339             printf("%sdebug: after reduction, shifting from state 0 to\
340  state %d\n", YYPREFIX, YYFINAL);
341 #endif
342         yystate = YYFINAL;
343         *++yystack.s_mark = YYFINAL;
344         *++yystack.l_mark = yyval;
345         if (yychar < 0)
346         {
347             if ((yychar = YYLEX) < 0) yychar = 0;
348 #if YYDEBUG
349             if (yydebug)
350             {
351                 yys = 0;
352                 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
353                 if (!yys) yys = "illegal-symbol";
354                 printf("%sdebug: state %d, reading %d (%s)\n",
355                         YYPREFIX, YYFINAL, yychar, yys);
356             }
357 #endif
358         }
359         if (yychar == 0) goto yyaccept;
360         goto yyloop;
361     }
362     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
363             yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
364         yystate = yytable[yyn];
365     else
366         yystate = yydgoto[yym];
367 #if YYDEBUG
368     if (yydebug)
369         printf("%sdebug: after reduction, shifting from state %d \
370 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
371 #endif
372     if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
373     {
374         goto yyoverflow;
375     }
376     *++yystack.s_mark = (short) yystate;
377     *++yystack.l_mark = yyval;
378     goto yyloop;
379
380 yyoverflow:
381     yyerror("yacc stack overflow");
382
383 yyabort:
384     yyfreestack(&yystack);
385     return (1);
386
387 yyaccept:
388     yyfreestack(&yystack);
389     return (0);
390 }