[antlr-interest] My kooky ASN.1 grammar again - can't find the ambiguity
s.barnett-cormack at lancaster.ac.uk
Mon Mar 16 11:35:40 PDT 2009
I've been trying to actually remove ambiguities, rather than papering
over the cracks with backtrack (as I realised there are some fundamental
ways in which this isn't going to work). I realised that there are a lot
of cases of value expressions being redundant between types. The
standard is *really* not aimed at implementors, which is a little
worrying... anyway, the grammar has been getting simpler, but I've hit a
snag when I get to the bits about constraints.
The grammar is attached; the difficulty I'm having is that 'type' and
'value' are apparently ambiguous with one another, as given by the
errors for the rule 'test' on line 715. I'm getting better at tracing
through to find the ambiguities and left-factoring them or reducing
redundancy. However, in this case I can't seem to find the situations
where CAPID is a valid value or LCID is a valid type, or the other
strange results it gives.
Any help gratefully appreciated - a pointer at the leaf-rules that are
at issue, and how one gets to them, would be ideal.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the antlr-interest