LRSTAR: LR(*) parser generator for C++ A.M.D.G.
About Feedback Downloads,
Setup
Grammars LRSTAR DFA Release
Notes
Contact

LRSTAR vs ANTLR vs BISON

  LRSTAR ANTLR BISON
Main Goal* FAST PARSERS EASE OF USE YACC COMPATIBLE
Generates Source Code In C++ C++, others C++, others
Test: C Parser Size* 100 KB 1000 KB N.A.
Test: C Parser Speed* 0.10 sec 14.0 sec N.A.
LR(*) Parser Engines* LALR(*) NO LALR(1)
LL(*) Recursive-Descent Parsers NO ALL(*) NO
GLR Parser Engines NO NO GLR
AST Construction* YES NO NO
Parse-Tree Construction NO YES NO
EBNF Grammar Notation YES YES NO
Error Recovery NO ? ?
Unicode Support SOME YES ?
Case Insensitivity YES YES YES
Grammar Syntax Coloring NO YES NO
Number of Grammars Available 23* 210+ ?
Documentation a little a lot a lot
License BSD BSD GNU
License fee FREE FREE FREE

* Reasons why people use LRSTAR.
* LRSTAR reads ANTLR and YACC grammars, which have been modified slightly. N.A. Not Applicable. BISON offers no symbol-table and no AST creation.


Difficult Grammars

LRSTAR will report conflicts, if found in your grammar, but offers an LR(*) parsing algorithm to take care of everything at runtime. Testing will eventually determine if the grammar is correct, and if not, the conflict report may prove helpful in correcting the grammar.

ANTLR accepts any grammar without complaining, but ambiguous grammars may cause problems like slow parsers or ambiguous parsers. If the grammar is not right, how can the parser be correct? Hopefully, the LL(*) parsing algorthm will take care of everything at runtime.


Parsing Algorithms

LRSTAR uses an LR table-driven parsing algorithm, like YACC. However, LRSTAR uses a more modern parser-table format, which allows chain-reduction elimination. LR parsers handle a larger class of grammars than LL parsers. LR parsers are the result of years of research and provide state-of-the-art small, fast parsers.

ANTLR uses an LL recursive-descent parsing technique, like the hand-coding method people have been using for many years. People like it because it's easy to follow the parsing with a debugger. But LL hates left recursion and forces people to write grammars in an unnatural way. ANTLR has allieviated this problem, but not completely.


C++ Language

To get small-fast parsers, LRSTAR requires some things that only C++ can provide. C++ is a systems-level, compiled language for professional work. Non-professional programmers are scared of C++. So, let them use Java or Python and stay away from projects that require maximum performance. And finally, the C++ code present in LRSTAR parsers is the most efficient C++ style of coding, static variables, function pointers, arrays instead of linked lists, and more.

(c) Copyright LRTEC 2020.  All rights reserved.