mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 08:43:03 +00:00
lalr1.cc: don't generate location.hh when location_type is defined
* data/bison.m4 (b4_percent_define_use): New.
(b4_percent_define_get): Use it.
Accept a default value.
* data/c++.m4: Do not provide a default value for the %define
variable location_type, rather, use b4_percent_define_get with a
default argument where its value is needed.
* data/lalr1.cc: Do not load location.cc (which outputs both
location.hh and position.hh) if the user defined location_type.
Do not include location.hh either.
* data/glr.cc: Likewise.
(cherry picked from commit 7789b6e3e7)
Conflicts:
ChangeLog
data/bison.m4
data/c++.m4
data/lalr1.cc
This commit is contained in:
@@ -229,7 +229,8 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include "location.hh"
|
||||
]b4_percent_define_ifdef([[location_type]], [],
|
||||
[[#include "location.hh"]])[
|
||||
|
||||
/* Using locations. */
|
||||
#define YYLSP_NEEDED ]b4_locations_flag[
|
||||
@@ -277,7 +278,8 @@ b4_user_stype
|
||||
typedef YYSTYPE semantic_type;
|
||||
#endif
|
||||
/// Symbol locations.
|
||||
typedef ]b4_percent_define_get([[location_type]])[ location_type;
|
||||
typedef ]b4_percent_define_get([[location_type]],
|
||||
[[location]])[ location_type;
|
||||
/// Tokens.
|
||||
struct token
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user