Xtext Parser - Enhance parsed model [message #1229117] |
Wed, 08 January 2014 19:03 |
|
Hi,
i am trying to enhance the parsed model, but i am not sure what is the best place for.
In my DSL i have an semantic element called "versioned" with type boolean.
If versioned == true in Xtext model, i would like to add semantic model elements to the parse result. A feature for fromDate and one for untilDate.
So the user only has to define:
versioned entity {
int id;
String name;
...
}
and the parser adds the
...
Date validFrom;
Date validUntil;
...
under the hood.
So i can use these features in the model inferrer to create java fields and accessor for them.
Is there a common way to enhance the parser result that way?
Thanks Florian
[Updated on: Wed, 08 January 2014 19:04] Report message to a moderator
|
|
|
|
|
Re: Xtext Parser - Enhance parsed model [message #1230342 is a reply to message #1229117] |
Sat, 11 January 2014 18:26 |
|
Hi,
i can not do in the inferrer since i need the semantic element for further processing in the semantic model.
But i extended the Linker and added stuff there. It works pretty fine.
Adding attributes is simple since no resolving has to be done.
Adding crossreferences was bit harder, but using proxies it also work pretty good.
Thanks for input...
Best Florian
|
|
|
Powered by
FUDForum. Page generated in 0.04141 seconds