variant: more assertions

Equip variants with more checking code.  Provide a means to request
includes.

* data/variant.hh (b4_variant_includes): New.
* data/lalr1.cc: Use it.
* data/variant.hh (variant::built): Define at the end, as a private member.
(variant::tname): New.
Somewhat makes "built" useless, but let's keep both for a start, in
case using "typeinfo" is considered unacceptable in some environments.
Fix some formatting issues.
This commit is contained in:
Akim Demaille
2012-12-19 10:09:07 +01:00
parent 7c0d37283d
commit 35f70d169f
2 changed files with 59 additions and 25 deletions

View File

@@ -139,6 +139,7 @@ m4_define([b4_shared_declarations],
# include <string>]b4_defines_if([[
# include "stack.hh"
]b4_bison_locations_if([[# include "location.hh"]])])[
]b4_variant_if([b4_variant_includes])[
]b4_YYDEBUG_define[