Build parsers in Java
Clone or download
Ben Yu
Latest commit e9ef130 Nov 11, 2018
Failed to load latest commit information.
jparsec-examples otherwise() Nov 11, 2018
jparsec-testutils otherwise() Nov 11, 2018
jparsec-workshop otherwise() Nov 11, 2018
jparsec otherwise() checks errorIndex() instead. Nov 11, 2018
parsing-made-easy otherwise() Nov 11, 2018
.gitignore otherwise() Nov 11, 2018
.travis.yml otherwise() Nov 11, 2018
LICENSE otherwise() Nov 11, 2018 otherwise() Nov 11, 2018
javadoc-stylesheet.css otherwise() Nov 11, 2018
pom.xml otherwise() Nov 11, 2018


Builds mini parsers in pure Java.

Latest version: 3.0 (requires Java 8+)



  • Removed references to Codehaus in copyright and package layout
  • Support for Java 8 now complete
  • Support for OSGi is merged in master, thanks to Alex Michael Berry and this PR

How to Use?

jparsec is available in maven-central. Snapshot Javadoc


Add the following fragment to your <dependencies> section:

If using Java 7-:


If using Java 8+:


Tell me more

Jparsec is a recursive-descent parser combinator framework written for Java. It's an implementation of Haskell Parsec on the Java platform.

Feature highlights

  • Operator precedence grammar,
  • Accurate error location and customizable error message,
  • Rich set of pre-defined reusable combinator functions,
  • Declarative API that resembles BNF.


Look at the wiki for documentation on implementing parsers with jparsec.

Talking about jparsec

  • 2014-01-16 - Nantes JUG: Quickie on jparsec for local JUG
  • 2013-09-23 - JUGSummerCamp 2013: Directory parsing-made-easy contains material for the talk (slides + sample code)