Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a CLI #10

Open
osa1 opened this issue Sep 20, 2022 · 0 comments
Open

Implement a CLI #10

osa1 opened this issue Sep 20, 2022 · 0 comments

Comments

@osa1
Copy link
Owner

osa1 commented Sep 20, 2022

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:

  • parsegen_lib will be the main thing. This is basically the current parsegen crate, except it shouldn't be marked as a proc macro.
  • parsegen_cli should provide a parsegen executable that can compile parsegen inputs to Rust using parsegen_lib. It should have flags for debug outputs, generating graphviz etc.
  • parsegen: A proc_macro wrapper around parsegen_lib.

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant