Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Serialising Xcore model to Xtext
Serialising Xcore model to Xtext [message #1702029] Fri, 17 July 2015 16:26
Andrew Clark is currently offline Andrew ClarkFriend
Messages: 23
Registered: June 2010
Junior Member
Hi ,

I am using code based on this example

http://www.eclipse.org/forums/index.php/mv/msg/382898/921393/#msg_921393

to serialise ecore models for a given language (DSL).

It all works fine up until I modify the Xtext project to use Xcore to specify the meta model, using the instructions in this blog post

http://koehnlein.blogspot.ch/2013/06/using-xcore-in-xtext.html

Then I get the following exception.

Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.xtext.serializer.analysis.GrammarConstraintProvider$Constraint.hashCode(GrammarConstraintProvider.java:309)
	at java.util.HashMap.hash(HashMap.java:338)
	at java.util.HashMap.get(HashMap.java:556)
	at org.eclipse.xtext.serializer.analysis.GrammarConstraintProvider.filterDuplicateConstraintsAndSetNames(GrammarConstraintProvider.java:1250)
	at org.eclipse.xtext.serializer.analysis.GrammarConstraintProvider.getConstraints(GrammarConstraintProvider.java:1462)
	at org.eclipse.xtext.serializer.sequencer.ContextFinder.initConstraints(ContextFinder.java:235)
	at org.eclipse.xtext.serializer.sequencer.ContextFinder.findContextsByContentsAndContainer(ContextFinder.java:177)
	at org.eclipse.xtext.serializer.impl.Serializer.getContext(Serializer.java:114)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:107)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:133)
	at org.eclipse.xtext.resource.XtextResource.doSave(XtextResource.java:354)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
	at org.xtext.example.mydsl.tests.SerializationTest.main(SerializationTest.java:33)


I have attached projects showing the test working with an inferred model , working with a imported ecore model and NOT working with and imported Xcore model.

I am using

Eclipse Modeling Tools
Version: Mars Release (4.5.0)
Build id: 20150621-1200

and

Xtext
Version: 2.8.3.v201506010551
Build id: R201506010551


What have I missed ?

cheers,

Andrew
Previous Topic:Testing multiple Xtext Dsl's
Next Topic:Guide to write own TMF analysis module.
Goto Forum:
  


Current Time: Tue Mar 19 04:49:15 GMT 2024

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

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

Back to the top