DSLs targetting non-Java languages [message #1033417] |
Thu, 04 April 2013 04:03  |
Eclipse User |
|
|
|
Hello,
Are there any Xtext-based DSLs (tutorials, examples, etc.) which cover targeting non-Java environments? I have a DSL which needs to translated to code which is to run in a C/C++ application with no JVM present, and I was hoping to avoid having to embed a JVM.
The DSL typically looks like this:
entity MyEntity {
name SomeName
handler {
<insert some code here>
}
}
I've been looking at using Xbase, but it seems very heavily tied to JVM execution, and I'm not sure how much work it would be to get it to generate C/C++ code instead.
Worst case I can embed C/C++ code inside a string, but if there is a more elegant solution which allows the user to leverage Xtext features in the embedded code, it would be very nice.
Any ideas?
|
|
|
Re: DSLs targetting non-Java languages [message #1033433 is a reply to message #1033417] |
Thu, 04 April 2013 04:11  |
Eclipse User |
|
|
|
Am 04.04.13 10:03, schrieb Jesper Eskilson:
> Hello,
>
> Are there any Xtext-based DSLs (tutorials, examples, etc.) which cover
> targeting non-Java environments? I have a DSL which needs to translated
> to code which is to run in a C/C++ application with no JVM present, and
> I was hoping to avoid having to embed a JVM.
>
> The DSL typically looks like this:
>
>
> entity MyEntity {
> name SomeName
> handler {
> <insert some code here>
> }
> }
>
>
> I've been looking at using Xbase, but it seems very heavily tied to JVM
> execution, and I'm not sure how much work it would be to get it to
> generate C/C++ code instead.
>
> Worst case I can embed C/C++ code inside a string, but if there is a
> more elegant solution which allows the user to leverage Xtext features
> in the embedded code, it would be very nice.
>
> Any ideas?
You can always use Xtext without Xbase and implement the expressions
manually. That's actually a very common usecase. The docs are pretty
clear about the cases where Xbase is applicable. Also, Jan wrote a blog
on that topic recently:
http://koehnlein.blogspot.de/2013/04/x-is-for-abstraction.html
Regards,
Sebastian
--
Looking for professional support for Xtext, Xtend or Eclipse Modeling?
Go visit: http://xtext.itemis.com
|
|
|
Powered by
FUDForum. Page generated in 0.03383 seconds