mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 07:13:02 +00:00
c++: add support for api.position.file and api.location.file
* data/location.cc: Sort includes. (b4_position_file, b4_location_file): New. When there's a file for locations but not for positions, include the definition of position in the location file. * data/lalr1.cc (b4_shared_declarations): Include the position/location file when it exists. Otherwise, define the class. * data/glr.cc: Likewise. * tests/input.at (%define file variables): Check them. * tests/output.at (C++ output): Check various cases with api.position.file and api.location.file.
This commit is contained in:
18
data/glr.cc
18
data/glr.cc
@@ -242,18 +242,24 @@ b4_namespace_close
|
||||
m4_define([b4_shared_declarations],
|
||||
[m4_pushdef([b4_parse_param], m4_defn([b4_parse_param_orig]))dnl
|
||||
b4_percent_code_get([[requires]])[
|
||||
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <iostream>]b4_defines_if([
|
||||
b4_bison_locations_if([[#include "location.hh"]])])[
|
||||
|
||||
]m4_ifdef([b4_position_file],
|
||||
[[# include "]b4_position_file["]])[
|
||||
]m4_ifdef([b4_location_file],
|
||||
[[# include "]b4_location_file["]])[
|
||||
|
||||
]b4_null_define[
|
||||
|
||||
]b4_YYDEBUG_define[
|
||||
|
||||
]b4_namespace_open[
|
||||
]b4_defines_if([],
|
||||
[b4_bison_locations_if([b4_position_define
|
||||
b4_location_define])])[
|
||||
]b4_bison_locations_if([m4_ifndef([b4_location_file],
|
||||
[m4_ifndef([b4_position_file], [b4_position_define
|
||||
|
||||
])[]b4_location_define])])[
|
||||
|
||||
/// A Bison parser.
|
||||
class ]b4_parser_class_name[
|
||||
|
||||
Reference in New Issue
Block a user