I have a grammar for a specific DSL. Here is a snippet (written in Xtext):
Vars: 'var' (vars += Var)
Var: ID (',' ID) * ':' Type ';'
And here is an example input:
var
a,b,c : int;
d,e: bool;
I'm really interested in Xtend automatic code generation option and want to have a single object for every Variable, storing it's id and it's type. Using Xtex grammar synatx all I can do is :
Var: ids+=ID (',' ids+=ID)* ':' type =[Type] ';'
Meaning that I may have more than one ID in a single object. How can I store each 'a','b','c' in a single object?