tokens: define the "$undefined" token kind

* data/skeletons/bison.m4 (b4_symbol_token_kind): Give a definition to
$undefined.
(b4_token_visible_if): $undefined has an id.
* src/output.c (prepare_symbol_definitions): Stop lying: $undefined
_is_ a token.
* tests/input.at: Adjust.
This commit is contained in:
Akim Demaille
2020-04-10 09:26:31 +02:00
parent a4ed94bc13
commit 95421df67b
6 changed files with 44 additions and 16 deletions

View File

@@ -430,6 +430,12 @@ static const b4_int_type_for([$2]) yy$1[[]] =
## Token kinds. ##
## ------------- ##
# Because C enums are not scoped, because tokens are exposed in the
# header, and because these tokens are common to all the parser, we
# need to make sure their names don't collide: use the api.prefix.
m4_define([b4_symbol(1, id)], [b4_api_PREFIX[][ERRCODE]])
m4_define([b4_symbol(2, id)], [b4_api_PREFIX[][UNDEF]])
# b4_token_define(TOKEN-NUM)
# --------------------------
# Output the definition of this token as #define.