mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +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:
@@ -190,6 +190,31 @@ AT_CHECK_OUTPUT([foo.yy],
|
||||
[],
|
||||
[foo.tab.cc foo.tab.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations],
|
||||
[],
|
||||
[foo.tab.cc foo.tab.hh location.hh position.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.position.file none],
|
||||
[],
|
||||
[foo.tab.cc foo.tab.hh location.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.position.file none %define api.location.file none],
|
||||
[],
|
||||
[foo.tab.cc foo.tab.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.position.file none %define api.location.file "foo.loc.hh"],
|
||||
[],
|
||||
[foo.loc.hh foo.tab.cc foo.tab.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([foo.yy],
|
||||
[%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.position.file "foo.pos.hh" %define api.location.file "foo.loc.hh"],
|
||||
[],
|
||||
[foo.loc.hh foo.pos.hh foo.tab.cc foo.tab.hh])
|
||||
|
||||
AT_CHECK_OUTPUT([gram_dir/foo.yy],
|
||||
[%skeleton "lalr1.cc" %verbose %defines %define api.stack.file "foo.sta.hh" %file-prefix "output_dir/foo"],
|
||||
[],
|
||||
|
||||
Reference in New Issue
Block a user