mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
Merge 'maint'
* upstream/maint: maint: post-release administrivia version 3.6.4 glr.cc: don't leak glr.c/glr.cc scaffolding to the user Some fixes were needed to adjust to recent changes in glr.cc and glr.c. * data/skeletons/glr.cc: Stop messing with the user's epilogue to insert glr.cc code. We need that code to be inserted _before_ the user's epilogue, not after. So define b4_glr_cc_pre_epilogue. * data/skeletons/glr.c: Use it.
This commit is contained in:
@@ -1 +1 @@
|
|||||||
3.6.3
|
3.6.4
|
||||||
|
|||||||
7
NEWS
7
NEWS
@@ -54,6 +54,13 @@ GNU Bison NEWS
|
|||||||
to the -ffile-prefix-map in GCC. This option can be used to make bison output
|
to the -ffile-prefix-map in GCC. This option can be used to make bison output
|
||||||
reproducible.
|
reproducible.
|
||||||
|
|
||||||
|
* Noteworthy changes in release 3.6.4 (2020-06-15) [stable]
|
||||||
|
|
||||||
|
** Bug fixes
|
||||||
|
|
||||||
|
In glr.cc some internal macros leaked in the user's code, and could damage
|
||||||
|
access to the token kinds.
|
||||||
|
|
||||||
* Noteworthy changes in release 3.6.3 (2020-06-03) [stable]
|
* Noteworthy changes in release 3.6.3 (2020-06-03) [stable]
|
||||||
|
|
||||||
** Bug fixes
|
** Bug fixes
|
||||||
|
|||||||
6
TODO
6
TODO
@@ -12,6 +12,9 @@ list_get_end (gl_list_t list)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
** glr.cc
|
||||||
|
Get rid of global_tokens_and_yystype.
|
||||||
|
|
||||||
** Bistromathic
|
** Bistromathic
|
||||||
- Hitting tab on a line with a syntax error is ugly
|
- Hitting tab on a line with a syntax error is ugly
|
||||||
|
|
||||||
@@ -149,6 +152,9 @@ Les catégories d'avertissements incluent :
|
|||||||
Line -1 and -3 should mention CATEGORIE, not CATEGORY.
|
Line -1 and -3 should mention CATEGORIE, not CATEGORY.
|
||||||
|
|
||||||
* Bison 3.8
|
* Bison 3.8
|
||||||
|
** Rewrite glr.cc
|
||||||
|
Get rid of scaffolding in glr.c.
|
||||||
|
|
||||||
** Unit rules / Injection rules (Akim Demaille)
|
** Unit rules / Injection rules (Akim Demaille)
|
||||||
Maybe we could expand unit rules (or "injections", see
|
Maybe we could expand unit rules (or "injections", see
|
||||||
https://homepages.cwi.nl/~daybuild/daily-books/syntax/2-sdf/sdf.html), i.e.,
|
https://homepages.cwi.nl/~daybuild/daily-books/syntax/2-sdf/sdf.html), i.e.,
|
||||||
|
|||||||
@@ -230,7 +230,9 @@ b4_copyright([Skeleton implementation for Bison GLR parsers in C],
|
|||||||
|
|
||||||
]b4_defines_if([[#include "@basename(]b4_spec_header_file[@)"]],
|
]b4_defines_if([[#include "@basename(]b4_spec_header_file[@)"]],
|
||||||
[b4_shared_declarations])[
|
[b4_shared_declarations])[
|
||||||
]b4_declare_symbol_enum[
|
|
||||||
|
]b4_glr_cc_if([b4_glr_cc_setup],
|
||||||
|
[b4_declare_symbol_enum])[
|
||||||
|
|
||||||
/* Default (constant) value used for initialization for null
|
/* Default (constant) value used for initialization for null
|
||||||
right-hand sides. Unlike the standard yacc.c template, here we set
|
right-hand sides. Unlike the standard yacc.c template, here we set
|
||||||
@@ -2731,7 +2733,8 @@ m4_if(b4_prefix, [yy], [],
|
|||||||
#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[
|
#define yynerrs ]b4_prefix[nerrs]b4_locations_if([[
|
||||||
#define yylloc ]b4_prefix[lloc]])])[
|
#define yylloc ]b4_prefix[lloc]])])[
|
||||||
|
|
||||||
]m4_ifdef([b4_pre_epilogue], [b4_pre_epilogue])[]dnl This is a hack for glr.cc. To remove when we have a better glr.cc.
|
]b4_glr_cc_if([b4_glr_cc_pre_epilogue
|
||||||
b4_percent_code_get([[epilogue]])[]dnl
|
b4_glr_cc_cleanup])[
|
||||||
|
]b4_percent_code_get([[epilogue]])[]dnl
|
||||||
b4_epilogue[]dnl
|
b4_epilogue[]dnl
|
||||||
b4_output_end
|
b4_output_end
|
||||||
|
|||||||
@@ -99,15 +99,9 @@ yyerror (]b4_locations_if([[const ]b4_namespace_ref::b4_parser_class[::location_
|
|||||||
]])[]m4_ifset([b4_parse_param], [b4_formals(b4_parse_param),
|
]])[]m4_ifset([b4_parse_param], [b4_formals(b4_parse_param),
|
||||||
])[const char* msg);]])[
|
])[const char* msg);]])[
|
||||||
|
|
||||||
]b4_percent_define_flag_if([[global_tokens_and_yystype]], [],
|
# Inserted before the epilogue to define implementations (yyerror, parser member
|
||||||
[m4_define([b4_pre_epilogue],
|
|
||||||
[[/* The user is using the C++ token kind, not the C one. */
|
|
||||||
#undef ]b4_symbol(0, [id])
|
|
||||||
])])[
|
|
||||||
|
|
||||||
# Hijack the epilogue to define implementations (yyerror, parser member
|
|
||||||
# functions etc.).
|
# functions etc.).
|
||||||
]m4_append([b4_epilogue],
|
]m4_define([b4_glr_cc_pre_epilogue],
|
||||||
[b4_syncline([@oline@], [@ofile@])dnl
|
[b4_syncline([@oline@], [@ofile@])dnl
|
||||||
[
|
[
|
||||||
/*------------------.
|
/*------------------.
|
||||||
@@ -216,6 +210,62 @@ b4_namespace_close[]dnl
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
m4_define([b4_define_symbol_kind],
|
||||||
|
[m4_format([#define %-15s %s],
|
||||||
|
b4_symbol($][1, kind_base),
|
||||||
|
b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol($1, kind_base))
|
||||||
|
])
|
||||||
|
|
||||||
|
# b4_glr_cc_setup
|
||||||
|
# ---------------
|
||||||
|
# Setup redirections for glr.c: Map the names used in c.m4 to the ones used
|
||||||
|
# in c++.m4.
|
||||||
|
m4_define([b4_glr_cc_setup],
|
||||||
|
[[#undef ]b4_symbol(-2, [id])[
|
||||||
|
#define ]b4_symbol(-2, [id])[ ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(-2, [id])[
|
||||||
|
#undef ]b4_symbol(0, [id])[
|
||||||
|
#define ]b4_symbol(0, [id])[ ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(0, [id])[
|
||||||
|
#undef ]b4_symbol(1, [id])[
|
||||||
|
#define ]b4_symbol(1, [id])[ ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(1, [id])[
|
||||||
|
|
||||||
|
#ifndef ]b4_api_PREFIX[STYPE
|
||||||
|
# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class[::semantic_type
|
||||||
|
#endif
|
||||||
|
#ifndef ]b4_api_PREFIX[LTYPE
|
||||||
|
# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class[::location_type
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef ]b4_namespace_ref[::]b4_parser_class[::symbol_kind_type yysymbol_kind_t;
|
||||||
|
|
||||||
|
// Expose C++ symbol kinds to C.
|
||||||
|
]b4_define_symbol_kind(-2)dnl
|
||||||
|
b4_symbol_foreach([b4_define_symbol_kind])])[
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
m4_define([b4_undef_symbol_kind],
|
||||||
|
[[#undef ]b4_symbol($1, kind_base)[
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
|
# b4_glr_cc_cleanup
|
||||||
|
# -----------------
|
||||||
|
# Remove redirections for glr.c.
|
||||||
|
m4_define([b4_glr_cc_cleanup],
|
||||||
|
[b4_percent_define_flag_if([[global_tokens_and_yystype]], [],
|
||||||
|
[[#undef ]b4_symbol(-2, [id])[
|
||||||
|
#undef ]b4_symbol(0, [id])[
|
||||||
|
#undef ]b4_symbol(1, [id])[
|
||||||
|
]])[
|
||||||
|
|
||||||
|
#undef ]b4_api_PREFIX[STYPE
|
||||||
|
#undef ]b4_api_PREFIX[LTYPE
|
||||||
|
|
||||||
|
]b4_undef_symbol_kind(-2)dnl
|
||||||
|
b4_symbol_foreach([b4_undef_symbol_kind])dnl
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
# b4_shared_declarations(hh|cc)
|
# b4_shared_declarations(hh|cc)
|
||||||
# -----------------------------
|
# -----------------------------
|
||||||
# Declaration that might either go into the header (if --defines, $1 = hh)
|
# Declaration that might either go into the header (if --defines, $1 = hh)
|
||||||
@@ -333,37 +383,11 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
|||||||
])[
|
])[
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
|
|
||||||
]dnl Map the name used in c.m4 to the one used in c++.m4.
|
|
||||||
[#undef ]b4_symbol(-2, [id])[
|
|
||||||
#define ]b4_symbol(-2, [id])[ ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(-2, [id])[
|
|
||||||
#undef ]b4_symbol(0, [id])[
|
|
||||||
#define ]b4_symbol(0, [id])[ ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(0, [id])[
|
|
||||||
#undef ]b4_symbol(1, [id])[
|
|
||||||
#define ]b4_symbol(1, [id])[ ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(1, [id])[
|
|
||||||
|
|
||||||
#ifndef ]b4_api_PREFIX[STYPE
|
|
||||||
# define ]b4_api_PREFIX[STYPE ]b4_namespace_ref[::]b4_parser_class[::semantic_type
|
|
||||||
#endif
|
|
||||||
#ifndef ]b4_api_PREFIX[LTYPE
|
|
||||||
# define ]b4_api_PREFIX[LTYPE ]b4_namespace_ref[::]b4_parser_class[::location_type
|
|
||||||
#endif
|
|
||||||
|
|
||||||
]m4_define([b4_define_symbol_kind],
|
|
||||||
[m4_format([#define %-15s %s],
|
|
||||||
b4_symbol($][1, kind_base),
|
|
||||||
b4_namespace_ref[::]b4_parser_class[::symbol_kind::]b4_symbol($][1, kind_base))
|
|
||||||
])[
|
|
||||||
]m4_define([b4_declare_symbol_enum],
|
|
||||||
[[typedef ]b4_namespace_ref[::]b4_parser_class[::symbol_kind_type yysymbol_kind_t;
|
|
||||||
|
|
||||||
// Expose C++ symbol kinds to C.
|
|
||||||
]b4_define_symbol_kind(-2)dnl
|
|
||||||
b4_symbol_foreach([b4_define_symbol_kind])])[
|
|
||||||
]b4_percent_code_get([[provides]])[
|
]b4_percent_code_get([[provides]])[
|
||||||
]m4_popdef([b4_parse_param])dnl
|
]m4_popdef([b4_parse_param])dnl
|
||||||
])
|
])[
|
||||||
|
|
||||||
b4_defines_if(
|
]b4_defines_if(
|
||||||
[b4_output_begin([b4_spec_header_file])
|
[b4_output_begin([b4_spec_header_file])
|
||||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||||
[2002-2015, 2018-2020])[
|
[2002-2015, 2018-2020])[
|
||||||
|
|||||||
Reference in New Issue
Block a user