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