Re: Q: what parser generator can do this?

gneuner@dyn.com (George Neuner)
28 Nov 1999 01:33:20 -0500

          From comp.compilers

Related articles
Q: what parser generator can do this? mgijsen@lucent.com (Martin Gijsen) (1999-11-25)
Re: Q: what parser generator can do this? qjackson@wave.home.com (Quinn Tyler Jackson) (1999-11-28)
Re: Q: what parser generator can do this? gneuner@dyn.com (1999-11-28)
| List of all articles for this month |

From: gneuner@dyn.com (George Neuner)
Newsgroups: comp.compilers
Date: 28 Nov 1999 01:33:20 -0500
Organization: Dynamic ReSolutions, Inc.
References: 99-11-158
Keywords: parse, tools

Martin Gijsen <mgijsen@lucent.com> wrote:


>I've been looking through a list of parser generators for one to
>use, but I never find all the info I need. So can anyone out there
>recommend a parser generator that can do all of the following:
>
>- multiple entry points (multiple parsers, shared code)
>- supports parameters to rules and local variables (like LLgen)
>- error mechanism that enables context specific error messages
> (such as: "bar" expected after "foo")
>- generates C or C++ code (Unix environment)
>
>It only needs to parse regular expressions in this case.


ANTLR [www.antlr.org, comp.compilers.tools.pccts] can do most or all
of that - I'm not certain what you mean by "shared" code in this
context.


ANTLR generates recursive decent, predicated LL parsers and lexers in
straight ANSI C++ or Java and allows rules to have user defined
parameters, return values and local variables. Rules defined in your
grammar become public member functions in the generated parser class
and thus can be called independently. Parse errors are signaled by
exceptions: handlers can be attached to either an entire rule or an
alternation within it.


ANTLR supports essentially unlimited lookahead and allows both
syntactic and semantic predicates to direct the parse. The tool
itself is written in Java and so requires a JVM to operate but the
generated C++ code is independent.


I've been using it for about 6 months. The recursive decent code is
much easier to debug [when necessary] than table driven parsers ala.
Yacc.




Hope this helps.


George Neuner
Dynamic Resolutions, Inc.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.