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