Files
bison/tests
Akim Demaille e5780041b9 c++: exhibit a safe symbol_type
Instead of introducing make_symbol (whose name, btw, somewhat
infringes on the user's "name space", if she defines a token named
"symbol"), let's make the construction of symbol_type safer, using
assertions.

For instance with:

    %token ':' <std::string> ID <int> INT;

generate:

    symbol_type (int token, const std::string&);
    symbol_type (int token, const int&);
    symbol_type (int token);

It does mean that now named token constructors (make_ID, make_INT,
etc.) go through a useless assert, but I think we can ignore this: I
assume any decent compiler will inline the symbol_type ctor inside the
make_TOKEN functions, which will show that the assert is trivially
verified, hence I expect no code will be emitted for it.  And anyway,
that's an assert, NDEBUG controls it.

* data/c++.m4 (symbol_type): Turn into a subclass of
basic_symbol<by_type>.
Declare symbol constructors when variants are enabled.
* data/variant.hh (_b4_type_constructor_declare)
(_b4_type_constructor_define): Replace with...
(_b4_symbol_constructor_declare, _b4_symbol_constructor_def): these.
Generate symbol_type constructors.
* doc/bison.texi (Complete Symbols): Document.
* tests/types.at: Check.
2018-12-22 14:55:07 +01:00
..
2008-11-16 19:46:16 +01:00
2018-11-16 17:37:47 +01:00
2018-12-04 20:43:01 +01:00
2018-12-01 12:54:42 +01:00
2018-12-01 11:13:08 +01:00
2018-05-12 18:18:41 +02:00
2018-05-12 18:18:41 +02:00
2018-11-12 07:28:20 +01:00
2018-12-16 12:27:28 +01:00
2018-08-11 18:09:29 +02:00
2018-05-12 18:18:41 +02:00
2018-11-29 07:44:37 +01:00
2018-11-26 07:56:06 +01:00
2018-12-22 14:55:07 +01:00