mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
d: remove unnecessary methods from the Lexer interface
The complete symbol approach in yylex removes the need for the methods semanticVal, startPos and endPos, which were used when the values were reported separately. * data/skeletons/lalr1.d: Here. * doc/bison.texi: Remove sections about the three methods. * examples/d/calc/calc.y, examples/d/simple/calc.y: Remove the unused methods. * tests/calc.at, tests/d.at, tests/scanner.at: Test it.
This commit is contained in:
committed by
Akim Demaille
parent
27109d9d4a
commit
32bb53870b
@@ -565,22 +565,7 @@ class CalcLexer(R) : Lexer
|
||||
|
||||
Value semanticVal_;]AT_LOCATION_IF([[
|
||||
Location location;
|
||||
|
||||
public final @property Position startPos()
|
||||
{
|
||||
return location.begin;
|
||||
}
|
||||
|
||||
public final @property Position endPos()
|
||||
{
|
||||
return location.end;
|
||||
}
|
||||
]])[
|
||||
public final @property Value semanticVal()
|
||||
{
|
||||
return semanticVal_;
|
||||
}
|
||||
|
||||
int parseInt ()
|
||||
{
|
||||
auto res = 0;
|
||||
|
||||
@@ -79,7 +79,6 @@ class CalcLexer(R) : Lexer
|
||||
void yyerror(string s) {}
|
||||
|
||||
Value semanticVal_;
|
||||
Value semanticVal() @property { return semanticVal_; }
|
||||
|
||||
Symbol yylex()
|
||||
{
|
||||
|
||||
@@ -116,10 +116,6 @@ class YYLexer(R) : Lexer
|
||||
]AT_YYERROR_DEFINE[
|
||||
|
||||
Value semanticVal_;
|
||||
public final @property Value semanticVal ()
|
||||
{
|
||||
return semanticVal_;
|
||||
}
|
||||
|
||||
Symbol yylex ()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user