[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Token value in custom error reporting
From: |
Hans Åberg |
Subject: |
Re: Token value in custom error reporting |
Date: |
Thu, 18 Jun 2020 14:54:13 +0200 |
> On 18 Jun 2020, at 10:24, Daniele Nicolodi <daniele@grinta.net> wrote:
>
> On 18/06/2020 00:39, Akim Demaille wrote:
>>
>> Would you have an example of what you mean?
> …
> In the existing code, on error the lexer emits a LEX_ERROR token. This
> results in a grammar error that triggers error recovery (good) but also
> in an extra error emitted by Bison (bad). Right now the code checks the
> error messages in yyerror() and suppresses the unwanted error reporting
> if it contains the string "LEX_ERROR”.
In my C++ parser, the lexer has rule
. { return my_parser::token::token_error; }
When it is triggers, I get the error:
<file>:21.1: error: syntax error, unexpected token error
It might be nicer to actually write out this token, though.
- Token value in custom error reporting, Daniele Nicolodi, 2020/06/17
- Re: Token value in custom error reporting, Akim Demaille, 2020/06/18
- Re: Token value in custom error reporting, Daniele Nicolodi, 2020/06/18
- Re: Token value in custom error reporting, Akim Demaille, 2020/06/18
- Re: Token value in custom error reporting, Daniele Nicolodi, 2020/06/18
- Re: Token value in custom error reporting, Adrian Vogelsgesang, 2020/06/18
- Re: Token value in custom error reporting, Akim Demaille, 2020/06/18
- Re: Token value in custom error reporting, Adrian Vogelsgesang, 2020/06/18
- Re: Token value in custom error reporting,
Hans Åberg <=
- Re: Token value in custom error reporting, Akim Demaille, 2020/06/18
- Re: Token value in custom error reporting, Hans Åberg, 2020/06/18
- Re: Token value in custom error reporting, Akim Demaille, 2020/06/18
- Re: Token value in custom error reporting, Hans Åberg, 2020/06/18
- Re: Token value in custom error reporting, Akim Demaille, 2020/06/19
- Re: Token value in custom error reporting, Hans Åberg, 2020/06/19
- Re: Token value in custom error reporting, Akim Demaille, 2020/06/18