Using a custom Xbase-compiler [message #1690298] |
Thu, 26 March 2015 12:35 |
Fenris Wolf Messages: 10 Registered: March 2015 |
Junior Member |
|
|
Hy
How can i make my JVMModelInferrer (org.xtext.example.foobar.jvmmodelinferrer.FoobarJvmModelInferrer.xtend) use a different Xbase-compiler? My own compiler (org.xtext.example.foobar.helpers.MyXBaseCompiler.java) is just a subclass of XbaseCompiler, with some additional methods.
Is there a way to call the compiler explicitely, e.g. in my model-inferrer-code "new MyXbaseCompiler().toJavaExpression(expression)" or something like that?
Greetings,
Fenris
[Updated on: Thu, 26 March 2015 14:52] Report message to a moderator
|
|
|
|
|
Re: Using a custom Xbase-compiler [message #1690393 is a reply to message #1690374] |
Fri, 27 March 2015 06:16 |
|
Hi,
the guice for xbase is the same as for the rest. if you have a look at the XXXRuntimeModule that indirectly inherits from DefaultXbaseRuntimeModule.
there you can find
public Class<? extends IGenerator> bindIGenerator() {
return JvmModelGenerator.class;
}
simply override this method
@Override
public Class<? extends IGenerator> bindIGenerator() {
return YourJvmModelGenerator.class;
}
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
Re: Using a custom Xbase-compiler [message #1690577 is a reply to message #1690393] |
Sun, 29 March 2015 10:01 |
Fenris Wolf Messages: 10 Registered: March 2015 |
Junior Member |
|
|
Hy again. The problem is related to what i've written here in the first paragraph.
For the approach with JvmModelGenerator: If i understand correctly, i'll need a mapping from XInputLiteral.java (generated by Xtext for my Rule XInputLiteral) to a Jvm*-object so that MyJvmModelGenerator.java (my generator) can handle it via its _toJavaLiteral-method or something similar. Is that correct? If yes: How to do that? If no: What is the way to go then?
[Updated on: Sun, 29 March 2015 10:02] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03632 seconds