Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Saving DSL script triggers the application main program.(XText DSL trigger application execution upon save/execute)
Saving DSL script triggers the application main program. [message #1698425] Mon, 15 June 2015 14:04 Go to next message
sam narayan is currently offline sam narayanFriend
Messages: 11
Registered: June 2015
Junior Member
Hi All,

I am a newbie to XText trying to develop a DSL editor to be distributed to an end-user group with a few commands.

Following Karsten's blog, I have created a standalone RCP product for XText DSL which works fine using Eclipse 3.7.2 and XText 2.3.0.

From the point-of-view of my end-user, he/she just needs an editor with a button 'execute' to run the commands in the .mydsl file.

I have started small with Martin's statemachine example - grammar:
sample.xtext file contents:
('commands'
commands+=Command+
'end')?
Sample.mydsl :
commands
start : value
stop : value
end
When I launch the mydsl product, I can get an editor. In the src-gen folder by Xtend, I have a 'sample.java' class with a main method that calls the doStart() and the doStop() methods (runs as a Java application upon right-click).

What I am trying without success is the following usecase. A user edits the file (changes the start and stop value parameters) and when he clicks on 'save', the automatically generated 'sample.java' should be run as an application, so the program is executed upon clicking on save/execute button. Because, in the final editor, the user does not have to create / see the src-gen folder. There must be a way to trigger the main class from a button/menu item, which I do not know.
Could you please help?
Many thanks,
Re: Saving DSL script triggers the application main program. [message #1698460 is a reply to message #1698425] Mon, 15 June 2015 19:12 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
this question nail down to: i have a file in a java project. how can i run it programatically. this question is better asked in the jdt forum since this part is not related to xtext

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Saving DSL script triggers the application main program. [message #1698560 is a reply to message #1698460] Tue, 16 June 2015 12:09 Go to previous message
sam narayan is currently offline sam narayanFriend
Messages: 11
Registered: June 2015
Junior Member
Hi Christian,

Thank you for pointing me in the right direction. I will raise this question in the JDT forum.

Thanks
Previous Topic:Inject not working with non xtext plugin
Next Topic:quick fix for terminal rules in xtext
Goto Forum:
  


Current Time: Wed Apr 24 18:59:59 GMT 2024

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

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

Back to the top