Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext Parser - Enhance parsed model
Xtext Parser - Enhance parsed model [message #1229117] Wed, 08 January 2014 14:03 Go to next message
Eclipse UserFriend
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 14:04] by Moderator

Re: Xtext Parser - Enhance parsed model [message #1229119 is a reply to message #1229117] Wed, 08 January 2014 14:09 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

i am not sure if i got you but why dont you do it completely in the inferrer?
Re: Xtext Parser - Enhance parsed model [message #1229123 is a reply to message #1229119] Wed, 08 January 2014 14:16 Go to previous messageGo to next message
Eclipse UserFriend
P.S.

this is usually (in non jvmmodelinferrer languages) done by a IDerivedStateComputer but
JvmModelAssociator is such a IDerivedStateComputer and delegates to the inferrer.
Re: Xtext Parser - Enhance parsed model [message #1230342 is a reply to message #1229117] Sat, 11 January 2014 13:26 Go to previous message
Eclipse UserFriend
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
Previous Topic:Population of emf model data values in content assist
Next Topic:Xtext (Xbase) QualifiedName not parsed completely
Goto Forum:
  


Current Time: Wed Jul 23 19:12:42 EDT 2025

Powered by FUDForum. Page generated in 0.03202 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top