Two DSLs in one Eclipse project [message #1153464] |
Thu, 24 October 2013 16:30 |
Gary Worsham Messages: 176 Registered: September 2013 |
Senior Member |
|
|
OK, last night I actually got some preliminary Xtend code generation working!
Here's my long term goal and why I think I might want to use 2 DSLs in one Eclipse project.
My first DSL/XText models a block of DSP code with input and output connections. For any given algorithm, several of these can be linked together in different ways to create the overall processing function. Each different block defined needs to have an entry in the Swing application's menu to allow the user to insert it. So, I have bunch of different blocks in my end application.
Right now, using brute force Java, I create the new block class and then I go over to the Swing JFrame class which contains the menu definition and I add code that creates a new menu entry to call the block's insert() method. I'd just as soon have a menu creation DSL possible at the same time (with a different source file type, of course) to handle this. There is only one menu in the end application, though I can imagine that different users might want to customize it one way or the other.
Then my menu definition file could be a very simplified representation. When it generated code (or perhaps in the validation step) it would look up the block class by name, and of course complain if it couldn't find it. Then I imagine it would create the menu class, which would be called by reference instead of inline in my JFrame as done currently.
Any reason I can't just define a second Xtext and corresponding Xtend file for this menu creation code in my existing project?
By the way I did find a similar discussion here:
http://www.eclipse.org/forums/index.php/m/927101/?srch=multiple+DSL#msg_927101
but it's not quite what I am asking.
Thanks,
GW
[Updated on: Thu, 24 October 2013 16:54] Report message to a moderator
|
|
|
|
Re: Two DSLs in one Eclipse project [message #1153698 is a reply to message #1153509] |
Thu, 24 October 2013 19:57 |
Gary Worsham Messages: 176 Registered: September 2013 |
Senior Member |
|
|
One thing I don't understand is the difference between selecting the Xtext file and choosing Run As...Generate Xtext Artifacts compared to selecting the mwe2 file and choosing Run As...Generate MWE2 Workflow.
In general, up to now I have selected the Xtext file, then click on the green "Run" button. After that completes, I select the top-level package and click on the Green "Run" button again, which launches Eclipse. Most of the time this works OK, but in many of the examples the mwe2 workflow is referenced. Although I have read these descriptions several times, I still have no idea what an mwe2 workflow is, what it does, and whether I need to worry about it.
[Updated on: Thu, 24 October 2013 19:58] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02486 seconds