Comparison of parser generators


This is a list of notable lexer generators and parser generators for various language classes.

Regular languages

Regular languages are a category of languages which can be matched by a state machine constructed from a regular expression. In particular, a regular language can match constructs like "A follows B", "Either A or B", "A, followed by zero or more instances of B", but cannot match constructs which require consistency between non-adjacent elements, such as "some instances of A followed by the same number of instances of B", and also cannot express the concept of recursive "nesting". A classic example of a problem which a regular grammar cannot handle is the question of whether a given string contains correctly nested parentheses.
NameLexer algorithmOutput languagesGrammar, codeDevelopment platformLicense
AlexDFAHaskell, BSD
AnnoFlexDFAJava, BSD
AstirDFA table driven, with branchingC++, MIT
AustenXDFAJava, BSD
C# FlexDFAC#, GNU GPL
C# LexDFAC#?
CookCCDFAJava, Apache 2.0
DFADFA compressed matrixC, C++Windows, Visual StudioBSD
DolphinDFAC++
FlexDFA table drivenC, C++, BSD
gelexDFAEiffel, MIT
golexDFAGo, BSD-style
gplexDFAC#, BSD-like
JFlexDFAJava, BSD
JLexDFAJava, BSD-like
lexDFAC, proprietary, CDDL
lexertlDFAC++?, GNU LGPL
QuexDFA direct codeC, C++, GNU LGPL
RagelDFAGo, C, C++, Java, assembly, GNU GPL, MIT
RE/flexDFA direct code, DFA table driven, and NFA regex librariesC++, BSD
re2cDFA direct codeC, C++, Go, Rust, public domain

Deterministic context-free languages

Context-free languages are a category of languages which can be matched by a sequence of replacement rules, each of which essentially maps each non-terminal element to a sequence of terminal elements and/or other nonterminal elements. Grammars of this type can match anything that can be matched by a regular grammar, and furthermore, can handle the concept of recursive "nesting", such as the question of whether a given string contains correctly nested parentheses. The rules of Context-free grammars are purely local, however, and therefore cannot handle questions that require non-local analysis such as "Does a declaration exist for every variable that is used in a function?". To do so technically would require a more sophisticated grammar, like a Chomsky Type 1 grammar, also termed a context-sensitive grammar. However, parser generators for context-free grammars often support the ability for user-written code to introduce limited amounts of context-sensitivity.
The deterministic context-free languages are a proper subset of the context-free languages which can be efficiently parsed by deterministic pushdown automata.
NameParsing algorithmInput grammar notationOutput languagesGrammar, codeLexerDevelopment platformIDELicense
ANTLR4Adaptive LLEBNFC#, Java, Python, JavaScript, C++, Swift, Go, PHPgenerated, BSD
ANTLR3LLEBNFActionScript, Ada95, C, C++, C#, Java, JavaScript, Objective-C, Perl, Python, Rubygenerated, BSD
APGRecursive descent, backtrackingABNFPython, JavaScript, C, Javanone, BSD
BeaverLALREBNFJavaexternal, BSD
BisonLALR, LR, IELR, GLRYaccC, C++, D, Javaexternal, GNU GPL with exception
BtYaccBacktracking Bottom-up?C++external, public domain
byaccLALRYaccCexternal, public domain
CL-YaccLALRLispCommon Lispexternal, MIT
Coco/RLL + semantic predicatesEBNFC, C++, C#, F#, Java, Ada, Object Pascal, Delphi, Modula-2, Oberon, Ruby, Swift, Unicon, Visual Basic.NETgenerated, GNU GPL
CppCCLL?C++generated, GNU GPL
CUPLALR?Javaexternal, BSD-like
EliLALR?Cgenerated, GNU GPL, GNU LGPL
EssenceLR?Scheme 48external, BSD
eyappLALR?Perlexternal or generated, Artistic
GOLDLALRBNFx86 assembly language, ANSI C, C#, D, Java, Pascal, Object Pascal, Python, Visual Basic 6, Visual Basic.NET, Visual C++generated, zlib modified
Hime Parser GeneratorLALR, GLRBNF dialectC#, Java, Rustgenerated, GNU LGPL
HyaccLR(1), LALR(1), LRYaccCexternal, GNU GPL
JavaCCLLEBNFJava, C++, JavaScript generated, BSD
JFLAPLL, LALR?Java???
JetPAGLL?C++generated, GNU GPL
JS/CCLALREBNFJavaScript, JScript, ECMAScriptinternal, BSD
KDevelop-PG-QtLL, backtracking, shunting-yard?C++generated or external, GNU LGPL
KelbtBacktracking LALR?C++generated, GNU GPL
kmyaccLALR?C, Java, Perl, JavaScriptexternal, GNU GPL
LapgLALR?C, C++, C#, Java, JavaScriptgenerated, GNU GPL
LarkLALR, Earley (SPPF)EBNFPython, JavaScriptgenerated, MIT
LemonLALRBNF dialectCexternal, public domain
LezerLR, GLREBNF dialectJavaScriptgeneratedNode.js, JavaScript, MIT
LimeLALR?PHPexternal, GNU GPL
LISALR, LL, LALR, SLR?Javagenerated, public domain
LLgenLL?Cexternal, BSD
LLnextgenLL?Cexternal, GNU GPL
LLLPGLL + syntactic and semantic predicatesANTLR-likeC#generated , GNU LGPL
LPGBacktracking LALR?Javagenerated, EPL
LRSTARLALR, LALRYACC, ANTLR, EBNFC++generated, BSD
MenhirLR?OCamlgenerated, QPL
ML-YaccLALR?MLexternal?
MonkeyLR?Javagenerated, GNU GPL
MstaLALR, LRYACC, EBNFC, C++external or generated, GNU GPL
MTP LL?Javagenerated, GNU GPL
MyParserLLMarkdownC++11internal, MIT
NLTGLRC#/BNF-likeC#mixed, MIT
ocamlyaccLALR?OCamlexternal, QPL
olexLL?C++generated, GNU GPL
ParsecLL, backtrackingHaskellHaskellnone, BSD
yappLALR?Perlexternal, GNU GPL
Parser ObjectsLL?Java?, zlib
PCCTSLL?C, C++???
PLYLALRBNFPythongenerated, MIT
PlyPlusLALREBNFPythongenerated, MIT
PRECCLL?Cgenerated, GNU GPL
QLALRLALR?C++external, GNU GPL
raccLALRBNF-like, yacc-likeRuby?
REXLL sLL LR LALR GLR PEG DFA Context-dependent lexingEBNFC++, C#, Java, JavaScript, Go, Haxe, Python, Scala, TypeScript, XQuery, XSLTgenerated, Apache License 2.0
SableCCLALR?C, C++, C#, Java, OCaml, Pythongenerated, GNU LGPL
SLKLL LR LALREBNFC, C++, C#, Java, JavaScriptexternalSLK
SLYLALRBNFPythongenerated, BSD
SP Recursive descentPythonPythongenerated, GNU LGPL
SpiritRecursive descent?C++internal, Boost
StyxLALR?C, C++generated, GNU LGPL
Sweet ParserLALR?C++generated, zlib
TapLL?C++generated, GNU GPL
TextTransformerLL?C++generated
TinyPGLL?C#, Visual Basic??, CPOL 1.0
Toy Parser GeneratorRecursive descent?Pythongenerated, GNU LGPL
TP YaccLALR?Turbo Pascalexternal, GNU GPL
Tree-SitterLR, GLRJavaScript DSL, JSONC, bindings generated + external, MIT
Tunnel Grammar StudioTunnel ParsingABNFC++generated
UltraGramLALR, LR, GLRBNFC++, Java, C#, Visual Basic.NETexternal, public domain
UniCCLALREBNFC, C++, Python, JavaScript, JSON, XMLgenerated, BSD
UrchinCCLL?Java?generated?
Yacc AT&T/SunLALRYaccCexternal, CPL & CDDL
Yacc++LR, LALRYaccC++, C#generated or external
YappsLL?Pythongenerated, MIT
yeccLALR?Erlanggenerated, Apache 2.0
Visual BNFLR, LALR?C#generated
YooParseLR, LALR?C++external, MIT
ParseLRBNF in C++ types??none, MIT
GGLLLLGraphJavagenerated, MIT
ProductParsing algorithmInput grammar notationOutput languagesGrammar, codeLexerDevelopment platformIDELicense

Parsing expression grammars, deterministic Boolean grammars

This table compares parser generators with parsing expression grammars, deterministic Boolean grammars.
NameParsing algorithmOutput languagesGrammar, codeDevelopment platformLicense
AustenXPackrat Java, BSD
AurochsPackratC, OCaml, Java, GNU GPL
BNFliteRecursive descentC++, MIT
CanopyPackratJava, JavaScript, Python, Ruby, GNU GPL
CL-pegPackratCommon Lisp, MIT
Drat!PackratD, GNU GPL
FrisbyPackratHaskell, BSD
grammar::pegPackratTcl, BSD
GrakoPackrat + Cut + Left RecursionPython, C++ , BSD
IronMetaPackratC#, BSD
Laja2-phase scannerless top-down backtracking + runtime supportJava, GNU GPL
lars::ParserPackrat C++Identical, BSD
LPegParsing machineLua, MIT
lugParsing machineC++17, MIT
MouseRecursive descent Java, Apache 2.0
NarwhalPackratC, BSD
NearleyEarleyJavaScript, MIT
Nemerle.PegRecursive descent + PrattNemerle, BSD
neotomaPackratErlang, MIT
nezParsing machineJava, C, BSD
NPEGRecursive descentC#, MIT
OMetaPackrat JavaScript, Squeak, Python, MIT
PackCCPackrat C, MIT
PackratPackratScheme, MIT
PappyPackratHaskell, BSD
parboiledRecursive descentJava, Scala, Apache 2.0
Lambda PEGRecursive descentJava, Apache 2.0
parseppRecursive descentC++, public domain
ParsnipPackratC++, GNU GPL
PatternsParsing machineSwiftIdentical, MIT
pegRecursive descentC, MIT
PEG.jsPackrat JavaScript, MIT
PeggyPackrat JavaScript, MIT
PegasusRecursive descent, Packrat C#, MIT
pegcRecursive descentC, public domain
pestRecursive descentRust, MIT, Apache 2.0
PetitParserPackratSmalltalk, Java, Dart, MIT
PEGTLRecursive descentC++11, C++17, Boost
Parser Grammar Engine Hybrid recursive descent / operator precedenceParrot bytecode, Artistic 2.0
PyPy rlibPackratPython, MIT
Rats!PackratJava, GNU LGPL
Spirit2Recursive descentC++, Boost
TreetopRecursive descentRuby, MIT
YardRecursive descentC++, MIT or public domain
WaxeyeParsing machineC, Java, JavaScript, Python, Racket, Ruby, MIT
PHP PEGPEG Parser?PHP, BSD

General context-free, conjunctive, or Boolean languages

This table compares parser generator languages with a general context-free grammar, a conjunctive grammar, or a Boolean grammar.
NameParsing algorithmInput grammar notationOutput languagesGrammar, codeLexerDevelopment platformIDELicense
ACCENTEarleyYacc variantCexternal, GNU GPL
APaGeDGLR, LALR, LL?Dgenerated, Artistic
BisonLALR, LR, IELR, GLRYaccC, C++, D, Java, XML, except XMLexternal, GNU GPL
DMS Software Reengineering ToolkitGLR?Parlansegenerated
DParserScannerless GLR?Cscannerless, BSD
DypgenRuntime-extensible GLR?OCamlgenerated, CeCILL-B
E3Earley?OCamlexternal, or scannerless?
ElkhoundGLR?C++, OCamlexternal, BSD
GDKLALR, GLR?C, Lex, Haskell, HTML, Java, Object Pascal, Yaccgenerated, MIT
HappyLALR, GLR?Haskellexternal, BSD
Hime Parser GeneratorGLR?C#, Java, Rustgenerated, GNU LGPL
IronText LibraryLALR, GLRC#C#generated or external, Apache 2.0
JisonLALR, LR, SLRYaccJavaScript, C#, PHPgenerated, MIT
SyntaxLALR, LR, SLR CLR LLJSON/YaccJavaScript, Python, PHP, Ruby, C++, C#, Rust, Javagenerated, MIT
LajaScannerless, two phaseLajaJavascannerless, GNU GPL
ModelCCEarleyAnnotated class modelJavaGeneratedgenerated, BSD
P3Earley–combinatorsBNF-likeOCamlexternal, or scannerless?
P4Earley–combinators, infinitary CFGsBNF-likeOCamlexternal, or scannerless?
Scannerless Boolean ParserScannerless GLR ?Haskell, Javascannerless, BSD
SDF/SGLRScannerless GLRSDFC, Javascannerless, BSD
SmaCCGLR, LALR, LR?Smalltalkinternal, MIT
SPARKEarley?Pythonexternal, MIT
TomGLR?CGeneratednone, "No licensing or copyright restrictions"
UltraGramLALR, LR, GLR?C++, C#, Java, Visual Basic.NETgenerated
WormholePruning, LR, GLR, Scannerless GLR?C, Pythonscannerless, MIT
Whale CalfGeneral tabular, SLL, Linear normal form, LR, Binary normal form ?C++external
yaepEarleyYacc-likeCexternal, GNU LGPL

Context-sensitive grammars

This table compares parser generators with context-sensitive grammars.
NameParsing algorithmInput grammar notationBoolean grammar abilitiesDevelopment platformLicense
Recursive descent simple BNF grammar, output is xml?Beta, and not a full EBNF parser, GNU GPL