# b4_declare_yyparse_push_
# ------------------------
+# Declaration of yyparse (and dependencies) when using the push parser
+# (including in pull mode).
m4_define([b4_declare_yyparse_push_],
[[typedef struct ]b4_prefix[pstate ]b4_prefix[pstate;
enum { YYPUSH_MORE = 4 };
# Declaration that might either go into the header (if --defines)
# or open coded in the parser body.
m4_define([b4_shared_declarations],
-[b4_declare_yydebug[
+[b4_cpp_guard_open([b4_spec_defines_file])[
+]b4_declare_yydebug[
]b4_percent_code_get([[requires]])[
]b4_token_enums_defines(b4_tokens)[
]b4_declare_yylstype[
]b4_declare_yyparse[
-]b4_percent_code_get([[provides]])[]dnl
+]b4_percent_code_get([[provides]])[
+]b4_cpp_guard_close([b4_spec_defines_file])[]dnl
])
## -------------- ##
]b4_identification
b4_percent_code_get([[top]])[]dnl
-m4_if(b4_prefix, [yy], [],
+m4_if(b4_api_prefix, [yy], [],
+[[/* Substitute the type names. */
+#define YYSTYPE ]b4_api_PREFIX[STYPE
+#define YYSTYPE_IS_TRIVIAL ]b4_api_PREFIX[STYPE_IS_TRIVIAL
+#define YYSTYPE_IS_DECLARED ]b4_api_PREFIX[STYPE_IS_DECLARED]b4_locations_if([[
+#define YYLTYPE ]b4_api_PREFIX[LTYPE
+#define YYLTYPE_IS_TRIVIAL ]b4_api_PREFIX[LTYPE_IS_TRIVIAL
+#define YYLTYPE_IS_DECLARED ]b4_api_PREFIX[LTYPE_IS_DECLARED]])])[
+]m4_if(b4_prefix, [yy], [],
[[/* Substitute the variable and function names. */]b4_pull_if([[
#define yyparse ]b4_prefix[parse]])b4_push_if([[
#define yypush_parse ]b4_prefix[push_parse]b4_pull_if([[
#define yylval ]b4_prefix[lval
#define yychar ]b4_prefix[char
#define yydebug ]b4_prefix[debug
-#define yynerrs ]b4_prefix[nerrs
-]b4_locations_if([[#define yylloc ]b4_prefix[lloc]])])[
+#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[
+#define yylloc ]b4_prefix[lloc]])])[
/* Copy the first part of user declarations. */
]b4_user_pre_prologue[
# define YYERROR_VERBOSE ]b4_error_verbose_if([1], [0])[
#endif
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE ]b4_token_table[
-#endif
-
-]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
- [b4_shared_declarations])[
+/* In a future release of Bison, this section will be replaced
+ by #include "@basename(]b4_spec_defines_file[@)". */
+]b4_shared_declarations[
/* Copy the second part of user declarations. */
]b4_user_post_prologue
[YYRLINE[YYN] -- Source line where rule number YYN was defined.])[
#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || ]b4_token_table_flag[
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
[@output(b4_spec_defines_file@)@
b4_copyright([Bison interface for Yacc-like parsers in C])[
-]b4_cpp_guard_open([b4_spec_defines_file])[
]b4_shared_declarations[
-]b4_pure_if([], [[extern YYSTYPE ]b4_prefix[lval;
-]b4_locations_if([[extern YYLTYPE ]b4_prefix[lloc;]])])[
-]b4_cpp_guard_close([b4_spec_defines_file])[
]])dnl b4_defines_if
m4_divert_pop(0)
m4_popdef([b4_copyright_years])