Expand description

This crate contains the code used for generating peginator parsing code from a grammar file. Unless you are using Compile in a buildscript, you probably want to see the peginator crate documentation instead.

To integrate peginator using a buildscript, first add peginator_codegen as a build dependency in your Cargo.toml:

peginator_codegen = "0.6"

And then in your build.rs:

use peginator_codegen::Compile;

fn main() {
    let out = format!("{}/grammar.rs", std::env::var("OUT_DIR").unwrap());



See the documentation of Compile for more advanced options.


  • Compiles peginator grammars into rust code with a builder interface.