20 Feb 2006 21:41:32 -0500

Related articles |
---|

generating recursive parsers from grammars. rpboland@gmail.com (Ralph Boland) (2006-02-03) |

Re: generating recursive parsers from grammars. peteg42@gmail.com (Peter Gammie) (2006-02-06) |

Re: generating recursive parsers from grammars. grosch@cocolab.de (Josef Grosch) (2006-02-06) |

Re: generating recursive parsers from grammars. scavadini@ucse.edu.ar (2006-02-07) |

generating recursive parsers from grammars. lowell@coasttocoastresearch.com (Lowell Thomas) (2006-02-20) |

From: | "Lowell Thomas" <lowell@coasttocoastresearch.com> |

Newsgroups: | comp.compilers |

Date: | 20 Feb 2006 21:41:32 -0500 |

Organization: | Compilers Central |

References: | 06-02-039 |

Keywords: | parse |

Posted-Date: | 20 Feb 2006 21:41:32 EST |

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

Post a followup to this message

Return to the
comp.compilers page.

Search the
comp.compilers archives again.