doc: more details about symbols in m4

* data/README.md: here.
* README-hacking.md (Vocabulary): More.
This commit is contained in:
Akim Demaille
2020-06-20 09:09:26 +02:00
parent 5f95583da7
commit 238692ad77
2 changed files with 5 additions and 3 deletions

View File

@@ -211,6 +211,8 @@ assert/abort), and all the --trace output which is meant for the maintainers
only. only.
## Vocabulary ## Vocabulary
- "lookahead", not "look-ahead".
- "midrule", not "mid-rule".
- "nonterminal", not "variable" or "non-terminal" or "non terminal". - "nonterminal", not "variable" or "non-terminal" or "non terminal".
Abbreviated as "nterm". Abbreviated as "nterm".
- "shift/reduce" and "reduce/reduce", not "shift-reduce" or "shift reduce", - "shift/reduce" and "reduce/reduce", not "shift-reduce" or "shift reduce",

View File

@@ -86,7 +86,7 @@ The macro `b4_symbol(NUM, FIELD)` gives access to the following FIELDS:
- `has_id`: 0 or 1 - `has_id`: 0 or 1
Whether the symbol has an `id`. Whether the symbol has an `id`.
- `id`: string - `id`: string (e.g., `exp`, `NUM`, or `TOK_NUM` with api.token.prefix)
If `has_id`, the name of the token kind (prefixed by api.token.prefix if If `has_id`, the name of the token kind (prefixed by api.token.prefix if
defined), otherwise empty. Guaranteed to be usable as a C identifier. defined), otherwise empty. Guaranteed to be usable as a C identifier.
This is used to define the token kind (i.e., the enum used by the return This is used to define the token kind (i.e., the enum used by the return
@@ -105,9 +105,9 @@ The macro `b4_symbol(NUM, FIELD)` gives access to the following FIELDS:
- `is_token`: 0 or 1 - `is_token`: 0 or 1
Whether this is a terminal symbol. Whether this is a terminal symbol.
- `kind_base`: string - `kind_base`: string (e.g., `YYSYMBOL_exp`, `YYSYMBOL_NUM`)
The base of the symbol kind, i.e., the enumerator of this symbol (token or The base of the symbol kind, i.e., the enumerator of this symbol (token or
nonterminal) which is mapping to its `number`. nonterminal) which is mapped to its `number`.
- `kind`: string - `kind`: string
Same as `kind_base`, but possibly with a prefix in some languages. E.g., Same as `kind_base`, but possibly with a prefix in some languages. E.g.,