The Oak Parser Generator

Hello! Oak is a parser generator based on Parsing Expression Grammar (PEG). This project has been started to explore the idea of typing parsing expressions. It is written as a syntax extension and can be embedded in your Rust code without complicating the build system.

Independently of your programming experience with parser generators, a first step is to consult the Getting Started section. If you are new to parser generator or PEG, the section Learn Oak is a smooth tutorial to Oak for incrementally building a small language with arithmetic expressions and variable bindings. The section Syntax and Semantics gives a short summary of the Oak constructions. For more informal and in-depth discussion about the design rational of Oak and to find out why it is different from other parser generators, please consult The Story of Oak.

The code is on github.

Oak status

My goal is to propose a complete library to ease the development of Embedded Domain Specific Language (EDSL) in Rust with procedural macros. For the moment my priority is to stabilize/test things. Next I want to add more static analysis to prevent grammar design error such as in "=" / "==" (can you find what's wrong?) Here some other wanted features:

A shortcoming to cleanly achieve these objectives with the Rust compiler is that we can only access item definitions declared inside the procedural macro. It probably means that, for the moment, compositionality would come at the cost of some run-time verifications (or no inter-grammar analysis at all).