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:
Adela Vais authored and Akim Demaille committed 2020-12-21 15:53:32 +01:00
1 parent 27109d9d4a
commit 32bb53870b
7 files changed
+1 -69

No files matched your search

-15
View File
@@ -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()
-7
View File
@@ -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;