LRGen: LR(1) parser generator

A.M.D.G.

Home Downloads Feedback Comparison Theory Papers Documentation Contact

Theoretical Considerations

LL Parsing

Some people like it, because: 1) they like to see the rules of their grammar in the parser code, 2) they hate black boxes (i.e. LR parser tables), and 3) they don't care if their grammar is ambiguous. If that's you, get ANTLR.

LR Parsing

Some people like it, because they prefer: 1) smaller parsers, 2) fast compile times, 3) left-recursion in their grammar, 4) faster parsing, and 5) high-tech LR parser tables. If that's you, get LRGen.

LR Parsing Algorithms


Builds State Machine Of Type Computes Lookaheads From Does Conflict Resolution By
Parser  
LR(0)
Canonical LR(1) Minimal LR(1) Minimal LR(k)
Grammar
State Machine  
Deterministic Parsing
Non- Deterministic Parsing  
Ambiguous Parsing
LR(0) yes Has no lookaheads Parsers are not very useful
SLR(1) yes yes Conflicts in grammar may
produce an incorrect parser
LALR(1) yes yes Conflicts in grammar may
produce an incorrect parser
Canonical LR(1) yes yes Conflicts in grammar may
produce an incorrect parser
Minimal LR(1) yes yes Conflicts in grammar may
produce an incorrect parser
LR(*) yes yes yes
LR(k) yes yes yes
GLR yes yes yes

(c) Copyright Paul B Mann 2018.  All rights reserved.