d: create alias Position for YYPosition

* data/skeletons/d.m4 (b4_public_types_declare): Here.
* data/skeletons/lalr1.d: Adjust.
* doc/bison.texi: Document it.
* examples/d/calc/calc.y: Use it.
* tests/calc.at: Test it.
This commit is contained in:
Adela Vais
2020-12-18 19:53:32 +02:00
committed by Akim Demaille
parent b00fa62e95
commit 20d657c1dd
5 changed files with 16 additions and 15 deletions

View File

@@ -456,7 +456,8 @@ m4_define([b4_public_types_declare],
[[
alias Symbol = ]b4_parser_class[.Symbol;
alias Value = ]b4_yystype[;]b4_locations_if([[
alias Location = ]b4_location_type[;]])[
alias Location = ]b4_location_type[;
alias Position = ]b4_position_type[;]])[
]])

View File

@@ -57,12 +57,12 @@ public interface Lexer
/**
* Method to retrieve the beginning position of the last scanned token.
* @@return the position at which the last scanned token starts. */
]b4_position_type[ startPos ();
Position startPos ();
/**
* Method to retrieve the ending position of the last scanned token.
* @@return the first position beyond the last scanned token. */
]b4_position_type[ endPos ();
Position endPos ();
]])[
/**