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:
Akim Demaille
2010-05-09 14:29:35 +02:00
parent 38f9fd6439
commit 95a2de5695
5 changed files with 56 additions and 13 deletions

View File

@@ -25,7 +25,12 @@ m4_include(b4_pkgdatadir/[c.m4])
# Default parser class name.
b4_percent_define_default([[parser_class_name]], [[parser]])
b4_percent_define_default([[location_type]], [[location]])
# Don't do that so that we remember whether we're using a user
# request, or the default value.
#
# b4_percent_define_default([[location_type]], [[location]])
b4_percent_define_default([[filename_type]], [[std::string]])
b4_percent_define_default([[namespace]], m4_defn([b4_prefix]))
b4_percent_define_default([[global_tokens_and_yystype]], [[false]])