Comparison of parser generators: Difference between revisions

Content deleted Content added
Moved QLALR up to its place in lexicographical order; added REx Parser Generator ( https://www.google.com/search?q=%22REx+Parser+Generator%22 )
Bender the Bot (talk | contribs)
m HTTP to HTTPS for SourceForge
 
(18 intermediate revisions by 11 users not shown)
Line 49:
| [[Ragel]] || [[Deterministic finite automaton|DFA]] || [[Go (programming language)|Go]], [[C (programming language)|C]], [[C++]], [[Java (programming language)|Java]], [[Assembly language|assembly]] || {{D-A|Mixed}} || {{Yes|All}} || {{Free}}, [[GNU General Public License|GNU GPL]], [[MIT License|MIT]]<ref>{{Cite web|url=http://www.colm.net/open-source/ragel/|title = Ragel State Machine Compiler}}</ref><ref>http://www.colm.net/open-source/ragel/ {{verify source |date=November 2020 |reason=This ref was deleted Special:Diff/987467678 by a bug in VisualEditor and later restored by a bot from the original cite located at Special:Permalink/987467450 cite #1 - verify the cite is accurate and delete this template. [[User:GreenC bot/Job 18]]}}</ref>
|-
| [[RE/flex]] || [[Deterministic finite automaton|DFA]] direct code, DFA table driven, and [[Nondeterministic finite automaton|NFA]] regex libraries || [[C++]] || {{D-A|Mixed}} || {{Yes|All}} || {{Free}}, [[BSD licenses|BSD]]
|-
| [[re2c]] || [[Deterministic finite automaton|DFA]] direct code || [[C (programming language)|C]], [[C++]], [[Go (programming language)|Go]], [[Rust (programming language)|Rust]] || {{D-A|Mixed}} || {{Yes|All}} || {{Free}}, [[public ___domain]]
Line 57:
[[Context-free language]]s are a category of languages (sometimes termed [[Chomsky hierarchy|Chomsky Type 2]]) 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" ("every A is eventually followed by a matching B"), 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. (For example, upon encountering a variable declaration, user-written code could save the name and type of the variable into an external data structure, so that these could be checked against later variable references detected by the parser.)
 
The [[deterministic context-free language]]s are a proper subset of the context-free languages which can be efficiently parsed by [[deterministic pushdown automata]].<!-- More parsing algorithms and output formats supported. See httphttps://gdk.sourceforge.net/gdkref.pdf -->
{| class="wikitable sortable" style="text-align: center; font-size: 85%; width: auto;"
|-
Line 66:
| [[ANTLR]]3 || [[LL parser|LL]](*) || [[Extended Backus–Naur form|EBNF]] || [[ActionScript]], [[Ada (programming language)|Ada95]], [[C (programming language)|C]], [[C++]], [[C Sharp (programming language)|C#]], [[Java (programming language)|Java]], [[JavaScript]], [[Objective-C]], [[Perl]], [[Python (programming language)|Python]], [[Ruby (programming language)|Ruby]] || {{D-A|Mixed}} || generated || {{Some|[[Java virtual machine]]}} || {{Yes}} || {{Free}}, [[BSD licenses|BSD]]
|-
| APG<ref>{{Cite web cn|title=Survey on Various Syntax Analyzer Tools |url=https://www.ijraset.com/research-paper/various-syntax-analyzer-tools |access-date=2023-09-16January |website=www.ijraset.com |language=en2025}}</ref>|| [[Recursive descent]], [[backtracking]] || [[ABNF]] || [[Python (programming language)|Python]], [[JavaScript]], [[C (programming language)|C]], [[Java (programming language)|Java]] || {{D-P|Separate}} || none || {{Yes|All}} || {{No}} || {{Free}}, [[BSD licenses|BSD]]
|-
| Beaver<ref>{{Cite journal |last1=Boyland |first1=John |last2=Spiewak |first2=Daniel |date=2010-09-17 |title=Tool Paper: ScalaBison Recursive Ascent-Descent Parser Generator |journal=Electronic Notes in Theoretical Computer Science |series=Proceedings of the Ninth Workshop on Language Descriptions Tools and Applications (LDTA 2009) |volume=253 |issue=7 |pages=65–74 |doi=10.1016/j.entcs.2010.08.032 |issn=1571-0661|doi-access=free }}</ref><ref>{{Cite web |title=Beaver - a LALR Parser Generator |url=https://beaver.sourceforge.net/ |access-date=2023-09-16 |website=beaver.sourceforge.net}}</ref>|| [[LALR parser|LALR]](1) || [[Extended Backus–Naur form|EBNF]]|| [[Java (programming language)|Java]]|| {{D-A|Mixed}} || external || {{Some|[[Java virtual machine]]}} || {{No}} || {{Free}}, [[BSD licenses|BSD]]
|-
| [[GNU Bison|Bison]] || [[LALR parser|LALR]](1), [[Canonical LR parser|LR]](1), [[IELR parser|IELR]](1), [[GLR parser|GLR]] || [[Yacc]] || [[C (programming language)|C]], [[C++]], [[D (programming language)|D]], [[Java (programming language)|Java]] || {{D-A|Mixed}} || external || {{Yes|All}} || {{No}} || {{Free}}, [[GNU General Public License|GNU GPL]] with exception
|-
| [[BtYacc]] || [[Backtracking]] [[Bottom-up parsing|Bottom-up]] || ? || [[C++]] || {{D-A|Mixed}} || external || {{Yes|All}} || {{No}} || {{Free}}, [[public ___domain]]
Line 84:
| CUP<ref>{{Cite web |title=Java Cup |url=https://pages.cs.wisc.edu/~fischer/cs536.s06/course.hold/html/NOTES/4a.JAVA-CUP.html |access-date=2023-09-16 |website=pages.cs.wisc.edu}}</ref><ref>{{Cite web |title=CUP |url=http://www2.cs.tum.edu/projects/cup/docs.php |access-date=2023-09-16 |website=www2.cs.tum.edu}}</ref>|| [[LALR parser|LALR]](1) || ? || [[Java (programming language)|Java]]|| {{D-A|Mixed}} || external || {{Some|[[Java virtual machine]]}} || {{No}} || {{Free}}, [[BSD licenses|BSD]]-like
|-
<!-- Other programming languages may be supported. See httphttps://eli-project.sourceforge.net/ -->
| Eli<ref>{{Cite journal |last1=Thiemann |first1=Peter |last2=Neubauer |first2=Matthias |date=2004-12-31 |title=Parameterized LR Parsing |journal=Electronic Notes in Theoretical Computer Science |series=Proceedings of the Fourth Workshop on Language Descriptions, Tools, and Applications (LDTA 2004) |volume=110 |pages=115–132 |doi=10.1016/j.entcs.2004.06.007 |issn=1571-0661|doi-access=free }}</ref><ref>{{Cite journal |last1=Gray |first1=Robert W. |last2=Levi |first2=Steven P. |last3=Heuring |first3=Vincent P. |last4=Sloane |first4=Anthony M. |last5=Waite |first5=William M. |title=Eli: a complete, flexible compiler construction system |journal=Communications of the ACM |date=1992 |language=en |volume=35 |issue=2 |pages=121–130 |doi=10.1145/129630.129637 |s2cid=5121773 |issn=0001-0782|doi-access=free }}</ref> || [[LALR parser|LALR]](1) || ? || [[C (programming language)|C]] || {{D-A|Mixed}} || generated || {{Some|[[POSIX]]}} || {{No}} || {{Free}}, [[GNU General Public License|GNU GPL]], [[GNU Lesser General Public License|GNU LGPL]]
|-
Line 177:
|{{Free|[[LGPL]]}}
|-
| RExREX<ref>{{Cite web |url=https://githubwww.com/GuntherRademacherbottlecaps.de/rex-parser-generator/ |title=RExThe REX Parser Generator|website=[[GitHub]]|access-date=2024-11-29 supports C, C++, Java, JavaScript, C#, Go, Haxe, Python, Scala, Typescript, XQuery, and XSLT}}</ref> || [[LL parser|LL]](1) SLL(k) [[LALRsLL parser|sLL]](k) [[LR parser|LR]](k) [[LALR]](k) [[GLR parser|GLR]] [[Parsing expression grammar|PEG]] [[Deterministic finite automaton|DFA]] [[Context-dependent lexing]] || [[Extended Backus–Naur form|EBNF]] || [[C++]], [[C Sharp (programming language)|C#]], [[GoJava (programming language)|GoJava]], [[HaxeJavaScript]], [[JavaGo (programming language)|JavaGo]], [[JavaScriptHaxe]], [[Python (programming language)|Python]], [[Scala (programming language)|Scala]], [[TypeScript|Typescript]], [[XQuery]], [[XSLT]] || {{D-AP|MixedSeparate}} || generated or external || {{Yes|All}} || {{No}} || {{Free}}, [[Apache License|Apache]] 2.0]]
|-
| [[SableCC]] || [[LALR parser|LALR]](1) || ? || [[C (programming language)|C]], [[C++]], [[C Sharp (programming language)|C#]], [[Java (programming language)|Java]], [[OCaml]], [[Python (programming language)|Python]] || {{D-P|Separate}} || generated || {{Some|[[Java virtual machine]]}} || {{No}} || {{Free}}, [[GNU Lesser General Public License|GNU LGPL]]
|-
| SLK<ref>{{Cite web |url=http://www.slkpg.techcom/ |title=The SLK Parser Generator supports C, C++, Java, JavaScript, and C#, optional backtracking, free}}</ref> || [[LL parser|LL]](k) [[LR parser|LR]](k) [[LALR]](k) || [[Extended Backus–Naur form|EBNF]] || [[C (programming language)|C]], [[C++]], [[C Sharp (programming language)|C#]], [[Java (programming language)|Java]], [[JavaScript]] || {{D-P|Separate}} || external || {{Yes|All}} || {{No}} || SLK<ref>http://www.slkpg.techcom/license.txt {{Bare URL plain text|date=March 2022}}</ref>
|-
| SLY<ref>{{Cite web |url=https://sly.readthedocs.io/en/latest/sly.html |title=SLY (Sly Lex Yacc)}}</ref> || [[LALR parser|LALR]](1) || BNF || [[Python (programming language)|Python]] || {{D-A|Mixed}} || generated || {{Yes|All}} || {{No}} || {{Free}}, [[MITBSD License|MITBSD]]
|-
| SP (Simple Parser) || [[Recursive descent]] || [[Python (programming language)|Python]] || [[Python (programming language)|Python]] || {{D-P|Separate}} || generated || {{Yes|All}} || {{No}} || {{Free}}, [[GNU Lesser General Public License|GNU LGPL]]
Line 278:
|-
| neotoma || [[Packrat parser|Packrat]] || [[Erlang (programming language)|Erlang]] || {{D-P|Separate}} || {{Yes|All}} || {{Free}}, [[MIT License|MIT]]
|-
| nez<ref>{{Citation |title=Nez: practical open grammar language |date=2015-11-26 |arxiv=1511.08307 |last1=Kuramitsu |first1=Kimio }}</ref> || Parsing machine || [[Java (programming language)|Java]], [[C (programming language)|C]] || {{D-P|Separate}} || {{Some|[[Java virtual machine]]}} || {{Free}}, [[BSD License|BSD]]
|-
| NPEG || Recursive descent || [[C Sharp (programming language)|C#]] || {{D-A|Mixed}} || {{Yes|All}} || {{Free}}, [[MIT License|MIT]]
Line 402 ⟶ 404:
! Name !! Parsing algorithm !! Input grammar notation !! Boolean grammar abilities !! Development platform !! [[Software license|License]]
|-
| [httphttps://sourceforge.net/p/bnf2xml/ bnf2xml] || [[Recursive descent]] (is a text filter output is xml) || simple [[Backus–Naur form|BNF]]{{clarify|Only context-free grammars can be denoted in BNF.|date=January 2018}} grammar (input matching), output is xml || ? || Beta, and not a full EBNF parser || {{Free}}, [[GNU General Public License|GNU GPL]]
|}