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

Redesign FirstPass to be more modular #1

Open
Rafaeltheraven opened this issue May 28, 2024 · 0 comments
Open

Redesign FirstPass to be more modular #1

Rafaeltheraven opened this issue May 28, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Rafaeltheraven
Copy link
Owner

Semi-inspired by the NoWa presentation. In the future numerous rewrite features for WAGon may be written. Not everyone wants every rewrite. Perhaps people only want the "import" rewrite but not the "ebnf" rewrite. It would be nice to allow people to easily specify which rewrites they want.

Current idea: have a trait Rewrite which takes a Wag and returns a Wag. People can implement it in whatever way they desire. Then, have a function rewrite which takes a list of dynamic Rewrite objects and simply applies them one-by-one to the Wag.

Not super efficient though. It would be nice to have some sort of visitor pattern wherein it first does all the rewrites on the Wag level, then on the Rule level etc. Don't know if that's actually feasible though. What if rewrites influence things further up in the tree?

@Rafaeltheraven Rafaeltheraven added the enhancement New feature or request label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant