mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
java: beware not to alias the locations of the various symbols
* examples/java/calc/Calc.y, tests/calc.at, tests/local.at (getStartPos, getEndPos): Always return a new object. * doc/bison.texi: Clarify this.
This commit is contained in:
@@ -12889,9 +12889,12 @@ Default is @code{java.io.IOException}.
|
||||
|
||||
@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.
|
||||
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.
|
||||
|
||||
The return type can be changed using @code{%define api.position.type
|
||||
@{@var{class-name}@}}.
|
||||
|
||||
Reference in New Issue
Block a user