-
Hello everyone, I hope you're doing good. I'm new to DSLs and I'm trying to do something like this
My languim file looks like this
But I'm getting this error |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @meddjelaili, thank you for your question. What version of Langium are you using? As far as I can tell, your grammar shouldn't even compile due to a bug in version 0.2.0 (#294). Anyway there are a few issues in your grammar that result from the lexer as well as an ambiguity issue coming from your Anyway, this is a fixed grammar for version 0.2.0 of Langium:
It parses this input perfectly:
If you want the |
Beta Was this translation helpful? Give feedback.
Hi @meddjelaili, thank you for your question.
What version of Langium are you using? As far as I can tell, your grammar shouldn't even compile due to a bug in version 0.2.0 (#294).
Anyway there are a few issues in your grammar that result from the lexer as well as an ambiguity issue coming from your
Column
rule. TheID
terminal can never be parsed, since its shadowed by theCOLUMN_NAME
andMODEL_NAME
terminals, as they mostly match the same input. Additionally, when encountering something likeModel NAME { id string }
, the parser will never know whether thestring
is thetype
of the previousid
column, or thename
property of a new column, you will need a separator of some sorts for that.A…