[antlr-interest] internal error
Gavin Lambert
antlr at mirality.co.nz
Fri Feb 1 23:26:54 PST 2008
At 17:01 2/02/2008, Olivier Lefevre wrote:
>
>In fairness to me you didn't quite say that: rather, you said
>"it's perfectly fine to bomb in this scenario", which didn't
>give much confidence that the issue will be addressed even
>after it becomes possible to ;-)
Actually Jim didn't say that -- I did. And that was only half of
what I said.
To rephrase: "It is reasonable behaviour for the parser to throw
an exception in that case, because it is a case that it should
never have to deal with in the first place. This is because it is
not an error in the input, it is an error in the code itself, and
thus not the responsibility of that code. (It is not possible to
write code that can defend itself from errors in its own
source.) Where the defensive line should be drawn is at the
compiler generating that code, which should detect that incorrect
generated code will result and report it as an error to the
grammar author. However this is not yet possible due to the
structure of ANTLR (since it's still using an old version
internally), so fixing it will have to wait until the structure is
updated."
More information about the antlr-interest
mailing list