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

Clarify how Rowan could be used with a GLR parser #152

Open
TzviPM opened this issue Feb 23, 2023 · 0 comments
Open

Clarify how Rowan could be used with a GLR parser #152

TzviPM opened this issue Feb 23, 2023 · 0 comments

Comments

@TzviPM
Copy link

TzviPM commented Feb 23, 2023

If I understand correctly, Rowan's use in rust-analyzer relies on a recursive descent parser that emits events for nodes beginning or ending and those events are converted by a TreeSink into calls to GreenNodeBuilder's start_node and finish_node.

I'm wondering if it could make sense to use Rowan's syntax tree abstraction with a different sort of parser, say GLR for example, which uses a shift-reduce mechanism for constructing trees and may even fork at some point to attempt multiple non-deterministic branches of the grammar in parallel. In such an algorithm, the context may not be known in advance, so nodes would have to be combined differently.

Can you clarify how I might accomplish this? Would I just make a different Builder abstraction?

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

No branches or pull requests

1 participant