generating recursive parsers from grammars.
- From: "Lowell Thomas" <lowell@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 20 Feb 2006 21:41:32 -0500
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
.
- References:
- generating recursive parsers from grammars.
- From: Ralph Boland
- generating recursive parsers from grammars.
- Prev by Date: Re: A Plain English Compiler
- Next by Date: Re: A Plain English Compiler
- Previous by thread: Re: generating recursive parsers from grammars.
- Next by thread: Compiler positions available for week ending February 5
- Index(es):