LR (k) or LALR (k) parser generator with functions similar to ANTLR

I am currently writing a parser for some language. I was given

for this language, but this grammar has some left recursion and non-LL (*) constructs, so ANTLR does not work very well, even with return.

Since deleting these left recursions and constructs without LL (*) is more complicated than at first glance, now I want to try the LR (k) or LALR (k) parser generator. The higher k, the better.

Can someone recommend me a parser generator that meets these requirements?

  • The generated analyzer is preferably an LR (k) analyzer with some high (or even arbitrary) k, or at least a LALR (k) parser with some high k.
  • The generated parser is written in C or C ++, and if it is written in C, it is associated with C ++ code.
  • It would be convenient to use a feature set similar to ANTLR (especially for rewriting AST).
  • Performance is not the most pressing problem; the generated parser is designed to be used on desktop computers with a large amount of memory and processor power.

Thanks and hi
Jost

PS: I do not ask because I cannot google myself, but because there is no time left to check some generators. Therefore, please answer only if you have experience with the recommended parser generators.

+4
source share
3 answers

Now I decided to use DParser , which is a GLR-Parser generator capable of recognizing any free context. It seems to be well programmed (look at the tests in the source distribution), but many of the functions provided by ANTLR are missing, primarily with AST-Construction tools.

As a plus, it basically repeats the ANTLRs grammar file format, which was the format of my grammar.

+3
source

You might consider LRSTAR .

I have no experience with the tool itself, but I met with the author and he looks like a pretty competent guy. (I am doing an analysis of engines and related technologies for life).

+4
source

LRSTAR 10.0 is available now. The comparison page has a comparison of LRSTAR, ANTLR and Bison. Now LRSTAR reads ANTLR-style notations using the same EBNF operators (:, |, *, + ,?). It is a C ++-based system that generates LR (k) parsers in C ++. Parsers perform automatic build and AST traversal. The new version 10.0 reads Yacc / Bison grammars if there is no action code in the grammar.

+4
source

All Articles