I have a grammar that can parse a list of containers and modules, then generate these containers in alphabetical order. But, I also want to add the module names into the container list.
For example:
With the configuration:
CONTAINER cont1;
CONTAINER cont2;
MODULE external WITH PRIORITY 1;
MODULE internal WITH PRIORITY 2;
The generated file should have:
main()
{
Container(cont1);
Container(cont2);
Container(external);
Container(internal);
}
I was able to generate what is in the CONTAINER configuration. But I want to merge the module names "internal" and "external" into the container. Then sort them alphabetically.
Is there a way to do this in xtext? And does this belong to the generator or scoping part?