c++: provide yy::parser::symbol_type::name

* data/skeletons/c++.m4 (yy::parser::basic_symbol::name): New.
* data/skeletons/lalr1.cc (yy_print_): Use it.
* doc/bison.texi: Document.
* tests/c++.at: Check.
This commit is contained in:
Akim Demaille
2020-05-10 09:58:30 +02:00
parent 6bb37dbe27
commit bf98d94f4f
5 changed files with 38 additions and 3 deletions

View File

@@ -162,6 +162,7 @@ int main()
parser::symbol_type s = parser::make_INT (12);
assert_eq (s.kind (), parser::symbol_kind::S_INT);
assert_eq (parser::symbol_name (s.kind ()), "\"int\"");
assert_eq (s.name (), "\"int\"");
assert_eq (s.value.as<int> (), 12);
}