]>
Dogcows Code - chaz/openbox/blob - util/epist/yacc_parser.cc
1 /* A Bison parser, made from epist.y
4 #define YYBISON 1 /* Identify Bison output. */
21 #define YYPARSE_PARAM parser_obj
31 void yyerror(const char *c
) {
32 printf("ERROR: %s\n", c
);
38 # define YYSTYPE_IS_TRIVIAL 1
50 /* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
51 #define YYTRANSLATE(x) ((unsigned)(x) <= 264 ? yytranslate[x] : 21)
53 /* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
54 static const char yytranslate
[] =
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,
86 static const short yyprhs
[] =
88 0, 0, 1, 4, 6, 8, 13, 18, 21, 23,
89 25, 26, 30, 32, 34, 36, 38, 40, 42, 43,
92 static const short yyrhs
[] =
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
104 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
105 static const short yyrline
[] =
107 0, 27, 28, 31, 32, 35, 44, 51, 55, 59,
108 63, 64, 67, 69, 70, 71, 72, 73, 76, 77,
114 #if (YYDEBUG) || defined YYERROR_VERBOSE
116 /* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
117 static const char *const yytname
[] =
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
126 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
127 static const short yyr1
[] =
129 0, 11, 11, 12, 12, 13, 14, 15, 16, 17,
130 18, 18, 19, 19, 19, 19, 19, 19, 20, 20,
134 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
135 static const short yyr2
[] =
137 0, 0, 2, 1, 1, 4, 4, 2, 1, 1,
138 0, 3, 1, 1, 1, 1, 1, 1, 0, 1,
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
145 static const short yydefact
[] =
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,
153 static const short yydefgoto
[] =
155 1, 3, 4, 5, 6, 11, 28, 7, 18, 23
158 static const short yypact
[] =
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,
166 static const short yypgoto
[] =
168 10,-32768,-32768,-32768,-32768,-32768,-32768, 12,-32768,-32768
175 static const short yytable
[] =
177 29, 12, 13, 14, 15, 16, 9, 17, 27, 2,
178 2, 8, 10, 25, 2, 20, 21, 22, 26, 30,
182 static const short yycheck
[] =
184 0, 3, 4, 5, 6, 7, 3, 9, 4, 10,
185 10, 6, 9, 7, 10, 6, 7, 8, 5, 0,
188 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
189 #line 3 "/usr/share/bison/bison.simple"
191 /* Skeleton output parser for bison,
193 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
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)
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.
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. */
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. */
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. */
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. */
228 #if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
230 /* The parser invokes alloca or malloc; define the necessary symbols. */
232 # if YYSTACK_USE_ALLOCA
233 # define YYSTACK_ALLOC alloca
235 # ifndef YYSTACK_USE_ALLOCA
236 # if defined (alloca) || defined (_ALLOCA_H)
237 # define YYSTACK_ALLOC alloca
240 # define YYSTACK_ALLOC __builtin_alloca
246 # ifdef YYSTACK_ALLOC
247 /* Pacify GCC's `empty if-body' warning. */
248 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
250 # if defined (__STDC__) || defined (__cplusplus)
251 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
252 # define YYSIZE_T size_t
254 # define YYSTACK_ALLOC malloc
255 # define YYSTACK_FREE free
257 #endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
260 #if (! defined (yyoverflow) \
261 && (! defined (__cplusplus) \
262 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
264 /* A type that is properly aligned for any stack member. */
274 /* The size of the maximum gap between one aligned stack and the next. */
275 # define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
277 /* The size of an array large to enough to hold all stacks, each with
280 # define YYSTACK_BYTES(N) \
281 ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
282 + 2 * YYSTACK_GAP_MAX)
284 # define YYSTACK_BYTES(N) \
285 ((N) * (sizeof (short) + sizeof (YYSTYPE)) \
289 /* Copy COUNT objects from FROM to TO. The source and destination do
293 # define YYCOPY(To, From, Count) \
294 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
296 # define YYCOPY(To, From, Count) \
299 register YYSIZE_T yyi; \
300 for (yyi = 0; yyi < (Count); yyi++) \
301 (To)[yyi] = (From)[yyi]; \
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
312 # define YYSTACK_RELOCATE(Stack) \
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); \
326 #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
327 # define YYSIZE_T __SIZE_TYPE__
329 #if ! defined (YYSIZE_T) && defined (size_t)
330 # define YYSIZE_T size_t
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
338 #if ! defined (YYSIZE_T)
339 # define YYSIZE_T unsigned int
342 #define yyerrok (yyerrstatus = 0)
343 #define yyclearin (yychar = YYEMPTY)
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) \
356 if (yychar == YYEMPTY && yylen == 1) \
360 yychar1 = YYTRANSLATE (yychar); \
366 yyerror ("syntax error: cannot back up"); \
372 #define YYERRCODE 256
375 /* YYLLOC_DEFAULT -- Compute the default location (before the actions
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. */
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;
389 /* YYLEX -- calling `yylex' with the right arguments. */
394 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
396 # define YYLEX yylex (&yylval, &yylloc)
398 # else /* !YYLSP_NEEDED */
400 # define YYLEX yylex (&yylval, YYLEX_PARAM)
402 # define YYLEX yylex (&yylval)
404 # endif /* !YYLSP_NEEDED */
406 # define YYLEX yylex ()
410 /* Enable debugging if requested. */
414 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
415 # define YYFPRINTF fprintf
418 # define YYDPRINTF(Args) \
423 /* Nonzero means print parse trace. It is left uninitialized so that
424 multiple parsers can coexist. */
427 # define YYDPRINTF(Args)
428 #endif /* !YYDEBUG */
430 /* YYINITDEPTH -- initial size of the parser's stacks. */
432 # define YYINITDEPTH 200
435 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
436 if the built-in stack extension method is used).
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. */
447 # define YYMAXDEPTH 10000
450 #ifdef YYERROR_VERBOSE
453 # if defined (__GLIBC__) && defined (_STRING_H)
454 # define yystrlen strlen
456 /* Return the length of YYSTR. */
458 # if defined (__STDC__) || defined (__cplusplus)
459 yystrlen (const char *yystr
)
465 register const char *yys
= yystr
;
467 while (*yys
++ != '\0')
470 return yys
- yystr
- 1;
476 # if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
477 # define yystpcpy stpcpy
479 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
482 # if defined (__STDC__) || defined (__cplusplus)
483 yystpcpy (char *yydest
, const char *yysrc
)
485 yystpcpy (yydest
, yysrc
)
490 register char *yyd
= yydest
;
491 register const char *yys
= yysrc
;
493 while ((*yyd
++ = *yys
++) != '\0')
502 #line 315 "/usr/share/bison/bison.simple"
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. */
512 # if defined (__STDC__) || defined (__cplusplus)
513 # define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
514 # define YYPARSE_PARAM_DECL
516 # define YYPARSE_PARAM_ARG YYPARSE_PARAM
517 # define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
519 #else /* !YYPARSE_PARAM */
520 # define YYPARSE_PARAM_ARG
521 # define YYPARSE_PARAM_DECL
522 #endif /* !YYPARSE_PARAM */
524 /* Prevent warning if -Wstrict-prototypes. */
526 # ifdef YYPARSE_PARAM
527 int yyparse (void *);
533 /* YY_DECL_VARIABLES -- depending whether we use a pure parser,
534 variables are global, or local to YYPARSE. */
536 #define YY_DECL_NON_LSP_VARIABLES \
537 /* The lookahead symbol. */ \
540 /* The semantic value of the lookahead symbol. */ \
543 /* Number of parse errors so far. */ \
547 # define YY_DECL_VARIABLES \
548 YY_DECL_NON_LSP_VARIABLES \
550 /* Location data for the lookahead symbol. */ \
553 # define YY_DECL_VARIABLES \
554 YY_DECL_NON_LSP_VARIABLES
558 /* If nonreentrant, generate the variables here. */
565 yyparse (YYPARSE_PARAM_ARG
)
568 /* If reentrant, generate the variables here. */
573 register int yystate
;
576 /* Number of tokens to shift before error messages enabled. */
578 /* Lookahead token as an internal (translated) token number. */
581 /* Three stacks and their tools:
582 `yyss': related to states,
583 `yyvs': related to semantic values,
584 `yyls': related to locations.
586 Refer to the stacks thru separate pointers, to allow yyoverflow
587 to reallocate them elsewhere. */
589 /* The state stack. */
590 short yyssa
[YYINITDEPTH
];
592 register short *yyssp
;
594 /* The semantic value stack. */
595 YYSTYPE yyvsa
[YYINITDEPTH
];
596 YYSTYPE
*yyvs
= yyvsa
;
597 register YYSTYPE
*yyvsp
;
600 /* The location stack. */
601 YYLTYPE yylsa
[YYINITDEPTH
];
602 YYLTYPE
*yyls
= yylsa
;
607 # define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
609 # define YYPOPSTACK (yyvsp--, yyssp--)
612 YYSIZE_T yystacksize
= YYINITDEPTH
;
615 /* The variables used to return semantic value and location from the
622 /* When reducing, the number of symbols on the RHS of the reduced
626 YYDPRINTF ((stderr
, "Starting parse\n"));
631 yychar
= YYEMPTY
; /* Cause a token to be read. */
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. */
645 /*------------------------------------------------------------.
646 | yynewstate -- Push a new state, which is found in yystate. |
647 `------------------------------------------------------------*/
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.
657 if (yyssp
>= yyss
+ yystacksize
- 1)
659 /* Get the current used size of the three stacks, in elements. */
660 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
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
667 YYSTYPE
*yyvs1
= yyvs
;
670 /* Each stack pointer address is followed by the size of the
671 data in use in that stack, in bytes. */
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
),
683 yyoverflow ("parser stack overflow",
684 &yyss1
, yysize
* sizeof (*yyssp
),
685 &yyvs1
, yysize
* sizeof (*yyvsp
),
691 #else /* no yyoverflow */
692 # ifndef YYSTACK_RELOCATE
695 /* Extend the stack our own way. */
696 if (yystacksize
>= YYMAXDEPTH
)
699 if (yystacksize
> YYMAXDEPTH
)
700 yystacksize
= YYMAXDEPTH
;
704 union yyalloc
*yyptr
=
705 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
708 YYSTACK_RELOCATE (yyss
);
709 YYSTACK_RELOCATE (yyvs
);
711 YYSTACK_RELOCATE (yyls
);
713 # undef YYSTACK_RELOCATE
715 YYSTACK_FREE (yyss1
);
718 #endif /* no yyoverflow */
720 yyssp
= yyss
+ yysize
- 1;
721 yyvsp
= yyvs
+ yysize
- 1;
723 yylsp
= yyls
+ yysize
- 1;
726 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
727 (unsigned long int) yystacksize
));
729 if (yyssp
>= yyss
+ yystacksize
- 1)
733 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
743 /* Do appropriate processing given the current state. */
744 /* Read a lookahead token if we need one and don't already have one. */
747 /* First try to decide what to do without reference to lookahead token. */
749 yyn
= yypact
[yystate
];
753 /* Not known => get a lookahead token if don't already have one. */
755 /* yychar is either YYEMPTY or YYEOF
756 or a valid token in external form. */
758 if (yychar
== YYEMPTY
)
760 YYDPRINTF ((stderr
, "Reading a token: "));
764 /* Convert token to internal form (in yychar1) for indexing tables with */
766 if (yychar
<= 0) /* This means end of input. */
769 yychar
= YYEOF
; /* Don't call YYLEX any more */
771 YYDPRINTF ((stderr
, "Now at end of input.\n"));
775 yychar1
= YYTRANSLATE (yychar
);
778 /* We have to keep this `#if YYDEBUG', since we use variables
779 which are defined only if `YYDEBUG' is set. */
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. */
787 YYPRINT (stderr
, yychar
, yylval
);
789 YYFPRINTF (stderr
, ")\n");
795 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != yychar1
)
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,
805 0, or most negative number => error. */
820 /* Shift the lookahead token. */
821 YYDPRINTF ((stderr
, "Shifting token %d (%s), ",
822 yychar
, yytname
[yychar1
]));
824 /* Discard the token being shifted unless it is eof. */
833 /* Count tokens shifted since error; after three, turn off error
842 /*-----------------------------------------------------------.
843 | yydefault -- do the default action for the current state. |
844 `-----------------------------------------------------------*/
846 yyn
= yydefact
[yystate
];
852 /*-----------------------------.
853 | yyreduce -- Do a reduction. |
854 `-----------------------------*/
856 /* yyn is the number of a rule to reduce with. */
859 /* If YYLEN is nonzero, implement the default value of the action:
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
];
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
);
877 /* We have to keep this `#if YYDEBUG', since we use variables which
878 are defined only if `YYDEBUG' is set. */
883 YYFPRINTF (stderr
, "Reducing via rule %d (line %d), ",
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
]]);
898 ((parser
*)parser_obj
)->setAction(yyvsp
[-2]);
899 ((parser
*)parser_obj
)->endAction();
905 ((parser
*)parser_obj
)->endChain();
910 { ((parser
*)parser_obj
)->startChain(); }
914 { /* ((parser*)parser_obj)->endChain(); */ }
918 { ((parser
*)parser_obj
)->addModifier(yyvsp
[-2]); }
922 { ((parser
*)parser_obj
)->setKey(yyvsp
[0]); }
926 { ((parser
*)parser_obj
)->setKey(yyvsp
[0]); }
930 { ((parser
*)parser_obj
)->setKey(yyvsp
[0]); }
934 { ((parser
*)parser_obj
)->setKey(yyvsp
[0]); }
938 { ((parser
*)parser_obj
)->setKey(yyvsp
[0]); }
942 { ((parser
*)parser_obj
)->setKey(yyvsp
[0]); }
946 { ((parser
*)parser_obj
)->setArgumentNum(yyvsp
[0]); }
950 { ((parser
*)parser_obj
)->setArgumentNegNum(yyvsp
[0]); }
954 { ((parser
*)parser_obj
)->setArgumentStr(yyvsp
[0]); }
958 #line 705 "/usr/share/bison/bison.simple"
970 short *yyssp1
= yyss
- 1;
971 YYFPRINTF (stderr
, "state stack now");
972 while (yyssp1
!= yyssp
)
973 YYFPRINTF (stderr
, " %d", *++yyssp1
);
974 YYFPRINTF (stderr
, "\n");
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. */
989 yystate
= yypgoto
[yyn
- YYNTBASE
] + *yyssp
;
990 if (yystate
>= 0 && yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
991 yystate
= yytable
[yystate
];
993 yystate
= yydefgoto
[yyn
- YYNTBASE
];
998 /*------------------------------------.
999 | yyerrlab -- here on detecting error |
1000 `------------------------------------*/
1002 /* If not already recovering from an error, report this error. */
1007 #ifdef YYERROR_VERBOSE
1008 yyn
= yypact
[yystate
];
1010 if (yyn
> YYFLAG
&& yyn
< YYLAST
)
1012 YYSIZE_T yysize
= 0;
1017 /* Start YYX at -YYN if negative to avoid negative indexes in
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
);
1028 char *yyp
= yystpcpy (yymsg
, "parse error, unexpected ");
1029 yyp
= yystpcpy (yyp
, yytname
[YYTRANSLATE (yychar
)]);
1034 for (yyx
= yyn
< 0 ? -yyn
: 0;
1035 yyx
< (int) (sizeof (yytname
) / sizeof (char *));
1037 if (yycheck
[yyx
+ yyn
] == yyx
)
1039 const char *yyq
= ! yycount
? ", expecting " : " or ";
1040 yyp
= yystpcpy (yyp
, yyq
);
1041 yyp
= yystpcpy (yyp
, yytname
[yyx
]);
1046 YYSTACK_FREE (yymsg
);
1049 yyerror ("parse error; also virtual memory exhausted");
1052 #endif /* defined (YYERROR_VERBOSE) */
1053 yyerror ("parse error");
1058 /*--------------------------------------------------.
1059 | yyerrlab1 -- error raised explicitly by an action |
1060 `--------------------------------------------------*/
1062 if (yyerrstatus
== 3)
1064 /* If just tried and failed to reuse lookahead token after an
1065 error, discard it. */
1067 /* return failure if at end of input */
1068 if (yychar
== YYEOF
)
1070 YYDPRINTF ((stderr
, "Discarding token %d (%s).\n",
1071 yychar
, yytname
[yychar1
]));
1075 /* Else will try to reuse lookahead token after shifting the error
1078 yyerrstatus
= 3; /* Each real token shifted decrements this */
1083 /*-------------------------------------------------------------------.
1084 | yyerrdefault -- current state does not do anything special for the |
1086 `-------------------------------------------------------------------*/
1089 /* This is wrong; only states that explicitly want error tokens
1090 should shift them. */
1092 /* If its default is to accept any token, ok. Otherwise pop it. */
1093 yyn
= yydefact
[yystate
];
1099 /*---------------------------------------------------------------.
1100 | yyerrpop -- pop the current state because it cannot handle the |
1102 `---------------------------------------------------------------*/
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");
1127 yyn
= yypact
[yystate
];
1132 if (yyn
< 0 || yyn
> YYLAST
|| yycheck
[yyn
] != YYTERROR
)
1149 YYDPRINTF ((stderr
, "Shifting error token, "));
1160 /*-------------------------------------.
1161 | yyacceptlab -- YYACCEPT comes here. |
1162 `-------------------------------------*/
1167 /*-----------------------------------.
1168 | yyabortlab -- YYABORT comes here. |
1169 `-----------------------------------*/
1174 /*---------------------------------------------.
1175 | yyoverflowab -- parser overflow comes here. |
1176 `---------------------------------------------*/
1178 yyerror ("parser stack overflow");
1185 YYSTACK_FREE (yyss
);
This page took 0.087959 seconds and 4 git commands to generate.