#pest #pest-parser #diagram #syntax #pest-grammar #parser #peg

app pest_railroad_gen

Railroad (aka syntax) SVG diagram generator for Pest parsers. It supports most (but not all) Pest grammar rules.

1 unstable release

new 0.1.0 Dec 21, 2024

#127 in Parser tooling

MIT/Apache

42KB
683 lines

pest_railroad

Crate Docs

Railroad (aka syntax) SVG diagram generator for pest parsers. It supports most (but not all) Pest grammar rules.

Install

Library crate:

cargo add pest_raiload

The binary:

cargo install pest_railroad_gen

Example

cargo run -- grammars/json.pest > json.svg

This results in:

JSON syntax diagram

Status

This does what I need it to, so it is more or less "finished", but may get support for more Pest rules if I need them. Contributions might be accepted as long as they align to my vision for the tool.

Dependencies

~8MB
~156K SLoC