[Haskell] Happy Error Token

Simon Marlow simonmar at microsoft.com
Tue Mar 22 08:46:59 EST 2005


On 18 March 2005 20:20, Clemens Ley wrote:

> I've had some trouble with the happy error token: What is it actually
> there for (apart form implementing the Haskell layout rule). I've not
> been able to find an example where it matters weather I include the
> error token or not. Can someone help me?

Happy's error token is a restricted version of the error token found in
Yacc.  It is sufficient to implement the Haskell layout rule, but not to
do general error recovery.

The reason I restricted it in this way is because I couldn't find a
sensible semantics for Yacc's error token.  Different Yacc
implementations seem to do different things (I found differences between
byacc and bison, for example), and using Yacc's error token to implement
the Haskell layout rule was unreliable.

It would be nice to have some kind of error recovery in Happy too,
though.

Cheers,
	Simon


More information about the Haskell mailing list