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

Improve AST structure by increasing the opportunities for merging #159

Open
paulgazz opened this issue Sep 10, 2021 · 0 comments
Open

Improve AST structure by increasing the opportunities for merging #159

paulgazz opened this issue Sep 10, 2021 · 0 comments

Comments

@paulgazz
Copy link
Member

If two subparsers are in the same production, and one reduces a symbol because that symbol has an empty production, the two subparsers will no longer be able to merge, even though they could have if not for the empty production reduction.

One way to solve this would be to take the grammar hierarchy into account when looking for merge opportunities, e.g., by checking whether the subparsers are in the production (and at the same level in the AST). Since checking for merges is expensive, the current optimization strategy does as many reduces as possible for each subparser before attempting a merge.

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