Open Source Parser Generators in Java

16 projects

JParsec is a parser combinator library for Java. Parsers are built by combining small parsers; supports operators, terminals, and operator precedence.

Details

ANTLR generates parsers from grammars for Java, C#, and other targets. It supports tree construction and walking and is widely used for DSLs and language tools.

Details

Coco/R is a compiler generator: from an attributed grammar it generates a scanner (DFA) and recursive-descent parser. LL(1) conflicts can be resolved with multi-symbol lookahead or semantic checks; grammars are LL(k). Java version.

Details

CUP is an LALR parser generator for Java. It reads a grammar specification and produces a Java parser; maintained at Technical University of Munich.

Details

Grammatica is a parser generator for C# and Java with readable output, automatic error recovery, and support for testing grammars without generating code.

Details

JavaCC reads a grammar and generates a Java parser. It supports extended BNF, JJTree for tree building, and full Unicode; java. net hosting moved to GitHub.

Details

parboiled is a PEG parsing library for Java (and Scala). Grammar rules are defined in Java source; it supports AST building, error reporting, and integrates with IDE tooling.

Details

SableCC generates compilers and interpreters in Java: strictly-typed ASTs and tree-walker classes (visitor pattern). Clean separation of generated and user code.

Details

JFlex is a lexical analyzer (scanner) generator for Java. It takes regular expressions and actions and generates a fast DFA-based lexer; works with CUP and others.

Details
BeaverInactive

Beaver is an LALR(1) parser generator that turns a context-free grammar into a Java parser class. It can be run from the command line or as an Ant task.

Details
ChaperonInactive

Chaperon converts structured text to XML using an LALR(1) parser and tree builder. It includes Ant tasks and can work with Apache Cocoon.

Details
JTopasInactive

JTopas is a small Java library for parsing arbitrary text: config files, HTML/XML/RTF, or source code. Supports full or partial parsing with a simple API.

Details
LajaInactive

Laja is a combined code generator and parser generator for Java. It aims to be simple and intuitive; the parser generator outputs Java code.

Details
runccInactive

RunCC generates parsers and lexers at runtime from EBNF (or embedded rules). Optional source generation; supports SLR, LR, LALR; includes Java/XML examples.

Details
SJPTInactive

SJPT supports top-down (LL(1), Simple Precedence) and bottom-up (LR(0), SLR, LR, LALR) parsing. It can generate Java parsers from CUP-like definitions for all bottom-up methods.

Details
OpenLInactive

OpenL is a framework for defining Java-like language variants: Language Opener foundation and Java Opener (openl. j). Used for rules, workflows, and embedding code in XML or Excel.

Details