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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user