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
Provide a mode that produce *all* possible parse trees for ambiguous grammars #3219
Comments
I'm just passing by here, but this could very easily result in a combinatorial explosion of possible parse trees depending on size and ambiguity. |
Sure, if a grammar is wildly ambiguous, there is a chance of combinatorial explosion. Even though I don't think that's going to be an issue in practice, but yeah, then maybe just returning a flag indicating "we had to guess, another parse trees are possible" would be better performance wise. |
Printing a warning when running |
Problem
Tree-sitter generates GLR parsers, that can parse truly ambiguous languages. Yet, at the moment, I think tree-sitter uses some heuristics to pick a single parse tree. I totally understand that for most practical applications that's what people usually want, but would it be possible to provide an extra API that would return all possible parse trees? Or, at least, return a flag indicating that the returned tree is not the only possible one?
Expected behavior
No response
The text was updated successfully, but these errors were encountered: