]> Dogcows Code - chaz/openbox/blob - util/epist/yacc_parser.cc
uber patch.
[chaz/openbox] / util / epist / yacc_parser.cc
1 /* A Bison parser, made from epist.y
2 by GNU bison 1.34. */
3
4 #define YYBISON 1 /* Identify Bison output. */
5
6 # define OBRACE 257
7 # define EBRACE 258
8 # define SEMICOLON 259
9 # define DASH 260
10 # define NUMBER 261
11 # define QUOTES 262
12 # define WORD 263
13 # define BINDING 264
14 # define OPTIONS 265
15
16 #line 1 "epist.y"
17
18 #include <stdio.h>
19 #include <string.h>
20 #include "parser.hh"
21
22 #define YYPARSE_PARAM parser_obj
23 #define YYSTYPE char*
24
25 extern "C" {
26 int yylex();
27 int yywrap() {
28 return 1;
29 }
30 }
31
32 void yyerror(const char *c) {
33 printf("ERROR: %s\n", c);
34 }
35
36
37 #ifndef YYSTYPE
38 #define YYSTYPE int
39 #endif
40 #ifndef YYDEBUG
41 # define YYDEBUG 0
42 #endif
43
44
45
46 #define YYFINAL 40
47 #define YYFLAG -32768
48 #define YYNTBASE 12
49
50 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
51 #define YYTRANSLATE(x) ((unsigned)(x) <= 265 ? yytranslate[x] : 26)
52
53 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
54 static const char yytranslate[] =
55 {
56 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
57 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
58 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
59 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
60 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
61 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
62 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
63 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
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, 1, 3, 4, 5,
82 6, 7, 8, 9, 10, 11
83 };
84
85 #if YYDEBUG
86 static const short yyprhs[] =
87 {
88 0, 0, 1, 4, 7, 9, 11, 16, 21, 26,
89 29, 31, 33, 34, 38, 40, 42, 44, 46, 48,
90 50, 51, 53, 56, 58, 60, 61, 64
91 };
92 static const short yyrhs[] =
93 {
94 -1, 12, 13, 0, 12, 16, 0, 14, 0, 15,
95 0, 17, 9, 22, 5, 0, 17, 18, 12, 19,
96 0, 23, 3, 24, 4, 0, 20, 21, 0, 3,
97 0, 4, 0, 0, 10, 6, 20, 0, 3, 0,
98 4, 0, 6, 0, 5, 0, 7, 0, 9, 0,
99 0, 7, 0, 6, 7, 0, 8, 0, 11, 0,
100 0, 24, 25, 0, 9, 22, 5, 0
101 };
102
103 #endif
104
105 #if YYDEBUG
106 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
107 static const short yyrline[] =
108 {
109 0, 27, 28, 29, 32, 33, 36, 45, 52, 56,
110 60, 64, 68, 69, 72, 74, 75, 76, 77, 78,
111 81, 82, 83, 84, 87, 91, 92, 95
112 };
113 #endif
114
115
116 #if (YYDEBUG) || defined YYERROR_VERBOSE
117
118 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
119 static const char *const yytname[] =
120 {
121 "$", "error", "$undefined.", "OBRACE", "EBRACE", "SEMICOLON", "DASH",
122 "NUMBER", "QUOTES", "WORD", "BINDING", "OPTIONS", "commands", "command",
123 "action_command", "chain_command", "options_block", "binding", "obrace",
124 "ebrace", "binding_w_modifier", "bind_key", "parameter",
125 "options_keyword", "options", "option", 0
126 };
127 #endif
128
129 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
130 static const short yyr1[] =
131 {
132 0, 12, 12, 12, 13, 13, 14, 15, 16, 17,
133 18, 19, 20, 20, 21, 21, 21, 21, 21, 21,
134 22, 22, 22, 22, 23, 24, 24, 25
135 };
136
137 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
138 static const short yyr2[] =
139 {
140 0, 0, 2, 2, 1, 1, 4, 4, 4, 2,
141 1, 1, 0, 3, 1, 1, 1, 1, 1, 1,
142 0, 1, 2, 1, 1, 0, 2, 3
143 };
144
145 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
146 doesn't specify something else to do. Zero means the default is an
147 error. */
148 static const short yydefact[] =
149 {
150 1, 12, 0, 24, 2, 4, 5, 3, 0, 0,
151 0, 12, 10, 20, 1, 14, 15, 17, 16, 18,
152 19, 9, 25, 13, 0, 21, 23, 0, 12, 0,
153 22, 6, 11, 7, 8, 20, 26, 0, 27, 0,
154 0
155 };
156
157 static const short yydefgoto[] =
158 {
159 1, 4, 5, 6, 7, 8, 14, 33, 9, 21,
160 27, 10, 29, 36
161 };
162
163 static const short yypact[] =
164 {
165 -32768, 0, -1,-32768,-32768,-32768,-32768,-32768, 14, 9,
166 3, 10,-32768, -4,-32768,-32768,-32768,-32768,-32768,-32768,
167 -32768,-32768,-32768,-32768, 2,-32768,-32768, 16, -3, 15,
168 -32768,-32768,-32768,-32768,-32768, -4,-32768, 17,-32768, 25,
169 -32768
170 };
171
172 static const short yypgoto[] =
173 {
174 12,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 18,-32768,
175 -8,-32768,-32768,-32768
176 };
177
178
179 #define YYLAST 29
180
181
182 static const short yytable[] =
183 {
184 39, 32, 24, 25, 26, 11, 22, 2, 3, 30,
185 2, 3, 15, 16, 17, 18, 19, 12, 20, 34,
186 2, 31, 38, 13, 35, 40, 28, 37, 0, 23
187 };
188
189 static const short yycheck[] =
190 {
191 0, 4, 6, 7, 8, 6, 3, 10, 11, 7,
192 10, 11, 3, 4, 5, 6, 7, 3, 9, 4,
193 10, 5, 5, 9, 9, 0, 14, 35, -1, 11
194 };
195 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
196 #line 3 "/usr/share/bison/bison.simple"
197
198 /* Skeleton output parser for bison,
199
200 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
201 Foundation, Inc.
202
203 This program is free software; you can redistribute it and/or modify
204 it under the terms of the GNU General Public License as published by
205 the Free Software Foundation; either version 2, or (at your option)
206 any later version.
207
208 This program is distributed in the hope that it will be useful,
209 but WITHOUT ANY WARRANTY; without even the implied warranty of
210 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
211 GNU General Public License for more details.
212
213 You should have received a copy of the GNU General Public License
214 along with this program; if not, write to the Free Software
215 Foundation, Inc., 59 Temple Place - Suite 330,
216 Boston, MA 02111-1307, USA. */
217
218 /* As a special exception, when this file is copied by Bison into a
219 Bison output file, you may use that output file without restriction.
220 This special exception was added by the Free Software Foundation
221 in version 1.24 of Bison. */
222
223 /* This is the parser code that is written into each bison parser when
224 the %semantic_parser declaration is not specified in the grammar.
225 It was written by Richard Stallman by simplifying the hairy parser
226 used when %semantic_parser is specified. */
227
228 /* All symbols defined below should begin with yy or YY, to avoid
229 infringing on user name space. This should be done even for local
230 variables, as they might otherwise be expanded by user macros.
231 There are some unavoidable exceptions within include files to
232 define necessary library symbols; they are noted "INFRINGES ON
233 USER NAME SPACE" below. */
234
235 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
236
237 /* The parser invokes alloca or malloc; define the necessary symbols. */
238
239 # if YYSTACK_USE_ALLOCA
240 # define YYSTACK_ALLOC alloca
241 # else
242 # ifndef YYSTACK_USE_ALLOCA
243 # if defined (alloca) || defined (_ALLOCA_H)
244 # define YYSTACK_ALLOC alloca
245 # else
246 # ifdef __GNUC__
247 # define YYSTACK_ALLOC __builtin_alloca
248 # endif
249 # endif
250 # endif
251 # endif
252
253 # ifdef YYSTACK_ALLOC
254 /* Pacify GCC's `empty if-body' warning. */
255 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
256 # else
257 # if defined (__STDC__) || defined (__cplusplus)
258 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
259 # define YYSIZE_T size_t
260 # endif
261 # define YYSTACK_ALLOC malloc
262 # define YYSTACK_FREE free
263 # endif
264
265 /* A type that is properly aligned for any stack member. */
266 union yyalloc
267 {
268 short yyss;
269 YYSTYPE yyvs;
270 # if YYLSP_NEEDED
271 YYLTYPE yyls;
272 # endif
273 };
274
275 /* The size of the maximum gap between one aligned stack and the next. */
276 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
277
278 /* The size of an array large to enough to hold all stacks, each with
279 N elements. */
280 # if YYLSP_NEEDED
281 # define YYSTACK_BYTES(N) \
282 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
283 + 2 * YYSTACK_GAP_MAX)
284 # else
285 # define YYSTACK_BYTES(N) \
286 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
287 + YYSTACK_GAP_MAX)
288 # endif
289
290 /* Relocate the TYPE STACK from its old location to the new one. The
291 local variables YYSIZE and YYSTACKSIZE give the old and new number of
292 elements in the stack, and YYPTR gives the new location of the
293 stack. Advance YYPTR to a properly aligned location for the next
294 stack. */
295 # define YYSTACK_RELOCATE(Type, Stack) \
296 do \
297 { \
298 YYSIZE_T yynewbytes; \
299 yymemcpy ((char *) yyptr, (char *) (Stack), \
300 yysize * (YYSIZE_T) sizeof (Type)); \
301 Stack = &yyptr->Stack; \
302 yynewbytes = yystacksize * sizeof (Type) + YYSTACK_GAP_MAX; \
303 yyptr += yynewbytes / sizeof (*yyptr); \
304 } \
305 while (0)
306
307 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
308
309
310 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
311 # define YYSIZE_T __SIZE_TYPE__
312 #endif
313 #if ! defined (YYSIZE_T) && defined (size_t)
314 # define YYSIZE_T size_t
315 #endif
316 #if ! defined (YYSIZE_T)
317 # if defined (__STDC__) || defined (__cplusplus)
318 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
319 # define YYSIZE_T size_t
320 # endif
321 #endif
322 #if ! defined (YYSIZE_T)
323 # define YYSIZE_T unsigned int
324 #endif
325
326 #define yyerrok (yyerrstatus = 0)
327 #define yyclearin (yychar = YYEMPTY)
328 #define YYEMPTY -2
329 #define YYEOF 0
330 #define YYACCEPT goto yyacceptlab
331 #define YYABORT goto yyabortlab
332 #define YYERROR goto yyerrlab1
333 /* Like YYERROR except do call yyerror. This remains here temporarily
334 to ease the transition to the new meaning of YYERROR, for GCC.
335 Once GCC version 2 has supplanted version 1, this can go. */
336 #define YYFAIL goto yyerrlab
337 #define YYRECOVERING() (!!yyerrstatus)
338 #define YYBACKUP(Token, Value) \
339 do \
340 if (yychar == YYEMPTY && yylen == 1) \
341 { \
342 yychar = (Token); \
343 yylval = (Value); \
344 yychar1 = YYTRANSLATE (yychar); \
345 YYPOPSTACK; \
346 goto yybackup; \
347 } \
348 else \
349 { \
350 yyerror ("syntax error: cannot back up"); \
351 YYERROR; \
352 } \
353 while (0)
354
355 #define YYTERROR 1
356 #define YYERRCODE 256
357
358
359 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
360 are run).
361
362 When YYLLOC_DEFAULT is run, CURRENT is set the location of the
363 first token. By default, to implement support for ranges, extend
364 its range to the last symbol. */
365
366 #ifndef YYLLOC_DEFAULT
367 # define YYLLOC_DEFAULT(Current, Rhs, N) \
368 Current.last_line = Rhs[N].last_line; \
369 Current.last_column = Rhs[N].last_column;
370 #endif
371
372
373 /* YYLEX -- calling `yylex' with the right arguments. */
374
375 #if YYPURE
376 # if YYLSP_NEEDED
377 # ifdef YYLEX_PARAM
378 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
379 # else
380 # define YYLEX yylex (&yylval, &yylloc)
381 # endif
382 # else /* !YYLSP_NEEDED */
383 # ifdef YYLEX_PARAM
384 # define YYLEX yylex (&yylval, YYLEX_PARAM)
385 # else
386 # define YYLEX yylex (&yylval)
387 # endif
388 # endif /* !YYLSP_NEEDED */
389 #else /* !YYPURE */
390 # define YYLEX yylex ()
391 #endif /* !YYPURE */
392
393
394 /* Enable debugging if requested. */
395 #if YYDEBUG
396
397 # ifndef YYFPRINTF
398 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
399 # define YYFPRINTF fprintf
400 # endif
401
402 # define YYDPRINTF(Args) \
403 do { \
404 if (yydebug) \
405 YYFPRINTF Args; \
406 } while (0)
407 /* Nonzero means print parse trace. It is left uninitialized so that
408 multiple parsers can coexist. */
409 int yydebug;
410 #else /* !YYDEBUG */
411 # define YYDPRINTF(Args)
412 #endif /* !YYDEBUG */
413
414 /* YYINITDEPTH -- initial size of the parser's stacks. */
415 #ifndef YYINITDEPTH
416 # define YYINITDEPTH 200
417 #endif
418
419 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
420 if the built-in stack extension method is used).
421
422 Do not make this value too large; the results are undefined if
423 SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
424 evaluated with infinite-precision integer arithmetic. */
425
426 #if YYMAXDEPTH == 0
427 # undef YYMAXDEPTH
428 #endif
429
430 #ifndef YYMAXDEPTH
431 # define YYMAXDEPTH 10000
432 #endif
433 \f
434 #if ! defined (yyoverflow) && ! defined (yymemcpy)
435 # if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
436 # define yymemcpy __builtin_memcpy
437 # else /* not GNU C or C++ */
438
439 /* This is the most reliable way to avoid incompatibilities
440 in available built-in functions on various systems. */
441 static void
442 # if defined (__STDC__) || defined (__cplusplus)
443 yymemcpy (char *yyto, const char *yyfrom, YYSIZE_T yycount)
444 # else
445 yymemcpy (yyto, yyfrom, yycount)
446 char *yyto;
447 const char *yyfrom;
448 YYSIZE_T yycount;
449 # endif
450 {
451 register const char *yyf = yyfrom;
452 register char *yyt = yyto;
453 register YYSIZE_T yyi = yycount;
454
455 while (yyi-- != 0)
456 *yyt++ = *yyf++;
457 }
458 # endif
459 #endif
460
461 #ifdef YYERROR_VERBOSE
462
463 # ifndef yystrlen
464 # if defined (__GLIBC__) && defined (_STRING_H)
465 # define yystrlen strlen
466 # else
467 /* Return the length of YYSTR. */
468 static YYSIZE_T
469 # if defined (__STDC__) || defined (__cplusplus)
470 yystrlen (const char *yystr)
471 # else
472 yystrlen (yystr)
473 const char *yystr;
474 # endif
475 {
476 register const char *yys = yystr;
477
478 while (*yys++ != '\0')
479 continue;
480
481 return yys - yystr - 1;
482 }
483 # endif
484 # endif
485
486 # ifndef yystpcpy
487 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
488 # define yystpcpy stpcpy
489 # else
490 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
491 YYDEST. */
492 static char *
493 # if defined (__STDC__) || defined (__cplusplus)
494 yystpcpy (char *yydest, const char *yysrc)
495 # else
496 yystpcpy (yydest, yysrc)
497 char *yydest;
498 const char *yysrc;
499 # endif
500 {
501 register char *yyd = yydest;
502 register const char *yys = yysrc;
503
504 while ((*yyd++ = *yys++) != '\0')
505 continue;
506
507 return yyd - 1;
508 }
509 # endif
510 # endif
511 #endif
512 \f
513 #line 319 "/usr/share/bison/bison.simple"
514
515
516 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
517 into yyparse. The argument should have type void *.
518 It should actually point to an object.
519 Grammar actions can access the variable by casting it
520 to the proper pointer type. */
521
522 #ifdef YYPARSE_PARAM
523 # if defined (__STDC__) || defined (__cplusplus)
524 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
525 # define YYPARSE_PARAM_DECL
526 # else
527 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
528 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
529 # endif
530 #else /* !YYPARSE_PARAM */
531 # define YYPARSE_PARAM_ARG
532 # define YYPARSE_PARAM_DECL
533 #endif /* !YYPARSE_PARAM */
534
535 /* Prevent warning if -Wstrict-prototypes. */
536 #ifdef __GNUC__
537 # ifdef YYPARSE_PARAM
538 int yyparse (void *);
539 # else
540 int yyparse (void);
541 # endif
542 #endif
543
544 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
545 variables are global, or local to YYPARSE. */
546
547 #define YY_DECL_NON_LSP_VARIABLES \
548 /* The lookahead symbol. */ \
549 int yychar; \
550 \
551 /* The semantic value of the lookahead symbol. */ \
552 YYSTYPE yylval; \
553 \
554 /* Number of parse errors so far. */ \
555 int yynerrs;
556
557 #if YYLSP_NEEDED
558 # define YY_DECL_VARIABLES \
559 YY_DECL_NON_LSP_VARIABLES \
560 \
561 /* Location data for the lookahead symbol. */ \
562 YYLTYPE yylloc;
563 #else
564 # define YY_DECL_VARIABLES \
565 YY_DECL_NON_LSP_VARIABLES
566 #endif
567
568
569 /* If nonreentrant, generate the variables here. */
570
571 #if !YYPURE
572 YY_DECL_VARIABLES
573 #endif /* !YYPURE */
574
575 int
576 yyparse (YYPARSE_PARAM_ARG)
577 YYPARSE_PARAM_DECL
578 {
579 /* If reentrant, generate the variables here. */
580 #if YYPURE
581 YY_DECL_VARIABLES
582 #endif /* !YYPURE */
583
584 register int yystate;
585 register int yyn;
586 int yyresult;
587 /* Number of tokens to shift before error messages enabled. */
588 int yyerrstatus;
589 /* Lookahead token as an internal (translated) token number. */
590 int yychar1 = 0;
591
592 /* Three stacks and their tools:
593 `yyss': related to states,
594 `yyvs': related to semantic values,
595 `yyls': related to locations.
596
597 Refer to the stacks thru separate pointers, to allow yyoverflow
598 to reallocate them elsewhere. */
599
600 /* The state stack. */
601 short yyssa[YYINITDEPTH];
602 short *yyss = yyssa;
603 register short *yyssp;
604
605 /* The semantic value stack. */
606 YYSTYPE yyvsa[YYINITDEPTH];
607 YYSTYPE *yyvs = yyvsa;
608 register YYSTYPE *yyvsp;
609
610 #if YYLSP_NEEDED
611 /* The location stack. */
612 YYLTYPE yylsa[YYINITDEPTH];
613 YYLTYPE *yyls = yylsa;
614 YYLTYPE *yylsp;
615 #endif
616
617 #if YYLSP_NEEDED
618 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
619 #else
620 # define YYPOPSTACK (yyvsp--, yyssp--)
621 #endif
622
623 YYSIZE_T yystacksize = YYINITDEPTH;
624
625
626 /* The variables used to return semantic value and location from the
627 action routines. */
628 YYSTYPE yyval;
629 #if YYLSP_NEEDED
630 YYLTYPE yyloc;
631 #endif
632
633 /* When reducing, the number of symbols on the RHS of the reduced
634 rule. */
635 int yylen;
636
637 YYDPRINTF ((stderr, "Starting parse\n"));
638
639 yystate = 0;
640 yyerrstatus = 0;
641 yynerrs = 0;
642 yychar = YYEMPTY; /* Cause a token to be read. */
643
644 /* Initialize stack pointers.
645 Waste one element of value and location stack
646 so that they stay on the same level as the state stack.
647 The wasted elements are never initialized. */
648
649 yyssp = yyss;
650 yyvsp = yyvs;
651 #if YYLSP_NEEDED
652 yylsp = yyls;
653 #endif
654 goto yysetstate;
655
656 /*------------------------------------------------------------.
657 | yynewstate -- Push a new state, which is found in yystate. |
658 `------------------------------------------------------------*/
659 yynewstate:
660 /* In all cases, when you get here, the value and location stacks
661 have just been pushed. so pushing a state here evens the stacks.
662 */
663 yyssp++;
664
665 yysetstate:
666 *yyssp = yystate;
667
668 if (yyssp >= yyss + yystacksize - 1)
669 {
670 /* Get the current used size of the three stacks, in elements. */
671 YYSIZE_T yysize = yyssp - yyss + 1;
672
673 #ifdef yyoverflow
674 {
675 /* Give user a chance to reallocate the stack. Use copies of
676 these so that the &'s don't force the real ones into
677 memory. */
678 YYSTYPE *yyvs1 = yyvs;
679 short *yyss1 = yyss;
680
681 /* Each stack pointer address is followed by the size of the
682 data in use in that stack, in bytes. */
683 # if YYLSP_NEEDED
684 YYLTYPE *yyls1 = yyls;
685 /* This used to be a conditional around just the two extra args,
686 but that might be undefined if yyoverflow is a macro. */
687 yyoverflow ("parser stack overflow",
688 &yyss1, yysize * sizeof (*yyssp),
689 &yyvs1, yysize * sizeof (*yyvsp),
690 &yyls1, yysize * sizeof (*yylsp),
691 &yystacksize);
692 yyls = yyls1;
693 # else
694 yyoverflow ("parser stack overflow",
695 &yyss1, yysize * sizeof (*yyssp),
696 &yyvs1, yysize * sizeof (*yyvsp),
697 &yystacksize);
698 # endif
699 yyss = yyss1;
700 yyvs = yyvs1;
701 }
702 #else /* no yyoverflow */
703 /* Extend the stack our own way. */
704 if (yystacksize >= YYMAXDEPTH)
705 goto yyoverflowlab;
706 yystacksize *= 2;
707 if (yystacksize > YYMAXDEPTH)
708 yystacksize = YYMAXDEPTH;
709
710 {
711 short *yyss1 = yyss;
712 union yyalloc *yyptr =
713 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
714 if (! yyptr)
715 goto yyoverflowlab;
716 YYSTACK_RELOCATE (short, yyss);
717 YYSTACK_RELOCATE (YYSTYPE, yyvs);
718 # if YYLSP_NEEDED
719 YYSTACK_RELOCATE (YYLTYPE, yyls);
720 # endif
721 # undef YYSTACK_RELOCATE
722 if (yyss1 != yyssa)
723 YYSTACK_FREE (yyss1);
724 }
725 #endif /* no yyoverflow */
726
727 yyssp = yyss + yysize - 1;
728 yyvsp = yyvs + yysize - 1;
729 #if YYLSP_NEEDED
730 yylsp = yyls + yysize - 1;
731 #endif
732
733 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
734 (unsigned long int) yystacksize));
735
736 if (yyssp >= yyss + yystacksize - 1)
737 YYABORT;
738 }
739
740 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
741
742 goto yybackup;
743
744
745 /*-----------.
746 | yybackup. |
747 `-----------*/
748 yybackup:
749
750 /* Do appropriate processing given the current state. */
751 /* Read a lookahead token if we need one and don't already have one. */
752 /* yyresume: */
753
754 /* First try to decide what to do without reference to lookahead token. */
755
756 yyn = yypact[yystate];
757 if (yyn == YYFLAG)
758 goto yydefault;
759
760 /* Not known => get a lookahead token if don't already have one. */
761
762 /* yychar is either YYEMPTY or YYEOF
763 or a valid token in external form. */
764
765 if (yychar == YYEMPTY)
766 {
767 YYDPRINTF ((stderr, "Reading a token: "));
768 yychar = YYLEX;
769 }
770
771 /* Convert token to internal form (in yychar1) for indexing tables with */
772
773 if (yychar <= 0) /* This means end of input. */
774 {
775 yychar1 = 0;
776 yychar = YYEOF; /* Don't call YYLEX any more */
777
778 YYDPRINTF ((stderr, "Now at end of input.\n"));
779 }
780 else
781 {
782 yychar1 = YYTRANSLATE (yychar);
783
784 #if YYDEBUG
785 /* We have to keep this `#if YYDEBUG', since we use variables
786 which are defined only if `YYDEBUG' is set. */
787 if (yydebug)
788 {
789 YYFPRINTF (stderr, "Next token is %d (%s",
790 yychar, yytname[yychar1]);
791 /* Give the individual parser a way to print the precise
792 meaning of a token, for further debugging info. */
793 # ifdef YYPRINT
794 YYPRINT (stderr, yychar, yylval);
795 # endif
796 YYFPRINTF (stderr, ")\n");
797 }
798 #endif
799 }
800
801 yyn += yychar1;
802 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
803 goto yydefault;
804
805 yyn = yytable[yyn];
806
807 /* yyn is what to do for this token type in this state.
808 Negative => reduce, -yyn is rule number.
809 Positive => shift, yyn is new state.
810 New state is final state => don't bother to shift,
811 just return success.
812 0, or most negative number => error. */
813
814 if (yyn < 0)
815 {
816 if (yyn == YYFLAG)
817 goto yyerrlab;
818 yyn = -yyn;
819 goto yyreduce;
820 }
821 else if (yyn == 0)
822 goto yyerrlab;
823
824 if (yyn == YYFINAL)
825 YYACCEPT;
826
827 /* Shift the lookahead token. */
828 YYDPRINTF ((stderr, "Shifting token %d (%s), ",
829 yychar, yytname[yychar1]));
830
831 /* Discard the token being shifted unless it is eof. */
832 if (yychar != YYEOF)
833 yychar = YYEMPTY;
834
835 *++yyvsp = yylval;
836 #if YYLSP_NEEDED
837 *++yylsp = yylloc;
838 #endif
839
840 /* Count tokens shifted since error; after three, turn off error
841 status. */
842 if (yyerrstatus)
843 yyerrstatus--;
844
845 yystate = yyn;
846 goto yynewstate;
847
848
849 /*-----------------------------------------------------------.
850 | yydefault -- do the default action for the current state. |
851 `-----------------------------------------------------------*/
852 yydefault:
853 yyn = yydefact[yystate];
854 if (yyn == 0)
855 goto yyerrlab;
856 goto yyreduce;
857
858
859 /*-----------------------------.
860 | yyreduce -- Do a reduction. |
861 `-----------------------------*/
862 yyreduce:
863 /* yyn is the number of a rule to reduce with. */
864 yylen = yyr2[yyn];
865
866 /* If YYLEN is nonzero, implement the default value of the action:
867 `$$ = $1'.
868
869 Otherwise, the following line sets YYVAL to the semantic value of
870 the lookahead token. This behavior is undocumented and Bison
871 users should not rely upon it. Assigning to YYVAL
872 unconditionally makes the parser a bit smaller, and it avoids a
873 GCC warning that YYVAL may be used uninitialized. */
874 yyval = yyvsp[1-yylen];
875
876 #if YYLSP_NEEDED
877 /* Similarly for the default location. Let the user run additional
878 commands if for instance locations are ranges. */
879 yyloc = yylsp[1-yylen];
880 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
881 #endif
882
883 #if YYDEBUG
884 /* We have to keep this `#if YYDEBUG', since we use variables which
885 are defined only if `YYDEBUG' is set. */
886 if (yydebug)
887 {
888 int yyi;
889
890 YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
891 yyn, yyrline[yyn]);
892
893 /* Print the symbols being reduced, and their result. */
894 for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
895 YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
896 YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
897 }
898 #endif
899
900 switch (yyn) {
901
902 case 6:
903 #line 38 "epist.y"
904 {
905 ((parser*)parser_obj)->setAction(yyvsp[-2]);
906 ((parser*)parser_obj)->endAction();
907 ;
908 break;}
909 case 7:
910 #line 47 "epist.y"
911 {
912 ((parser*)parser_obj)->endChain();
913 ;
914 break;}
915 case 10:
916 #line 61 "epist.y"
917 { ((parser*)parser_obj)->startChain(); ;
918 break;}
919 case 11:
920 #line 65 "epist.y"
921 { /* ((parser*)parser_obj)->endChain(); */ ;
922 break;}
923 case 13:
924 #line 69 "epist.y"
925 { ((parser*)parser_obj)->addModifier(yyvsp[-2]); ;
926 break;}
927 case 14:
928 #line 73 "epist.y"
929 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
930 break;}
931 case 15:
932 #line 74 "epist.y"
933 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
934 break;}
935 case 16:
936 #line 75 "epist.y"
937 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
938 break;}
939 case 17:
940 #line 76 "epist.y"
941 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
942 break;}
943 case 18:
944 #line 77 "epist.y"
945 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
946 break;}
947 case 19:
948 #line 78 "epist.y"
949 { ((parser*)parser_obj)->setKey(yyvsp[0]); ;
950 break;}
951 case 21:
952 #line 82 "epist.y"
953 { ((parser*)parser_obj)->setArgumentNum(yyvsp[0]); ;
954 break;}
955 case 22:
956 #line 83 "epist.y"
957 { ((parser*)parser_obj)->setArgumentNegNum(yyvsp[0]); ;
958 break;}
959 case 23:
960 #line 84 "epist.y"
961 { ((parser*)parser_obj)->setArgumentStr(yyvsp[0]); ;
962 break;}
963 case 27:
964 #line 97 "epist.y"
965 { ((parser*)parser_obj)->setOption(yyvsp[-2]); ;
966 break;}
967 }
968
969 #line 705 "/usr/share/bison/bison.simple"
970
971 \f
972 yyvsp -= yylen;
973 yyssp -= yylen;
974 #if YYLSP_NEEDED
975 yylsp -= yylen;
976 #endif
977
978 #if YYDEBUG
979 if (yydebug)
980 {
981 short *yyssp1 = yyss - 1;
982 YYFPRINTF (stderr, "state stack now");
983 while (yyssp1 != yyssp)
984 YYFPRINTF (stderr, " %d", *++yyssp1);
985 YYFPRINTF (stderr, "\n");
986 }
987 #endif
988
989 *++yyvsp = yyval;
990 #if YYLSP_NEEDED
991 *++yylsp = yyloc;
992 #endif
993
994 /* Now `shift' the result of the reduction. Determine what state
995 that goes to, based on the state we popped back to and the rule
996 number reduced by. */
997
998 yyn = yyr1[yyn];
999
1000 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1001 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1002 yystate = yytable[yystate];
1003 else
1004 yystate = yydefgoto[yyn - YYNTBASE];
1005
1006 goto yynewstate;
1007
1008
1009 /*------------------------------------.
1010 | yyerrlab -- here on detecting error |
1011 `------------------------------------*/
1012 yyerrlab:
1013 /* If not already recovering from an error, report this error. */
1014 if (!yyerrstatus)
1015 {
1016 ++yynerrs;
1017
1018 #ifdef YYERROR_VERBOSE
1019 yyn = yypact[yystate];
1020
1021 if (yyn > YYFLAG && yyn < YYLAST)
1022 {
1023 YYSIZE_T yysize = 0;
1024 char *yymsg;
1025 int yyx, yycount;
1026
1027 yycount = 0;
1028 /* Start YYX at -YYN if negative to avoid negative indexes in
1029 YYCHECK. */
1030 for (yyx = yyn < 0 ? -yyn : 0;
1031 yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
1032 if (yycheck[yyx + yyn] == yyx)
1033 yysize += yystrlen (yytname[yyx]) + 15, yycount++;
1034 yysize += yystrlen ("parse error, unexpected ") + 1;
1035 yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
1036 yymsg = (char *) YYSTACK_ALLOC (yysize);
1037 if (yymsg != 0)
1038 {
1039 char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
1040 yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
1041
1042 if (yycount < 5)
1043 {
1044 yycount = 0;
1045 for (yyx = yyn < 0 ? -yyn : 0;
1046 yyx < (int) (sizeof (yytname) / sizeof (char *));
1047 yyx++)
1048 if (yycheck[yyx + yyn] == yyx)
1049 {
1050 const char *yyq = ! yycount ? ", expecting " : " or ";
1051 yyp = yystpcpy (yyp, yyq);
1052 yyp = yystpcpy (yyp, yytname[yyx]);
1053 yycount++;
1054 }
1055 }
1056 yyerror (yymsg);
1057 YYSTACK_FREE (yymsg);
1058 }
1059 else
1060 yyerror ("parse error; also virtual memory exhausted");
1061 }
1062 else
1063 #endif /* defined (YYERROR_VERBOSE) */
1064 yyerror ("parse error");
1065 }
1066 goto yyerrlab1;
1067
1068
1069 /*--------------------------------------------------.
1070 | yyerrlab1 -- error raised explicitly by an action |
1071 `--------------------------------------------------*/
1072 yyerrlab1:
1073 if (yyerrstatus == 3)
1074 {
1075 /* If just tried and failed to reuse lookahead token after an
1076 error, discard it. */
1077
1078 /* return failure if at end of input */
1079 if (yychar == YYEOF)
1080 YYABORT;
1081 YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
1082 yychar, yytname[yychar1]));
1083 yychar = YYEMPTY;
1084 }
1085
1086 /* Else will try to reuse lookahead token after shifting the error
1087 token. */
1088
1089 yyerrstatus = 3; /* Each real token shifted decrements this */
1090
1091 goto yyerrhandle;
1092
1093
1094 /*-------------------------------------------------------------------.
1095 | yyerrdefault -- current state does not do anything special for the |
1096 | error token. |
1097 `-------------------------------------------------------------------*/
1098 yyerrdefault:
1099 #if 0
1100 /* This is wrong; only states that explicitly want error tokens
1101 should shift them. */
1102
1103 /* If its default is to accept any token, ok. Otherwise pop it. */
1104 yyn = yydefact[yystate];
1105 if (yyn)
1106 goto yydefault;
1107 #endif
1108
1109
1110 /*---------------------------------------------------------------.
1111 | yyerrpop -- pop the current state because it cannot handle the |
1112 | error token |
1113 `---------------------------------------------------------------*/
1114 yyerrpop:
1115 if (yyssp == yyss)
1116 YYABORT;
1117 yyvsp--;
1118 yystate = *--yyssp;
1119 #if YYLSP_NEEDED
1120 yylsp--;
1121 #endif
1122
1123 #if YYDEBUG
1124 if (yydebug)
1125 {
1126 short *yyssp1 = yyss - 1;
1127 YYFPRINTF (stderr, "Error: state stack now");
1128 while (yyssp1 != yyssp)
1129 YYFPRINTF (stderr, " %d", *++yyssp1);
1130 YYFPRINTF (stderr, "\n");
1131 }
1132 #endif
1133
1134 /*--------------.
1135 | yyerrhandle. |
1136 `--------------*/
1137 yyerrhandle:
1138 yyn = yypact[yystate];
1139 if (yyn == YYFLAG)
1140 goto yyerrdefault;
1141
1142 yyn += YYTERROR;
1143 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1144 goto yyerrdefault;
1145
1146 yyn = yytable[yyn];
1147 if (yyn < 0)
1148 {
1149 if (yyn == YYFLAG)
1150 goto yyerrpop;
1151 yyn = -yyn;
1152 goto yyreduce;
1153 }
1154 else if (yyn == 0)
1155 goto yyerrpop;
1156
1157 if (yyn == YYFINAL)
1158 YYACCEPT;
1159
1160 YYDPRINTF ((stderr, "Shifting error token, "));
1161
1162 *++yyvsp = yylval;
1163 #if YYLSP_NEEDED
1164 *++yylsp = yylloc;
1165 #endif
1166
1167 yystate = yyn;
1168 goto yynewstate;
1169
1170
1171 /*-------------------------------------.
1172 | yyacceptlab -- YYACCEPT comes here. |
1173 `-------------------------------------*/
1174 yyacceptlab:
1175 yyresult = 0;
1176 goto yyreturn;
1177
1178 /*-----------------------------------.
1179 | yyabortlab -- YYABORT comes here. |
1180 `-----------------------------------*/
1181 yyabortlab:
1182 yyresult = 1;
1183 goto yyreturn;
1184
1185 /*---------------------------------------------.
1186 | yyoverflowab -- parser overflow comes here. |
1187 `---------------------------------------------*/
1188 yyoverflowlab:
1189 yyerror ("parser stack overflow");
1190 yyresult = 2;
1191 /* Fall through. */
1192
1193 yyreturn:
1194 #ifndef yyoverflow
1195 if (yyss != yyssa)
1196 YYSTACK_FREE (yyss);
1197 #endif
1198 return yyresult;
1199 }
1200 #line 100 "epist.y"
1201
1202
This page took 0.09226 seconds and 5 git commands to generate.