Running / Interpret the DSL [message #798439] |
Tue, 14 February 2012 12:48  |
Eclipse User |
|
|
|
[new to xtext - so please bare with me]
OK, so now I have a simple defined DSL with all the features that one can
expect from an IDE!
But how can I re-use this generated infrastructure to actually execute / run
/ interpret my langauge files?
Preferably I would like to be able to execute both from within Eclipse and
from a command line set-up.
Any hint trick suggestion greatly appreciated.
Peter
|
|
|
|
|
|
Re: Running / Interpret the DSL [message #798623 is a reply to message #798580] |
Tue, 14 February 2012 17:47   |
Eclipse User |
|
|
|
I did exactly what you are after in the Eclipse b3 project - I
implemented running/interpreting in several different ways - running the
dirty state in the editor, running from dialogs/wizards (passing in
parameters), and much more.
There is a "run" menu extension IIRC in one of the ui components that
serves as an entry point into the functionality.
- henrik
On 2012-14-02 22:27, Peter S Eden wrote:
> Hi,
>
> Thanks for prompt reply.
>
> Here is want I want to achive:
> - when in Eclipse and working in the XText generated editor / environment :
> having the abilty to press a Run button to execute the code in the editor
> and to get the output in the Eclipse Console
> - when in command line mode (comamnd shell): enter java -cp mydsl.jar
> mydsl.dsl (where mydsl.dsl is a text file with my 'code'), output to stdout
>
> Pretty much like when you develop java code in Eclipse, you can run it
> directly in the IDE, but you can also run the code at command prompt.
>
> I would prefer it I can maintain the generated xtext plug-in structure and
> simply do a export of the jar file (to mydsl.jar in my sample above).
>
> Is it possible to achive this with xtext (run from Eclipse, run standalone
> with the same plug-ins)? If not how can I make it in another way?
>
> I did have a quick peek into the
> http://wiki.eclipse.org/Xtext/FAQ#How_do_I_load_my_model_in_a_standalone_Java_application.C2.A0.3F
> article and was
> a bit surprised that the model defintion must be loaded. I would have
> thought that all symbols etc where compiled into java code. - agian I'm new
> to xtext / antlr etc.
>
>
>
>
> //Peter
>
>
>
>
>
> "Christian Dietrich"<forums-noreply@eclipse.org> skrev i meddelandet
> news:jheaue$ts1$1@news.eclipse.org...
>> Hi,
>>
>> welcome to Xtext.
>> your question is very unspecific so it is hard to give an answer.
>> here are some options
>>
>> (1) you can call your processor when saving the model file e.g. using an
>> IXtextBuilderParticipant (2) you can call your processor explicitely e.g.
>> like it is done for this code generator
>> http://christiandietrich.wordpress.com/2011/10/15/xtext-calling-the-generator-from-a-context-menu/
>> (3) process your models standalone with a mwe2 workflow or via java app as
>> described here:
>> http://wiki.eclipse.org/Xtext/FAQ#How_do_I_load_my_model_in_a_standalone_Java_application.C2.A0.3F
>>
>> ~Christian
>
>
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07129 seconds