generating recursive parsers from grammars.



You might have a look at APG, an ABNF Parser Generator tool that I have
written (www.coasttocoastresearch.com). Its parsers use a recursive-decent
algorithm and as far as I can determine they can handle any context-free
grammar. With ABNF left recursion can be eliminated via the repetition (*)
operator. Other types of recursion, except for cyclical recursion and
infinite strings, are not a problem. It uses a hard-coded disambiguation
rule to resolve ambiguities, but the source code is available other rules
can be implemented. It is not a mainstream method but I have found it to
work well for all grammars that I have tried so far, including
dangling-else, expressions and an expression/declaration abstraction that
requires semantic predicates.

I'd be interested in hearing about your experience with APG if you decide to
give it a try.

Lowell Thomas

.