]b4_identification
m4_if(b4_prefix, [yy], [],
[/* Substitute the variable and function names. */
-#define yyparse b4_prefix[]parse
]b4_push_if([#define yypush_parse b4_prefix[]push_parse
#define yypstate_new b4_prefix[]pstate_new
#define yypstate_delete b4_prefix[]pstate_delete
-#define yypstate b4_prefix[]pstate])[
+#define yypstate b4_prefix[]pstate],
+[#define yyparse b4_prefix[]parse])[
#define yylex b4_prefix[]lex
#define yyerror b4_prefix[]error
#define yylval b4_prefix[]lval
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss;
- YYSTYPE yyvs;
- ]b4_locations_if([ YYLTYPE yyls;
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;
+ ]b4_locations_if([ YYLTYPE yyls_alloc;
])dnl
[};
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack) \
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
[[YYSTYPE *yyvsp], [yyvsp]],
b4_locations_if([[[YYLTYPE *yylsp], [yylsp]],
])[[int yyrule], [yyrule]]m4_ifset([b4_parse_param], [,
- ])b4_parse_param)[
+ b4_parse_param]))[
{
int yynrhs = yyr2[yyrule];
int yyi;
/* Prevent warnings from -Wmissing-prototypes. */
-#ifdef YYPARSE_PARAM
-]b4_c_function_decl([yyparse], [int],
- [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[
-#else /* ! YYPARSE_PARAM */
-]b4_c_function_decl([yyparse], [int], b4_parse_param)[
-#endif /* ! YYPARSE_PARAM */
-
]b4_push_if([
struct yypstate;
+typedef struct yypstate yypstate;
enum { YYPUSH_MORE = 4 };
-]b4_c_function_decl([yypstate_new], [struct yypstate *], [[void], []])[
-]b4_c_function_decl([yypstate_delete], [void], [[struct yypstate *yyps], [yyps]])[
+]b4_c_function_decl([yypstate_new], [yypstate *], [[void], []])[
+]b4_c_function_decl([yypstate_delete], [void], [[yypstate *yyps], [yyps]])[
]b4_c_function_decl([yypush_parse], [int],
- [[struct yypstate *yyps], [yyps]],
+ [[yypstate *yyps], [yyps]],
[[int yynchar], [yynchar]],
[[YYSTYPE const *yynlval], [yynlval]]
- b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]]))[
-])[
+ b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]])
+ m4_ifset([b4_parse_param], [, b4_parse_param]))[
+],[#ifdef YYPARSE_PARAM
+]b4_c_function_decl([yyparse], [int],
+ [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])[
+#else /* ! YYPARSE_PARAM */
+]b4_c_function_decl([yyparse], [int], b4_parse_param)[
+#endif /* ! YYPARSE_PARAM */])[
]m4_divert_push([KILL])# ======================== M4 code.
# b4_declare_parser_variables
};
/* Initialize the parser data structure. */
-]b4_c_function_def([yypstate_new], [struct yypstate *])[
+]b4_c_function_def([yypstate_new], [yypstate *])[
{
- struct yypstate *yyps = (struct yypstate *) malloc (sizeof *yyps);
+ yypstate *yyps = (yypstate *) malloc (sizeof *yyps);
yyps->yystate = 0;
yyps->yyresult = -1;
yyps->yyerrstatus = 0;
}
]b4_c_function_def([yypstate_delete], [void],
- [[struct yypstate *yyps], [yyps]])[
+ [[yypstate *yyps], [yyps]])[
{
free (yyps);
}
])
m4_divert_pop([KILL])dnl# ====================== End of M4 code.
-b4_push_if([],[b4_pure_if([],
- [b4_declare_parser_variables])])
+b4_pure_if([], [b4_declare_parser_variables])
b4_push_if([b4_declare_yyparse_variables])
`-------------------------*/
b4_push_if([
-b4_c_function_def([yypush_parse], [int], [[struct yypstate *yyps], [yyps]],
+b4_c_function_def([yypush_parse], [int], [[yypstate *yyps], [yyps]],
[[int yynchar], [yynchar]],
[[YYSTYPE const *yynlval], [yynlval]]
- b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]]))],[
+ b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]])
+ m4_ifset([b4_parse_param], [, b4_parse_param]))],[
#ifdef YYPARSE_PARAM
b4_c_function_def([yyparse], [int], [[void *YYPARSE_PARAM], [YYPARSE_PARAM]])
#else /* ! YYPARSE_PARAM */
#endif])
{[
]b4_pure_if([b4_declare_parser_variables])[
- ]b4_push_if([b4_declare_parser_variables])[
int yystate;
int yyn;
int yyresult;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-]b4_locations_if([ YYSTACK_RELOCATE (yyls);])[
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+]b4_locations_if([ YYSTACK_RELOCATE (yyls_alloc, yyls);])[
# undef YYSTACK_RELOCATE
if (yyss1 != ]b4_yyssa[)
YYSTACK_FREE (yyss1);
# define YYLTYPE_IS_TRIVIAL 1
#endif
+]b4_pure_if([],
+ [extern YYLTYPE b4_prefix[]lloc;])
+)dnl b4_locations_if
+
]b4_push_if([struct ]b4_prefix[pstate;
-]b4_c_function_decl([]b4_prefix[pstate_new], [struct ]b4_prefix[pstate *],
+typedef struct ]b4_prefix[pstate ]b4_prefix[pstate;
+]b4_c_function_decl([]b4_prefix[pstate_new], []b4_prefix[pstate *],
[[void], []])[
]b4_c_function_decl([]b4_prefix[pstate_delete], [void],
- [[struct ]b4_prefix[pstate *yyps],[yyps]])[
+ [[]b4_prefix[pstate *yyps],[yyps]])[
]b4_c_function_decl([]b4_prefix[push_parse], [int],
- [[struct ]b4_prefix[pstate *]b4_prefix[pstate], []b4_prefix[pstate]],
+ [[]b4_prefix[pstate *]b4_prefix[pstate], []b4_prefix[pstate]],
[[int yynchar], [yynchar]],
[[YYSTYPE const *yynlval], [yynlval]]
- b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]]))[
+ b4_locations_if([,[[YYLTYPE const *yynlloc], [yynlloc]]])
+ m4_ifset([b4_parse_param], [, b4_parse_param]))[
enum { YYPUSH_MORE = 4 };])[
-]b4_pure_if([],
- [extern YYLTYPE b4_prefix[]lloc;])
-)dnl b4_locations_if
m4_ifdef([b4_provides],
[[/* Copy the %provides blocks. */