Regular languages
– Regular languages can be matched by a state machine constructed from a regular expression.
– Regular languages can express constructs like A follows B, Either A or B, A followed by zero or more instances of B.
– Regular languages cannot express constructs that require consistency between non-adjacent elements or recursive nesting.
– Regular languages cannot handle problems like checking correctly-nested parentheses.
– Examples of regular language parser generators include .NET CLR, Free, GNU GPL, C# Lex, DFA, Mixed.
Context-free languages
– Context-free languages can be matched by a sequence of replacement rules.
– Context-free languages can handle the concept of recursive nesting.
– Context-free grammars are purely local and cannot handle non-local analysis.
– Context-free grammars can be extended with limited context-sensitivity using user-written code.
– Examples of context-free language parser generators include .NET CLR, Free, Apache 2.0, CookCC, DFA, Java.
Deterministic context-free languages
– Deterministic context-free languages are a subset of context-free languages.
– Deterministic context-free languages can be efficiently parsed by deterministic pushdown automata.
– Examples of programming languages that support deterministic context-free languages include C, C++, C#, F#, Java, Ada, Object Pascal, Delphi, Modula-2, Oberon, Ruby, Swift, Unicon, Visual Basic .NET.
– Parser generators for deterministic context-free languages include LR(?), LL(?), LALR(?), SLR(?).
– The generated parsers can be used for partial parsing and follow CPOL 1.0 license.
General context-free, conjunctive, or boolean languages
– General context-free, conjunctive, or boolean languages are compared in a table.
– Parser generators for these languages are free and use licenses like Apache 2.0.
– Examples of programming languages supported by these parser generators include C++, C#, Java, Visual Basic .NET.
– These parser generators are compared with context-sensitive grammars.
– Ragel State Machine Compiler is mentioned as a related tool.
Other parser generator tools
– Other parser generator tools are mentioned in various references.
– These tools include Drat!, Narwhal, POSIX, Windows, Nearley, Earley, JavaScript, Nemerle.Peg, Lambda PEG, PyPy rlib, Rats!, Rekex, PEG Parser?, PHP, and more.
– These tools support different programming languages and use various licenses like MIT, BSD, GNU LGPL, and Apache 2.0.
– Some tools are specifically designed for packrat parsing.
– References and sources are provided for further reading.
This article needs additional citations for verification. (July 2023) |
This is a list of notable lexer generators and parser generators for various language classes.