skeletons: introduce "slot"s for symbols

Extracted from d9cf99b6a5, in the master
branch.

* data/skeletons/bison.m4 (b4_symbol_slot): New, with safer semantics
than type and type_tag.
This commit is contained in:
Akim Demaille
2021-01-23 10:14:19 +01:00
parent 11f6839645
commit c73dcd6958
2 changed files with 21 additions and 1 deletions

View File

@@ -142,11 +142,17 @@ The macro `b4_symbol(NUM, FIELD)` gives access to the following FIELDS:
When api.value.type=union, the generated name for the union member.
yytype_INT etc. for symbols that has_id, otherwise yytype_1 etc.
- `type`
- `type`: string
If it has a semantic value, its type tag, or, if variant are used,
its type.
In the case of api.value.type=union, type is the real type (e.g. int).
- `slot`: string
If it has a semantic value, the name of the union member (i.e., bounces to
either `type_tag` or `type`). It would be better to fix our mess and
always use `type` for the true type of the member, and `type_tag` for the
name of the union member.
- `has_printer`: 0, 1
- `printer`: string
- `printer_file`: string