I am looking for a possibitlity to refer to an element which is a bit deeper in the grammar in the error function.
My grammar snippet looks like that:
Declaration:
name = ID "=" decCon=DecContent
;
DecContent:
singleContent=VarContent (op+=OPERATOR nextCon+=VarContent)*
;
VarContent:
(unOP=("+"|"-"))? num = NUMBER
| string = STRING
| (unOP=("+"|"-"))? reference = [Declaration]
| arrayContent = ArrayLiteral
| embraced = "(" embrCon=DecContent ")"
;
Now I want the error mehtod not to refer to "decCon" (eINSTANCE.declaration_decCon) but to, let's say, "string" in the rule "VarContent".
How would I manage this?
Do I have to implement custom scopes for that?
Greeting Krzmbrzl