]> icculus.org git repositories - mikachu/openbox.git/blob - util/epist/yacc_parser.cc
took out some debug messages
[mikachu/openbox.git] / util / epist / yacc_parser.cc
1
2 /*  A Bison parser, made from epist.y
3     by GNU Bison version 1.28  */
4
5 #define YYBISON 1  /* Identify Bison output.  */
6
7 #define OBRACE  257
8 #define EBRACE  258
9 #define SEMICOLON       259
10 #define DASH    260
11 #define NUMBER  261
12 #define QUOTES  262
13 #define WORD    263
14 #define BINDING 264
15 #define OPTIONS 265
16 #define TRUE    266
17 #define FALSE   267
18
19 #line 1 "epist.y"
20
21 #ifdef    HAVE_CONFIG_H
22 #  include "../../config.h"
23 #endif // HAVE_CONFIG_H
24
25 #include <stdio.h>
26 #include <string.h>
27 #include "parser.hh"
28     
29 #define YYPARSE_PARAM parser_obj
30 #define YYSTYPE char*
31     
32 extern "C" {
33     int yylex();
34     int yywrap() {
35         return 1;
36     }
37 }
38
39 void yyerror(const char *c) {
40     printf("ERROR: %s\n", c);
41 }
42
43
44 #ifndef YYSTYPE
45 #define YYSTYPE int
46 #endif
47 #include <stdio.h>
48
49 #ifndef __cplusplus
50 #ifndef __STDC__
51 #define const
52 #endif
53 #endif
54
55
56
57 #define YYFINAL         42
58 #define YYFLAG          -32768
59 #define YYNTBASE        14
60
61 #define YYTRANSLATE(x) ((unsigned)(x) <= 267 ? yytranslate[x] : 28)
62
63 static const char yytranslate[] = {     0,
64      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
65      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
66      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
67      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
68      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
69      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
70      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
71      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
72      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
73      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
74      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
75      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
76      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
77      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
78      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
79      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
80      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
81      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
82      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
83      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
84      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
85      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
86      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
87      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
88      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
89      2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
90      7,     8,     9,    10,    11,    12,    13
91 };
92
93 #if YYDEBUG != 0
94 static const short yyprhs[] = {     0,
95      0,     1,     4,     7,     9,    11,    16,    21,    26,    29,
96     31,    33,    34,    38,    40,    42,    44,    46,    48,    50,
97     51,    53,    56,    58,    60,    62,    64,    65,    68
98 };
99
100 static const short yyrhs[] = {    -1,
101     14,    15,     0,    14,    18,     0,    16,     0,    17,     0,
102     19,     9,    24,     5,     0,    19,    20,    14,    21,     0,
103     25,     3,    26,     4,     0,    22,    23,     0,     3,     0,
104      4,     0,     0,    10,     6,    22,     0,     3,     0,     4,
105      0,     6,     0,     5,     0,     7,     0,     9,     0,     0,
106      7,     0,     6,     7,     0,     8,     0,    12,     0,    13,
107      0,    11,     0,     0,    26,    27,     0,     9,    24,     5,
108      0
109 };
110
111 #endif
112
113 #if YYDEBUG != 0
114 static const short yyrline[] = { 0,
115     31,    32,    33,    36,    37,    40,    49,    56,    60,    64,
116     68,    72,    73,    76,    78,    79,    80,    81,    82,    85,
117     86,    87,    88,    89,    90,    93,    97,    98,   101
118 };
119 #endif
120
121
122 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
123
124 static const char * const yytname[] = {   "$","error","$undefined.","OBRACE",
125 "EBRACE","SEMICOLON","DASH","NUMBER","QUOTES","WORD","BINDING","OPTIONS","TRUE",
126 "FALSE","commands","command","action_command","chain_command","options_block",
127 "binding","obrace","ebrace","binding_w_modifier","bind_key","parameter","options_keyword",
128 "options","option", NULL
129 };
130 #endif
131
132 static const short yyr1[] = {     0,
133     14,    14,    14,    15,    15,    16,    17,    18,    19,    20,
134     21,    22,    22,    23,    23,    23,    23,    23,    23,    24,
135     24,    24,    24,    24,    24,    25,    26,    26,    27
136 };
137
138 static const short yyr2[] = {     0,
139      0,     2,     2,     1,     1,     4,     4,     4,     2,     1,
140      1,     0,     3,     1,     1,     1,     1,     1,     1,     0,
141      1,     2,     1,     1,     1,     1,     0,     2,     3
142 };
143
144 static const short yydefact[] = {     1,
145     12,     0,    26,     2,     4,     5,     3,     0,     0,     0,
146     12,    10,    20,     1,    14,    15,    17,    16,    18,    19,
147      9,    27,    13,     0,    21,    23,    24,    25,     0,    12,
148      0,    22,     6,    11,     7,     8,    20,    28,     0,    29,
149      0,     0
150 };
151
152 static const short yydefgoto[] = {     1,
153      4,     5,     6,     7,     8,    14,    35,     9,    21,    29,
154     10,    31,    38
155 };
156
157 static const short yypact[] = {-32768,
158      0,    -2,-32768,-32768,-32768,-32768,-32768,    16,    11,     6,
159     12,-32768,    -5,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
160 -32768,-32768,-32768,    20,-32768,-32768,-32768,-32768,    18,     2,
161     17,-32768,-32768,-32768,-32768,-32768,    -5,-32768,    19,-32768,
162      5,-32768
163 };
164
165 static const short yypgoto[] = {    14,
166 -32768,-32768,-32768,-32768,-32768,-32768,-32768,    21,-32768,    -8,
167 -32768,-32768,-32768
168 };
169
170
171 #define YYLAST          32
172
173
174 static const short yytable[] = {    41,
175     24,    25,    26,    11,    42,    34,    27,    28,    22,     2,
176      3,     2,     3,    15,    16,    17,    18,    19,    12,    20,
177     36,     2,    33,    40,    13,    37,    32,    30,    39,     0,
178      0,    23
179 };
180
181 static const short yycheck[] = {     0,
182      6,     7,     8,     6,     0,     4,    12,    13,     3,    10,
183     11,    10,    11,     3,     4,     5,     6,     7,     3,     9,
184      4,    10,     5,     5,     9,     9,     7,    14,    37,    -1,
185     -1,    11
186 };
187 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
188 #line 3 "/usr/share/misc/bison.simple"
189 /* This file comes from bison-1.28.  */
190
191 /* Skeleton output parser for bison,
192    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
193
194    This program is free software; you can redistribute it and/or modify
195    it under the terms of the GNU General Public License as published by
196    the Free Software Foundation; either version 2, or (at your option)
197    any later version.
198
199    This program is distributed in the hope that it will be useful,
200    but WITHOUT ANY WARRANTY; without even the implied warranty of
201    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
202    GNU General Public License for more details.
203
204    You should have received a copy of the GNU General Public License
205    along with this program; if not, write to the Free Software
206    Foundation, Inc., 59 Temple Place - Suite 330,
207    Boston, MA 02111-1307, USA.  */
208
209 /* As a special exception, when this file is copied by Bison into a
210    Bison output file, you may use that output file without restriction.
211    This special exception was added by the Free Software Foundation
212    in version 1.24 of Bison.  */
213
214 /* This is the parser code that is written into each bison parser
215   when the %semantic_parser declaration is not specified in the grammar.
216   It was written by Richard Stallman by simplifying the hairy parser
217   used when %semantic_parser is specified.  */
218
219 #ifndef YYSTACK_USE_ALLOCA
220 #ifdef alloca
221 #define YYSTACK_USE_ALLOCA
222 #else /* alloca not defined */
223 #ifdef __GNUC__
224 #define YYSTACK_USE_ALLOCA
225 #define alloca __builtin_alloca
226 #else /* not GNU C.  */
227 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
228 #define YYSTACK_USE_ALLOCA
229 #include <alloca.h>
230 #else /* not sparc */
231 /* We think this test detects Watcom and Microsoft C.  */
232 /* This used to test MSDOS, but that is a bad idea
233    since that symbol is in the user namespace.  */
234 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
235 #if 0 /* No need for malloc.h, which pollutes the namespace;
236          instead, just don't use alloca.  */
237 #include <malloc.h>
238 #endif
239 #else /* not MSDOS, or __TURBOC__ */
240 #if defined(_AIX)
241 /* I don't know what this was needed for, but it pollutes the namespace.
242    So I turned it off.   rms, 2 May 1997.  */
243 /* #include <malloc.h>  */
244  #pragma alloca
245 #define YYSTACK_USE_ALLOCA
246 #else /* not MSDOS, or __TURBOC__, or _AIX */
247 #if 0
248 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
249                  and on HPUX 10.  Eventually we can turn this on.  */
250 #define YYSTACK_USE_ALLOCA
251 #define alloca __builtin_alloca
252 #endif /* __hpux */
253 #endif
254 #endif /* not _AIX */
255 #endif /* not MSDOS, or __TURBOC__ */
256 #endif /* not sparc */
257 #endif /* not GNU C */
258 #endif /* alloca not defined */
259 #endif /* YYSTACK_USE_ALLOCA not defined */
260
261 #ifdef YYSTACK_USE_ALLOCA
262 #define YYSTACK_ALLOC alloca
263 #else
264 #define YYSTACK_ALLOC malloc
265 #endif
266
267 /* Note: there must be only one dollar sign in this file.
268    It is replaced by the list of actions, each action
269    as one case of the switch.  */
270
271 #define yyerrok         (yyerrstatus = 0)
272 #define yyclearin       (yychar = YYEMPTY)
273 #define YYEMPTY         -2
274 #define YYEOF           0
275 #define YYACCEPT        goto yyacceptlab
276 #define YYABORT         goto yyabortlab
277 #define YYERROR         goto yyerrlab1
278 /* Like YYERROR except do call yyerror.
279    This remains here temporarily to ease the
280    transition to the new meaning of YYERROR, for GCC.
281    Once GCC version 2 has supplanted version 1, this can go.  */
282 #define YYFAIL          goto yyerrlab
283 #define YYRECOVERING()  (!!yyerrstatus)
284 #define YYBACKUP(token, value) \
285 do                                                              \
286   if (yychar == YYEMPTY && yylen == 1)                          \
287     { yychar = (token), yylval = (value);                       \
288       yychar1 = YYTRANSLATE (yychar);                           \
289       YYPOPSTACK;                                               \
290       goto yybackup;                                            \
291     }                                                           \
292   else                                                          \
293     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
294 while (0)
295
296 #define YYTERROR        1
297 #define YYERRCODE       256
298
299 #ifndef YYPURE
300 #define YYLEX           yylex()
301 #endif
302
303 #ifdef YYPURE
304 #ifdef YYLSP_NEEDED
305 #ifdef YYLEX_PARAM
306 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
307 #else
308 #define YYLEX           yylex(&yylval, &yylloc)
309 #endif
310 #else /* not YYLSP_NEEDED */
311 #ifdef YYLEX_PARAM
312 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
313 #else
314 #define YYLEX           yylex(&yylval)
315 #endif
316 #endif /* not YYLSP_NEEDED */
317 #endif
318
319 /* If nonreentrant, generate the variables here */
320
321 #ifndef YYPURE
322
323 int     yychar;                 /*  the lookahead symbol                */
324 YYSTYPE yylval;                 /*  the semantic value of the           */
325                                 /*  lookahead symbol                    */
326
327 #ifdef YYLSP_NEEDED
328 YYLTYPE yylloc;                 /*  location data for the lookahead     */
329                                 /*  symbol                              */
330 #endif
331
332 int yynerrs;                    /*  number of parse errors so far       */
333 #endif  /* not YYPURE */
334
335 #if YYDEBUG != 0
336 int yydebug;                    /*  nonzero means print parse trace     */
337 /* Since this is uninitialized, it does not stop multiple parsers
338    from coexisting.  */
339 #endif
340
341 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
342
343 #ifndef YYINITDEPTH
344 #define YYINITDEPTH 200
345 #endif
346
347 /*  YYMAXDEPTH is the maximum size the stacks can grow to
348     (effective only if the built-in stack extension method is used).  */
349
350 #if YYMAXDEPTH == 0
351 #undef YYMAXDEPTH
352 #endif
353
354 #ifndef YYMAXDEPTH
355 #define YYMAXDEPTH 10000
356 #endif
357 \f
358 /* Define __yy_memcpy.  Note that the size argument
359    should be passed with type unsigned int, because that is what the non-GCC
360    definitions require.  With GCC, __builtin_memcpy takes an arg
361    of type size_t, but it can handle unsigned int.  */
362
363 #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
364 #define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)
365 #else                           /* not GNU C or C++ */
366 #ifndef __cplusplus
367
368 /* This is the most reliable way to avoid incompatibilities
369    in available built-in functions on various systems.  */
370 static void
371 __yy_memcpy (to, from, count)
372      char *to;
373      char *from;
374      unsigned int count;
375 {
376   register char *f = from;
377   register char *t = to;
378   register int i = count;
379
380   while (i-- > 0)
381     *t++ = *f++;
382 }
383
384 #else /* __cplusplus */
385
386 /* This is the most reliable way to avoid incompatibilities
387    in available built-in functions on various systems.  */
388 static void
389 __yy_memcpy (char *to, char *from, unsigned int count)
390 {
391   register char *t = to;
392   register char *f = from;
393   register int i = count;
394
395   while (i-- > 0)
396     *t++ = *f++;
397 }
398
399 #endif
400 #endif
401 \f
402 #line 217 "/usr/share/misc/bison.simple"
403
404 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
405    into yyparse.  The argument should have type void *.
406    It should actually point to an object.
407    Grammar actions can access the variable by casting it
408    to the proper pointer type.  */
409
410 #ifdef YYPARSE_PARAM
411 #ifdef __cplusplus
412 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
413 #define YYPARSE_PARAM_DECL
414 #else /* not __cplusplus */
415 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
416 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
417 #endif /* not __cplusplus */
418 #else /* not YYPARSE_PARAM */
419 #define YYPARSE_PARAM_ARG
420 #define YYPARSE_PARAM_DECL
421 #endif /* not YYPARSE_PARAM */
422
423 /* Prevent warning if -Wstrict-prototypes.  */
424 #ifdef __GNUC__
425 #ifdef YYPARSE_PARAM
426 int yyparse (void *);
427 #else
428 int yyparse (void);
429 #endif
430 #endif
431
432 int
433 yyparse(YYPARSE_PARAM_ARG)
434      YYPARSE_PARAM_DECL
435 {
436   register int yystate;
437   register int yyn;
438   register short *yyssp;
439   register YYSTYPE *yyvsp;
440   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
441   int yychar1 = 0;              /*  lookahead token as an internal (translated) token number */
442
443   short yyssa[YYINITDEPTH];     /*  the state stack                     */
444   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
445
446   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
447   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
448
449 #ifdef YYLSP_NEEDED
450   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
451   YYLTYPE *yyls = yylsa;
452   YYLTYPE *yylsp;
453
454 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
455 #else
456 #define YYPOPSTACK   (yyvsp--, yyssp--)
457 #endif
458
459   int yystacksize = YYINITDEPTH;
460   int yyfree_stacks = 0;
461
462 #ifdef YYPURE
463   int yychar;
464   YYSTYPE yylval;
465   int yynerrs;
466 #ifdef YYLSP_NEEDED
467   YYLTYPE yylloc;
468 #endif
469 #endif
470
471   YYSTYPE yyval;                /*  the variable used to return         */
472                                 /*  semantic values from the action     */
473                                 /*  routines                            */
474
475   int yylen;
476
477 #if YYDEBUG != 0
478   if (yydebug)
479     fprintf(stderr, "Starting parse\n");
480 #endif
481
482   yystate = 0;
483   yyerrstatus = 0;
484   yynerrs = 0;
485   yychar = YYEMPTY;             /* Cause a token to be read.  */
486
487   /* Initialize stack pointers.
488      Waste one element of value and location stack
489      so that they stay on the same level as the state stack.
490      The wasted elements are never initialized.  */
491
492   yyssp = yyss - 1;
493   yyvsp = yyvs;
494 #ifdef YYLSP_NEEDED
495   yylsp = yyls;
496 #endif
497
498 /* Push a new state, which is found in  yystate  .  */
499 /* In all cases, when you get here, the value and location stacks
500    have just been pushed. so pushing a state here evens the stacks.  */
501 yynewstate:
502
503   *++yyssp = yystate;
504
505   if (yyssp >= yyss + yystacksize - 1)
506     {
507       /* Give user a chance to reallocate the stack */
508       /* Use copies of these so that the &'s don't force the real ones into memory. */
509       YYSTYPE *yyvs1 = yyvs;
510       short *yyss1 = yyss;
511 #ifdef YYLSP_NEEDED
512       YYLTYPE *yyls1 = yyls;
513 #endif
514
515       /* Get the current used size of the three stacks, in elements.  */
516       int size = yyssp - yyss + 1;
517
518 #ifdef yyoverflow
519       /* Each stack pointer address is followed by the size of
520          the data in use in that stack, in bytes.  */
521 #ifdef YYLSP_NEEDED
522       /* This used to be a conditional around just the two extra args,
523          but that might be undefined if yyoverflow is a macro.  */
524       yyoverflow("parser stack overflow",
525                  &yyss1, size * sizeof (*yyssp),
526                  &yyvs1, size * sizeof (*yyvsp),
527                  &yyls1, size * sizeof (*yylsp),
528                  &yystacksize);
529 #else
530       yyoverflow("parser stack overflow",
531                  &yyss1, size * sizeof (*yyssp),
532                  &yyvs1, size * sizeof (*yyvsp),
533                  &yystacksize);
534 #endif
535
536       yyss = yyss1; yyvs = yyvs1;
537 #ifdef YYLSP_NEEDED
538       yyls = yyls1;
539 #endif
540 #else /* no yyoverflow */
541       /* Extend the stack our own way.  */
542       if (yystacksize >= YYMAXDEPTH)
543         {
544           yyerror("parser stack overflow");
545           if (yyfree_stacks)
546             {
547               free (yyss);
548               free (yyvs);
549 #ifdef YYLSP_NEEDED
550               free (yyls);
551 #endif
552             }
553           return 2;
554         }
555       yystacksize *= 2;
556       if (yystacksize > YYMAXDEPTH)
557         yystacksize = YYMAXDEPTH;
558 #ifndef YYSTACK_USE_ALLOCA
559       yyfree_stacks = 1;
560 #endif
561       yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
562       __yy_memcpy ((char *)yyss, (char *)yyss1,
563                    size * (unsigned int) sizeof (*yyssp));
564       yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
565       __yy_memcpy ((char *)yyvs, (char *)yyvs1,
566                    size * (unsigned int) sizeof (*yyvsp));
567 #ifdef YYLSP_NEEDED
568       yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
569       __yy_memcpy ((char *)yyls, (char *)yyls1,
570                    size * (unsigned int) sizeof (*yylsp));
571 #endif
572 #endif /* no yyoverflow */
573
574       yyssp = yyss + size - 1;
575       yyvsp = yyvs + size - 1;
576 #ifdef YYLSP_NEEDED
577       yylsp = yyls + size - 1;
578 #endif
579
580 #if YYDEBUG != 0
581       if (yydebug)
582         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
583 #endif
584
585       if (yyssp >= yyss + yystacksize - 1)
586         YYABORT;
587     }
588
589 #if YYDEBUG != 0
590   if (yydebug)
591     fprintf(stderr, "Entering state %d\n", yystate);
592 #endif
593
594   goto yybackup;
595  yybackup:
596
597 /* Do appropriate processing given the current state.  */
598 /* Read a lookahead token if we need one and don't already have one.  */
599 /* yyresume: */
600
601   /* First try to decide what to do without reference to lookahead token.  */
602
603   yyn = yypact[yystate];
604   if (yyn == YYFLAG)
605     goto yydefault;
606
607   /* Not known => get a lookahead token if don't already have one.  */
608
609   /* yychar is either YYEMPTY or YYEOF
610      or a valid token in external form.  */
611
612   if (yychar == YYEMPTY)
613     {
614 #if YYDEBUG != 0
615       if (yydebug)
616         fprintf(stderr, "Reading a token: ");
617 #endif
618       yychar = YYLEX;
619     }
620
621   /* Convert token to internal form (in yychar1) for indexing tables with */
622
623   if (yychar <= 0)              /* This means end of input. */
624     {
625       yychar1 = 0;
626       yychar = YYEOF;           /* Don't call YYLEX any more */
627
628 #if YYDEBUG != 0
629       if (yydebug)
630         fprintf(stderr, "Now at end of input.\n");
631 #endif
632     }
633   else
634     {
635       yychar1 = YYTRANSLATE(yychar);
636
637 #if YYDEBUG != 0
638       if (yydebug)
639         {
640           fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
641           /* Give the individual parser a way to print the precise meaning
642              of a token, for further debugging info.  */
643 #ifdef YYPRINT
644           YYPRINT (stderr, yychar, yylval);
645 #endif
646           fprintf (stderr, ")\n");
647         }
648 #endif
649     }
650
651   yyn += yychar1;
652   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
653     goto yydefault;
654
655   yyn = yytable[yyn];
656
657   /* yyn is what to do for this token type in this state.
658      Negative => reduce, -yyn is rule number.
659      Positive => shift, yyn is new state.
660        New state is final state => don't bother to shift,
661        just return success.
662      0, or most negative number => error.  */
663
664   if (yyn < 0)
665     {
666       if (yyn == YYFLAG)
667         goto yyerrlab;
668       yyn = -yyn;
669       goto yyreduce;
670     }
671   else if (yyn == 0)
672     goto yyerrlab;
673
674   if (yyn == YYFINAL)
675     YYACCEPT;
676
677   /* Shift the lookahead token.  */
678
679 #if YYDEBUG != 0
680   if (yydebug)
681     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
682 #endif
683
684   /* Discard the token being shifted unless it is eof.  */
685   if (yychar != YYEOF)
686     yychar = YYEMPTY;
687
688   *++yyvsp = yylval;
689 #ifdef YYLSP_NEEDED
690   *++yylsp = yylloc;
691 #endif
692
693   /* count tokens shifted since error; after three, turn off error status.  */
694   if (yyerrstatus) yyerrstatus--;
695
696   yystate = yyn;
697   goto yynewstate;
698
699 /* Do the default action for the current state.  */
700 yydefault:
701
702   yyn = yydefact[yystate];
703   if (yyn == 0)
704     goto yyerrlab;
705
706 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
707 yyreduce:
708   yylen = yyr2[yyn];
709   if (yylen > 0)
710     yyval = yyvsp[1-yylen]; /* implement default value of the action */
711
712 #if YYDEBUG != 0
713   if (yydebug)
714     {
715       int i;
716
717       fprintf (stderr, "Reducing via rule %d (line %d), ",
718                yyn, yyrline[yyn]);
719
720       /* Print the symbols being reduced, and their result.  */
721       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
722         fprintf (stderr, "%s ", yytname[yyrhs[i]]);
723       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
724     }
725 #endif
726
727
728   switch (yyn) {
729
730 case 6:
731 #line 42 "epist.y"
732 {
733         ((parser*)parser_obj)->setAction(yyvsp[-2]);
734         ((parser*)parser_obj)->endAction();
735     ;
736     break;}
737 case 7:
738 #line 51 "epist.y"
739 {
740         ((parser*)parser_obj)->endChain();
741     ;
742     break;}
743 case 10:
744 #line 65 "epist.y"
745 { ((parser*)parser_obj)->startChain(); ;
746     break;}
747 case 11:
748 #line 69 "epist.y"
749 { /* ((parser*)parser_obj)->endChain(); */ ;
750     break;}
751 case 13:
752 #line 73 "epist.y"
753 { ((parser*)parser_obj)->addModifier(yyvsp[-2]); ;
754     break;}
755 case 14:
756 #line 77 "epist.y"
757 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
758     break;}
759 case 15:
760 #line 78 "epist.y"
761 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
762     break;}
763 case 16:
764 #line 79 "epist.y"
765 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
766     break;}
767 case 17:
768 #line 80 "epist.y"
769 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
770     break;}
771 case 18:
772 #line 81 "epist.y"
773 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
774     break;}
775 case 19:
776 #line 82 "epist.y"
777 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
778     break;}
779 case 21:
780 #line 86 "epist.y"
781 { ((parser*)parser_obj)->setArgumentNum(yyvsp[0]); ;
782     break;}
783 case 22:
784 #line 87 "epist.y"
785 { ((parser*)parser_obj)->setArgumentNegNum(yyvsp[0]); ;
786     break;}
787 case 23:
788 #line 88 "epist.y"
789 { ((parser*)parser_obj)->setArgumentStr(yyvsp[0]); ;
790     break;}
791 case 24:
792 #line 89 "epist.y"
793 { ((parser*)parser_obj)->setArgumentTrue(yyvsp[0]); ;
794     break;}
795 case 25:
796 #line 90 "epist.y"
797 { ((parser*)parser_obj)->setArgumentFalse(yyvsp[0]); ;
798     break;}
799 case 29:
800 #line 103 "epist.y"
801 { ((parser*)parser_obj)->setOption(yyvsp[-2]); ;
802     break;}
803 }
804    /* the action file gets copied in in place of this dollarsign */
805 #line 543 "/usr/share/misc/bison.simple"
806 \f
807   yyvsp -= yylen;
808   yyssp -= yylen;
809 #ifdef YYLSP_NEEDED
810   yylsp -= yylen;
811 #endif
812
813 #if YYDEBUG != 0
814   if (yydebug)
815     {
816       short *ssp1 = yyss - 1;
817       fprintf (stderr, "state stack now");
818       while (ssp1 != yyssp)
819         fprintf (stderr, " %d", *++ssp1);
820       fprintf (stderr, "\n");
821     }
822 #endif
823
824   *++yyvsp = yyval;
825
826 #ifdef YYLSP_NEEDED
827   yylsp++;
828   if (yylen == 0)
829     {
830       yylsp->first_line = yylloc.first_line;
831       yylsp->first_column = yylloc.first_column;
832       yylsp->last_line = (yylsp-1)->last_line;
833       yylsp->last_column = (yylsp-1)->last_column;
834       yylsp->text = 0;
835     }
836   else
837     {
838       yylsp->last_line = (yylsp+yylen-1)->last_line;
839       yylsp->last_column = (yylsp+yylen-1)->last_column;
840     }
841 #endif
842
843   /* Now "shift" the result of the reduction.
844      Determine what state that goes to,
845      based on the state we popped back to
846      and the rule number reduced by.  */
847
848   yyn = yyr1[yyn];
849
850   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
851   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
852     yystate = yytable[yystate];
853   else
854     yystate = yydefgoto[yyn - YYNTBASE];
855
856   goto yynewstate;
857
858 yyerrlab:   /* here on detecting error */
859
860   if (! yyerrstatus)
861     /* If not already recovering from an error, report this error.  */
862     {
863       ++yynerrs;
864
865 #ifdef YYERROR_VERBOSE
866       yyn = yypact[yystate];
867
868       if (yyn > YYFLAG && yyn < YYLAST)
869         {
870           int size = 0;
871           char *msg;
872           int x, count;
873
874           count = 0;
875           /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
876           for (x = (yyn < 0 ? -yyn : 0);
877                x < (sizeof(yytname) / sizeof(char *)); x++)
878             if (yycheck[x + yyn] == x)
879               size += strlen(yytname[x]) + 15, count++;
880           msg = (char *) malloc(size + 15);
881           if (msg != 0)
882             {
883               strcpy(msg, "parse error");
884
885               if (count < 5)
886                 {
887                   count = 0;
888                   for (x = (yyn < 0 ? -yyn : 0);
889                        x < (sizeof(yytname) / sizeof(char *)); x++)
890                     if (yycheck[x + yyn] == x)
891                       {
892                         strcat(msg, count == 0 ? ", expecting `" : " or `");
893                         strcat(msg, yytname[x]);
894                         strcat(msg, "'");
895                         count++;
896                       }
897                 }
898               yyerror(msg);
899               free(msg);
900             }
901           else
902             yyerror ("parse error; also virtual memory exceeded");
903         }
904       else
905 #endif /* YYERROR_VERBOSE */
906         yyerror("parse error");
907     }
908
909   goto yyerrlab1;
910 yyerrlab1:   /* here on error raised explicitly by an action */
911
912   if (yyerrstatus == 3)
913     {
914       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
915
916       /* return failure if at end of input */
917       if (yychar == YYEOF)
918         YYABORT;
919
920 #if YYDEBUG != 0
921       if (yydebug)
922         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
923 #endif
924
925       yychar = YYEMPTY;
926     }
927
928   /* Else will try to reuse lookahead token
929      after shifting the error token.  */
930
931   yyerrstatus = 3;              /* Each real token shifted decrements this */
932
933   goto yyerrhandle;
934
935 yyerrdefault:  /* current state does not do anything special for the error token. */
936
937 #if 0
938   /* This is wrong; only states that explicitly want error tokens
939      should shift them.  */
940   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
941   if (yyn) goto yydefault;
942 #endif
943
944 yyerrpop:   /* pop the current state because it cannot handle the error token */
945
946   if (yyssp == yyss) YYABORT;
947   yyvsp--;
948   yystate = *--yyssp;
949 #ifdef YYLSP_NEEDED
950   yylsp--;
951 #endif
952
953 #if YYDEBUG != 0
954   if (yydebug)
955     {
956       short *ssp1 = yyss - 1;
957       fprintf (stderr, "Error: state stack now");
958       while (ssp1 != yyssp)
959         fprintf (stderr, " %d", *++ssp1);
960       fprintf (stderr, "\n");
961     }
962 #endif
963
964 yyerrhandle:
965
966   yyn = yypact[yystate];
967   if (yyn == YYFLAG)
968     goto yyerrdefault;
969
970   yyn += YYTERROR;
971   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
972     goto yyerrdefault;
973
974   yyn = yytable[yyn];
975   if (yyn < 0)
976     {
977       if (yyn == YYFLAG)
978         goto yyerrpop;
979       yyn = -yyn;
980       goto yyreduce;
981     }
982   else if (yyn == 0)
983     goto yyerrpop;
984
985   if (yyn == YYFINAL)
986     YYACCEPT;
987
988 #if YYDEBUG != 0
989   if (yydebug)
990     fprintf(stderr, "Shifting error token, ");
991 #endif
992
993   *++yyvsp = yylval;
994 #ifdef YYLSP_NEEDED
995   *++yylsp = yylloc;
996 #endif
997
998   yystate = yyn;
999   goto yynewstate;
1000
1001  yyacceptlab:
1002   /* YYACCEPT comes here.  */
1003   if (yyfree_stacks)
1004     {
1005       free (yyss);
1006       free (yyvs);
1007 #ifdef YYLSP_NEEDED
1008       free (yyls);
1009 #endif
1010     }
1011   return 0;
1012
1013  yyabortlab:
1014   /* YYABORT comes here.  */
1015   if (yyfree_stacks)
1016     {
1017       free (yyss);
1018       free (yyvs);
1019 #ifdef YYLSP_NEEDED
1020       free (yyls);
1021 #endif
1022     }
1023   return 1;
1024 }
1025 #line 106 "epist.y"
1026
1027