|Q: what parser generator can do this? firstname.lastname@example.org (Martin Gijsen) (1999-11-25)|
|Re: Q: what parser generator can do this? email@example.com (Quinn Tyler Jackson) (1999-11-28)|
|Re: Q: what parser generator can do this? firstname.lastname@example.org (1999-11-28)|
|From:||email@example.com (George Neuner)|
|Date:||28 Nov 1999 01:33:20 -0500|
|Organization:||Dynamic ReSolutions, Inc.|
Martin Gijsen <firstname.lastname@example.org> 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
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.
Hope this helps.
Dynamic Resolutions, Inc.
Return to the
Search the comp.compilers archives again.