mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 04:13:03 +00:00
d: remove dead comment
* data/skeletons/lalr1.d (reportSyntaxError): here.
This commit is contained in:
@@ -677,37 +677,6 @@ m4_popdef([b4_at_dollar])])dnl
|
|||||||
[custom], [[
|
[custom], [[
|
||||||
yylexer.syntax_error(yyctx);]],
|
yylexer.syntax_error(yyctx);]],
|
||||||
[detailed\|verbose], [[
|
[detailed\|verbose], [[
|
||||||
/* There are many possibilities here to consider:
|
|
||||||
- Assume YYFAIL is not used. It's too flawed to consider.
|
|
||||||
See
|
|
||||||
<http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
|
|
||||||
for details. YYERROR is fine as it does not invoke this
|
|
||||||
function.
|
|
||||||
- If this state is a consistent state with a default action,
|
|
||||||
then the only way this function was invoked is if the
|
|
||||||
default action is an error action. In that case, don't
|
|
||||||
check for expected tokens because there are none.
|
|
||||||
- The only way there can be no lookahead present (in tok) is
|
|
||||||
if this state is a consistent state with a default action.
|
|
||||||
Thus, detecting the absence of a lookahead is sufficient to
|
|
||||||
determine that there is no unexpected or expected token to
|
|
||||||
report. In that case, just report a simple "syntax error".
|
|
||||||
- Don't assume there isn't a lookahead just because this
|
|
||||||
state is a consistent state with a default action. There
|
|
||||||
might have been a previous inconsistent state, consistent
|
|
||||||
state with a non-default action, or user semantic action
|
|
||||||
that manipulated yychar. (However, yychar is currently out
|
|
||||||
of scope during semantic actions.)
|
|
||||||
- Of course, the expected token list depends on states to
|
|
||||||
have correct lookahead information, and it depends on the
|
|
||||||
parser not to perform extra reductions after fetching a
|
|
||||||
lookahead from the scanner and before detecting a syntax
|
|
||||||
error. Thus, state merging (from LALR or IELR) and default
|
|
||||||
reductions corrupt the expected token list. However, the
|
|
||||||
list is correct for canonical LR with one exception: it
|
|
||||||
will still contain any token that will not be accepted due
|
|
||||||
to an error action in a later state.
|
|
||||||
*/
|
|
||||||
if (yyctx.getToken() != ]b4_symbol(empty, kind)[)
|
if (yyctx.getToken() != ]b4_symbol(empty, kind)[)
|
||||||
{
|
{
|
||||||
// FIXME: This method of building the message is not compatible
|
// FIXME: This method of building the message is not compatible
|
||||||
|
|||||||
Reference in New Issue
Block a user