Parboiled is a lightweight, easy-to-use library for defining PEG parsers in Java and Scala.
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Define and run a simple arithmetic expression parser.
import org.parboiled.Parboiled;
import org.parboiled.parserunners.ReportingParseRunner;
import org.parboiled.support.ParsingResult;
class MyParser extends BaseParser<Object> {
Rule Expression() { return Sequence(Number(), Optional(AnyOf("+-"), Expression())); }
Rule Number() { return OneOrMore(Digit()); }
}
MyParser parser = Parboiled.createParser(MyParser.class);
ParsingResult<?> result = new ReportingParseRunner<>(parser.Expression()).run("1+2");
Debug
Known footguns
No known footguns recorded.
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.