I followed this tutorial: https://www.eclipse.org/Xtext/documentation/104_jvmdomainmodel.html , but the generated files are.java, I want to change the file extension as well as the grammar, but I want to keep some java features. Also the class DomainmodelGenerator extends AbstractGenerator
does not get generated when I use grammar org.example.domainmodel.Domainmodel with org.eclipse.xtext.xbase.Xbase
, only if I use terminals. How can I achieve that?
If you use Xbase then, JvmModelGenerator
will be used as IGenerator(2)
. So you have to customize that one and override org.eclipse.xtext.xbase.DefaultXbaseRuntimeModule.bindIGenerator()
for binding. But also triple check if you really want to customize the generator and not enhance the inferrer
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.