help-bison
[Top][All Lists]
Advanced

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

Re: Bison Error reporting


From: Hans Aberg
Subject: Re: Bison Error reporting
Date: Thu, 14 Dec 2000 16:24:13 +0100

At 15:19 +0100 0-12-14, Akim Demaille wrote:
>Hans> - If Bison encounters an undefined token it calls it
>Hans> "$undefined.", usually a sporadic character from the lexer. Is
>Hans> it easy to make the error reporting instead writing out which
>Hans> character this is? (Apart from defining a token for every
>Hans> character.)
>
>Good question.  The problem is you can't really assume you can print
>an unknown token as a char.  Someone might return 424242 in the
>scanner, and then?  What can we do?

Somehow one must be able to regulate this (that is, what to print).

>Personally in my projects it can never happen: there is always a rule
>catching unexpected characters in my scanners: the parser never sees
>them, they're skipped by the scanner.

I think that the error reporting was somewhat too sparse also in these
cases: Suppose it found an unexpected `identifier', would it not be prudent
to also report the name of this identifier?

-- I may work more on error reporting later, and if I get any good ideas, I
will get back with that to you.

  Hans Aberg





reply via email to

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