mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-17 08:13:02 +00:00
glr.cc, lalr1.cc: define b4_shared_declarations
* data/glr.cc, data/lalr1.cc: here. The name is no longer right, but at least it is consistent with the other skeletons.
This commit is contained in:
4
TODO
4
TODO
@@ -3,6 +3,10 @@
|
|||||||
Avoid variables for format strings, as then GCC cannot check them.
|
Avoid variables for format strings, as then GCC cannot check them.
|
||||||
show_sub_messages should call show_sub_message.
|
show_sub_messages should call show_sub_message.
|
||||||
|
|
||||||
|
** m4 names
|
||||||
|
b4_shared_declarations is no longer what it is. Make it
|
||||||
|
b4_parser_declaration for instance.
|
||||||
|
|
||||||
** Variable names.
|
** Variable names.
|
||||||
What should we name `variant' and `lex_symbol'?
|
What should we name `variant' and `lex_symbol'?
|
||||||
|
|
||||||
|
|||||||
26
data/glr.cc
26
data/glr.cc
@@ -223,16 +223,13 @@ m4_defn([b4_parse_param]))],
|
|||||||
m4_include(b4_pkgdatadir/[glr.c])
|
m4_include(b4_pkgdatadir/[glr.c])
|
||||||
m4_popdef([b4_parse_param])
|
m4_popdef([b4_parse_param])
|
||||||
|
|
||||||
m4_divert_push(0)
|
|
||||||
@output(b4_spec_defines_file@)@
|
|
||||||
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
|
||||||
[2002-2012])[
|
|
||||||
|
|
||||||
/* C++ GLR parser skeleton written by Akim Demaille. */
|
# b4_shared_declarations
|
||||||
|
# ----------------------
|
||||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
# Declaration that might either go into the header (if --defines)
|
||||||
|
# or open coded in the parser body.
|
||||||
]b4_percent_code_get([[requires]])[
|
m4_define([b4_shared_declarations],
|
||||||
|
[b4_percent_code_get([[requires]])[
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -312,5 +309,16 @@ b4_percent_define_flag_if([[global_tokens_and_yystype]],
|
|||||||
|
|
||||||
]b4_namespace_close[
|
]b4_namespace_close[
|
||||||
]b4_percent_code_get([[provides]])[
|
]b4_percent_code_get([[provides]])[
|
||||||
|
]])
|
||||||
|
|
||||||
|
m4_divert_push(0)
|
||||||
|
@output(b4_spec_defines_file@)@
|
||||||
|
b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||||
|
[2002-2012])[
|
||||||
|
|
||||||
|
/* C++ GLR parser skeleton written by Akim Demaille. */
|
||||||
|
|
||||||
|
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||||
|
]b4_shared_declarations[
|
||||||
]b4_cpp_guard_close([b4_spec_defines_file])[
|
]b4_cpp_guard_close([b4_spec_defines_file])[
|
||||||
]m4_divert_pop(0)
|
]m4_divert_pop(0)
|
||||||
|
|||||||
@@ -131,21 +131,12 @@ b4_locations_if([b4_percent_define_ifdef([[location_type]], [],
|
|||||||
m4_include(b4_pkgdatadir/[stack.hh])
|
m4_include(b4_pkgdatadir/[stack.hh])
|
||||||
b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])])
|
b4_variant_if([m4_include(b4_pkgdatadir/[variant.hh])])
|
||||||
|
|
||||||
# We do want M4 expansion after # for CPP macros.
|
# b4_shared_declarations
|
||||||
m4_changecom()
|
# ----------------------
|
||||||
m4_divert_push(0)dnl
|
# Declaration that might either go into the header (if --defines)
|
||||||
@output(b4_spec_defines_file@)@
|
# or open coded in the parser body.
|
||||||
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
|
m4_define([b4_shared_declarations],
|
||||||
[
|
[b4_percent_code_get([[requires]])[
|
||||||
/**
|
|
||||||
** \file ]b4_spec_defines_file[
|
|
||||||
** Define the ]b4_namespace_ref[::parser class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
|
||||||
|
|
||||||
]b4_cpp_guard_open([b4_spec_defines_file])[
|
|
||||||
]b4_percent_code_get([[requires]])[
|
|
||||||
]b4_parse_assert_if([# include <cassert>])[
|
]b4_parse_assert_if([# include <cassert>])[
|
||||||
# include <stdexcept>
|
# include <stdexcept>
|
||||||
# include <string>
|
# include <string>
|
||||||
@@ -341,6 +332,23 @@ b4_public_types_define])[
|
|||||||
#endif
|
#endif
|
||||||
])[
|
])[
|
||||||
]b4_percent_code_get([[provides]])[
|
]b4_percent_code_get([[provides]])[
|
||||||
|
]])
|
||||||
|
|
||||||
|
# We do want M4 expansion after # for CPP macros.
|
||||||
|
m4_changecom()
|
||||||
|
m4_divert_push(0)dnl
|
||||||
|
@output(b4_spec_defines_file@)@
|
||||||
|
b4_copyright([Skeleton interface for Bison LALR(1) parsers in C++])
|
||||||
|
[
|
||||||
|
/**
|
||||||
|
** \file ]b4_spec_defines_file[
|
||||||
|
** Define the ]b4_namespace_ref[::parser class.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* C++ LALR(1) parser skeleton written by Akim Demaille. */
|
||||||
|
|
||||||
|
]b4_cpp_guard_open([b4_spec_defines_file])[
|
||||||
|
]b4_shared_declarations[
|
||||||
]b4_cpp_guard_close([b4_spec_defines_file])
|
]b4_cpp_guard_close([b4_spec_defines_file])
|
||||||
@output(b4_parser_file_name@)@
|
@output(b4_parser_file_name@)@
|
||||||
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++])
|
b4_copyright([Skeleton implementation for Bison LALR(1) parsers in C++])
|
||||||
|
|||||||
Reference in New Issue
Block a user