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