d: put YYEMPTY in the TokenKind

* data/skeletons/d.m4, data/skeletons/lalr1.d (b4_token_enums): Rename
YYTokenType as TokenKind.
Define YYEMPTY.
* examples/d/calc.y, tests/calc.at, tests/scanner.at: Adjust.
This commit is contained in:
Akim Demaille
2020-04-13 08:45:46 +02:00
parent 3877b7210e
commit 71e3f6d4da
7 changed files with 39 additions and 39 deletions

7
TODO
View File

@@ -120,6 +120,11 @@ https://www.cs.tufts.edu/~nr/cs257/archive/clinton-jefferey/lr-error-messages.pd
https://research.swtch.com/yyerror
http://gallium.inria.fr/~fpottier/publis/fpottier-reachability-cc2016.pdf
* D
** yylex
It would be better to have TokenKind as return value. Can we use reflexion
to support both output types?
* Modernization
Fix data/skeletons/yacc.c so that it defines YYPTRDIFF_T properly for modern
and older C++ compilers. Currently the code defaults to defining it to
@@ -264,7 +269,7 @@ It would be a very nice source of inspiration for the other languages.
Valentin Tolmer is working on this.
** yychar == yyempty_
** yychar == YYEMPTY
The code in yyerrlab reads:
if (yychar <= YYEOF)