b4_semantic_type_declare.

* data/c++.m4 (b4_semantic_type_declare): New.
	Factors and generalizes what was in glr.cc and lalr1.cc.
	* data/variant.hh (b4_semantic_type_declare): Redefine it for
	variants.
	* data/lalr1.cc, data/glr.cc: Use it.
This commit is contained in:
Akim Demaille
2008-12-31 12:44:58 +01:00
parent 6a6e7f0c65
commit b9e4eb5b72
5 changed files with 37 additions and 24 deletions

View File

@@ -266,16 +266,8 @@ b4_copyright([Skeleton interface for Bison GLR parsers in C++],
class ]b4_parser_class_name[
{
public:
/// Symbol semantic values.
#ifndef YYSTYPE
]m4_ifdef([b4_stype],
[ union semantic_type
{
b4_user_stype
};],
[m4_if(b4_tag_seen_flag, 0,
[[ typedef int semantic_type;]],
[[ typedef YYSTYPE semantic_type;]])])[
]b4_semantic_type_declare[
#else
typedef YYSTYPE semantic_type;
#endif