help-bison
[Top][All Lists]
Advanced

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

Re: Bison Error reporting


From: Akim Demaille
Subject: Re: Bison Error reporting
Date: 07 Dec 2000 20:01:58 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

>>>>> "Hans" == Hans Aberg <address@hidden> writes:

Hans> - One can define YYLTYPE for use with the @n variables, but
Hans> there seems to be no way one can get that info into the
Hans> yyerror() function. That is, should one not be able to have say
Hans> a prototype yyerror(const std::string&, YYLTYPE); and when an
Hans> error occurs, one can use the YYLTYPE in order to produce that
Hans> error message. Or is it easy to use this information anyway?

This is a known problem.  Please, check the mailing list archive to
read some notes about this.

Hans> - Bison seems to not enforce any structure on YYLTYPE, so one
Hans> could define it to anything, whereas the manual says one has to
Hans> use struct { int first_line, last_line, first_column,
Hans> last_column; }; Which one is correct? That is, can YYLTYPE be
Hans> defined to anything?  (Speaking about Bison.simple --
Hans> Bison.hairy seems to make such assumptions about YYLTYPE, I
Hans> recall, with an additional filed for time.)

I changed the sources so that there is no requirements over YYLTYPE.
But I did not change the documentation since I'm not yet sure how I
want to finish this overhaul.  I promised myself to dive first into
btyacc to see how they handle this, since they do.

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.)

I don't use characters as tokens, so just don't ;)



reply via email to

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