Skip to content

Idea on how to solve an ambiguous alternative #1676

Answered by msujew
ydaveluy asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @ydaveluy,

I'm not sure it's possible to resolve this ambiguity error with the tools provided by Langium. The parser works right now, mostly by abusing the ambiguity behavior (i.e. picking the first option in case of a detected ambiguity). In theory, you would need a manual lookahead that looks a few tokens into the token stream to detect whether there's another ID token right after the current ID token. However, Langium doesn't provide the API for it.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ydaveluy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants