mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 13:53:03 +00:00
Merge remote-tracking branch 'origin/maint'
* origin/maint: skeletons: factor yacc.c and glr.c. glr.c: minor refactoring. tests: remove all the -On flags. maint: fix spello. maint: improve release procedure instructions. gnulib: update readme-release. maint: cfg.mk: manual title. maint: cfg.mk: simplify maint: post-release administrivia Conflicts: NEWS bootstrap.conf
This commit is contained in:
37
data/c.m4
37
data/c.m4
@@ -567,3 +567,40 @@ b4_locations_if([, yylocationp])[]b4_user_args[);
|
||||
YYFPRINTF (yyoutput, ")");
|
||||
}]dnl
|
||||
])
|
||||
|
||||
## -------------- ##
|
||||
## Declarations. ##
|
||||
## -------------- ##
|
||||
|
||||
# b4_declare_yylstype
|
||||
# ------------------
|
||||
# Declaration that might either go into the header (if --defines)
|
||||
# or open coded in the parser body. Declare YYSTYPE and YYLTYPE.
|
||||
m4_define([b4_declare_yylstype],
|
||||
[[#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
]m4_ifdef([b4_stype],
|
||||
[[typedef union ]b4_union_name[
|
||||
{
|
||||
]b4_user_stype[
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[typedef int YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]])])[
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif]b4_locations_if([[
|
||||
|
||||
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
typedef struct YYLTYPE
|
||||
{
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
} YYLTYPE;
|
||||
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYLTYPE_IS_DECLARED 1
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif]])
|
||||
])
|
||||
|
||||
57
data/glr.c
57
data/glr.c
@@ -162,6 +162,21 @@ m4_define([b4_rhs_location],
|
||||
[(b4_rhs_data([$1], [$2]).yyloc)])
|
||||
|
||||
|
||||
## -------------- ##
|
||||
## Declarations. ##
|
||||
## -------------- ##
|
||||
|
||||
# b4_shared_declarations
|
||||
# ----------------------
|
||||
# Declaration that might either go into the header (if --defines)
|
||||
# or open coded in the parser body.
|
||||
m4_define([b4_shared_declarations],
|
||||
[b4_percent_code_get([[requires]])[
|
||||
]b4_token_enums(b4_tokens)[
|
||||
]b4_declare_yylstype[
|
||||
]b4_percent_code_get([[provides]])[]dnl
|
||||
])
|
||||
|
||||
|
||||
## -------------- ##
|
||||
## Output files. ##
|
||||
@@ -191,47 +206,11 @@ m4_if(b4_prefix, [yy], [],
|
||||
#define yylloc b4_prefix[]lloc])[
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
]b4_user_pre_prologue
|
||||
]b4_user_pre_prologue[
|
||||
|
||||
b4_null_define
|
||||
]b4_null_define[
|
||||
|
||||
dnl # b4_shared_declarations
|
||||
dnl # ----------------------
|
||||
dnl # Declaration that might either go into the header (if --defines)
|
||||
dnl # or open coded in the parser body.
|
||||
m4_define([b4_shared_declarations],
|
||||
[b4_percent_code_get([[requires]])[]dnl
|
||||
|
||||
b4_token_enums(b4_tokens)
|
||||
|
||||
[#ifndef YYSTYPE
|
||||
]m4_ifdef([b4_stype],
|
||||
[[typedef union ]b4_union_name[
|
||||
{
|
||||
]b4_user_stype[
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[typedef int YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]])])[
|
||||
#endif
|
||||
]b4_locations_if([[
|
||||
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
typedef struct YYLTYPE
|
||||
{
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
} YYLTYPE;
|
||||
# define YYLTYPE_IS_DECLARED 1
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
]])[
|
||||
]b4_percent_code_get([[provides]])[]dnl
|
||||
])
|
||||
|
||||
b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
|
||||
]b4_defines_if([[#include "@basename(]b4_spec_defines_file[@)"]],
|
||||
[b4_shared_declarations])[
|
||||
|
||||
/* Enabling traces. */
|
||||
|
||||
86
data/yacc.c
86
data/yacc.c
@@ -160,9 +160,9 @@ m4_define([b4_rhs_location],
|
||||
[(yylsp@{b4_subtract([$2], [$1])@})])
|
||||
|
||||
|
||||
## ------------------ ##
|
||||
## Parser variables. ##
|
||||
## ------------------ ##
|
||||
## -------------- ##
|
||||
## Declarations. ##
|
||||
## -------------- ##
|
||||
|
||||
# b4_declare_scanner_communication_variables
|
||||
# ------------------------------------------
|
||||
@@ -226,10 +226,9 @@ m4_define([b4_declare_parser_state_variables], [b4_pure_if([[
|
||||
yytype_int16 *yyes;
|
||||
YYSIZE_T yyes_capacity;]])])
|
||||
|
||||
|
||||
## --------------------------------------------------------- ##
|
||||
## Defining symbol actions, e.g., printers and destructors. ##
|
||||
## --------------------------------------------------------- ##
|
||||
## -------------- ##
|
||||
## Output files. ##
|
||||
## -------------- ##
|
||||
|
||||
# We do want M4 expansion after # for CPP macros.
|
||||
m4_changecom()
|
||||
@@ -288,37 +287,10 @@ m4_if(b4_prefix, [yy], [],
|
||||
# define YYTOKEN_TABLE ]b4_token_table[
|
||||
#endif
|
||||
|
||||
]b4_percent_code_get([[requires]])[]dnl
|
||||
|
||||
b4_token_enums_defines(b4_tokens)[
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
]m4_ifdef([b4_stype],
|
||||
[[typedef union ]b4_union_name[
|
||||
{
|
||||
]b4_user_stype[
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[typedef int YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]])])[
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif]b4_locations_if([[
|
||||
|
||||
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
typedef struct YYLTYPE
|
||||
{
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
} YYLTYPE;
|
||||
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYLTYPE_IS_DECLARED 1
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif]])b4_push_if([[
|
||||
|
||||
]b4_percent_code_get([[requires]])[
|
||||
]b4_token_enums_defines(b4_tokens)[
|
||||
]b4_declare_yylstype[
|
||||
]b4_push_if([[
|
||||
#ifndef YYPUSH_DECLS
|
||||
# define YYPUSH_DECLS
|
||||
struct yypstate;
|
||||
@@ -2008,40 +1980,10 @@ b4_copyright([Bison interface for Yacc-like parsers in C])dnl
|
||||
|
||||
b4_percent_code_get([[requires]])[]dnl
|
||||
|
||||
b4_token_enums_defines(b4_tokens)
|
||||
|
||||
[#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
]m4_ifdef([b4_stype],
|
||||
[[typedef union ]b4_union_name[
|
||||
{
|
||||
]b4_user_stype[
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]],
|
||||
[m4_if(b4_tag_seen_flag, 0,
|
||||
[[typedef int YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1]])])[
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
]b4_pure_if([], [[extern YYSTYPE ]b4_prefix[lval;]])
|
||||
|
||||
b4_locations_if(
|
||||
[#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
typedef struct YYLTYPE
|
||||
{
|
||||
int first_line;
|
||||
int first_column;
|
||||
int last_line;
|
||||
int last_column;
|
||||
} YYLTYPE;
|
||||
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYLTYPE_IS_DECLARED 1
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
]b4_pure_if([], [[extern YYLTYPE ]b4_prefix[lloc;]])
|
||||
)dnl b4_locations_if
|
||||
b4_token_enums_defines(b4_tokens)[
|
||||
]b4_declare_yylstype[
|
||||
]b4_pure_if([], [[extern YYSTYPE ]b4_prefix[lval;
|
||||
]b4_locations_if([[extern YYLTYPE ]b4_prefix[lloc;]])])dnl
|
||||
b4_push_if([[
|
||||
#ifndef YYPUSH_DECLS
|
||||
# define YYPUSH_DECLS
|
||||
|
||||
Reference in New Issue
Block a user