mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
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:
committed by
Akim Demaille
parent
b00fa62e95
commit
20d657c1dd
@@ -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[;]])[
|
||||
]])
|
||||
|
||||
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
]])[
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user