Saving DSL script triggers the application main program. [message #1698425] |
Mon, 15 June 2015 14:04 |
sam narayan 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,
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03472 seconds