mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
lalr1.cc: add LAC support
Implement lookahead correction (LAC) for the C++ skeleton. LAC is a mechanism to make sure that we report the correct list of expected tokens if a syntax error occurs. So far, LAC was only supported for the C skeleton "yacc.c". * data/skeletons/lalr1.cc: Add LAC support. * doc/bison.texi: Update.
This commit is contained in:
committed by
Akim Demaille
parent
996abe62d7
commit
72d4ae5306
@@ -8697,7 +8697,7 @@ Enable LAC to improve syntax error handling.
|
||||
@item @code{none} (default)
|
||||
@item @code{full}
|
||||
@end itemize
|
||||
This feature is currently only available for deterministic parsers in C.
|
||||
This feature is currently only available for deterministic parsers in C and C++.
|
||||
@end deffn
|
||||
|
||||
Conceptually, the LAC mechanism is straight-forward. Whenever the parser
|
||||
@@ -11685,7 +11685,7 @@ location (if enabled) being @var{yylval} and @var{yylloc}. Invocations of
|
||||
Note that when using variants, the interface for @code{yylex} is the same,
|
||||
but @code{yylval} is handled differently.
|
||||
|
||||
Regular union-based code in Lex scanner typically look like:
|
||||
Regular union-based code in Lex scanner typically looks like:
|
||||
|
||||
@example
|
||||
[0-9]+ @{
|
||||
|
||||
Reference in New Issue
Block a user