So I'm trying to get this grammar to work, however it gives me an error. It comes from the @context="num" inside the Number lexical. It tells me that it's ambiguous, can anybody tell me why?
start syntax Statement = Type Id "=" Number ";" ;
lexical Id = @context="id" [a-z] !<< [a-z]+ !>> [a-z] \ Type;
lexical Number = @context="num" [0-9]+;
keyword Type = @context="type" ("int"|"str"|"float");
It is really weird because it works without the @context tag, but then when I add it I can suddenly not import/find the symbol Statement in a different module. Or is gives me the grammar is ambiguous error.
please help
**edit: ** If i change the keyword Type to a normal lexical type then, with or without the parentheses the problem remains.