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

Re: SableCC Thoughts Part II



> 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?

[I didn't check, this is my intuition] This should be a non-recoverable
parse error.  If the programmer wanted to handle the case you mentioned,
there should have been an error alternative on production d.  I think
the alternative error node should only apply once processing of
production a has started.  It's as if an exception is thrown and gets
handled by the first catch block.  In this case, the exception is thrown
"in" d, not "in" a.

So, am I right?

-Dan