Java Parser

oschrenk edited this page Sep 8, 2012 · 6 revisions
Clone this wiki locally

This example lives in the package org.parboiled.examples.java and showcases a full-blown Java 1.6 parser.

This examples demonstrates many of parboileds features (no actions, however) and shows that parboiled can handle even large and complex grammars, like the Java 1.6 grammar. The example code parses all java source files in the parboiled source distribution and outputs some basic performance indicators like files, lines and characters parsed per second.

This Java 6 PEG grammar can give you many clues as to how effectively build larger PEG grammars and codify them in parboileds internal java DSL. Parsing Java from Java has never been easier…