|Chain 2 parsers/generators [message #985782]
||Fri, 16 November 2012 07:40
| Sergio Otero
Registered: June 2012
I have a template grammar that parses files with extension ".LANG1" and the output is ".LANG2" files.
I have another grammar that parses files with extension ".LANG2" and the output is ".java"
When i save a ".LANG1" file, the generator ouptuts a ".LANG2" file in the src-gen directory, but the generated file is not parsed nor compiled into java.
If i open the file and save it, then it gets generated.
I've tried several options to accomplish this, but none have worked:
* Change the OutputConfiguration to set derived to false
* In the compiler, after the ".LANG2" file is generated in xtend, find the IResource and save it
* Add a dependency from the Lang2 plugin to the Lang1 plugin and then in the compiler, after the ".LANG2" file is generated in xtend, find the IResource and invoke the lang2Generator.doGenerate(resource,fsa) method. It doesn't seem the right option because i think the lang1 generator is being invoked with the lang2 guice configuration (i had a custom OutputConfiguration in lang2 and lang1 didn't seem to find the default OutputConfiguration that was deleted only in lang2)
Powered by FUDForum
. Page generated in 0.03904 seconds