mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
d: create alias Symbol for YYParse.Symbol
* data/skeletons/lalr1.d: Here. * doc/bison.texi: Document it. * examples/d/calc/calc.y, examples/d/simple/calc.y: Adjust. * tests/calc.at, tests/d.at, tests/scanner.at: Test it.
This commit is contained in:
committed by
Akim Demaille
parent
848a17fa33
commit
13bb2b78b3
@@ -447,6 +447,14 @@ m4_define([b4_var_decls],
|
||||
m4_define([b4_var_decl],
|
||||
[ protected $1;])
|
||||
|
||||
# b4_public_types_declare
|
||||
# -----------------------
|
||||
# Define the public types: token, semantic value, location, and so forth.
|
||||
# Depending on %define token_lex, may be output in the header or source file.
|
||||
m4_define([b4_public_types_declare],
|
||||
[[
|
||||
alias Symbol = ]b4_parser_class[.Symbol;
|
||||
]])
|
||||
|
||||
# b4_symbol_type_define
|
||||
# ---------------------
|
||||
|
||||
@@ -75,7 +75,7 @@ public interface Lexer
|
||||
* to the next token and prepares to return the semantic value
|
||||
* ]b4_locations_if([and beginning/ending positions ])[of the token.
|
||||
* @@return the token identifier corresponding to the next token. */
|
||||
]b4_parser_class[.Symbol yylex ();
|
||||
Symbol yylex ();
|
||||
|
||||
/**
|
||||
* Entry point for error reporting. Emits an error
|
||||
@@ -95,6 +95,8 @@ public interface Lexer
|
||||
]])[
|
||||
}
|
||||
|
||||
]b4_public_types_declare[
|
||||
|
||||
]b4_locations_if([b4_position_type_if([[
|
||||
static assert(__traits(compiles,
|
||||
(new ]b4_position_type[[1])[0]=(new ]b4_position_type[[1])[0]),
|
||||
|
||||
Reference in New Issue
Block a user