Reference issue #1876
Replies: 1 comment
-
Hey @vasilache-radu, You might have a few misconceptions about how Langium (or most compilers for that matter) works: The issue is that
As outlined above, this is not possible (this is unrelated to Langium - any context-free parser has this issue), as the reference cannot be evaluated until parsing has completed. However, there are ways to instruct Langium to treat references as declarations. See #1615. Note that your grammar in general is very unusual. I would recommend you this section of the documentation about tree-rewriting actions. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have written this grammar and there is a problem with the PrimaryExpression rule. The parser checks first if there is a StateValue reference (which is expected) but once it doesn't find it, it doesn't go to the next following possibility. It stops the search there and it says: There is no reference to StateValue. Is this normal? And if yes, how can I modify the grammar such that it first checks the reference, and if it doesn't find it, it just goes to the next rule?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions