Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Mixing an xtext DSL with Java
Mixing an xtext DSL with Java [message #489776] Mon, 05 October 2009 21:20 Go to next message
Eclipse UserFriend
Originally posted by: nomail.email.com

Hi,

I'm new to xtext, I've just spent a few hours playing with grammars and
for now I'm very pleased with it, it's a very neat tool that makes
creating your DSL very easy.

That being said, I'm a bit stuck with my last twisted idea : having a
dsl where you can write java code at some places, maybe by reusing the JDT.

For example something like this :

StateMachine(
State one( do{/* some java code here */}, call(two) )
State two( ... )
)

Do you think my idea is impossible? really hard to implement? or does
xtext already provides some facilities to do this kind of things?

Thanks
Re: Mixing an xtext DSL with Java [message #489779 is a reply to message #489776] Mon, 05 October 2009 21:30 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Jeremy Lavean schrieb:
> Hi,
>
> I'm new to xtext, I've just spent a few hours playing with grammars and
> for now I'm very pleased with it, it's a very neat tool that makes
> creating your DSL very easy.
>
> That being said, I'm a bit stuck with my last twisted idea : having a
> dsl where you can write java code at some places, maybe by reusing the JDT.
>
> For example something like this :
>
> StateMachine(
> State one( do{/* some java code here */}, call(two) )
> State two( ... )
> )
>
> Do you think my idea is impossible? really hard to implement? or does
> xtext already provides some facilities to do this kind of things?

I think the simplest way to do this is to implement Java (at least
statements and expressions) in Xtext and then inherit from that grammar.
Actually, we plan to ship something like that. We call it the base
language. But it won't be Java :-)

Also note that we are working an a Java - EMF bridge which allows for
referencing Java elements from within any Xtext language.

Cheers,
Sven

--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Re: Mixing an xtext DSL with Java [message #489832 is a reply to message #489776] Tue, 06 October 2009 07:53 Go to previous message
Steven Derrien is currently offline Steven DerrienFriend
Messages: 50
Registered: July 2009
Member
Hi,

I believe that the EMFText project provides what you need. It looks very
promising, but there is very little documentation.

http://www.emftext.org/index.php/EMFText

Steven


Jeremy Lavean a écrit :
> Hi,
>
> I'm new to xtext, I've just spent a few hours playing with grammars and
> for now I'm very pleased with it, it's a very neat tool that makes
> creating your DSL very easy.
>
> That being said, I'm a bit stuck with my last twisted idea : having a
> dsl where you can write java code at some places, maybe by reusing the JDT.
>
> For example something like this :
>
> StateMachine(
> State one( do{/* some java code here */}, call(two) )
> State two( ... )
> )
>
> Do you think my idea is impossible? really hard to implement? or does
> xtext already provides some facilities to do this kind of things?
>
> Thanks
Previous Topic:[Xtext] Collapsed outline by default
Next Topic:Missing MyDslJavaValidator in Runtime Xtext parser
Goto Forum:
  


Current Time: Fri Apr 26 22:03:08 GMT 2024

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

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

Back to the top