I translate one dsl (A) to another dsl (B) create in xtext.
The code generation of A looks like
override void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) {
fsa.generateFile('transformed.wp', resource.allContents.filter(typeof(ActionSystem)).map [
compile
].join(', '))
val rs = new ResourceSetImpl();
val r = rs.getResource(URI.createPlatformResourceURI('transformed.wp'), true);
val List<EObject> contentOfYourFile = r.getContents();
}
the error is then I call URI.createPlatformResourceURI('transformed.wp')
the file cannot be found.
How do I access the file 'transformed.wp'.
The idea will be to copy part of the emf model of A to the model of B after the code was generated.
The solution was in
IFileSystemAccess2