I'm working on a DSL where it should be possible to differ between a declaration of a element and the definition of a element. For example:
int b = 42;
a = 12;
So, I've started with the following construct
type=DataType name=ID ';';
whereas DataType refers to my defined data types. I've thought it might be an idea to use cross references like in the following fragment
name=[VariableDecl] '=' INT;
But that's not working and I doubt that this is the right way. So far, what I really want is to "extend" the already defined element VariableDecl (and Variable might be a better name). I'm new to Xtext and so this question might be quite stupid. Maybe somebody has an idea or can point me into the right direction? Thanks in advance!