[Top][All Lists]

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

Re: Bison and $ (dollarsign) token at the end

From: Hans Aberg
Subject: Re: Bison and $ (dollarsign) token at the end
Date: Wed, 10 Jul 2002 12:13:30 +0200

At 08:44 +0200 2002/07/10, Akim Demaille wrote:
>  First, the error messages have to be
>cleaned.  Then we can see how aliases can help.  Currently, anyway,
>the messages, even with the assistance of the grammar writer, are far
>from being perfect.  For instance:
>        parse error: unexpected "number", expected "end of file"
>should look like
>        parse error: unexpected number, expected end of file

Actually, I like being able to see th semantic qualities token/character,
which is currently indicated by Bison using "..." and '...'. But if Bison
does not write those quote marks out for tokens, then one can enter them,
or whatever is preferred in the grammar. Also, there is a distinction
between grammar variables and tokens; pehraps one should be able to
indicate that in a printout.

For characters, if they should continue to be supported by Bison, and be
written out, one will have to add an encoding for the non-printable

>not matter the internal/external names.  It's the whole composition of
>the error message that ought to be revisited.

ONe idea that comes to my mind is that one can indicate both grammar
aliases and error message strings, for example:
%token DOUBLE "float" "floating point number"
%variable nbr_seq "number sequence"ยจ
   nbr_seq: "float" | "float" nbr_seq

Then error messages would use the strings "floating point number" and
"number sequence" (not including the quotes). (I do not immediately recall
if grammar variables are printed out in error messages, though. :-) )

-- But fixing the C++ support is more important. :-)

  Hans Aberg
                  * Email: Hans Aberg <mailto:address@hidden>
                  * Home Page: <>
                  * AMS member listing: <>

reply via email to

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