Skip to content

Parsers timeline

1961196419651968196919701971198319841990199319992004200520062007200920102011201420162018201920202022CYKEarleyBrzozowski DerivativeRegular-expression derivativesRelational parsingLRLALRGLRLLLRYakkerSEVMLL(k)Efficient LL(k)GLLSLRLAR(m)TDPLPEGGLCGLR*SGLRRIGLRIGLRLL(*)MSGLRISGLRTratt's PEGMOGPikaPEGLLRNGLRBRNGLRParsing with DerivativesALL(*)Parsing with Zippers

Algorithms

List of algorithms (based on this page):

LL

left-to-right, leftmost derivation (top-down), “recursive descent”

  • LL(k)
    • k tokens of lookahead
    • very expensive (when introduced)
  • LL(1)
    • exactly one token lookahead
    • much more efficient
    • uses FIRST() and FOLLOW() to build parse tables
  • Efficient LL(k)
    • k tokens of lookahead
    • k is gradually increased w/ backtracking as a fallback
    • basis of original ANTLR
  • GLL: Generalised LL
    • LL analogue to GLR
    • maintains multiple parsing descriptors on a stack
  • LL(*)
    • LL analogue to LAR(m)
    • regular lookaheads w/ cyclic DFAs
    • basis of ANTLR 3
  • ALL(*): Adaptive LL(*)
    • parallel regular lookaheads
    • dynamic; adapts to input sentences
    • simulates augmented recursive transition networks (ATNs)
    • basis of ANTLR 4
  • LLLR: a Combination of LL and LR

LR

left-to-right, rightmost derivation (“bottom-up”), “shift/reduce”

PEG

  • PEG: parsing expression grammar
    • similar to CFG-based grammars, but alternation is inherently ordered
    • often implemented with “packrat” parsers that memoize partial results
    • recursive descent with backtracking
  • PEGLL: PEG + GLL

Parsing with derivatives