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
2020-12-21 15:49:27 +02:00
committed by Akim Demaille
parent 27109d9d4a
commit 32bb53870b
7 changed files with 1 additions and 69 deletions

View File

@@ -14016,16 +14016,6 @@ Return the next token. The return value is of type @code{Symbol}, which
binds together the kind, the semantic value and the location.
@end deftypemethod
@deftypemethod {Lexer} {Position} getStartPos()
@deftypemethodx {Lexer} {Position} getEndPos()
Return respectively the first position of the last token that @code{yylex}
returned, and the first position beyond it. These methods are not needed
unless location tracking is active.
They should return new objects for each call, to avoid that all the symbol
share the same Position boundaries.
@end deftypemethod
@deftypemethod {Lexer} {void} reportSyntaxError(@code{YYParser.Context} @var{ctx})
If you invoke @samp{%define parse.error custom} (@pxref{Bison
Declarations}), then the parser no longer passes syntax error messages to