osa1 / parsegen

An LR parser generator, implemented as a proc macro
MIT License
15 stars 0 forks source link

Implement a CLI #10

Open osa1 opened 1 year ago

osa1 commented 1 year ago

In the lane_table branch I'm using an executable to debug the algorithm and print a graphviz graph for the state machines.

Outside of debugging, a CLI can be used to build parsers in a build script. This can help avoiding redundant recompilations until we make the proc macro cache its outputs.

Here's the crate structure I have in mind:

To allow debugging proc macro usage, parsegen_cli should have a simple parser to extract the parser! { ... } part of a file and pass it to parsegen_lib. This way we don't have to add syntax to the proc macro for debugging, we can pass debug flags to parsegen_cli, and pass it the file with parsegen parser(s).