1 m4_divert(-1) -*- C
-*-
3 # GLR skeleton for Bison
4 # Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 ## ---------------- ##
24 ## ---------------- ##
27 m4_define_default([b4_stack_depth_max
], [10000])
28 m4_define_default([b4_stack_depth_init
], [200])
32 ## ------------------------ ##
33 ## Pure/impure interfaces. ##
34 ## ------------------------ ##
39 # Accumule in b4_lex_param all the yylex arguments.
40 # Yes, this is quite ugly...
41 m4_define([b4_lex_param
],
42 m4_dquote(b4_pure_if([[[[YYSTYPE
*]], [[yylvalp]]][]dnl
43 b4_location_if([, [[YYLTYPE
*], [yyllocp
]]])])dnl
44 m4_ifdef([b4_lex_param
], [, ]b4_lex_param
)))
49 m4_define([b4_user_formals
],
50 [m4_ifset([b4_parse_param
], [, b4_c_ansi_formals(b4_parse_param
)])])
55 # Arguments passed to yyerror: user args plus yylloc.
56 m4_define([b4_yyerror_args
],
57 [b4_pure_if([b4_location_if([yylocp
, ])])dnl
58 m4_ifset([b4_parse_param
], [b4_c_args(b4_parse_param
), ])])
63 # Same as above, but on the look-ahead, hence yyllocp instead of yylocp.
64 m4_define([b4_lyyerror_args
],
65 [b4_pure_if([b4_location_if([yyllocp
, ])])dnl
66 m4_ifset([b4_parse_param
], [b4_c_args(b4_parse_param
), ])])
71 # Arguments needed by yyerror: user args plus yylloc.
72 m4_define([b4_pure_args
],
73 [b4_pure_if([b4_location_if([, yylocp
])])[]b4_user_args
])
78 # Arguments passed to yyerror: user formals plus yyllocp.
79 m4_define([b4_pure_formals
],
80 [b4_pure_if([b4_location_if([, YYLTYPE
*yylocp
])])[]b4_user_formals
])
85 # Same as above, but on the look-ahead, hence yyllocp instead of yylocp.
86 m4_define([b4_lpure_args
],
87 [b4_pure_if([b4_location_if([, yyllocp
])])[]b4_user_args
])
92 # Same as above, but on the look-ahead, hence yyllocp instead of yylocp.
93 m4_define([b4_lpure_formals
],
94 [b4_pure_if([b4_location_if([YYLTYPE
*yyllocp
])])[]b4_user_formals
])
97 ## ----------------- ##
98 ## Semantic Values. ##
99 ## ----------------- ##
102 # b4_lhs_value([TYPE])
103 # --------------------
104 # Expansion of $<TYPE>$.
105 m4_define([b4_lhs_value
],
106 [((*yyvalp
)[]m4_ifval([$
1], [.$
1]))])
109 # b4_rhs_value(RULE-LENGTH, NUM, [TYPE])
110 # --------------------------------------
111 # Expansion of $<TYPE>NUM, where the current rule has RULE-LENGTH
113 m4_define([b4_rhs_value
],
114 [(((yyGLRStackItem
const *)yyvsp
)@
{YYFILL (m4_eval([$
2 - $
1]))@
}.yystate
.yysemantics
.yysval
[]m4_ifval([$
3], [.$
3]))])
125 m4_define([b4_lhs_location
],
129 # b4_rhs_location(RULE-LENGTH, NUM)
130 # ---------------------------------
131 # Expansion of @NUM, where the current rule has RULE-LENGTH symbols
133 m4_define([b4_rhs_location
],
134 [(((yyGLRStackItem
const *)yyvsp
)@
{YYFILL (m4_eval([$
2 - $
1]))@
}.yystate
.yyloc
)])
136 # We do want M4 expansion after # for CPP macros.
139 @output @output_parser_name@
140 b4_copyright([Skeleton parser
for GLR parsing with Bison
],
141 [2002, 2003, 2004, 2005])
143 /* This is the parser code for GLR (Generalized LR) parser. */
152 m4_if(b4_prefix
[], [yy
], [],
153 [/* Substitute the variable and function names. */
154 #define yyparse b4_prefix[]parse
155 #define yylex b4_prefix[]lex
156 #define yyerror b4_prefix[]error
157 #define yylval b4_prefix[]lval
158 #define yychar b4_prefix[]char
159 #define yydebug b4_prefix[]debug
160 #define yynerrs b4_prefix[]nerrs
161 #define yylloc b4_prefix[]lloc])
163 b4_token_defines(b4_tokens
)
165 /* Copy the first part of user declarations. */
168 /* Enabling traces. */
170 # define YYDEBUG ]b4_debug[
173 /* Enabling verbose error messages. */
174 #ifdef YYERROR_VERBOSE
175 # undef YYERROR_VERBOSE
176 # define YYERROR_VERBOSE 1
178 # define YYERROR_VERBOSE ]b4_error_verbose[
181 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
182 ]m4_ifdef([b4_stype
],
183 [b4_syncline([b4_stype_line
], [b4_filename
])
184 typedef union m4_bregexp(b4_stype
, [^{], [YYSTYPE
])b4_stype YYSTYPE
;
185 /* Line __line__ of glr.c. */
186 b4_syncline([@oline@
], [@ofile@
])],
187 [typedef int YYSTYPE
;])[
188 # define YYSTYPE_IS_DECLARED 1
189 # define YYSTYPE_IS_TRIVIAL 1
192 #if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
193 typedef struct YYLTYPE
204 # define YYLTYPE_IS_DECLARED 1
205 # define YYLTYPE_IS_TRIVIAL 1
208 /* Default (constant) value used for initialization for null
209 right-hand sides. Unlike the standard yacc.c template,
210 here we set the default value of $$ to a zeroed-out value.
211 Since the default value is undefined, this behavior is
212 technically correct. */
213 static YYSTYPE yyval_default
;
215 /* Copy the second part of user declarations. */
218 ]/* Line __line__ of glr.c. */
219 b4_syncline([@oline@
], [@ofile@
])
225 # define YYMALLOC malloc
228 # define YYREALLOC realloc
234 typedef unsigned char yybool
;
243 #ifndef __attribute__
244 /* This feature is available in gcc versions 2.5 and later. */
245 # if !defined (__GNUC__) || __GNUC__ < 2 || \
246 (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
247 # define __attribute__(Spec) /* empty */
252 # define YYASSERT(condition) ((void) ((condition) || (abort (), 0)))
255 #ifndef ATTRIBUTE_UNUSED
256 # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
259 /* YYFINAL -- State number of the termination state. */
260 #define YYFINAL ]b4_final_state_number[
261 /* YYLAST -- Last index in YYTABLE. */
262 #define YYLAST ]b4_last[
264 /* YYNTOKENS -- Number of terminals. */
265 #define YYNTOKENS ]b4_tokens_number[
266 /* YYNNTS -- Number of nonterminals. */
267 #define YYNNTS ]b4_nterms_number[
268 /* YYNRULES -- Number of rules. */
269 #define YYNRULES ]b4_rules_number[
270 /* YYNRULES -- Number of states. */
271 #define YYNSTATES ]b4_states_number[
272 /* YYMAXRHS -- Maximum number of symbols on right-hand side of rule. */
273 #define YYMAXRHS ]b4_r2_max[
274 /* YYMAXLEFT -- Maximum number of symbols to the left of a handle
275 accessed by $0, $-1, etc., in any rule. */
276 #define YYMAXLEFT ]b4_max_left_semantic_context[
278 /* YYTRANSLATE(X) -- Bison symbol number corresponding to X. */
279 #define YYUNDEFTOK ]b4_undef_token_number[
280 #define YYMAXUTOK ]b4_user_token_number_max[
282 #define YYTRANSLATE(YYX) \
283 ((YYX <= 0) ? YYEOF : \
284 (unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
286 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
287 static const ]b4_int_type_for([b4_translate
])[ yytranslate
[] =
293 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
295 static const ]b4_int_type_for([b4_prhs
])[ yyprhs
[] =
300 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
301 static const ]b4_int_type_for([b4_rhs
])[ yyrhs
[] =
306 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
307 static const ]b4_int_type_for([b4_rline
])[ yyrline
[] =
313 #if (YYDEBUG) || YYERROR_VERBOSE
314 /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
315 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
316 static const char *const yytname
[] =
322 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
323 static const ]b4_int_type_for([b4_r1
])[ yyr1
[] =
328 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
329 static const ]b4_int_type_for([b4_r2
])[ yyr2
[] =
334 /* YYDPREC[RULE-NUM] -- Dynamic precedence of rule #RULE-NUM (0 if none). */
335 static const ]b4_int_type_for([b4_dprec
])[ yydprec
[] =
340 /* YYMERGER[RULE-NUM] -- Index of merging function for rule #RULE-NUM. */
341 static const ]b4_int_type_for([b4_merger
])[ yymerger
[] =
346 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
347 doesn't specify something else to do. Zero means the default is an
349 static const ]b4_int_type_for([b4_defact
])[ yydefact
[] =
354 /* YYPDEFGOTO[NTERM-NUM]. */
355 static const ]b4_int_type_for([b4_defgoto
])[ yydefgoto
[] =
360 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
362 #define YYPACT_NINF ]b4_pact_ninf[
363 static const ]b4_int_type_for([b4_pact
])[ yypact
[] =
368 /* YYPGOTO[NTERM-NUM]. */
369 static const ]b4_int_type_for([b4_pgoto
])[ yypgoto
[] =
374 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
375 positive, shift that token. If negative, reduce the rule which
376 number is the opposite. If zero, do what YYDEFACT says.
377 If YYTABLE_NINF, syntax error. */
378 #define YYTABLE_NINF ]b4_table_ninf[
379 static const ]b4_int_type_for([b4_table
])[ yytable
[] =
384 /* YYCONFLP[YYPACT[STATE-NUM]] -- Pointer into YYCONFL of start of
385 list of conflicting reductions corresponding to action entry for
386 state STATE-NUM in yytable. 0 means no conflicts. The list in
387 yyconfl is terminated by a rule number of 0. */
388 static const ]b4_int_type_for([b4_conflict_list_heads
])[ yyconflp
[] =
390 ]b4_conflict_list_heads
[
393 /* YYCONFL[I] -- lists of conflicting rule numbers, each terminated by
394 0, pointed into by YYCONFLP. */
395 ]dnl Do
not use b4_int_type_for here
, since there are places where
396 dnl pointers onto yyconfl are taken
, which type is
"short int *".
397 dnl We probably ought to introduce a type
for confl
.
398 [static const short int yyconfl
[] =
400 ]b4_conflicting_rules
[
403 static const ]b4_int_type_for([b4_check
])[ yycheck
[] =
408 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
409 symbol of state STATE-NUM. */
410 static const ]b4_int_type_for([b4_stos
])[ yystos
[] =
416 /* Prevent warning if -Wmissing-prototypes. */
417 ]b4_c_ansi_function_decl([yyparse
], [int], b4_parse_param
)[
419 /* Error token number */
422 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
423 If N is 0, then set CURRENT to the empty location which ends
424 the previous symbol: RHS[0] (always defined). */
427 #define YYRHSLOC(Rhs, K) ((Rhs)[K].yystate.yyloc)
428 #ifndef YYLLOC_DEFAULT
429 # define YYLLOC_DEFAULT(Current, Rhs, N) \
433 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
434 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
435 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
436 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
440 (Current).first_line = (Current).last_line = \
441 YYRHSLOC (Rhs, 0).last_line; \
442 (Current).first_column = (Current).last_column = \
443 YYRHSLOC (Rhs, 0).last_column; \
447 /* YY_LOCATION_PRINT -- Print the location on the stream.
448 This macro was not mandated originally: define only if we know
449 we won't break user code: when these are the locations we know. */
451 # define YY_LOCATION_PRINT(File, Loc) \
452 fprintf (File, "%d.%d-%d.%d", \
453 (Loc).first_line, (Loc).first_column, \
454 (Loc).last_line, (Loc).last_column)
457 #ifndef YYLLOC_DEFAULT
458 # define YYLLOC_DEFAULT(Current, Rhs, N) ((void) 0)
462 #ifndef YY_LOCATION_PRINT
463 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
467 /* YYLEX -- calling `yylex' with the right arguments. */
468 #define YYLEX ]b4_c_function_call([yylex], [int], b4_lex_param)[
473 #define yynerrs (yystack->yyerrcnt)
475 #define yychar (yystack->yyrawchar)],
483 static const int YYEOF
= 0;
484 static const int YYEMPTY
= -2;
486 typedef enum { yyok
, yyaccept
, yyabort
, yyerr
} YYRESULTTAG
;
489 do { YYRESULTTAG yyflag = YYE; if (yyflag != yyok) return yyflag; } \
494 #if ! defined (YYFPRINTF)
495 # define YYFPRINTF fprintf
498 # define YYDPRINTF(Args) \
504 ]b4_yysymprint_generate([b4_c_ansi_function_def
])[
506 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
510 YYFPRINTF (stderr, "%s ", Title); \
511 yysymprint (stderr, \
512 Type, Value]b4_location_if([, Location])[); \
516 /* Nonzero means print parse trace. It is left uninitialized so that
517 multiple parsers can coexist. */
522 # define YYDPRINTF(Args)
523 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
525 #endif /* !YYDEBUG */
527 /* YYINITDEPTH -- initial size of the parser's stacks. */
529 # define YYINITDEPTH ]b4_stack_depth_init[
532 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
533 if the built-in stack extension method is used).
535 Do not make this value too large; the results are undefined if
536 SIZE_MAX < YYMAXDEPTH * sizeof (GLRStackItem)
537 evaluated with infinite-precision integer arithmetic. */
540 # define YYMAXDEPTH ]b4_stack_depth_max[
543 /* Minimum number of free items on the stack allowed after an
544 allocation. This is to allow allocation and initialization
545 to be completed by functions that call expandGLRStack before the
546 stack is expanded, thus insuring that all necessary pointers get
547 properly redirected to new data. */
550 #if (! defined (YYSTACKEXPANDABLE) \
551 && (! defined (__cplusplus) \
552 || (]b4_location_if([[defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
553 && ]])[defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
554 #define YYSTACKEXPANDABLE 1
556 #define YYSTACKEXPANDABLE 0
559 /** State numbers, as in LALR(1) machine */
560 typedef int yyStateNum
;
562 /** Rule numbers, as in LALR(1) machine */
563 typedef int yyRuleNum
;
565 /** Grammar symbol */
566 typedef short int yySymbol
;
568 /** Item references, as in LALR(1) machine */
569 typedef short int yyItemNum
;
571 typedef struct yyGLRState yyGLRState
;
572 typedef struct yySemanticOption yySemanticOption
;
573 typedef union yyGLRStackItem yyGLRStackItem
;
574 typedef struct yyGLRStack yyGLRStack
;
575 typedef struct yyGLRStateSet yyGLRStateSet
;
578 /** Type tag: always true. */
580 /** Type tag for yysemantics. If true, yysval applies, otherwise
581 * yyfirstVal applies. */
583 /** Number of corresponding LALR(1) machine state. */
584 yyStateNum yylrState
;
585 /** Preceding state in this stack */
587 /** Source position of the first token produced by my symbol */
590 /** First in a chain of alternative reductions producing the
591 * non-terminal corresponding to this state, threaded through
593 yySemanticOption
* yyfirstVal
;
594 /** Semantic value for this state. */
597 /** Source location for this state. */
601 struct yyGLRStateSet
{
602 yyGLRState
** yystates
;
603 size_t yysize
, yycapacity
;
606 struct yySemanticOption
{
607 /** Type tag: always false. */
609 /** Rule number for this reduction */
611 /** The last RHS state in the list of states to be reduced. */
613 /** Next sibling in chain of options. To facilitate merging,
614 * options are chained in decreasing order by address. */
615 yySemanticOption
* yynext
;
618 /** Type of the items in the GLR stack. The yyisState field
619 * indicates which item of the union is valid. */
620 union yyGLRStackItem
{
622 yySemanticOption yyoption
;
628 ]b4_location_if([[ /* To compute the location of the error token. */
629 yyGLRStackItem yyerror_range
[3];]])[
636 jmp_buf yyexception_buffer
;
637 yyGLRStackItem
* yyitems
;
638 yyGLRStackItem
* yynextFree
;
640 yyGLRState
* yysplitPoint
;
641 yyGLRState
* yylastDeleted
;
642 yyGLRStateSet yytops
;
645 static void yyinitGLRStack (yyGLRStack
* yystack
, size_t yysize
);
646 static void yyexpandGLRStack (yyGLRStack
* yystack
]b4_pure_formals
[);
647 static void yyfreeGLRStack (yyGLRStack
* yystack
);
650 yyFail (yyGLRStack
* yystack
]b4_pure_formals
[, const char* yyformat
, ...)
652 yystack
->yyerrflag
= 1;
653 if (yyformat
!= NULL
)
657 va_start (yyap
, yyformat
);
658 vsprintf (yymsg
, yyformat
, yyap
);
659 yyerror (]b4_yyerror_args
[yymsg
);
661 longjmp (yystack
->yyexception_buffer
, 1);
664 #if YYDEBUG || YYERROR_VERBOSE
665 /** A printable representation of TOKEN. Valid until next call to
667 static inline const char*
668 yytokenName (yySymbol yytoken
)
670 if (yytoken
== YYEMPTY
)
673 return yytname
[yytoken
];
677 /** Fill in YYVSP[YYLOW1 .. YYLOW0-1] from the chain of states starting
678 * at YYVSP[YYLOW0].yystate.yypred. Leaves YYVSP[YYLOW1].yystate.yypred
679 * containing the pointer to the next state in the chain. Assumes
680 * YYLOW1 < YYLOW0. */
681 static void yyfillin (yyGLRStackItem
*, int, int) ATTRIBUTE_UNUSED
;
683 yyfillin (yyGLRStackItem
*yyvsp
, int yylow0
, int yylow1
)
687 s
= yyvsp
[yylow0
].yystate
.yypred
;
688 for (i
= yylow0
-1; i
>= yylow1
; i
-= 1)
690 YYASSERT (s
->yyresolved
);
691 yyvsp
[i
].yystate
.yyresolved
= yytrue
;
692 yyvsp
[i
].yystate
.yysemantics
.yysval
= s
->yysemantics
.yysval
;
693 yyvsp
[i
].yystate
.yyloc
= s
->yyloc
;
694 s
= yyvsp
[i
].yystate
.yypred
= s
->yypred
;
698 /* Do nothing if YYNORMAL or if *YYLOW <= YYLOW1. Otherwise, fill in
699 YYVSP[YYLOW1 .. *YYLOW-1] as in yyfillin and set *YYLOW = YYLOW1.
700 For convenience, always return YYLOW1. */
701 static inline int yyfill (yyGLRStackItem
*, int *, int, yybool
)
704 yyfill (yyGLRStackItem
*yyvsp
, int *yylow
, int yylow1
, yybool yynormal
)
706 if (!yynormal
&& yylow1
< *yylow
)
708 yyfillin (yyvsp
, *yylow
, yylow1
);
714 /** Perform user action for rule number YYN, with RHS length YYRHSLEN,
715 * and top stack item YYVSP. YYLVALP points to place to put semantic
716 * value ($$), and yylocp points to place for location information
717 * (@@$). Returns yyok for normal return, yyaccept for YYACCEPT,
718 * yyerr for YYERROR, yyabort for YYABORT. */
720 yyuserAction (yyRuleNum yyn
, int yyrhslen
, yyGLRStackItem
* yyvsp
,
722 YYLTYPE
* yylocp
]b4_location_if(, [ ATTRIBUTE_UNUSED
])[,
726 yybool yynormal ATTRIBUTE_UNUSED
= (yystack
->yysplitPoint
== NULL
);
730 # define yyerrok (yystack->yyerrState = 0)
732 # define YYACCEPT return yyaccept
734 # define YYABORT return yyabort
736 # define YYERROR return yyerrok, yyerr
738 # define YYRECOVERING (yystack->yyerrState != 0)
740 # define yyclearin (yychar = *(yystack->yytokenp) = YYEMPTY)
742 # define YYFILL(N) yyfill (yyvsp, &yylow, N, yynormal)
744 # define YYBACKUP(Token, Value) \
745 return yyerror (]b4_yyerror_args["syntax error: cannot back up"), \
750 *yyvalp
= yyval_default
;
752 *yyvalp
= yyvsp
[YYFILL (1-yyrhslen
)].yystate
.yysemantics
.yysval
;
753 YYLLOC_DEFAULT (*yylocp
, yyvsp
- yyrhslen
, yyrhslen
);
769 /* Line __line__ of glr.c. */
770 b4_syncline([@oline@
], [@ofile@
])
775 yyuserMerge (int yyn
, YYSTYPE
* yy0
, YYSTYPE
* yy1
)
777 /* `Use' the arguments. */
787 /* Bison grammar-table manipulation. */
789 ]b4_yydestruct_generate([b4_c_ansi_function_def
])[
791 /** Number of symbols composing the right hand side of rule #RULE. */
793 yyrhsLength (yyRuleNum yyrule
)
798 /** Left-hand-side symbol for rule #RULE. */
799 static inline yySymbol
800 yylhsNonterm (yyRuleNum yyrule
)
805 #define yyis_pact_ninf(yystate) \
806 ]m4_if(m4_eval(b4_pact_ninf < b4_pact_min), 1,
808 ((yystate
) == YYPACT_NINF
))[
810 /** True iff LR state STATE has only a default reduction (regardless
813 yyisDefaultedState (yyStateNum yystate
)
815 return yyis_pact_ninf (yypact
[yystate
]);
818 /** The default reduction for STATE, assuming it has one. */
819 static inline yyRuleNum
820 yydefaultAction (yyStateNum yystate
)
822 return yydefact
[yystate
];
825 #define yyis_table_ninf(yytable_value) \
826 ]m4_if(m4_eval(b4_table_ninf < b4_table_min), 1,
828 ((yytable_value
) == YYTABLE_NINF
))[
830 /** Set *YYACTION to the action to take in YYSTATE on seeing YYTOKEN.
832 * R < 0: Reduce on rule -R.
834 * R > 0: Shift to state R.
835 * Set *CONFLICTS to a pointer into yyconfl to 0-terminated list of
836 * conflicting reductions.
839 yygetLRActions (yyStateNum yystate
, int yytoken
,
840 int* yyaction
, const short int** yyconflicts
)
842 int yyindex
= yypact
[yystate
] + yytoken
;
843 if (yyindex
< 0 || YYLAST
< yyindex
|| yycheck
[yyindex
] != yytoken
)
845 *yyaction
= -yydefact
[yystate
];
846 *yyconflicts
= yyconfl
;
848 else if (! yyis_table_ninf (yytable
[yyindex
]))
850 *yyaction
= yytable
[yyindex
];
851 *yyconflicts
= yyconfl
+ yyconflp
[yyindex
];
856 *yyconflicts
= yyconfl
+ yyconflp
[yyindex
];
860 static inline yyStateNum
861 yyLRgotoState (yyStateNum yystate
, yySymbol yylhs
)
864 yyr
= yypgoto
[yylhs
- YYNTOKENS
] + yystate
;
865 if (0 <= yyr
&& yyr
<= YYLAST
&& yycheck
[yyr
] == yystate
)
868 return yydefgoto
[yylhs
- YYNTOKENS
];
872 yyisShiftAction (int yyaction
)
878 yyisErrorAction (int yyaction
)
880 return yyaction
== 0;
886 yyaddDeferredAction (yyGLRStack
* yystack
, yyGLRState
* yystate
,
887 yyGLRState
* rhs
, yyRuleNum yyrule
]b4_pure_formals
[)
889 yySemanticOption
* yynewItem
;
890 yynewItem
= &yystack
->yynextFree
->yyoption
;
891 yystack
->yyspaceLeft
-= 1;
892 yystack
->yynextFree
+= 1;
893 yynewItem
->yyisState
= yyfalse
;
894 yynewItem
->yystate
= rhs
;
895 yynewItem
->yyrule
= yyrule
;
896 yynewItem
->yynext
= yystate
->yysemantics
.yyfirstVal
;
897 yystate
->yysemantics
.yyfirstVal
= yynewItem
;
898 if (yystack
->yyspaceLeft
< YYHEADROOM
)
899 yyexpandGLRStack (yystack
]b4_pure_args
[);
904 /** Initialize SET to a singleton set containing an empty stack. */
906 yyinitStateSet (yyGLRStateSet
* yyset
)
909 yyset
->yycapacity
= 16;
910 yyset
->yystates
= (yyGLRState
**) YYMALLOC (16 * sizeof yyset
->yystates
[0]);
911 yyset
->yystates
[0] = NULL
;
914 static void yyfreeStateSet (yyGLRStateSet
* yyset
)
916 YYFREE (yyset
->yystates
);
919 /** Initialize STACK to a single empty stack, with total maximum
920 * capacity for all stacks of SIZE. */
922 yyinitGLRStack (yyGLRStack
* yystack
, size_t yysize
)
924 yystack
->yyerrflag
= 0;
925 yystack
->yyerrState
= 0;
927 yystack
->yyspaceLeft
= yysize
;
928 yystack
->yynextFree
= yystack
->yyitems
=
929 (yyGLRStackItem
*) YYMALLOC (yysize
* sizeof yystack
->yynextFree
[0]);
930 yystack
->yysplitPoint
= NULL
;
931 yystack
->yylastDeleted
= NULL
;
932 yyinitStateSet (&yystack
->yytops
);
935 #define YYRELOC(YYFROMITEMS,YYTOITEMS,YYX,YYTYPE) \
936 &((YYTOITEMS) - ((YYFROMITEMS) - (yyGLRStackItem*) (YYX)))->YYTYPE
938 /** If STACK is expandable, extend it. WARNING: Pointers into the
939 stack from outside should be considered invalid after this call.
940 We always expand when there are 1 or fewer items left AFTER an
941 allocation, so that we can avoid having external pointers exist
942 across an allocation. */
944 yyexpandGLRStack (yyGLRStack
* yystack
]b4_pure_formals
[)
946 #if YYSTACKEXPANDABLE
947 yyGLRStack yynewStack
;
948 yyGLRStackItem
* yyp0
, *yyp1
;
949 size_t yysize
, yynewSize
;
951 yysize
= yystack
->yynextFree
- yystack
->yyitems
;
952 if (YYMAXDEPTH
<= yysize
)
953 yyFail (yystack
][]b4_pure_args
[, "parser stack overflow");
954 yynewSize
= 2*yysize
;
955 if (YYMAXDEPTH
< yynewSize
)
956 yynewSize
= YYMAXDEPTH
;
957 yyinitGLRStack (&yynewStack
, yynewSize
);
958 for (yyp0
= yystack
->yyitems
, yyp1
= yynewStack
.yyitems
, yyn
= yysize
;
960 yyn
-= 1, yyp0
+= 1, yyp1
+= 1)
963 if (*(yybool
*) yyp0
)
965 yyGLRState
* yys0
= &yyp0
->yystate
;
966 yyGLRState
* yys1
= &yyp1
->yystate
;
967 if (yys0
->yypred
!= NULL
)
969 YYRELOC (yyp0
, yyp1
, yys0
->yypred
, yystate
);
970 if (! yys0
->yyresolved
&& yys0
->yysemantics
.yyfirstVal
!= NULL
)
971 yys1
->yysemantics
.yyfirstVal
=
972 YYRELOC(yyp0
, yyp1
, yys0
->yysemantics
.yyfirstVal
, yyoption
);
976 yySemanticOption
* yyv0
= &yyp0
->yyoption
;
977 yySemanticOption
* yyv1
= &yyp1
->yyoption
;
978 if (yyv0
->yystate
!= NULL
)
979 yyv1
->yystate
= YYRELOC (yyp0
, yyp1
, yyv0
->yystate
, yystate
);
980 if (yyv0
->yynext
!= NULL
)
981 yyv1
->yynext
= YYRELOC (yyp0
, yyp1
, yyv0
->yynext
, yyoption
);
984 if (yystack
->yysplitPoint
!= NULL
)
985 yystack
->yysplitPoint
= YYRELOC (yystack
->yyitems
, yynewStack
.yyitems
,
986 yystack
->yysplitPoint
, yystate
);
988 for (yyn
= 0; yyn
< yystack
->yytops
.yysize
; yyn
+= 1)
989 if (yystack
->yytops
.yystates
[yyn
] != NULL
)
990 yystack
->yytops
.yystates
[yyn
] =
991 YYRELOC (yystack
->yyitems
, yynewStack
.yyitems
,
992 yystack
->yytops
.yystates
[yyn
], yystate
);
993 YYFREE (yystack
->yyitems
);
994 yystack
->yyitems
= yynewStack
.yyitems
;
995 yystack
->yynextFree
= yynewStack
.yynextFree
+ yysize
;
996 yystack
->yyspaceLeft
= yynewStack
.yyspaceLeft
- yysize
;
1000 yyFail (yystack
][]b4_pure_args
[, "parser stack overflow");
1005 yyfreeGLRStack (yyGLRStack
* yystack
)
1007 YYFREE (yystack
->yyitems
);
1008 yyfreeStateSet (&yystack
->yytops
);
1011 /** Assuming that S is a GLRState somewhere on STACK, update the
1012 * splitpoint of STACK, if needed, so that it is at least as deep as
1015 yyupdateSplit (yyGLRStack
* yystack
, yyGLRState
* yys
)
1017 if (yystack
->yysplitPoint
!= NULL
&& yystack
->yysplitPoint
> yys
)
1018 yystack
->yysplitPoint
= yys
;
1021 /** Invalidate stack #K in STACK. */
1023 yymarkStackDeleted (yyGLRStack
* yystack
, int yyk
)
1025 if (yystack
->yytops
.yystates
[yyk
] != NULL
)
1026 yystack
->yylastDeleted
= yystack
->yytops
.yystates
[yyk
];
1027 yystack
->yytops
.yystates
[yyk
] = NULL
;
1030 /** Undelete the last stack that was marked as deleted. Can only be
1031 done once after a deletion, and only when all other stacks have
1034 yyundeleteLastStack (yyGLRStack
* yystack
)
1036 if (yystack
->yylastDeleted
== NULL
|| yystack
->yytops
.yysize
!= 0)
1038 yystack
->yytops
.yystates
[0] = yystack
->yylastDeleted
;
1039 yystack
->yytops
.yysize
= 1;
1040 YYDPRINTF ((stderr
, "Restoring last deleted stack as stack #0.\n"));
1041 yystack
->yylastDeleted
= NULL
;
1045 yyremoveDeletes (yyGLRStack
* yystack
)
1049 while (yyj
< yystack
->yytops
.yysize
)
1051 if (yystack
->yytops
.yystates
[yyi
] == NULL
)
1055 YYDPRINTF ((stderr
, "Removing dead stacks.\n"));
1057 yystack
->yytops
.yysize
-= 1;
1061 yystack
->yytops
.yystates
[yyj
] = yystack
->yytops
.yystates
[yyi
];
1064 YYDPRINTF ((stderr
, "Rename stack %lu -> %lu.\n",
1065 (unsigned long int) yyi
, (unsigned long int) yyj
));
1073 /** Shift to a new state on stack #K of STACK, corresponding to LR state
1074 * LRSTATE, at input position POSN, with (resolved) semantic value SVAL. */
1076 yyglrShift (yyGLRStack
* yystack
, int yyk
, yyStateNum yylrState
, size_t yyposn
,
1077 YYSTYPE yysval
, YYLTYPE
* yylocp
]b4_user_formals
[)
1079 yyGLRStackItem
* yynewItem
;
1081 yynewItem
= yystack
->yynextFree
;
1082 yystack
->yynextFree
+= 1;
1083 yystack
->yyspaceLeft
-= 1;
1084 yynewItem
->yystate
.yyisState
= yytrue
;
1085 yynewItem
->yystate
.yylrState
= yylrState
;
1086 yynewItem
->yystate
.yyposn
= yyposn
;
1087 yynewItem
->yystate
.yyresolved
= yytrue
;
1088 yynewItem
->yystate
.yypred
= yystack
->yytops
.yystates
[yyk
];
1089 yystack
->yytops
.yystates
[yyk
] = &yynewItem
->yystate
;
1090 yynewItem
->yystate
.yysemantics
.yysval
= yysval
;
1091 yynewItem
->yystate
.yyloc
= *yylocp
;
1092 if (yystack
->yyspaceLeft
< YYHEADROOM
)
1093 yyexpandGLRStack (yystack
]b4_pure_args
[);
1096 /** Shift stack #K of YYSTACK, to a new state corresponding to LR
1097 * state YYLRSTATE, at input position YYPOSN, with the (unresolved)
1098 * semantic value of YYRHS under the action for YYRULE. */
1100 yyglrShiftDefer (yyGLRStack
* yystack
, int yyk
, yyStateNum yylrState
,
1101 size_t yyposn
, yyGLRState
* rhs
, yyRuleNum yyrule
]b4_pure_formals
[)
1103 yyGLRStackItem
* yynewItem
;
1105 yynewItem
= yystack
->yynextFree
;
1106 yynewItem
->yystate
.yyisState
= yytrue
;
1107 yynewItem
->yystate
.yylrState
= yylrState
;
1108 yynewItem
->yystate
.yyposn
= yyposn
;
1109 yynewItem
->yystate
.yyresolved
= yyfalse
;
1110 yynewItem
->yystate
.yypred
= yystack
->yytops
.yystates
[yyk
];
1111 yynewItem
->yystate
.yysemantics
.yyfirstVal
= NULL
;
1112 yystack
->yytops
.yystates
[yyk
] = &yynewItem
->yystate
;
1113 yystack
->yynextFree
+= 1;
1114 yystack
->yyspaceLeft
-= 1;
1115 yyaddDeferredAction (yystack
, &yynewItem
->yystate
, rhs
, yyrule
]b4_pure_args
[);
1118 /** Pop the symbols consumed by reduction #RULE from the top of stack
1119 * #K of STACK, and perform the appropriate semantic action on their
1120 * semantic values. Assumes that all ambiguities in semantic values
1121 * have been previously resolved. Set *VALP to the resulting value,
1122 * and *LOCP to the computed location (if any). Return value is as
1123 * for userAction. */
1124 static inline YYRESULTTAG
1125 yydoAction (yyGLRStack
* yystack
, int yyk
, yyRuleNum yyrule
,
1126 YYSTYPE
* yyvalp
, YYLTYPE
* yylocp
]b4_user_formals
[)
1128 int yynrhs
= yyrhsLength (yyrule
);
1130 if (yystack
->yysplitPoint
== NULL
)
1132 /* Standard special case: single stack. */
1133 yyGLRStackItem
* rhs
= (yyGLRStackItem
*) yystack
->yytops
.yystates
[yyk
];
1134 YYASSERT (yyk
== 0);
1135 yystack
->yynextFree
-= yynrhs
;
1136 yystack
->yyspaceLeft
+= yynrhs
;
1137 yystack
->yytops
.yystates
[0] = & yystack
->yynextFree
[-1].yystate
;
1138 return yyuserAction (yyrule
, yynrhs
, rhs
,
1139 yyvalp
, yylocp
, yystack
]b4_user_args
[);
1145 yyGLRStackItem yyrhsVals
[YYMAXRHS
+ YYMAXLEFT
+ 1];
1146 yys
= yyrhsVals
[YYMAXRHS
+ YYMAXLEFT
].yystate
.yypred
1147 = yystack
->yytops
.yystates
[yyk
];
1148 for (yyi
= 0; yyi
< yynrhs
; yyi
+= 1)
1153 yyupdateSplit (yystack
, yys
);
1154 yystack
->yytops
.yystates
[yyk
] = yys
;
1155 return yyuserAction (yyrule
, yynrhs
, yyrhsVals
+ YYMAXRHS
+ YYMAXLEFT
- 1,
1156 yyvalp
, yylocp
, yystack
]b4_user_args
[);
1161 # define YY_REDUCE_PRINT(K, Rule)
1163 # define YY_REDUCE_PRINT(K, Rule) \
1166 yy_reduce_print (K, Rule); \
1169 /*----------------------------------------------------------.
1170 | Report that the RULE is going to be reduced on stack #K. |
1171 `----------------------------------------------------------*/
1174 yy_reduce_print (size_t yyk
, yyRuleNum yyrule
)
1177 YYFPRINTF (stderr
, "Reducing stack %lu by rule %d (line %lu), ",
1178 (unsigned long int) yyk
, yyrule
- 1,
1179 (unsigned long int) yyrline
[yyrule
]);
1180 /* Print the symbols being reduced, and their result. */
1181 for (yyi
= yyprhs
[yyrule
]; 0 <= yyrhs
[yyi
]; yyi
++)
1182 YYFPRINTF (stderr
, "%s ", yytokenName (yyrhs
[yyi
]));
1183 YYFPRINTF (stderr
, "-> %s\n", yytokenName (yyr1
[yyrule
]));
1187 /** Pop items off stack #K of STACK according to grammar rule RULE,
1188 * and push back on the resulting nonterminal symbol. Perform the
1189 * semantic action associated with RULE and store its value with the
1190 * newly pushed state, if FORCEEVAL or if STACK is currently
1191 * unambiguous. Otherwise, store the deferred semantic action with
1192 * the new state. If the new state would have an identical input
1193 * position, LR state, and predecessor to an existing state on the stack,
1194 * it is identified with that existing state, eliminating stack #K from
1195 * the STACK. In this case, the (necessarily deferred) semantic value is
1196 * added to the options for the existing state's semantic value.
1198 static inline YYRESULTTAG
1199 yyglrReduce (yyGLRStack
* yystack
, size_t yyk
, yyRuleNum yyrule
,
1200 yybool yyforceEval
]b4_pure_formals
[)
1202 size_t yyposn
= yystack
->yytops
.yystates
[yyk
]->yyposn
;
1204 if (yyforceEval
|| yystack
->yysplitPoint
== NULL
)
1209 YY_REDUCE_PRINT (yyk
, yyrule
);
1210 YYCHK (yydoAction (yystack
, yyk
, yyrule
, &yysval
, &yyloc
]b4_user_args
[));
1211 yyglrShift (yystack
, yyk
,
1212 yyLRgotoState (yystack
->yytops
.yystates
[yyk
]->yylrState
,
1213 yylhsNonterm (yyrule
)),
1214 yyposn
, yysval
, &yyloc
]b4_user_args
[);
1220 yyGLRState
* yys
, *yys0
= yystack
->yytops
.yystates
[yyk
];
1221 yyStateNum yynewLRState
;
1223 for (yys
= yystack
->yytops
.yystates
[yyk
], yyn
= yyrhsLength (yyrule
);
1229 yyupdateSplit (yystack
, yys
);
1230 yynewLRState
= yyLRgotoState (yys
->yylrState
, yylhsNonterm (yyrule
));
1232 "Reduced stack %lu by rule #%d; action deferred. Now in state %d.\n",
1233 (unsigned long int) yyk
, yyrule
- 1, yynewLRState
));
1234 for (yyi
= 0; yyi
< yystack
->yytops
.yysize
; yyi
+= 1)
1235 if (yyi
!= yyk
&& yystack
->yytops
.yystates
[yyi
] != NULL
)
1237 yyGLRState
* yyp
, *yysplit
= yystack
->yysplitPoint
;
1238 yyp
= yystack
->yytops
.yystates
[yyi
];
1239 while (yyp
!= yys
&& yyp
!= yysplit
&& yyp
->yyposn
>= yyposn
)
1241 if (yyp
->yylrState
== yynewLRState
&& yyp
->yypred
== yys
)
1243 yyaddDeferredAction (yystack
, yyp
, yys0
, yyrule
]b4_pure_args
[);
1244 yymarkStackDeleted (yystack
, yyk
);
1245 YYDPRINTF ((stderr
, "Merging stack %lu into stack %lu.\n",
1246 (unsigned long int) yyk
,
1247 (unsigned long int) yyi
));
1253 yystack
->yytops
.yystates
[yyk
] = yys
;
1254 yyglrShiftDefer (yystack
, yyk
, yynewLRState
, yyposn
, yys0
, yyrule
]b4_pure_args
[);
1260 yysplitStack (yyGLRStack
* yystack
, int yyk
)
1262 if (yystack
->yysplitPoint
== NULL
)
1264 YYASSERT (yyk
== 0);
1265 yystack
->yysplitPoint
= yystack
->yytops
.yystates
[yyk
];
1267 if (yystack
->yytops
.yysize
>= yystack
->yytops
.yycapacity
)
1269 yystack
->yytops
.yycapacity
*= 2;
1270 yystack
->yytops
.yystates
=
1271 (yyGLRState
**) YYREALLOC (yystack
->yytops
.yystates
,
1272 (yystack
->yytops
.yycapacity
1273 * sizeof yystack
->yytops
.yystates
[0]));
1275 yystack
->yytops
.yystates
[yystack
->yytops
.yysize
]
1276 = yystack
->yytops
.yystates
[yyk
];
1277 yystack
->yytops
.yysize
+= 1;
1278 return yystack
->yytops
.yysize
-1;
1281 /** True iff Y0 and Y1 represent identical options at the top level.
1282 * That is, they represent the same rule applied to RHS symbols
1283 * that produce the same terminal symbols. */
1285 yyidenticalOptions (yySemanticOption
* yyy0
, yySemanticOption
* yyy1
)
1287 if (yyy0
->yyrule
== yyy1
->yyrule
)
1289 yyGLRState
*yys0
, *yys1
;
1291 for (yys0
= yyy0
->yystate
, yys1
= yyy1
->yystate
,
1292 yyn
= yyrhsLength (yyy0
->yyrule
);
1294 yys0
= yys0
->yypred
, yys1
= yys1
->yypred
, yyn
-= 1)
1295 if (yys0
->yyposn
!= yys1
->yyposn
)
1303 /** Assuming identicalOptions (Y0,Y1), destructively merge the
1304 * alternative semantic values for the RHS-symbols of Y1 and Y0. */
1306 yymergeOptionSets (yySemanticOption
* yyy0
, yySemanticOption
* yyy1
)
1308 yyGLRState
*yys0
, *yys1
;
1310 for (yys0
= yyy0
->yystate
, yys1
= yyy1
->yystate
,
1311 yyn
= yyrhsLength (yyy0
->yyrule
);
1313 yys0
= yys0
->yypred
, yys1
= yys1
->yypred
, yyn
-= 1)
1317 else if (yys0
->yyresolved
)
1319 yys1
->yyresolved
= yytrue
;
1320 yys1
->yysemantics
.yysval
= yys0
->yysemantics
.yysval
;
1322 else if (yys1
->yyresolved
)
1324 yys0
->yyresolved
= yytrue
;
1325 yys0
->yysemantics
.yysval
= yys1
->yysemantics
.yysval
;
1329 yySemanticOption
** yyz0p
;
1330 yySemanticOption
* yyz1
;
1331 yyz0p
= &yys0
->yysemantics
.yyfirstVal
;
1332 yyz1
= yys1
->yysemantics
.yyfirstVal
;
1335 if (yyz1
== *yyz0p
|| yyz1
== NULL
)
1337 else if (*yyz0p
== NULL
)
1342 else if (*yyz0p
< yyz1
)
1344 yySemanticOption
* yyz
= *yyz0p
;
1346 yyz1
= yyz1
->yynext
;
1347 (*yyz0p
)->yynext
= yyz
;
1349 yyz0p
= &(*yyz0p
)->yynext
;
1351 yys1
->yysemantics
.yyfirstVal
= yys0
->yysemantics
.yyfirstVal
;
1356 /** Y0 and Y1 represent two possible actions to take in a given
1357 * parsing state; return 0 if no combination is possible,
1358 * 1 if user-mergeable, 2 if Y0 is preferred, 3 if Y1 is preferred. */
1360 yypreference (yySemanticOption
* y0
, yySemanticOption
* y1
)
1362 yyRuleNum r0
= y0
->yyrule
, r1
= y1
->yyrule
;
1363 int p0
= yydprec
[r0
], p1
= yydprec
[r1
];
1367 if (yymerger
[r0
] == 0 || yymerger
[r0
] != yymerger
[r1
])
1372 if (p0
== 0 || p1
== 0)
1381 static YYRESULTTAG
yyresolveValue (yySemanticOption
* yyoptionList
,
1382 yyGLRStack
* yystack
, YYSTYPE
* yyvalp
,
1383 YYLTYPE
* yylocp
]b4_user_formals
[);
1386 yyresolveStates (yyGLRState
* yys
, int yyn
, yyGLRStack
* yystack
]b4_user_formals
[)
1391 YYASSERT (yys
->yypred
);
1392 yyflag
= yyresolveStates (yys
->yypred
, yyn
-1, yystack
]b4_user_args
[);
1395 if (! yys
->yyresolved
)
1397 yyflag
= yyresolveValue (yys
->yysemantics
.yyfirstVal
, yystack
,
1398 &yys
->yysemantics
.yysval
, &yys
->yyloc
1402 yys
->yyresolved
= yytrue
;
1409 yyresolveAction (yySemanticOption
* yyopt
, yyGLRStack
* yystack
,
1410 YYSTYPE
* yyvalp
, YYLTYPE
* yylocp
]b4_user_formals
[)
1412 yyGLRStackItem yyrhsVals
[YYMAXRHS
+ YYMAXLEFT
+ 1];
1415 yynrhs
= yyrhsLength (yyopt
->yyrule
);
1416 YYCHK (yyresolveStates (yyopt
->yystate
, yynrhs
, yystack
]b4_user_args
[));
1417 yyrhsVals
[YYMAXRHS
+ YYMAXLEFT
].yystate
.yypred
= yyopt
->yystate
;
1418 return yyuserAction (yyopt
->yyrule
, yynrhs
,
1419 yyrhsVals
+ YYMAXRHS
+ YYMAXLEFT
- 1,
1420 yyvalp
, yylocp
, yystack
]b4_user_args
[);
1425 yyreportTree (yySemanticOption
* yyx
, int yyindent
)
1427 int yynrhs
= yyrhsLength (yyx
->yyrule
);
1430 yyGLRState
* yystates
[YYMAXRHS
];
1431 yyGLRState yyleftmost_state
;
1433 for (yyi
= yynrhs
, yys
= yyx
->yystate
; 0 < yyi
; yyi
-= 1, yys
= yys
->yypred
)
1434 yystates
[yyi
] = yys
;
1437 yyleftmost_state
.yyposn
= 0;
1438 yystates
[0] = &yyleftmost_state
;
1443 if (yyx
->yystate
->yyposn
< yys
->yyposn
+ 1)
1444 YYFPRINTF (stderr
, "%*s%s -> <Rule %d, empty>\n",
1445 yyindent
, "", yytokenName (yylhsNonterm (yyx
->yyrule
)),
1448 YYFPRINTF (stderr
, "%*s%s -> <Rule %d, tokens %lu .. %lu>\n",
1449 yyindent
, "", yytokenName (yylhsNonterm (yyx
->yyrule
)),
1450 yyx
->yyrule
, (unsigned long int) (yys
->yyposn
+ 1),
1451 (unsigned long int) yyx
->yystate
->yyposn
);
1452 for (yyi
= 1; yyi
<= yynrhs
; yyi
+= 1)
1454 if (yystates
[yyi
]->yyresolved
)
1456 if (yystates
[yyi
-1]->yyposn
+1 > yystates
[yyi
]->yyposn
)
1457 YYFPRINTF (stderr
, "%*s%s <empty>\n", yyindent
+2, "",
1458 yytokenName (yyrhs
[yyprhs
[yyx
->yyrule
]+yyi
-1]));
1460 YYFPRINTF (stderr
, "%*s%s <tokens %lu .. %lu>\n", yyindent
+2, "",
1461 yytokenName (yyrhs
[yyprhs
[yyx
->yyrule
]+yyi
-1]),
1462 (unsigned long int) (yystates
[yyi
- 1]->yyposn
+ 1),
1463 (unsigned long int) yystates
[yyi
]->yyposn
);
1466 yyreportTree (yystates
[yyi
]->yysemantics
.yyfirstVal
, yyindent
+2);
1472 yyreportAmbiguity (yySemanticOption
* yyx0
, yySemanticOption
* yyx1
,
1473 yyGLRStack
* yystack
]b4_pure_formals
[)
1475 /* `Unused' warnings. */
1480 YYFPRINTF (stderr
, "Ambiguity detected.\n");
1481 YYFPRINTF (stderr
, "Option 1,\n");
1482 yyreportTree (yyx0
, 2);
1483 YYFPRINTF (stderr
, "\nOption 2,\n");
1484 yyreportTree (yyx1
, 2);
1485 YYFPRINTF (stderr
, "\n");
1487 yyFail (yystack
][]b4_pure_args
[, "ambiguity detected");
1491 /** Resolve the ambiguity represented by OPTIONLIST, perform the indicated
1492 * actions, and return the result. */
1494 yyresolveValue (yySemanticOption
* yyoptionList
, yyGLRStack
* yystack
,
1495 YYSTYPE
* yyvalp
, YYLTYPE
* yylocp
]b4_user_formals
[)
1497 yySemanticOption
* yybest
;
1498 yySemanticOption
* yyp
;
1501 yybest
= yyoptionList
;
1503 for (yyp
= yyoptionList
->yynext
; yyp
!= NULL
; yyp
= yyp
->yynext
)
1505 if (yyidenticalOptions (yybest
, yyp
))
1506 yymergeOptionSets (yybest
, yyp
);
1508 switch (yypreference (yybest
, yyp
))
1511 yyreportAmbiguity (yybest
, yyp
, yystack
]b4_pure_args
[);
1527 int yyprec
= yydprec
[yybest
->yyrule
];
1528 YYCHK (yyresolveAction (yybest
, yystack
, yyvalp
, yylocp
]b4_user_args
[));
1529 for (yyp
= yybest
->yynext
; yyp
!= NULL
; yyp
= yyp
->yynext
)
1531 if (yyprec
== yydprec
[yyp
->yyrule
])
1535 YYCHK (yyresolveAction (yyp
, yystack
, &yyval1
, &yydummy
]b4_user_args
[));
1536 yyuserMerge (yymerger
[yyp
->yyrule
], yyvalp
, &yyval1
);
1542 return yyresolveAction (yybest
, yystack
, yyvalp
, yylocp
]b4_user_args
[);
1546 yyresolveStack (yyGLRStack
* yystack
]b4_user_formals
[)
1548 if (yystack
->yysplitPoint
!= NULL
)
1553 for (yyn
= 0, yys
= yystack
->yytops
.yystates
[0];
1554 yys
!= yystack
->yysplitPoint
;
1555 yys
= yys
->yypred
, yyn
+= 1)
1557 YYCHK (yyresolveStates (yystack
->yytops
.yystates
[0], yyn
, yystack
1564 yycompressStack (yyGLRStack
* yystack
)
1566 yyGLRState
* yyp
, *yyq
, *yyr
;
1568 if (yystack
->yytops
.yysize
!= 1 || yystack
->yysplitPoint
== NULL
)
1571 for (yyp
= yystack
->yytops
.yystates
[0], yyq
= yyp
->yypred
, yyr
= NULL
;
1572 yyp
!= yystack
->yysplitPoint
;
1573 yyr
= yyp
, yyp
= yyq
, yyq
= yyp
->yypred
)
1576 yystack
->yyspaceLeft
+= yystack
->yynextFree
- yystack
->yyitems
;
1577 yystack
->yynextFree
= ((yyGLRStackItem
*) yystack
->yysplitPoint
) + 1;
1578 yystack
->yyspaceLeft
-= yystack
->yynextFree
- yystack
->yyitems
;
1579 yystack
->yysplitPoint
= NULL
;
1580 yystack
->yylastDeleted
= NULL
;
1584 yystack
->yynextFree
->yystate
= *yyr
;
1586 yystack
->yynextFree
->yystate
.yypred
= & yystack
->yynextFree
[-1].yystate
;
1587 yystack
->yytops
.yystates
[0] = &yystack
->yynextFree
->yystate
;
1588 yystack
->yynextFree
+= 1;
1589 yystack
->yyspaceLeft
-= 1;
1594 yyprocessOneStack (yyGLRStack
* yystack
, int yyk
,
1595 size_t yyposn
, YYSTYPE
* yylvalp
, YYLTYPE
* yyllocp
1599 const short int* yyconflicts
;
1601 yySymbol
* const yytokenp
= yystack
->yytokenp
;
1603 while (yystack
->yytops
.yystates
[yyk
] != NULL
)
1605 yyStateNum yystate
= yystack
->yytops
.yystates
[yyk
]->yylrState
;
1606 YYDPRINTF ((stderr
, "Stack %d Entering state %d\n", yyk
, yystate
));
1608 YYASSERT (yystate
!= YYFINAL
);
1610 if (yyisDefaultedState (yystate
))
1612 yyrule
= yydefaultAction (yystate
);
1615 YYDPRINTF ((stderr
, "Stack %d dies.\n", yyk
));
1616 yymarkStackDeleted (yystack
, yyk
);
1619 YYCHK (yyglrReduce (yystack
, yyk
, yyrule
, yyfalse
]b4_lpure_args
[));
1623 if (*yytokenp
== YYEMPTY
)
1625 YYDPRINTF ((stderr
, "Reading a token: "));
1627 *yytokenp
= YYTRANSLATE (yychar
);
1628 YY_SYMBOL_PRINT ("Next token is", *yytokenp
, yylvalp
, yyllocp
);
1629 YYDPRINTF ((stderr
, "\n"));
1631 yygetLRActions (yystate
, *yytokenp
, &yyaction
, &yyconflicts
);
1633 while (*yyconflicts
!= 0)
1635 int yynewStack
= yysplitStack (yystack
, yyk
);
1636 YYDPRINTF ((stderr
, "Splitting off stack %d from %d.\n",
1638 YYCHK (yyglrReduce (yystack
, yynewStack
,
1639 *yyconflicts
, yyfalse
]b4_lpure_args
[));
1640 YYCHK (yyprocessOneStack (yystack
, yynewStack
, yyposn
,
1641 yylvalp
, yyllocp
]b4_user_args
[));
1645 if (yyisShiftAction (yyaction
))
1647 YYDPRINTF ((stderr
, "On stack %d, ", yyk
));
1648 YY_SYMBOL_PRINT ("shifting", *yytokenp
, yylvalp
, yyllocp
);
1649 yyglrShift (yystack
, yyk
, yyaction
, yyposn
+1,
1650 *yylvalp
, yyllocp
]b4_user_args
[);
1651 YYDPRINTF ((stderr
, ", now in state #%d\n",
1652 yystack
->yytops
.yystates
[yyk
]->yylrState
));
1655 else if (yyisErrorAction (yyaction
))
1657 YYDPRINTF ((stderr
, "Stack %d dies.\n", yyk
));
1658 yymarkStackDeleted (yystack
, yyk
);
1662 YYCHK (yyglrReduce (yystack
, yyk
, -yyaction
, yyfalse
]b4_lpure_args
[));
1669 yyreportSyntaxError (yyGLRStack
* yystack
,
1670 YYSTYPE
* yylvalp
, YYLTYPE
* yyllocp
]b4_user_formals
[)
1672 /* `Unused' warnings. */
1676 if (yystack
->yyerrState
== 0)
1679 yySymbol
* const yytokenp
= yystack
->yytokenp
;
1681 yyn
= yypact
[yystack
->yytops
.yystates
[0]->yylrState
];
1682 if (YYPACT_NINF
< yyn
&& yyn
< YYLAST
)
1685 const char* yyprefix
;
1689 /* Start YYX at -YYN if negative to avoid negative indexes in
1691 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1693 /* Stay within bounds of both yycheck and yytname. */
1694 int yychecklim
= YYLAST
- yyn
;
1695 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1698 yyprefix
= ", expecting ";
1699 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1700 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1702 yysize
+= strlen (yyprefix
) + strlen (yytokenName (yyx
));
1711 yysize
+= (sizeof ("syntax error, unexpected ")
1712 + strlen (yytokenName (*yytokenp
)));
1713 yymsg
= (char*) YYMALLOC (yysize
);
1717 sprintf (yyp
, "syntax error%s%s",
1718 (*yytokenp
== YYEMPTY
? "" : ", unexpected "),
1719 yytokenName (*yytokenp
));
1720 yyp
+= strlen (yyp
);
1723 yyprefix
= ", expecting ";
1724 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1725 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
)
1727 sprintf (yyp
, "%s%s", yyprefix
, yytokenName (yyx
));
1728 yyp
+= strlen (yyp
);
1732 yyerror (]b4_lyyerror_args
[yymsg
);
1736 yyerror (]b4_lyyerror_args
["syntax error; also virtual memory exhausted");
1739 #endif /* YYERROR_VERBOSE */
1740 yyerror (]b4_lyyerror_args
["syntax error");
1745 /* Recover from a syntax error on YYSTACK, assuming that YYTOKENP,
1746 YYLVALP, and YYLLOCP point to the syntactic category, semantic
1747 value, and location of the look-ahead. */
1749 yyrecoverSyntaxError (yyGLRStack
* yystack
,
1751 YYLTYPE
* yyllocp
]b4_location_if(, [ ATTRIBUTE_UNUSED
])[
1754 yySymbol
* const yytokenp
= yystack
->yytokenp
;
1758 if (yystack
->yyerrState
== 3)
1759 /* We just shifted the error token and (perhaps) took some
1760 reductions. Skip tokens until we can proceed. */
1763 if (*yytokenp
== YYEOF
)
1765 /* Now pop stack until empty and fail. */
1766 while (yystack
->yytops
.yystates
[0] != NULL
)
1768 yyGLRState
*yys
= yystack
->yytops
.yystates
[0];
1769 ]b4_location_if([[ yystack
->yyerror_range
[1].yystate
.yyloc
= yys
->yyloc
;]])[
1770 yydestruct ("Error: popping",
1771 yystos
[yys
->yylrState
],
1772 &yys
->yysemantics
.yysval
]b4_location_if([, &yys
->yyloc
])[);
1773 yystack
->yytops
.yystates
[0] = yys
->yypred
;
1774 yystack
->yynextFree
-= 1;
1775 yystack
->yyspaceLeft
+= 1;
1777 yyFail (yystack
][]b4_lpure_args
[, NULL
);
1779 if (*yytokenp
!= YYEMPTY
)
1781 /* We throw away the lookahead, but the error range
1782 of the shifted error token must take it into account. */
1783 yyGLRState
*yys
= yystack
->yytops
.yystates
[0];
1784 yyGLRStackItem yyerror_range
[3];
1785 yyerror_range
[1].yystate
.yyloc
= yys
->yyloc
;
1786 yyerror_range
[2].yystate
.yyloc
= *yyllocp
;
1787 YYLLOC_DEFAULT (yys
->yyloc
, yyerror_range
, 2);]])[
1788 yydestruct ("Error: discarding",
1789 *yytokenp
, yylvalp
]b4_location_if([, yyllocp
])[);
1791 YYDPRINTF ((stderr
, "Reading a token: "));
1793 *yytokenp
= YYTRANSLATE (yychar
);
1794 YY_SYMBOL_PRINT ("Next token is", *yytokenp
, yylvalp
, yyllocp
);
1795 YYDPRINTF ((stderr
, "\n"));
1796 yyj
= yypact
[yystack
->yytops
.yystates
[0]->yylrState
];
1797 if (yyis_pact_ninf (yyj
))
1800 if (yyj
< 0 || YYLAST
< yyj
|| yycheck
[yyj
] != *yytokenp
)
1802 if (yydefact
[yystack
->yytops
.yystates
[0]->yylrState
] != 0)
1805 else if (yytable
[yyj
] != 0 && ! yyis_table_ninf (yytable
[yyj
]))
1809 /* Reduce to one stack. */
1810 for (yyk
= 0; yyk
< yystack
->yytops
.yysize
; yyk
+= 1)
1811 if (yystack
->yytops
.yystates
[yyk
] != NULL
)
1813 if (yyk
>= yystack
->yytops
.yysize
)
1814 yyFail (yystack
][]b4_lpure_args
[, NULL
);
1815 for (yyk
+= 1; yyk
< yystack
->yytops
.yysize
; yyk
+= 1)
1816 yymarkStackDeleted (yystack
, yyk
);
1817 yyremoveDeletes (yystack
);
1818 yycompressStack (yystack
);
1820 /* Now pop stack until we find a state that shifts the error token. */
1821 yystack
->yyerrState
= 3;
1822 while (yystack
->yytops
.yystates
[0] != NULL
)
1824 yyGLRState
*yys
= yystack
->yytops
.yystates
[0];
1825 yyj
= yypact
[yys
->yylrState
];
1826 if (! yyis_pact_ninf (yyj
))
1829 if (0 <= yyj
&& yyj
<= YYLAST
&& yycheck
[yyj
] == YYTERROR
1830 && yyisShiftAction (yytable
[yyj
]))
1832 /* Shift the error token having adjusted its location. */
1833 YYLTYPE yyerrloc
;]b4_location_if([[
1834 yystack
->yyerror_range
[2].yystate
.yyloc
= *yyllocp
;
1835 YYLLOC_DEFAULT (yyerrloc
, yystack
->yyerror_range
, 2);]])[
1836 YY_SYMBOL_PRINT ("Shifting", yystos
[yytable
[yyj
]],
1837 yylvalp
, &yyerrloc
);
1838 YYDPRINTF ((stderr
, "\n"));
1839 yyglrShift (yystack
, 0, yytable
[yyj
],
1840 yys
->yyposn
, *yylvalp
, &yyerrloc
]b4_user_args
[);
1841 yys
= yystack
->yytops
.yystates
[0];
1845 ]b4_location_if([[ yystack
->yyerror_range
[1].yystate
.yyloc
= yys
->yyloc
;]])[
1846 yydestruct ("Error: popping",
1847 yystos
[yys
->yylrState
],
1848 &yys
->yysemantics
.yysval
]b4_location_if([, &yys
->yyloc
])[);
1849 yystack
->yytops
.yystates
[0] = yys
->yypred
;
1850 yystack
->yynextFree
-= 1;
1851 yystack
->yyspaceLeft
+= 1;
1853 if (yystack
->yytops
.yystates
[0] == NULL
)
1854 yyFail (yystack
][]b4_lpure_args
[, NULL
);
1857 #define YYCHK1(YYE) \
1863 yystack.yyerrflag = 1; \
1866 yystack.yyerrflag = 0; \
1869 goto yyuser_error; \
1878 ]b4_c_ansi_function_def([yyparse
], [int], b4_parse_param
)[
1888 #define yychar (yystack.yyrawchar)
1891 YYSTYPE
* const yylvalp
= &yylval
;
1892 YYLTYPE
* const yyllocp
= &yylloc
;
1894 yyinitGLRStack (&yystack
, YYINITDEPTH
);
1895 yystack
.yytokenp
= &yytoken
;
1897 YYDPRINTF ((stderr
, "Starting parse\n"));
1899 if (setjmp (yystack
.yyexception_buffer
) != 0)
1902 yylval
= yyval_default
;
1904 #if YYLTYPE_IS_TRIVIAL
1905 yylloc
.first_line
= yylloc
.last_line
= 1;
1906 yylloc
.first_column
= yylloc
.last_column
= 0;
1909 m4_ifdef([b4_initial_action
], [
1910 m4_pushdef([b4_at_dollar
], [yylval
])dnl
1911 m4_pushdef([b4_dollar_dollar
], [yylloc
])dnl
1912 /* User initialization code. */
1914 m4_popdef([b4_dollar_dollar
])dnl
1915 m4_popdef([b4_at_dollar
])dnl
1916 /* Line __line__ of glr.c. */
1917 b4_syncline([@oline@
], [@ofile@
])])dnl
1919 yyglrShift (&yystack
, 0, 0, 0, yylval
, &yylloc
]b4_user_args
[);
1925 /* For efficiency, we have two loops, the first of which is
1926 specialized to deterministic operation (single stack, no
1927 potential ambiguity). */
1933 const short int* yyconflicts
;
1935 yyStateNum yystate
= yystack
.yytops
.yystates
[0]->yylrState
;
1936 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1937 if (yystate
== YYFINAL
)
1939 if (yyisDefaultedState (yystate
))
1941 yyrule
= yydefaultAction (yystate
);
1944 ]b4_location_if([[ yystack
.yyerror_range
[1].yystate
.yyloc
= *yyllocp
;]])[
1945 yyreportSyntaxError (&yystack
, yylvalp
, yyllocp
]b4_user_args
[);
1948 YYCHK1 (yyglrReduce (&yystack
, 0, yyrule
, yytrue
]b4_lpure_args
[));
1952 if (yytoken
== YYEMPTY
)
1954 YYDPRINTF ((stderr
, "Reading a token: "));
1956 yytoken
= YYTRANSLATE (yychar
);
1957 YY_SYMBOL_PRINT ("Next token is", yytoken
, yylvalp
, yyllocp
);
1958 YYDPRINTF ((stderr
, "\n"));
1960 yygetLRActions (yystate
, yytoken
, &yyaction
, &yyconflicts
);
1961 if (*yyconflicts
!= 0)
1963 if (yyisShiftAction (yyaction
))
1965 YY_SYMBOL_PRINT ("Shifting", yytoken
, yylvalp
, yyllocp
);
1966 YYDPRINTF ((stderr
, "\n"));
1967 if (yytoken
!= YYEOF
)
1970 yyglrShift (&yystack
, 0, yyaction
, yyposn
,
1971 yylval
, yyllocp
]b4_user_args
[);
1972 if (0 < yystack
.yyerrState
)
1973 yystack
.yyerrState
-= 1;
1975 else if (yyisErrorAction (yyaction
))
1977 ]b4_location_if([[ yystack
.yyerror_range
[1].yystate
.yyloc
= *yyllocp
;]])[
1978 yyreportSyntaxError (&yystack
, yylvalp
, yyllocp
]b4_user_args
[);
1982 YYCHK1 (yyglrReduce (&yystack
, 0, -yyaction
, yytrue
]b4_lpure_args
[));
1989 int yyn
= yystack
.yytops
.yysize
;
1990 for (yys
= 0; yys
< yyn
; yys
+= 1)
1991 YYCHK1 (yyprocessOneStack (&yystack
, yys
, yyposn
,
1992 yylvalp
, yyllocp
]b4_user_args
[));
1995 yyremoveDeletes (&yystack
);
1996 if (yystack
.yytops
.yysize
== 0)
1998 yyundeleteLastStack (&yystack
);
1999 if (yystack
.yytops
.yysize
== 0)
2000 yyFail (&yystack
][]b4_lpure_args
[, "syntax error");
2001 YYCHK1 (yyresolveStack (&yystack
]b4_user_args
[));
2002 YYDPRINTF ((stderr
, "Returning to deterministic operation.\n"));
2003 ]b4_location_if([[ yystack
.yyerror_range
[1].yystate
.yyloc
= *yyllocp
;]])[
2004 yyreportSyntaxError (&yystack
, yylvalp
, yyllocp
]b4_user_args
[);
2007 else if (yystack
.yytops
.yysize
== 1)
2009 YYCHK1 (yyresolveStack (&yystack
]b4_user_args
[));
2010 YYDPRINTF ((stderr
, "Returning to deterministic operation.\n"));
2011 yycompressStack (&yystack
);
2017 yyrecoverSyntaxError (&yystack
, yylvalp
, yyllocp
]b4_user_args
[);
2018 yyposn
= yystack
.yytops
.yystates
[0]->yyposn
;
2021 /* On YYABORT, free the lookahead. */
2022 if (yystack
.yyerrflag
== 1 && yytoken
!= YYEMPTY
)
2023 yydestruct ("Error: discarding lookahead",
2024 yytoken
, yylvalp
]b4_location_if([, yyllocp
])[);
2026 yyfreeGLRStack (&yystack
);
2027 return yystack
.yyerrflag
;
2030 /* DEBUGGING ONLY */
2032 static void yypstack (yyGLRStack
* yystack
, int yyk
) ATTRIBUTE_UNUSED
;
2033 static void yypdumpstack (yyGLRStack
* yystack
) ATTRIBUTE_UNUSED
;
2036 yy_yypstack (yyGLRState
* yys
)
2040 yy_yypstack (yys
->yypred
);
2041 fprintf (stderr
, " -> ");
2043 fprintf (stderr
, "%d@@%lu", yys
->yylrState
, (unsigned long int) yys
->yyposn
);
2047 yypstates (yyGLRState
* yyst
)
2050 fprintf (stderr
, "<null>");
2053 fprintf (stderr
, "\n");
2057 yypstack (yyGLRStack
* yystack
, int yyk
)
2059 yypstates (yystack
->yytops
.yystates
[yyk
]);
2062 #define YYINDEX(YYX) \
2063 ((YYX) == NULL ? -1 : (yyGLRStackItem*) (YYX) - yystack->yyitems)
2067 yypdumpstack (yyGLRStack
* yystack
)
2069 yyGLRStackItem
* yyp
;
2071 for (yyp
= yystack
->yyitems
; yyp
< yystack
->yynextFree
; yyp
+= 1)
2073 fprintf (stderr
, "%3lu. ", (unsigned long int) (yyp
- yystack
->yyitems
));
2074 if (*(yybool
*) yyp
)
2076 fprintf (stderr
, "Res: %d, LR State: %d, posn: %lu, pred: %ld",
2077 yyp
->yystate
.yyresolved
, yyp
->yystate
.yylrState
,
2078 (unsigned long int) yyp
->yystate
.yyposn
,
2079 (long int) YYINDEX (yyp
->yystate
.yypred
));
2080 if (! yyp
->yystate
.yyresolved
)
2081 fprintf (stderr
, ", firstVal: %ld",
2082 (long int) YYINDEX (yyp
->yystate
.yysemantics
.yyfirstVal
));
2086 fprintf (stderr
, "Option. rule: %d, state: %ld, next: %ld",
2087 yyp
->yyoption
.yyrule
,
2088 (long int) YYINDEX (yyp
->yyoption
.yystate
),
2089 (long int) YYINDEX (yyp
->yyoption
.yynext
));
2091 fprintf (stderr
, "\n");
2093 fprintf (stderr
, "Tops:");
2094 for (yyi
= 0; yyi
< yystack
->yytops
.yysize
; yyi
+= 1)
2095 fprintf (stderr
, "%lu: %ld; ", (unsigned long int) yyi
,
2096 (long int) YYINDEX (yystack
->yytops
.yystates
[yyi
]));
2097 fprintf (stderr
, "\n");
2103 m4_if(b4_defines_flag
, 0, [],
2104 [@output @output_header_name@
2105 b4_copyright([Skeleton parser
for GLR parsing with Bison
],
2106 [2002, 2003, 2004, 2005])
2108 b4_token_defines(b4_tokens
)
2110 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
2111 m4_ifdef([b4_stype
],
2112 [b4_syncline([b4_stype_line
], [b4_filename
])
2113 typedef union m4_bregexp(b4_stype
, [^{], [YYSTYPE
])b4_stype YYSTYPE
;
2114 /* Line __line__ of glr.c. */
2115 b4_syncline([@oline@
], [@ofile@
])],
2116 [typedef int YYSTYPE
;])
2117 # define YYSTYPE_IS_DECLARED 1
2118 # define YYSTYPE_IS_TRIVIAL 1
2122 [extern YYSTYPE b4_prefix
[]lval
;])
2124 #if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
2125 typedef struct YYLTYPE
2136 # define YYLTYPE_IS_DECLARED 1
2137 # define YYLTYPE_IS_TRIVIAL 1
2140 b4_location_if([b4_pure_if([],
2141 [extern YYLTYPE b4_prefix
[]lloc
;])