Lexing and Parsing Utilities

1.4k views Asked by At

I'm looking for lexical analysis and parser-generating utilities that are not Flex or Bison. Requirements:

  • Parser is specified using a context-free LL(*) or GLR grammar. I would also consider PEGs.
  • Integrates tightly with a programming language that could be used for both scripting and application development. Language should also have facilities for easily interfacing with C. Good examples are Python, Ruby, and Guile. No C, Java, or Perl please. I want the language to be homogeneous; I want the parser generator to output code in the same language.
  • Well-documented and production-quality.
  • Open source. Free is also desirable (although not required).
  • Compatible with Linux distributions or one of the open source BSDs. I would consider OpenSolaris.
  • Rapid development is a considerably greater concern than efficiency.
  • Suited to parsing natural language as well as formal languages. Natural language parsing is limited to short, simple sentences with very little ambiguity.

I have my eye on ANTLR, although I have never used it. Comments to that effect are appreciated. Let me know what your favorite utilities are that meet these requirements, and why you would recommend them.

3

There are 3 answers

2
SK-logic On BEST ANSWER

There is a list of modern Packrat parsers here.

0
C. K. Young On

Guile 2.0 (to be released in about a few days) has an LALR(1) parsing library.

0
Ira Baxter On

NL text tends have to lots of ambiguity. If you want to parse natural langauge, I don't think any of the classic compiler-type parser generators (LALR, LL [including ANTLR]) will help you much, and compiler type parser generators typically don't handle this at all.

A GLR parser, which does handle ambiguity, may be of some use; bison offers this as an option.