A pure Java library for building recursive-descent parser combinators, inspired by Haskell Parsec.
jparsec is a parser combinator library for Java that allows developers to build recursive-descent parsers using a functional, compositional approach. It solves the problem of parsing complex grammars by providing a declarative API that resembles BNF, along with accurate error location and operator precedence support.
Java developers who need to implement custom parsers for domain-specific languages, configuration files, or data formats without relying on external parser generators.
Developers choose jparsec for its pure Java implementation, rich set of combinators, and the ability to define parsers declaratively, which reduces boilerplate and improves readability compared to traditional parsing approaches.
Build parsers in Java
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Built-in support for defining operator precedence and associativity rules, enabling straightforward parsing of expressions without manual handling.
Pinpoints parsing errors with precise line and column information, as highlighted in the README, which aids in debugging complex grammars.
Allows grammar specification in a style resembling Backus-Naur Form, promoting readability and maintainability, as stated in the key features.
Includes a comprehensive set of reusable parser combinators for common tasks, reducing boilerplate code, as noted in the documentation.
The API can lead to infinite loops or accidental left recursions with zero-consumption parsers, a known issue that's painful to debug, as admitted in the README's comparison to Google Mug Dot Parse.
Lacks built-in lazy or streaming parsing capabilities, requiring custom workarounds for large inputs, unlike modern alternatives mentioned in the news section.
Does not fully embrace modern Java features like Stream or pattern matching, and has a larger footprint compared to newer libraries, as highlighted in the 2025 update.