Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Serializing partial model
Serializing partial model [message #1396073] Mon, 07 July 2014 21:01
Christian Pelster is currently offline Christian PelsterFriend
Messages: 23
Registered: January 2010
Junior Member
Hi all,

I'm trying to serialize not a full but only a small part of a xtext model wihtin xtend. My naive approach was to just call the serialization like:


@Inject extension Serializer

[....]
		
var dictionary = MangoFactory.eINSTANCE.createDictionary();
dictionary.setEntity(entity);
dictionary.setName("xxx");

var serializedModel = dictionary.serialize



Unfortunatly this fails because of the
dictionary.setEntity(entity); part. The entity set via setEntity is from an existing full model. The callstack is:

at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getResourceScope(ImportedNamespaceAwareLocalScopeProvider.java:95)
	at org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.getScope(ImportedNamespaceAwareLocalScopeProvider.java:89)
	at org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.delegateGetScope(AbstractDeclarativeScopeProvider.java:72)
	at org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.getScope(AbstractDeclarativeScopeProvider.java:102)
	at org.eclipse.xtext.serializer.tokens.CrossReferenceSerializer.serializeCrossRef(CrossReferenceSerializer.java:84)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.getToken(SequenceFeeder.java:454)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.accept(SequenceFeeder.java:220)
	at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.accept(BacktrackingSemanticSequencer.java:407)
	at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.createSequence(BacktrackingSemanticSequencer.java:449)
	at io.pelle.mango.dsl.serializer.MangoSemanticSequencer.sequence_Dictionary(MangoSemanticSequencer.java:864)
	at io.pelle.mango.dsl.serializer.MangoSemanticSequencer.createSequence(MangoSemanticSequencer.java:163)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:85)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:108)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:122)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:51)


Obviously it fails when getting the scope for the partial model (which seems logical because there currently is no scope because of it's nature).

any hints how to achieve this?

Regards,

Christian
Previous Topic:Possible to extend Google'S Go using Xtext?
Next Topic:No EObjectDescription could be found in Scope when saving a model
Goto Forum:
  


Current Time: Tue Apr 23 18:01:15 GMT 2024

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

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

Back to the top