Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » About CrossReferenceSerialization in Xtext(the performance of CrossReferenceSerialization )
About CrossReferenceSerialization in Xtext [message #1791322] Thu, 28 June 2018 06:57 Go to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
Hi,
I have a question about the serialization of cross reference in Xtext.
The class CrossReferenceSerialization in package "org.eclipse.xtext.serializer.tokens" is responsible for serializing the corss reference of semantic element. The func serializeCrossRef() has two ways to get serialization result: 1) serialize the Node in the parse tree, invoking serializeNode() func; 2) invoking getCrossReferenceNameFromScope(). And my question is about getting serialization result from invoking getCrossReferenceNameFromScope().
In our analysis, we find that it will get a scope which contain all the EObjectDescription of the resource, then traverse these EObjectDescription to get the matched EObjectDescription which is related with the semantic element, and can get serialization result. So if the model scale is very large, the match process will be slow and inefficient, which contribute to very slowly cross reference serialization.
1. Why not creating only one EObjectDescription according to the semantic element and then get serialization result from this EObjectDescription, which can avoid the performance overhead of traversing all EObjectDescription of smeantic model?
2. And whether there are some scenes that one semantic element can have several EObjectDescription? So if there are, the process of traversing is necessary and important, can you give a detail description about these scenes?

Thank you very much!
Re: About CrossReferenceSerialization in Xtext [message #1791325 is a reply to message #1791322] Thu, 28 June 2018 07:03 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
yes it is possible to have one eobject with multiple names and scope is used to dertermine the correct one.
a similar issue during refactoring is described at https://github.com/eclipse/xtext-eclipse/issues/320
of course you can change the behaviour for your dsl if you can rely on assumtions.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: About CrossReferenceSerialization in Xtext [message #1791680 is a reply to message #1791325] Wed, 04 July 2018 06:20 Go to previous messageGo to next message
jingjing wang is currently offline jingjing wangFriend
Messages: 28
Registered: July 2017
Junior Member
Hi, Christian

Thank you very much!

I have read your reply info carefully. Our dsl model is based on EMF, we have no idea about the scene of one eobject with multiple names. Can you give us a detail exmaple/scene about one eobject with multiple names? We will be very grateful if you give us more advice about one eobject with multiple name. Thanks!
Re: About CrossReferenceSerialization in Xtext [message #1791689 is a reply to message #1791680] Wed, 04 July 2018 07:57 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
well it depends on the domain you have. e.g. this or super in programming languages could be such cases.
as i said: feel free to customize it in your dsl


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Grammar for nested units
Next Topic:Inheritance from non-grammar java class
Goto Forum:
  


Current Time: Fri Mar 29 07:50:42 GMT 2024

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

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

Back to the top