Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Embedding DSL in Java
Embedding DSL in Java [message #1699918] Mon, 29 June 2015 05:35 Go to next message
Eclipse UserFriend
Hello everybody,

I have developed a DSL. Now I want to embed this DSL in java.
I am new in this concept (Embedding DSL in GPL or java).

Is it possible?
Can I write the code between java codes with my DSL keywords?

Best regards
Parisa
Re: Embedding DSL in Java [message #1700090 is a reply to message #1699918] Tue, 30 June 2015 02:10 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

To give a better explanation about what I want to do, it's better to say.
I want to have a DSL in which I have the ability of writing java code.
Re: Embedding DSL in Java [message #1700094 is a reply to message #1700090] Tue, 30 June 2015 02:30 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

so you want to have java like expression inside your dsl?

java: hard to do.
xbase; very easy to do.

have a look at the domain model example or at the seven languages examples (see docs)
Re: Embedding DSL in Java [message #1700095 is a reply to message #1700094] Tue, 30 June 2015 02:36 Go to previous messageGo to next message
Eclipse UserFriend
you may have a look at https://github.com/LorenzoBettini/javamm as well
Re: Embedding DSL in Java [message #1700096 is a reply to message #1700095] Tue, 30 June 2015 02:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi Parisa

You can do it using Xbase grammar in your grammar. You can see the process in this link : http://stackoverflow.com/questions/12196448/how-to-include-java-code-block-in-xtext-dsl
Re: Embedding DSL in Java [message #1700142 is a reply to message #1700095] Tue, 30 June 2015 07:43 Go to previous messageGo to next message
Eclipse UserFriend
On 30/06/2015 08:36, Christian Dietrich wrote:
> you may have a look at https://github.com/LorenzoBettini/javamm as well

Thanks for mentioning that, Christian :)
In the near future, I'm planning to refactoring the plain expression
part to be reusable in other DSLs.

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Re: Embedding DSL in Java [message #1700327 is a reply to message #1700142] Wed, 01 July 2015 17:08 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
is it possible to embed the syntax of a DSL in GPL?
For example here I define a DSL with Xtext and embed this syntax in java.

Re: Embedding DSL in Java [message #1700337 is a reply to message #1700327] Wed, 01 July 2015 23:47 Go to previous messageGo to next message
Eclipse UserFriend
No
Re: Embedding DSL in Java [message #1700585 is a reply to message #1700337] Sat, 04 July 2015 03:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian,

I have thought about it and I think if I embed a Java in DSL and use a reference to Java-Code. It can be vice versa, therefore I can have a Java Code which can refer to DSL-Code.

Actually the implementation must be done with two editors. It's only a solution but it's not a scientific solution.

Regards,
Parisa
Re: Embedding DSL in Java [message #1700586 is a reply to message #1700585] Sat, 04 July 2015 03:28 Go to previous messageGo to next message
Eclipse UserFriend
the go with xbase.
Re: Embedding DSL in Java [message #1701094 is a reply to message #1700586] Thu, 09 July 2015 05:20 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian,

how can I call java content assistance/ auto completion in DSL text editor in runtime instance of eclipse. Now I have auto completion but I want to open Java auto completion. In which part of forum or in which internet link can I want something about "Call completion engine"?

I have searched a little but I didn't find any code to call it manually.

[Updated on: Thu, 09 July 2015 05:22] by Moderator

Re: Embedding DSL in Java [message #1701095 is a reply to message #1701094] Thu, 09 July 2015 05:27 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

i do not understand what you are talking about. please explain: what do you mean by java auto completion
Re: Embedding DSL in Java [message #1701270 is a reply to message #1701095] Fri, 10 July 2015 07:47 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
I want to have auto completion in DSL editor when I write java code block. Something like this photo.
  • Attachment: 1.png
    (Size: 23.94KB, Downloaded 114 times)
Re: Embedding DSL in Java [message #1701271 is a reply to message #1701270] Fri, 10 July 2015 07:48 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

this works out of the box ?!?
Re: Embedding DSL in Java [message #1701303 is a reply to message #1701271] Fri, 10 July 2015 13:32 Go to previous messageGo to next message
Eclipse UserFriend
I made it in paint Smile but I want to develop somnething like this.
Re: Embedding DSL in Java [message #1701308 is a reply to message #1701303] Fri, 10 July 2015 14:40 Go to previous message
Eclipse UserFriend
Have a look at the domainmodel example
Previous Topic:Match Until (not working)
Next Topic:How to approach a scope problem
Goto Forum:
  


Current Time: Sun Jul 06 14:55:26 EDT 2025

Powered by FUDForum. Page generated in 0.27206 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top