PanPG uses plain PEG grammar files without embedded code. The same grammar file is equally usable by a compiler, a syntax highlighter running in real time in a text editor, a static analysis tool, etc. All of these will need to process the parsed representation in different ways; if the code is embedded in the grammar then the grammar cannot be shared. Embedded code also needlessly ties the grammar to a single implementation language, when grammars could otherwise be shared among tools that generate parsers in different languages.
PanPG uses the PEG formalism, which is inherently composable; this supports reuse of grammars and grammar components. PanPG supports grammar composition by passing grammar patches or lists of grammars to the parser generator, which then merges them.
The PEG formalism does not necessitate a separate lexing or tokenizing stage. There is only one formalism to learn, and the grammar uses the same primitives and operators (and can support the same visualization and debugging tools) "all the way down" — from the top-level rule to the individual characters that make up each token.
Please direct questions, bug reports, patches, etc to email@example.com, or stop by #inimino on Freenode.
The stable version is 0.0.10.
The compiling API and utility API builds can be downloaded directly, or you can download the full source tree.
The build system is browser-based and a little unusual, so rebuilding if you are hacking the source will require some work and installing some extra dependencies.
A separate driver for the build system, using
make instead of the browser, also exists; visit the IRC channel for details.
If you are using node.js you can use npm to get the latest version.
The source tarball contains a package.json file and is identical to the npm package.
In addition to the published packages you can also always browse the source online in the revision store, which is always the most recent source code.
There is an
rvs_get shell script that can be used to download a local copy of the current tip, or you can use wget.
If you just want the two library files:
If you want to check out the source code:
npm install PanPG, see also doc/nodejs.
There's now a vim script by gf3 which gives syntax highlighting for PanPG grammar syntax in vim: