this isn't that easy and it wasn't topic of the screencast. You have to configure and run eclipse in headless mode using eclipse compiler and export routines.
Normally with Xtext 2.0 you have two MWE files. First MWE workflow (that you posted here) is used to generate java and other artifacts from your MyDsl.xtext grammar. We will leave it alone for now.
The second workflow is used to generate code from your DSL. You will find this MWE file in the same directory your generator class located in. Within this MWE file you can define custom outlets, like I showed in my previous comment.
In Xtext version 2.0.1 you probably use MWE workflow files to run the generator. In this case you define your output configurations (called outlets) as follow
Thank you for the contribution. Scope is a complex topic, that will be often misunderstood. I will definitely make more episodes about it in the future.
Also thank you for the advice with the version information. I already put the versions of the used software at the bottom on the show notes of the episode 17. I will do it for all other episodes soon.
And here again:
Eclipse version: 4.2 (Juno)
Xtext version: 2.3
There shouldn't be so much differences between Xtext 2.3 and 2.4 considering episode 17. What problems do you have exactly?
Operators:
The documentation uses def keyword. For example, see definition of the compile method def compile(Entity e) (page 28).
The '::' operator is good, if you want to call a static method, see "Character::isUpperCase(..)" (page 32)
The extended scoping tutorial is planed, but the topic is pretty complicated and because of this very time consuming :-(
The build with maven is pretty good documented already. Most open source projects (like Jnario and Xtext itself) use it. So, I decided to start with the Ant build.
Hi,
You generate code in the IGenerator implementation.
Take a look of the screencast 3:
http://xtextcasts.org/episodes/3-parameterized-enum-2
Cheers,
Boris
I'm glad it helped :)
Hello,
this isn't that easy and it wasn't topic of the screencast. You have to configure and run eclipse in headless mode using eclipse compiler and export routines.
Yes, starting with Xtext 2.5.0 you need a new dependency:
Just add the new jar to your build process.
Thank you very much for your contribution!
Hi Kunal,
you alter wrong MWE workflow file.
Normally with Xtext 2.0 you have two MWE files. First MWE workflow (that you posted here) is used to generate java and other artifacts from your
MyDsl.xtext
grammar. We will leave it alone for now.The second workflow is used to generate code from your DSL. You will find this MWE file in the same directory your generator class located in. Within this MWE file you can define custom outlets, like I showed in my previous comment.
In Xtext version 2.0.1 you probably use MWE workflow files to run the generator. In this case you define your output configurations (called outlets) as follow
Then within your generator you can specify the letout to use
Hi,
could you please provide the Xtext version you are using?
Cheers
Thank you for the contribution. Scope is a complex topic, that will be often misunderstood. I will definitely make more episodes about it in the future.
Hi,
I use following command to find jars with required classes:
Works on Linux/Mac or on MinGW/Cygwin on Windows
This is definitively a nice improvement. Prior to this, you had to know or google on how to retrieve your model elements from the resource.
I'm happy you like XtextCasts!
Also thank you for the advice with the version information. I already put the versions of the used software at the bottom on the show notes of the episode 17. I will do it for all other episodes soon.
And here again:
There shouldn't be so much differences between Xtext 2.3 and 2.4 considering episode 17. What problems do you have exactly?
Operators:
def
keyword. For example, see definition of the compile methoddef compile(Entity e)
(page 28).The extended scoping tutorial is planed, but the topic is pretty complicated and because of this very time consuming :-(
Yes, it will come :-)
The build with maven is pretty good documented already. Most open source projects (like Jnario and Xtext itself) use it. So, I decided to start with the Ant build.
Meanwhile, you could also take a look at this:
https://github.com/aphethean/xtext-maven-examples
Thanks for the comment!