mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
d: change the return value of yylex from TokenKind to YYParser.Symbol
The complete symbol approach was deemed to be the right approach for Dlang. Now, the user can return from yylex() an instance of YYParser.Symbol structure, which binds together the TokenKind, the semantic value and the location. Before, the last two were reported separately to the parser. Only the user API is changed, Bisons's internal structure is kept the same. * data/skeletons/d.m4 (struct YYParser.Symbol): New. * data/skeletons/lalr1.d: Change the return value. * doc/bison.texi: Document it. * examples/d/calc/calc.y, examples/d/simple/calc.y: Demonstrate it. * tests/calc.at, tests/scanner.at: Test it.
This commit is contained in:
committed by
Akim Demaille
parent
2ca158c893
commit
10305f3e94
@@ -14011,9 +14011,9 @@ This method is defined by the user to emit an error message. The first
|
||||
parameter is omitted if location tracking is not active.
|
||||
@end deftypemethod
|
||||
|
||||
@deftypemethod {Lexer} {TokenKind} yylex()
|
||||
Return the next token. Its type is the return value, its semantic value and
|
||||
location are saved and returned by the their methods in the interface.
|
||||
@deftypemethod {Lexer} {YYParser.Symbol} yylex()
|
||||
Return the next token. The return value is of type YYParser.Symbol, which
|
||||
binds together the TokenKind, the semantic value and the location.
|
||||
@end deftypemethod
|
||||
|
||||
@deftypemethod {Lexer} {YYPosition} getStartPos()
|
||||
|
||||
Reference in New Issue
Block a user