[antlr-interest] OPEN, EOF ambiguity

William B. Clodius wclodius at los-alamos.net
Fri Apr 9 19:11:04 PDT 2010


On Apr 9, 2010, at 11:02 AM, Cliff Hudson wrote:

> Well, it's not always true that grammar specs are, for instance, LALR(1) or
> LL(k).  In such cases, you have to rejigger the grammar to make it work.
> The important thing is (or should be) that the grammar you do produce,
> regardless of the technicalities, will parse what you intend and nothing
> more.
<snip>
However it is often useful to make the grammar you parse be different from the official grammar for the language. Often some constructs that the language language differentiates in the syntax may best (sometimes only) be distinguished during the semantic analysis. Error reporting can also be better if the lexical and syntactic properties of the accepted language is looser than the official language, though care must be taken to ensure that the semantic analysis detects all such errors and does not acidently give such errors meaning.


More information about the antlr-interest mailing list