Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How use Xtext grammar DSL writing in editor for translating to another language ?(Hi , I want to convert a specific words in my grammar DSl in my editor to another words for new language and put the converting in another file i hope you can help me i'm beginner in Xtext.)
How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754668] Tue, 21 February 2017 12:20 Go to next message
abdf mncr is currently offline abdf mncrFriend
Messages: 75
Registered: February 2017
Member
Hi , I want to convert a specific words in my grammar DSl in my editor to another words for new language and put the converting in another file i hope you can help me i'm beginner in Xtext.
Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754680 is a reply to message #1754668] Tue, 21 February 2017 14:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11206
Registered: July 2009
Senior Member
hi can you please be a bit more specific and provide a example scenario e.g. based on the hello world dsl

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754691 is a reply to message #1754680] Tue, 21 February 2017 15:31 Go to previous messageGo to next message
abdf mncr is currently offline abdf mncrFriend
Messages: 75
Registered: February 2017
Member
for example i have this Xtext Model :

Model :
elements+=Expression* ;

Expression :
" req " name=ID " : " (p=pattern s=scope )

pattern :
( ( ( " always " | " never " | " eventua l l y ") ( exp=ID ) ) )
;
scope :
( ( ( " g l o b a l l y ") | ( " be f o r e " | " a f t e r ") exp2=ID ) | ( ( ' between ' exp3=ID ' and ' exp4=ID ) | ( ' a f t e r ' exp4=ID ' u n t i l ' exp5=ID ) )
)

I want to write this Grammar DSL in Xtext Editor and when save it a new file is generate have this translation :

always p(expression) globally ---> (convert to) AG(P)
never p globally ---> AG( !P)
eventually p globally ----> AF(P)
always p after q ----> AG(Q -> AG(P))

I want to convert like this in a file when i save my Grammar in Xtext Edior.

[Updated on: Tue, 21 February 2017 15:35]

Report message to a moderator

Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754694 is a reply to message #1754691] Tue, 21 February 2017 15:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11206
Registered: July 2009
Senior Member
sounds like a generator to me. the tutorials cover how to write one

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754705 is a reply to message #1754694] Tue, 21 February 2017 16:49 Go to previous messageGo to next message
abdf mncr is currently offline abdf mncrFriend
Messages: 75
Registered: February 2017
Member
I don't Understand , can you give me any recources(URLs) for that please i need it Thanks.

[Updated on: Tue, 21 February 2017 16:51]

Report message to a moderator

Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754708 is a reply to message #1754705] Tue, 21 February 2017 17:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 11206
Registered: July 2009
Senior Member
http://www.eclipse.org/Xtext/documentation/103_domainmodelnextsteps.html

Need professional support for Xtext, Xpand, EMF?
Go to: http://xtext.itemis.com
Twitter : @chrdietrich
Blog : christiandietrich.wordpress.com
Re: How use Xtext grammar DSL writing in editor for translating to another language ? [message #1754711 is a reply to message #1754708] Tue, 21 February 2017 17:29 Go to previous message
abdf mncr is currently offline abdf mncrFriend
Messages: 75
Registered: February 2017
Member
Thanks for your answering i hope this help me.
Previous Topic:Implicitly add method call to generated interface.
Next Topic:Producing multiple objects from one rule
Goto Forum:
  


Current Time: Tue Sep 26 12:56:03 GMT 2017

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

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