[antlr-interest] Confusing, hopefully-final, problems

Sam Barnett-Cormack s.barnett-cormack at lancaster.ac.uk
Sun Mar 1 06:10:42 PST 2009


Hi all

[resent with grammar *actually* attached]

So, I solved the recursion issue (which had been complicated by me
failing to notice a '|' in the standard), and fixed a lot of intractable
issues using predicates (or backtracking, at least for now). However,
I'm still getting some errors/warnings which I can't for the life of me
figure out the reason for. I know what they mean, but they don't make
sense. The grammar is, of course, attached. The build errors I'm getting
are:

[18:09:42] warning(200): ASN_1.g:346:108: Decision can match input such
as "'('" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
[18:09:42] warning(200): ASN_1.g:470:4: Decision can match input such as
"'...'" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
[18:09:42] warning(200): ASN_1.g:473:31: Decision can match input such
as "'}'" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
[18:09:42] warning(200): ASN_1.g:473:31: Decision can match input such
as "','" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
[18:09:42] warning(200): ASN_1.g:473:31: Decision can match input such
as "EOF" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
[18:09:42] error(201): ASN_1.g:473:31: The following alternatives can
never be matched: 2

[18:09:42] warning(200): ASN_1.g:518:15: Decision can match input such
as "'...'" using multiple alternatives: 1, 2
As a result, alternative(s) 2 were disabled for that input
[18:09:42] error(201): ASN_1.g:518:15: The following alternatives can
never be matched: 2


In the case of line 473, some of those inputs that can supposedly be
matched in more than one way can't really be matched at all, as far as I
can tell. In the other cases, the inputs can be matched, but I'm pretty
sure they can't be matched by the things it says they can be.

I'm sure that this isn't some sort of software bug, because I know antlr
isn't that flaky and weird. Beginning to feel incredibly stupid, but can
anyone offer me any tips or ideas, or even a full debugging of my code
(hey, it's unlikely, but I can hope, right)?

Thanks all

Sam



More information about the antlr-interest mailing list