1/* original parser id follows */
2/* yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93" */
3/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
4
5#define YYBYACC 1
6#define YYMAJOR 1
7#define YYMINOR 9
8#define YYCHECK "yyyymmdd"
9
10#define YYEMPTY        (-1)
11#define yyclearin      (yychar = YYEMPTY)
12#define yyerrok        (yyerrflag = 0)
13#define YYRECOVERING() (yyerrflag != 0)
14#define YYENOMEM       (-2)
15#define YYEOF          0
16
17#ifndef yyparse
18#define yyparse    error_parse
19#endif /* yyparse */
20
21#ifndef yylex
22#define yylex      error_lex
23#endif /* yylex */
24
25#ifndef yyerror
26#define yyerror    error_error
27#endif /* yyerror */
28
29#ifndef yychar
30#define yychar     error_char
31#endif /* yychar */
32
33#ifndef yyval
34#define yyval      error_val
35#endif /* yyval */
36
37#ifndef yylval
38#define yylval     error_lval
39#endif /* yylval */
40
41#ifndef yydebug
42#define yydebug    error_debug
43#endif /* yydebug */
44
45#ifndef yynerrs
46#define yynerrs    error_nerrs
47#endif /* yynerrs */
48
49#ifndef yyerrflag
50#define yyerrflag  error_errflag
51#endif /* yyerrflag */
52
53#ifndef yylhs
54#define yylhs      error_lhs
55#endif /* yylhs */
56
57#ifndef yylen
58#define yylen      error_len
59#endif /* yylen */
60
61#ifndef yydefred
62#define yydefred   error_defred
63#endif /* yydefred */
64
65#ifndef yydgoto
66#define yydgoto    error_dgoto
67#endif /* yydgoto */
68
69#ifndef yysindex
70#define yysindex   error_sindex
71#endif /* yysindex */
72
73#ifndef yyrindex
74#define yyrindex   error_rindex
75#endif /* yyrindex */
76
77#ifndef yygindex
78#define yygindex   error_gindex
79#endif /* yygindex */
80
81#ifndef yytable
82#define yytable    error_table
83#endif /* yytable */
84
85#ifndef yycheck
86#define yycheck    error_check
87#endif /* yycheck */
88
89#ifndef yyname
90#define yyname     error_name
91#endif /* yyname */
92
93#ifndef yyrule
94#define yyrule     error_rule
95#endif /* yyrule */
96#define YYPREFIX "error_"
97
98#define YYPURE 0
99
100#line 2 "code_error.y"
101
102#ifdef YYBISON
103int yylex(void);
104static void yyerror(const char *);
105#endif
106
107#line 108 "code_error.code.c"
108
109#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
110/* Default: YYSTYPE is the semantic value type. */
111typedef int YYSTYPE;
112# define YYSTYPE_IS_DECLARED 1
113#endif
114
115/* compatibility with bison */
116#ifdef YYPARSE_PARAM
117/* compatibility with FreeBSD */
118# ifdef YYPARSE_PARAM_TYPE
119#  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
120# else
121#  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
122# endif
123#else
124# define YYPARSE_DECL() yyparse(void)
125#endif
126
127/* Parameters sent to lex. */
128#ifdef YYLEX_PARAM
129# define YYLEX_DECL() yylex(void *YYLEX_PARAM)
130# define YYLEX yylex(YYLEX_PARAM)
131#else
132# define YYLEX_DECL() yylex(void)
133# define YYLEX yylex()
134#endif
135
136/* Parameters sent to yyerror. */
137#ifndef YYERROR_DECL
138#define YYERROR_DECL() yyerror(const char *s)
139#endif
140#ifndef YYERROR_CALL
141#define YYERROR_CALL(msg) yyerror(msg)
142#endif
143
144#define YYERRCODE 256
145#define YYTABLESIZE 0
146#define YYFINAL 2
147#ifndef YYDEBUG
148#define YYDEBUG 0
149#endif
150#define YYMAXTOKEN 256
151#define YYUNDFTOKEN 259
152#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
153
154extern int YYPARSE_DECL();
155typedef int YYINT;
156extern YYINT yylhs[];
157extern YYINT yylen[];
158extern YYINT yydefred[];
159extern YYINT yydgoto[];
160extern YYINT yysindex[];
161extern YYINT yyrindex[];
162extern YYINT yygindex[];
163extern YYINT yytable[];
164extern YYINT yycheck[];
165
166#if YYDEBUG || defined(yytname)
167extern char *yyname[];
168#endif
169#if YYDEBUG
170extern char *yyrule[];
171#endif
172
173int      yydebug;
174int      yynerrs;
175
176int      yyerrflag;
177int      yychar;
178YYSTYPE  yyval;
179YYSTYPE  yylval;
180
181/* define the initial stack-sizes */
182#ifdef YYSTACKSIZE
183#undef YYMAXDEPTH
184#define YYMAXDEPTH  YYSTACKSIZE
185#else
186#ifdef YYMAXDEPTH
187#define YYSTACKSIZE YYMAXDEPTH
188#else
189#define YYSTACKSIZE 10000
190#define YYMAXDEPTH  10000
191#endif
192#endif
193
194#define YYINITSTACKSIZE 200
195
196typedef struct {
197    unsigned stacksize;
198    YYINT    *s_base;
199    YYINT    *s_mark;
200    YYINT    *s_last;
201    YYSTYPE  *l_base;
202    YYSTYPE  *l_mark;
203} YYSTACKDATA;
204/* variables for the parser stack */
205static YYSTACKDATA yystack;
206#line 12 "code_error.y"
207
208#include <stdio.h>
209
210#ifdef YYBYACC
211extern int YYLEX_DECL();
212#endif
213
214int
215main(void)
216{
217    printf("yyparse() = %d\n", yyparse());
218    return 0;
219}
220
221int
222yylex(void)
223{
224    return -1;
225}
226
227static void
228yyerror(const char* s)
229{
230    printf("%s\n", s);
231}
232#line 233 "code_error.code.c"
233
234#if YYDEBUG
235#include <stdio.h>	/* needed for printf */
236#endif
237
238#include <stdlib.h>	/* needed for malloc, etc */
239#include <string.h>	/* needed for memset */
240
241/* allocate initial stack or double stack size, up to YYMAXDEPTH */
242static int yygrowstack(YYSTACKDATA *data)
243{
244    int i;
245    unsigned newsize;
246    YYINT *newss;
247    YYSTYPE *newvs;
248
249    if ((newsize = data->stacksize) == 0)
250        newsize = YYINITSTACKSIZE;
251    else if (newsize >= YYMAXDEPTH)
252        return YYENOMEM;
253    else if ((newsize *= 2) > YYMAXDEPTH)
254        newsize = YYMAXDEPTH;
255
256    i = (int) (data->s_mark - data->s_base);
257    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
258    if (newss == 0)
259        return YYENOMEM;
260
261    data->s_base = newss;
262    data->s_mark = newss + i;
263
264    newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
265    if (newvs == 0)
266        return YYENOMEM;
267
268    data->l_base = newvs;
269    data->l_mark = newvs + i;
270
271    data->stacksize = newsize;
272    data->s_last = data->s_base + newsize - 1;
273    return 0;
274}
275
276#if YYPURE || defined(YY_NO_LEAKS)
277static void yyfreestack(YYSTACKDATA *data)
278{
279    free(data->s_base);
280    free(data->l_base);
281    memset(data, 0, sizeof(*data));
282}
283#else
284#define yyfreestack(data) /* nothing */
285#endif
286
287#define YYABORT  goto yyabort
288#define YYREJECT goto yyabort
289#define YYACCEPT goto yyaccept
290#define YYERROR  goto yyerrlab
291
292int
293YYPARSE_DECL()
294{
295    int yym, yyn, yystate;
296#if YYDEBUG
297    const char *yys;
298
299    if ((yys = getenv("YYDEBUG")) != 0)
300    {
301        yyn = *yys;
302        if (yyn >= '0' && yyn <= '9')
303            yydebug = yyn - '0';
304    }
305#endif
306
307    yym = 0;
308    yyn = 0;
309    yynerrs = 0;
310    yyerrflag = 0;
311    yychar = YYEMPTY;
312    yystate = 0;
313
314#if YYPURE
315    memset(&yystack, 0, sizeof(yystack));
316#endif
317
318    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
319    yystack.s_mark = yystack.s_base;
320    yystack.l_mark = yystack.l_base;
321    yystate = 0;
322    *yystack.s_mark = 0;
323
324yyloop:
325    if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
326    if (yychar < 0)
327    {
328        yychar = YYLEX;
329        if (yychar < 0) yychar = YYEOF;
330#if YYDEBUG
331        if (yydebug)
332        {
333            if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
334            printf("%sdebug: state %d, reading %d (%s)\n",
335                    YYPREFIX, yystate, yychar, yys);
336        }
337#endif
338    }
339    if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
340            yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
341    {
342#if YYDEBUG
343        if (yydebug)
344            printf("%sdebug: state %d, shifting to state %d\n",
345                    YYPREFIX, yystate, yytable[yyn]);
346#endif
347        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
348        yystate = yytable[yyn];
349        *++yystack.s_mark = yytable[yyn];
350        *++yystack.l_mark = yylval;
351        yychar = YYEMPTY;
352        if (yyerrflag > 0)  --yyerrflag;
353        goto yyloop;
354    }
355    if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
356            yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
357    {
358        yyn = yytable[yyn];
359        goto yyreduce;
360    }
361    if (yyerrflag != 0) goto yyinrecovery;
362
363    YYERROR_CALL("syntax error");
364
365    goto yyerrlab; /* redundant goto avoids 'unused label' warning */
366yyerrlab:
367    ++yynerrs;
368
369yyinrecovery:
370    if (yyerrflag < 3)
371    {
372        yyerrflag = 3;
373        for (;;)
374        {
375            if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
376                    yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
377            {
378#if YYDEBUG
379                if (yydebug)
380                    printf("%sdebug: state %d, error recovery shifting\
381 to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
382#endif
383                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
384                yystate = yytable[yyn];
385                *++yystack.s_mark = yytable[yyn];
386                *++yystack.l_mark = yylval;
387                goto yyloop;
388            }
389            else
390            {
391#if YYDEBUG
392                if (yydebug)
393                    printf("%sdebug: error recovery discarding state %d\n",
394                            YYPREFIX, *yystack.s_mark);
395#endif
396                if (yystack.s_mark <= yystack.s_base) goto yyabort;
397                --yystack.s_mark;
398                --yystack.l_mark;
399            }
400        }
401    }
402    else
403    {
404        if (yychar == YYEOF) goto yyabort;
405#if YYDEBUG
406        if (yydebug)
407        {
408            if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
409            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
410                    YYPREFIX, yystate, yychar, yys);
411        }
412#endif
413        yychar = YYEMPTY;
414        goto yyloop;
415    }
416
417yyreduce:
418#if YYDEBUG
419    if (yydebug)
420        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
421                YYPREFIX, yystate, yyn, yyrule[yyn]);
422#endif
423    yym = yylen[yyn];
424    if (yym > 0)
425        yyval = yystack.l_mark[1-yym];
426    else
427        memset(&yyval, 0, sizeof yyval);
428
429    switch (yyn)
430    {
431    }
432    yystack.s_mark -= yym;
433    yystate = *yystack.s_mark;
434    yystack.l_mark -= yym;
435    yym = yylhs[yyn];
436    if (yystate == 0 && yym == 0)
437    {
438#if YYDEBUG
439        if (yydebug)
440            printf("%sdebug: after reduction, shifting from state 0 to\
441 state %d\n", YYPREFIX, YYFINAL);
442#endif
443        yystate = YYFINAL;
444        *++yystack.s_mark = YYFINAL;
445        *++yystack.l_mark = yyval;
446        if (yychar < 0)
447        {
448            yychar = YYLEX;
449            if (yychar < 0) yychar = YYEOF;
450#if YYDEBUG
451            if (yydebug)
452            {
453                if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
454                printf("%sdebug: state %d, reading %d (%s)\n",
455                        YYPREFIX, YYFINAL, yychar, yys);
456            }
457#endif
458        }
459        if (yychar == YYEOF) goto yyaccept;
460        goto yyloop;
461    }
462    if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
463            yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
464        yystate = yytable[yyn];
465    else
466        yystate = yydgoto[yym];
467#if YYDEBUG
468    if (yydebug)
469        printf("%sdebug: after reduction, shifting from state %d \
470to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
471#endif
472    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
473    *++yystack.s_mark = (YYINT) yystate;
474    *++yystack.l_mark = yyval;
475    goto yyloop;
476
477yyoverflow:
478    YYERROR_CALL("yacc stack overflow");
479
480yyabort:
481    yyfreestack(&yystack);
482    return (1);
483
484yyaccept:
485    yyfreestack(&yystack);
486    return (0);
487}
488