mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +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
@@ -108,11 +108,6 @@ if (isInputRange!R && is(ElementType!R : dchar))
|
||||
|
||||
Value semanticVal_;
|
||||
|
||||
public final Value semanticVal()
|
||||
{
|
||||
return semanticVal_;
|
||||
}
|
||||
|
||||
Symbol yylex()
|
||||
{
|
||||
import std.uni : isWhite, isNumber;
|
||||
@@ -167,16 +162,6 @@ if (isInputRange!R && is(ElementType!R : dchar))
|
||||
default: assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
Position startPos() const
|
||||
{
|
||||
return location.begin;
|
||||
}
|
||||
|
||||
Position endPos() const
|
||||
{
|
||||
return location.end;
|
||||
}
|
||||
}
|
||||
|
||||
int main()
|
||||
|
||||
@@ -102,13 +102,6 @@ if (isInputRange!R && is(ElementType!R : dchar))
|
||||
stderr.writeln(s);
|
||||
}
|
||||
|
||||
Value semanticVal_;
|
||||
|
||||
public final Value semanticVal()
|
||||
{
|
||||
return semanticVal_;
|
||||
}
|
||||
|
||||
Symbol yylex()
|
||||
{
|
||||
import std.uni : isWhite, isNumber;
|
||||
|
||||
Reference in New Issue
Block a user