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

Use as a library? #496

Open
stevefan1999-personal opened this issue Nov 2, 2024 · 3 comments
Open

Use as a library? #496

stevefan1999-personal opened this issue Nov 2, 2024 · 3 comments

Comments

@stevefan1999-personal
Copy link

I want to put this in a Rust build script so I don't have to run the generator every time. I wonder if there is a way to interface with the re2rust program as a library?

@skvadrik
Copy link
Owner

skvadrik commented Nov 2, 2024

Not at the moment. There is libre2c, but it exists for a different purpose (it exposes only DFA construction algorithms and does not include code generator). Can you explain your setup a bit more, e.g. why it would be a problem for the build script to call an external program? Is it not what build scripts usually do?

@stevefan1999-personal
Copy link
Author

Not at the moment. There is libre2c, but it exists for a different purpose (it exposes only DFA construction algorithms and does not include code generator). Can you explain your setup a bit more, e.g. why it would be a problem for the build script to call an external program? Is it not what build scripts usually do?

Well, I can't assume the user always have re2c installed

@PolarGoose
Copy link
Contributor

PolarGoose commented Nov 5, 2024

Well, I can't assume the user always have re2c installed

I had a similar issue in my Cmake project. Can you download re2c.exe as a pre-build event and execute it for the *.re files? How is the fact that it is a library going to help? Or do you mean you want re2c to be a rust crate that you can reference?

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

3 participants