Error messages and Yacc (Soee Niels)
27 Jul 89 09:08:30 GMT

          From comp.compilers

Related articles
Error messages and Yacc (1989-07-27)
Re: Error messages and Yacc (1989-08-02)
| List of all articles for this month |

From: (Soee Niels)
Newsgroups: comp.compilers
Date: 27 Jul 89 09:08:30 GMT
Organization: Dept. of Mathematics and Computer Science, Odense University, Denmark

We are using yacc to write a compiler, and we have problems
as we want to give some meaningful error messages to the user.
Yacc knows which symbol is valid from every state, and we want to
use this information to write something like:
One possible solution to the problem is a function "yyexpected"
that could return a list of possible terminal symbols.
Does any of you have this function, or is there another
solution to the problem?

Thank you in advance.

My email address is, but maybe the answer is of
interest to the newsgroup.

[This is not as easy as it looks, because yacc combines states
wherever possible, which means that the legitimate follow set in each
state is often a lot larger than the grammar would make it. There
has been a lot of work done on improving yacc's notoriously weak
error handling, and nobody has asked about this for a while, so I'd
be interested in hearing what's new in yacc error recovery. -John]

Post a followup to this message

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