2 DSLs and 1 Ecore-Model [message #1759099] |
Thu, 06 April 2017 06:46  |
Eclipse User |
|
|
|
Hello everyone
I am currently working on a little DSL which should replace some pretty tedious configuration XML and HTML.
The DSLs should each have their own concern, one being a description of data and the other the ui.
So I defined a Ecore-Model (with Xcore) which looks like this
Model
Document (n)
Data
Field (n)
UI
define UI with references to Fields
Of course I can define everything in one DSL, but then the file gets pretty big and ugly.
I already have two DSLs (within one project) working nicely. Unfortunately each DSL has its own model-instance (within Document I expect that Data and UI have references, but one is always null depending on the file edited). Is is possible that 2 DSL work on the same model-instance? Or what is the correct way to achieve this
I assume that my Parser is wrong because I define the complete hierarchy and just switch data/ui in Documents. In my first attempt the parser started at Data or UI but then the eContainer-fields where null.
Data-Parser
Model returns Model:
documents+=Document
;
Document returns Document :
data=Data
;
Data returns Data:
("Fields" "{"
(fields+=Field)+
"}")*
(groups+=Group)+
;
....some more stuff
UI-Parser
Model returns Model:
documents+=Document
;
Document returns Document :
ui=UI
;
UI returns UI:
...
;
....some more stuff
I have no idea if what I am trying to achieve is possible at all. So any help is appreciated, even if I have to go a completely other way (scoping?).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.26736 seconds