I am a Student and currently doing my BSc in Computer Science and Software Engineering.
Out of curiosity I have started to spend my free time on DSL's and have bought the Book "Implementing Domainspecific Languages with XText and Xtend" of Lorenzo Bettini.
In the book there is an example which I am trying to reimplement to grasp the basics of XTend. But I have gotten into a problem.
The example is a little DSL which is generated and then you had to open a new Eclipse Application and could use this DSL. It is mentioned in the book that if I change the DSL in anyway and then go to the File with the ending ".mwe2" which generated by XTend and run this as MWE2 WORKFLOW, it should be automatically changed in the second Application, in which the DSL is being used.
But my second Application isn't updated. First I had a simple grammar which allowed me to use Arrays with no input between the brackets e.G. Entity[] myEntity; and then it was shown in the example how to change the grammar to get an Syntax as e.G. Entity[10] myEntity;. I have implemented accordingly but as mentioned above the second IDE doesn't update.
I have also checked that Eclipse has Build Automatically enabled.
Does anyone know what my mistake could be?
(I am not sure if I am allowed to post the example of the book here.)
Using the second Eclipse instance to test your DSL is a preferred way. Starting the second Eclipse instance with Eclipse's Debug mode some code changes are automatically propagated into your running second test instance.
But, there are limitations for propagating code changes into the running Eclipse instance: Any changes on any class signature cannot be propagated. New classes cannot be propagated. Deleted classes cannot be unloaded.
Changes at the grammar that require to regenerate the language will change class signatures and will create/delete classes. That means you have to restart the second Eclipse instance after regenerating the language. Even if you add/remove classes or methods you have to restart the Eclipse application.
As I remember correctly, Eclipse will open an information dialog that asks you to restart the second Eclipse instance.