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

Re: SableCC Thoughts Part II

Dan Sandberg wrote:
> Interesting.  I know you're busy now, but at some point when you have
> more time I'd love to see an example of when the error-recovery
> construct:
> a = b |
>     c |
>     error eol;
> introduces non-intuitive behavior.  I'm curious because the construct
> seems very clean to me.

How about:

d = a | 'k';

a = 'b' | 'c' | error 'eol';

(where x is a production, and 'x' is a token).

If I feed this the string:  'e' 'eol', what will happen?

Etienne M. Gagnon, M.Sc.                     e-mail: egagnon@j-meg.com
Author of SableCC:                             http://www.sablecc.org/
and SableVM:                                   http://www.sablevm.org/