I have a grammar defined which can be parsed ok. Due to the nature of the model it makes sense to split the model across multiple files. Following cross references in the IDE is working fine and I am all happy there.
My requirement is to generate a single XML document from the multiple input model files.
What I find is that when my generator
import org.eclipse.xtext.generator.AbstractGenerator
...
class MyModelGenerator extends AbstractGenerator
is called
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
That the resource only contains the files that modified. Whereas, what I need is all of the model files.
I have found Xtend – Generating from multiple input models which seems to address what I need. But what I have found is that most of the interfaces have changed since it's writing in 2011.
Reading the release notes, version 2.9.0 introduced a new generator.
I have looked at using the approach I referenced and updating it. The generators seem different in places. I am experimenting with ways that might work, but I am trying to understand the way it was intended to work.
Is there any documentation on how the generation process is intended to work? Or if there is an example that would be appreciated.