mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
* data/bison.m4 (b4_percent_code_get): Output %code block comments like
`"%code top" blocks' instead of `%code "top" blocks'. * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03. Clean up whitespace in the output a little.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
|
||||||
|
|
||||||
|
* data/bison.m4 (b4_percent_code_get): Output %code block comments like
|
||||||
|
`"%code top" blocks' instead of `%code "top" blocks'.
|
||||||
|
* data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
|
||||||
|
Clean up whitespace in the output a little.
|
||||||
|
|
||||||
2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
|
2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
|
||||||
|
|
||||||
Fix documentation problems reported by Tim Josling at
|
Fix documentation problems reported by Tim Josling at
|
||||||
@@ -359,7 +366,7 @@
|
|||||||
glr.cc has already defined b4_pure_flag.
|
glr.cc has already defined b4_pure_flag.
|
||||||
* data/push.c: Define b4_pure_if based on `%define api.pure'.
|
* data/push.c: Define b4_pure_if based on `%define api.pure'.
|
||||||
Remove YYPUSH and YYPULL since they're back in b4_identification again.
|
Remove YYPUSH and YYPULL since they're back in b4_identification again.
|
||||||
* data/yacc.c Define b4_pure_if based on `%define api.pure'.
|
* data/yacc.c: Define b4_pure_if based on `%define api.pure'.
|
||||||
* doc/bison.texinfo (Pure Decl): Update.
|
* doc/bison.texinfo (Pure Decl): Update.
|
||||||
(Push Decl): Update.
|
(Push Decl): Update.
|
||||||
(Decl Summary): Add api.pure to %define entry.
|
(Decl Summary): Add api.pure to %define entry.
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
-*- Autoconf -*-
|
-*- Autoconf -*-
|
||||||
|
|
||||||
# Language-independent M4 Macros for Bison.
|
# Language-independent M4 Macros for Bison.
|
||||||
# Copyright (C) 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
|
# Copyright (C) 2002, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
|
||||||
|
# Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -521,7 +522,7 @@ m4_define([b4_percent_code_get],
|
|||||||
m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])dnl
|
m4_ifval([$1], [m4_define([b4_percent_code_bison_qualifiers(]$1[)])])dnl
|
||||||
m4_ifdef(b4_macro_name,
|
m4_ifdef(b4_macro_name,
|
||||||
[b4_comment([m4_if([$#], [0], [[Unqualified %code]],
|
[b4_comment([m4_if([$#], [0], [[Unqualified %code]],
|
||||||
[[%code "]$1["]])[ blocks.]])
|
[["%code ]$1["]])[ blocks.]])
|
||||||
b4_user_code([m4_indir(b4_macro_name)])
|
b4_user_code([m4_indir(b4_macro_name)])
|
||||||
])dnl
|
])dnl
|
||||||
m4_popdef([b4_macro_name])])
|
m4_popdef([b4_macro_name])])
|
||||||
|
|||||||
75
data/push.c
75
data/push.c
@@ -3,7 +3,7 @@
|
|||||||
# Yacc compatible skeleton for Bison
|
# Yacc compatible skeleton for Bison
|
||||||
|
|
||||||
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
# Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||||
# 2007 Free Software Foundation, Inc.
|
# 2007, 2008 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -168,7 +168,6 @@ b4_copyright([Skeleton implementation for Bison's Yacc-like parsers in C],dnl '
|
|||||||
USER NAME SPACE" below. */
|
USER NAME SPACE" below. */
|
||||||
|
|
||||||
]b4_identification
|
]b4_identification
|
||||||
|
|
||||||
b4_percent_code_get([[top]])[]dnl
|
b4_percent_code_get([[top]])[]dnl
|
||||||
m4_if(b4_prefix, [yy], [],
|
m4_if(b4_prefix, [yy], [],
|
||||||
[[/* Substitute the variable and function names. */
|
[[/* Substitute the variable and function names. */
|
||||||
@@ -223,9 +222,9 @@ b4_token_enums_defines(b4_tokens)[
|
|||||||
# define YYSTYPE_IS_TRIVIAL 1]])])[
|
# define YYSTYPE_IS_TRIVIAL 1]])])[
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
#endif
|
#endif]b4_locations_if([[
|
||||||
|
|
||||||
]b4_locations_if([#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||||
typedef struct YYLTYPE
|
typedef struct YYLTYPE
|
||||||
{
|
{
|
||||||
int first_line;
|
int first_line;
|
||||||
@@ -236,9 +235,9 @@ typedef struct YYLTYPE
|
|||||||
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
|
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYLTYPE_IS_DECLARED 1
|
# define YYLTYPE_IS_DECLARED 1
|
||||||
# define YYLTYPE_IS_TRIVIAL 1
|
# define YYLTYPE_IS_TRIVIAL 1
|
||||||
#endif])
|
#endif]])b4_push_if([[
|
||||||
|
|
||||||
b4_push_if([[#ifndef YYPUSH_DECLS
|
#ifndef YYPUSH_DECLS
|
||||||
# define YYPUSH_DECLS
|
# define YYPUSH_DECLS
|
||||||
struct yypstate;
|
struct yypstate;
|
||||||
typedef struct yypstate yypstate;
|
typedef struct yypstate yypstate;
|
||||||
@@ -257,8 +256,8 @@ b4_pull_if([b4_c_function_decl([[yypull_parse]], [[int]],
|
|||||||
b4_c_function_decl([[yypstate_new]], [[yypstate *]], [[[void]], []])
|
b4_c_function_decl([[yypstate_new]], [[yypstate *]], [[[void]], []])
|
||||||
b4_c_function_decl([[yypstate_delete]], [[void]],
|
b4_c_function_decl([[yypstate_delete]], [[void]],
|
||||||
[[[yypstate *yyps]], [[yyps]]])[
|
[[[yypstate *yyps]], [[yyps]]])[
|
||||||
#endif
|
#endif]])
|
||||||
]])
|
|
||||||
b4_percent_code_get([[provides]])[]dnl
|
b4_percent_code_get([[provides]])[]dnl
|
||||||
|
|
||||||
[/* Copy the second part of user declarations. */
|
[/* Copy the second part of user declarations. */
|
||||||
@@ -417,10 +416,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
|
|||||||
union yyalloc
|
union yyalloc
|
||||||
{
|
{
|
||||||
yytype_int16 yyss_alloc;
|
yytype_int16 yyss_alloc;
|
||||||
YYSTYPE yyvs_alloc;
|
YYSTYPE yyvs_alloc;]b4_locations_if([
|
||||||
]b4_locations_if([ YYLTYPE yyls_alloc;
|
YYLTYPE yyls_alloc;])[
|
||||||
])dnl
|
};
|
||||||
[};
|
|
||||||
|
|
||||||
/* The size of the maximum gap between one aligned stack and the next. */
|
/* The size of the maximum gap between one aligned stack and the next. */
|
||||||
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
|
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
|
||||||
@@ -1041,10 +1039,10 @@ m4_define([b4_declare_parser_state_variables],
|
|||||||
/* Number of tokens to shift before error messages enabled. */
|
/* Number of tokens to shift before error messages enabled. */
|
||||||
int yyerrstatus;
|
int yyerrstatus;
|
||||||
|
|
||||||
/* Three stacks and their tools:
|
/* The stacks and their tools:
|
||||||
`yyss': related to states,
|
`yyss': related to states.
|
||||||
`yyvs': related to semantic values,
|
`yyvs': related to semantic values.]b4_locations_if([[
|
||||||
`yyls': related to locations.
|
`yyls': related to locations.]])[
|
||||||
|
|
||||||
Refer to the stacks thru separate pointers, to allow yyoverflow
|
Refer to the stacks thru separate pointers, to allow yyoverflow
|
||||||
to reallocate them elsewhere. */
|
to reallocate them elsewhere. */
|
||||||
@@ -1169,11 +1167,9 @@ static char yypstate_allocated = 0;]])[
|
|||||||
#define yyerror_range yyps->yyerror_range
|
#define yyerror_range yyps->yyerror_range
|
||||||
]])[#define yystacksize yyps->yystacksize
|
]])[#define yystacksize yyps->yystacksize
|
||||||
]])[
|
]])[
|
||||||
|
|
||||||
/*-------------------------.
|
/*-------------------------.
|
||||||
| yyparse or yypush_parse. |
|
| yyparse or yypush_parse. |
|
||||||
`-------------------------*/
|
`-------------------------*/
|
||||||
|
|
||||||
]b4_push_if([
|
]b4_push_if([
|
||||||
b4_c_function_def([[yypush_parse]], [[int]],
|
b4_c_function_def([[yypush_parse]], [[int]],
|
||||||
[[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
|
[[[yypstate *yyps]], [[yyps]]]b4_pure_if([,
|
||||||
@@ -1195,7 +1191,7 @@ b4_push_if([b4_pure_if([], [[ int yypushed_char = yychar;
|
|||||||
[b4_declare_parser_state_variables])[
|
[b4_declare_parser_state_variables])[
|
||||||
int yyn;
|
int yyn;
|
||||||
int yyresult;
|
int yyresult;
|
||||||
/* Look-ahead token as an internal (translated) token number. */
|
/* Lookahead token as an internal (translated) token number. */
|
||||||
int yytoken;
|
int yytoken;
|
||||||
/* The variables used to return semantic value and location from the
|
/* The variables used to return semantic value and location from the
|
||||||
action routines. */
|
action routines. */
|
||||||
@@ -1240,16 +1236,15 @@ b4_push_if([b4_pure_if([], [[ int yypushed_char = yychar;
|
|||||||
so that they stay on the same level as the state stack.
|
so that they stay on the same level as the state stack.
|
||||||
The wasted elements are never initialized. */
|
The wasted elements are never initialized. */
|
||||||
yyssp = yyss;
|
yyssp = yyss;
|
||||||
yyvsp = yyvs;
|
yyvsp = yyvs;]b4_locations_if([[
|
||||||
]b4_locations_if([[ yylsp = yyls;
|
yylsp = yyls;
|
||||||
|
|
||||||
#if YYLTYPE_IS_TRIVIAL
|
#if YYLTYPE_IS_TRIVIAL
|
||||||
/* Initialize the default location before parsing starts. */
|
/* Initialize the default location before parsing starts. */
|
||||||
yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
|
yylloc.first_line = yylloc.last_line = ]b4_location_initial_line[;
|
||||||
yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
|
yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
|
||||||
#endif
|
#endif]])
|
||||||
]])
|
m4_ifdef([b4_initial_action],[
|
||||||
m4_ifdef([b4_initial_action], [
|
|
||||||
m4_pushdef([b4_at_dollar], [m4_define([b4_at_dollar_used])yylloc])dnl
|
m4_pushdef([b4_at_dollar], [m4_define([b4_at_dollar_used])yylloc])dnl
|
||||||
m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl
|
m4_pushdef([b4_dollar_dollar], [m4_define([b4_dollar_dollar_used])yylval])dnl
|
||||||
/* User initialization code. */
|
/* User initialization code. */
|
||||||
@@ -1259,8 +1254,7 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
|
m4_ifdef([b4_dollar_dollar_used],[[ yyvsp[0] = yylval;
|
||||||
]])dnl
|
]])dnl
|
||||||
m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
||||||
]])dnl
|
]])[
|
||||||
[
|
|
||||||
goto yysetstate;
|
goto yysetstate;
|
||||||
|
|
||||||
/*------------------------------------------------------------.
|
/*------------------------------------------------------------.
|
||||||
@@ -1285,8 +1279,8 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
|||||||
these so that the &'s don't force the real ones into
|
these so that the &'s don't force the real ones into
|
||||||
memory. */
|
memory. */
|
||||||
YYSTYPE *yyvs1 = yyvs;
|
YYSTYPE *yyvs1 = yyvs;
|
||||||
yytype_int16 *yyss1 = yyss;
|
yytype_int16 *yyss1 = yyss;]b4_locations_if([
|
||||||
]b4_locations_if([ YYLTYPE *yyls1 = yyls;])[
|
YYLTYPE *yyls1 = yyls;])[
|
||||||
|
|
||||||
/* Each stack pointer address is followed by the size of the
|
/* Each stack pointer address is followed by the size of the
|
||||||
data in use in that stack, in bytes. This used to be a
|
data in use in that stack, in bytes. This used to be a
|
||||||
@@ -1294,10 +1288,11 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
|||||||
be undefined if yyoverflow is a macro. */
|
be undefined if yyoverflow is a macro. */
|
||||||
yyoverflow (YY_("memory exhausted"),
|
yyoverflow (YY_("memory exhausted"),
|
||||||
&yyss1, yysize * sizeof (*yyssp),
|
&yyss1, yysize * sizeof (*yyssp),
|
||||||
&yyvs1, yysize * sizeof (*yyvsp),
|
&yyvs1, yysize * sizeof (*yyvsp),]b4_locations_if([
|
||||||
]b4_locations_if([ &yyls1, yysize * sizeof (*yylsp),])[
|
&yyls1, yysize * sizeof (*yylsp),])[
|
||||||
&yystacksize);
|
&yystacksize);
|
||||||
]b4_locations_if([ yyls = yyls1;])[
|
]b4_locations_if([
|
||||||
|
yyls = yyls1;])[
|
||||||
yyss = yyss1;
|
yyss = yyss1;
|
||||||
yyvs = yyvs1;
|
yyvs = yyvs1;
|
||||||
}
|
}
|
||||||
@@ -1319,8 +1314,8 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
|||||||
if (! yyptr)
|
if (! yyptr)
|
||||||
goto yyexhaustedlab;
|
goto yyexhaustedlab;
|
||||||
YYSTACK_RELOCATE (yyss_alloc, yyss);
|
YYSTACK_RELOCATE (yyss_alloc, yyss);
|
||||||
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
|
YYSTACK_RELOCATE (yyvs_alloc, yyvs);]b4_locations_if([
|
||||||
]b4_locations_if([ YYSTACK_RELOCATE (yyls_alloc, yyls);])[
|
YYSTACK_RELOCATE (yyls_alloc, yyls);])[
|
||||||
# undef YYSTACK_RELOCATE
|
# undef YYSTACK_RELOCATE
|
||||||
if (yyss1 != yyssa)
|
if (yyss1 != yyssa)
|
||||||
YYSTACK_FREE (yyss1);
|
YYSTACK_FREE (yyss1);
|
||||||
@@ -1329,8 +1324,8 @@ m4_ifdef([b4_at_dollar_used], [[ yylsp[0] = yylloc;
|
|||||||
#endif /* no yyoverflow */
|
#endif /* no yyoverflow */
|
||||||
|
|
||||||
yyssp = yyss + yysize - 1;
|
yyssp = yyss + yysize - 1;
|
||||||
yyvsp = yyvs + yysize - 1;
|
yyvsp = yyvs + yysize - 1;]b4_locations_if([
|
||||||
]b4_locations_if([ yylsp = yyls + yysize - 1;])[
|
yylsp = yyls + yysize - 1;])[
|
||||||
|
|
||||||
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
|
||||||
(unsigned long int) yystacksize));
|
(unsigned long int) yystacksize));
|
||||||
@@ -1475,8 +1470,8 @@ yyreduce:
|
|||||||
yylen = 0;
|
yylen = 0;
|
||||||
YY_STACK_PRINT (yyss, yyssp);
|
YY_STACK_PRINT (yyss, yyssp);
|
||||||
|
|
||||||
*++yyvsp = yyval;
|
*++yyvsp = yyval;]b4_locations_if([
|
||||||
]b4_locations_if([ *++yylsp = yyloc;])[
|
*++yylsp = yyloc;])[
|
||||||
|
|
||||||
/* Now `shift' the result of the reduction. Determine what state
|
/* Now `shift' the result of the reduction. Determine what state
|
||||||
that goes to, based on the state we popped back to and the rule
|
that goes to, based on the state we popped back to and the rule
|
||||||
@@ -1646,7 +1641,7 @@ yyabortlab:
|
|||||||
yyresult = 1;
|
yyresult = 1;
|
||||||
goto yyreturn;
|
goto yyreturn;
|
||||||
|
|
||||||
#ifndef yyoverflow
|
#if !defined(yyoverflow) || YYERROR_VERBOSE
|
||||||
/*-------------------------------------------------.
|
/*-------------------------------------------------.
|
||||||
| yyexhaustedlab -- memory exhaustion comes here. |
|
| yyexhaustedlab -- memory exhaustion comes here. |
|
||||||
`-------------------------------------------------*/
|
`-------------------------------------------------*/
|
||||||
@@ -1728,8 +1723,8 @@ typedef struct YYLTYPE
|
|||||||
|
|
||||||
]b4_pure_if([], [[extern YYLTYPE ]b4_prefix[lloc;]])
|
]b4_pure_if([], [[extern YYLTYPE ]b4_prefix[lloc;]])
|
||||||
)dnl b4_locations_if
|
)dnl b4_locations_if
|
||||||
|
b4_push_if([[
|
||||||
b4_push_if([[#ifndef YYPUSH_DECLS
|
#ifndef YYPUSH_DECLS
|
||||||
# define YYPUSH_DECLS
|
# define YYPUSH_DECLS
|
||||||
struct ]b4_prefix[pstate;
|
struct ]b4_prefix[pstate;
|
||||||
typedef struct ]b4_prefix[pstate ]b4_prefix[pstate;
|
typedef struct ]b4_prefix[pstate ]b4_prefix[pstate;
|
||||||
|
|||||||
Reference in New Issue
Block a user