Re: Error reporting/recovery
8 May 2000 00:43:40 -0400

          From comp.compilers

Related articles
[2 earlier articles]
Re: Error reporting/recovery (2000-04-11)
Re: Error reporting/recovery (Jean-Marc Bourguet) (2000-04-14)
Re: Error reporting/recovery (Jean-Marc Bourguet) (2000-04-14)
Re: Error reporting/recovery (Rodney M. Bates) (2000-04-14)
Re: Error reporting/recovery (2000-04-16)
Re: Error reporting/recovery (Jocelyn Coulmance) (2000-04-20)
Re: Error reporting/recovery (2000-05-08)
| List of all articles for this month |

Newsgroups: comp.compilers
Date: 8 May 2000 00:43:40 -0400
Organization: - Before you buy.
References: 00-04-053
Keywords: errors, yacc, question, comment

This is a general question to all members of the thread!

It sounds on the answers in this thread that bison/yacc is totally
incapable when it comes to error reporting. I'm trying to generate
decent error messages from a compiler, and I'm really having trouble
getting the information I need.

I would like to get the following:

The token text of the read erroneous token (token id available in
yychar, but where is the text?).
The token that was expected.
The column where the error occurred.

Where do I get these?

Are these possible to get?
Is it true that you have to enter error rules for every thinkable
situation to give a meaningful error message??


[It's straightforward to track the token text and the column in the lexer,
but getting the set of possible tokens is more of a pain. It's been
discussed in the past, see the archives. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.