diff options
author | Adela Vais <adela.vais99@gmail.com> | 2020-12-21 15:49:27 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2020-12-21 15:53:32 +0100 |
commit | 32bb53870bb9caa2f8de081fdb53cb3540c8ce7a (patch) | |
tree | 752bcee21228117dc9391e34859532f946c0ea24 /examples | |
parent | 27109d9d4ac11665612119344141df0b9f440fbb (diff) | |
download | bison-32bb53870bb9caa2f8de081fdb53cb3540c8ce7a.tar.gz |
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.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/d/calc/calc.y | 15 | ||||
-rw-r--r-- | examples/d/simple/calc.y | 7 |
2 files changed, 0 insertions, 22 deletions
diff --git a/examples/d/calc/calc.y b/examples/d/calc/calc.y index 9599501f..2c79c158 100644 --- a/examples/d/calc/calc.y +++ b/examples/d/calc/calc.y @@ -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() diff --git a/examples/d/simple/calc.y b/examples/d/simple/calc.y index 5fca647e..58f1d020 100644 --- a/examples/d/simple/calc.y +++ b/examples/d/simple/calc.y @@ -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; |