help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Token value in custom error reporting


From: Akim Demaille
Subject: Re: Token value in custom error reporting
Date: Fri, 19 Jun 2020 07:16:08 +0200


> Le 18 juin 2020 à 20:46, Hans Åberg <haberg-1@telia.com> a écrit :
> 
> Otherwise, in your link above you suggest not using the semantic value in 
> error messages, but when using locations, it contains the token 
> delimitations. So there seems to be no advantage letting the lexer generating 
> the error.

It is still useful for the scanner to emit the error message, because the 
parser has no idea what is wrong.  Granted, it knows _where_ it's wrong, but 
not _why_:
- invalid character?
- not-closed string?
- invalid escape sequence?
- out-of-range literal number?
- etc.

The scanner faces the error, *it* should say what's wrong.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]