Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Error when saving a generated XMI to DSL(Error when saving a generated XMI to DSL)
Error when saving a generated XMI to DSL [message #1740096] Tue, 09 August 2016 07:38 Go to next message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
Hello,

I have a langage generated with XText, and what I try to do is to convert a DSL file into a XMI file (in order to use Sirius), and then convert it back into a DSL file. One thing to note is that when I modify the generated XMI, it implies modifications on several DSL files.
The fact is that, when I am converting back to DSL, at the moment of saving, an error occur (the stack trace is under the message).
I do not think that it is due to the conversion, since I have checked the textual xmi file, and nothing seems wrong on it. But if it is not this, then I dont see what it could be.
What I do during the second conversion is loading one of the DSL file that need to be updated, get from the XMI the new instance of the model, put it on the DSL (after deleting the old content) and then save. But the error appear for each saving.
I have never saw such error on the web, and I would reallly appreciate some help.
Thank you, and have a nice day.
Vincent

java.lang.RuntimeException: The value 'platform:/resource/_messages/Test/Mat.proto' is an invalid STRING
Semantic Object: Model.algoDef[0]->AlgoDef.includes[0]->Includes
	at org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic$ExceptionThrowingAcceptor.accept(ISerializationDiagnostic.java:77)
	at org.eclipse.xtext.serializer.tokens.ValueSerializer.serializeAssignedValue(ValueSerializer.java:67)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.getToken(SequenceFeeder.java:462)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.accept(SequenceFeeder.java:214)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.sequence_Includes(YaafSemanticSequencer.java:267)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.createSequence(YaafSemanticSequencer.java:83)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.acceptEObjectRuleCall(SequenceFeeder.java:299)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.acceptRuleCall(SequenceFeeder.java:325)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.accept(SequenceFeeder.java:239)
	at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.accept(BacktrackingSemanticSequencer.java:401)
	at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.createSequence(BacktrackingSemanticSequencer.java:454)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.sequence_AlgoDef(YaafSemanticSequencer.java:136)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.createSequence(YaafSemanticSequencer.java:59)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.acceptEObjectRuleCall(SequenceFeeder.java:299)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.acceptRuleCall(SequenceFeeder.java:325)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.accept(SequenceFeeder.java:239)
	at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.accept(BacktrackingSemanticSequencer.java:401)
	at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.createSequence(BacktrackingSemanticSequencer.java:454)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.sequence_Model(YaafSemanticSequencer.java:311)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.createSequence(YaafSemanticSequencer.java:95)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:86)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:109)
	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 com.conti.xcit.yaaf.ui.sirius.XMI2Yaaf.convert(XMI2Yaaf.java:109)
	at com.conti.xcit.xmitoyaaf.handlers.SampleHandler.execute(SampleHandler.java:48)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:799)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:675)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$7(HandledContributionItem.java:659)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:592)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1488)
Re: Error when saving a generated XMI to DSL [message #1740119 is a reply to message #1740096] Tue, 09 August 2016 12:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Looks like the Model is not properly saved as xmi or not properly loaded from xmi. Can you share a unit test or Java main example and a grammar reproducing this

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error when saving a generated XMI to DSL [message #1740211 is a reply to message #1740119] Wed, 10 August 2016 13:44 Go to previous messageGo to next message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
Hello Christian,

I tried to see if the xmi was saved or loaded in a wrong way. It doesn't look like so, but I found something interesting while searching:
I can add an element to a DSL file at one condition: its ID must be its only set value. I can get this value from a generated XMI, or from a Factory, if it have any other set value than its ID, it will display the previous error stack.
I added a test unit below: I left (commented) the way I load a resource from a XMI file. After it, the commented part corresond to the troubling part: if I run the code as it is now, there will be no problem, but if I run the "danger" part, it will mess with the semantic object error.
My model is like
Model:
	algoDef += AlgoDef*
;
AlgoDef:
	(includes+=Includes)*
	('component:' algo=Algo)
;
Algo:
	 'name:' name=ID
	 ('authors:' authors=Authors)?
;
Includes:
    'import' importURI=STRING 
;
Authors:
	 list+=Author ((','|(', ')) list+=Author)* 
;
Author:
	name=STRING
;


And here is the snippet of my test code

	@Inject
	static Injector injector_r;

	@SuppressWarnings("unused")
	public static void main(String args[]) {

		YaafPackage.eINSTANCE.eClass();
		ProtobufPackage.eINSTANCE.eClass();
		Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
		Map<String, Object> m = reg.getExtensionToFactoryMap();
		m.put("xmi", new XMIResourceFactoryImpl());
		ResourceSet resourceSet = new ResourceSetImpl();
		
		//Resource xmiResource = resourceSet.getResource(URI.createFileURI(new File(xmiPath).getAbsolutePath()), true);
		//AlgoDef ad = ((Model) xmiResource.getContents().get(0)).getAlgoDef().get(0);
		AlgoDef ad = YaafFactory.eINSTANCE.createAlgoDef();
		Algo a = YaafFactory.eINSTANCE.createAlgo();
		a.setName("test name");
		// // Danger
		// Author at = YaafFactory.eINSTANCE.createAuthor();
		// at.setName("test name");
		// Authors ats = YaafFactory.eINSTANCE.createAuthors();
		// ats.getList().add(at);
		// a.setAuthors(ats);
		// // Danger
		ad.setAlgo(a);
		

		injector_r = YaafStandaloneSetup.doSetup();
		YaafResourceManager manager = new YaafResourceManager();
		injector_r.injectMembers(manager);
		try {
			manager.doSetup(args[1]);
		} catch (ConfigurationException | IOException e1) {
			e1.printStackTrace();
		}

		XtextResource xtextResource = null;
		try {
			xtextResource = (XtextResource) manager.loadResource(new File(yaafPath).getAbsolutePath());
		} catch (ConfigurationException | IOException e1) {
			e1.printStackTrace();
		}
		
		((Model) xtextResource.getContents().get(0)).getAlgoDef().add(ad);
		
		try {
			xtextResource.save(Collections.EMPTY_MAP);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}


Thank you for your precious help,

Vincent

[Updated on: Wed, 10 August 2016 14:02]

Report message to a moderator

Re: Error when saving a generated XMI to DSL [message #1740213 is a reply to message #1740211] Wed, 10 August 2016 13:53 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi

this is still not anything reproducable.

how does your include rule look like?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error when saving a generated XMI to DSL [message #1740214 is a reply to message #1740213] Wed, 10 August 2016 14:01 Go to previous messageGo to next message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
Sorry, I forgot them!
Includes:
    'import' importURI=STRING 
;
Authors:
	 list+=Author ((','|(', ')) list+=Author)* 
;
Author:
	name=STRING
;

What more do you need to reproduce it?

[Updated on: Wed, 10 August 2016 14:02]

Report message to a moderator

Re: Error when saving a generated XMI to DSL [message #1740215 is a reply to message #1740214] Wed, 10 August 2016 14:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
do you have any customizations to terminals like ID or STRING

e.g.

'test name' is not a valid ID


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error when saving a generated XMI to DSL [message #1740216 is a reply to message #1740215] Wed, 10 August 2016 14:07 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
does this pure java main run for you?

package org.xtext.example.mydsl1;

import java.util.Map;

import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.xtext.serializer.ISerializer;
import org.xtext.example.mydsl1.myDsl.Algo;
import org.xtext.example.mydsl1.myDsl.AlgoDef;
import org.xtext.example.mydsl1.myDsl.Author;
import org.xtext.example.mydsl1.myDsl.Authors;
import org.xtext.example.mydsl1.myDsl.Includes;
import org.xtext.example.mydsl1.myDsl.MyDslFactory;
import org.xtext.example.mydsl1.myDsl.MyDslPackage;

import com.google.inject.Inject;
import com.google.inject.Injector;

public class Main {

@Inject
static Injector injector_r;

@SuppressWarnings("unused")
public static void main(String args[]) {

Injector i = new MyDslStandaloneSetup().createInjectorAndDoEMFRegistration();
ISerializer s = i.getInstance(ISerializer.class);

MyDslPackage.eINSTANCE.eClass();
Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
Map<String, Object> m = reg.getExtensionToFactoryMap();
m.put("xmi", new XMIResourceFactoryImpl());
ResourceSet resourceSet = new ResourceSetImpl();

// Resource xmiResource = resourceSet.getResource(URI.createFileURI(new
// File(xmiPath).getAbsolutePath()), true);
// AlgoDef ad = ((Model)
// xmiResource.getContents().get(0)).getAlgoDef().get(0);
MyDslFactory factory = MyDslFactory.eINSTANCE;
AlgoDef ad = factory.createAlgoDef();
Algo a = factory.createAlgo();
a.setName("test_name");
// // Danger
Author at = factory.createAuthor();
at.setName("test name");
Authors ats = factory.createAuthors();
ats.getList().add(at);
a.setAuthors(ats);
// // Danger
ad.setAlgo(a);

Includes inc = factory.createIncludes();
inc.setImportURI("platform:/resource/_messages/Test/Mat.proto");

ad.getIncludes().add(inc);

System.out.println(s.serialize(ad));

}

}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error when saving a generated XMI to DSL [message #1740219 is a reply to message #1740215] Wed, 10 August 2016 14:18 Go to previous messageGo to next message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
Here is the STRING and ID rules I use:
terminal ID : 
	'^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*
;
terminal STRING	  : 
	'"' ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|'"') )* '"' |
	"'" ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|"'") )* "'" 
; 

[Updated on: Thu, 11 August 2016 06:02]

Report message to a moderator

Re: Error when saving a generated XMI to DSL [message #1740221 is a reply to message #1740219] Wed, 10 August 2016 14:23 Go to previous messageGo to next message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
Here is the result fo the code you gave me:
Exception in thread "main" java.lang.RuntimeException: The value 'platform:/resource/_messages/Test/Mat.proto' is an invalid STRING
Semantic Object: AlgoDef.includes[0]->Includes
	at org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic$ExceptionThrowingAcceptor.accept(ISerializationDiagnostic.java:77)
	at org.eclipse.xtext.serializer.tokens.ValueSerializer.serializeAssignedValue(ValueSerializer.java:67)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.getToken(SequenceFeeder.java:462)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.accept(SequenceFeeder.java:214)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.sequence_Includes(YaafSemanticSequencer.java:267)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.createSequence(YaafSemanticSequencer.java:83)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.acceptEObjectRuleCall(SequenceFeeder.java:299)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.acceptRuleCall(SequenceFeeder.java:325)
	at org.eclipse.xtext.serializer.acceptor.SequenceFeeder.accept(SequenceFeeder.java:239)
	at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.accept(BacktrackingSemanticSequencer.java:401)
	at org.eclipse.xtext.serializer.sequencer.BacktrackingSemanticSequencer.createSequence(BacktrackingSemanticSequencer.java:454)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.sequence_AlgoDef(YaafSemanticSequencer.java:136)
	at com.conti.xcit.yaaf.serializer.YaafSemanticSequencer.createSequence(YaafSemanticSequencer.java:59)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:86)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:109)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:124)
	at org.eclipse.xtext.serializer.impl.Serializer.serialize(Serializer.java:52)
	at com.conti.xcit.yaaf.ui.sirius.Main.main(Main.java:61)


Thank you very much for your help!
Re: Error when saving a generated XMI to DSL [message #1740224 is a reply to message #1740221] Wed, 10 August 2016 14:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
well here we go. how does your value converter implementations for ID and STRING look like? (should be configured in a IValueConverterService subclass)

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error when saving a generated XMI to DSL [message #1740227 is a reply to message #1740224] Wed, 10 August 2016 14:43 Go to previous messageGo to next message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
I don't fully understand how does it works, but I found:
public class YaafRuntimeModule extends com.conti.xcit.yaaf.AbstractYaafRuntimeModule {
	  @Override public Class<? extends IValueConverterService> bindIValueConverterService() {
		    return YaafTerminalConverters.class;
	  }
	  
	  @Override
	  public void configure(Binder binder) {
		  binder.bind(ILogging.class).to(CommandLineConsole.class);
		  super.configure(binder);
	  }
}

and
public class YaafTerminalConverters extends DefaultTerminalConverters{
	@Inject private IStringValueConverter iStringValueConverter;

	@ValueConverter(rule = "STRING")
	  public IValueConverter<String> STRING() {
	    return iStringValueConverter;
	  }

}

[Updated on: Fri, 12 August 2016 07:29]

Report message to a moderator

Re: Error when saving a generated XMI to DSL [message #1740228 is a reply to message #1740227] Wed, 10 August 2016 14:47 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
and how is your IStringValueConverter implemented? what happens if you debug toString there?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error when saving a generated XMI to DSL [message #1740229 is a reply to message #1740228] Wed, 10 August 2016 14:54 Go to previous messageGo to next message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
In debug mode, it returns path+YaafPreferences.ALGO_DESCRIPTION_FILE_NAME;

[Updated on: Fri, 12 August 2016 07:30]

Report message to a moderator

Re: Error when saving a generated XMI to DSL [message #1740231 is a reply to message #1740229] Wed, 10 August 2016 15:02 Go to previous messageGo to next message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
Wait, what I posted is what happen when I run my code. When I run yours, I dont reach the isValue function.
Re: Error when saving a generated XMI to DSL [message #1740239 is a reply to message #1740231] Wed, 10 August 2016 15:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
it is not about the toValue method, it is about the toString method.

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error when saving a generated XMI to DSL [message #1740240 is a reply to message #1740239] Wed, 10 August 2016 15:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
simply set an exception breakpoint for ValueConverterException

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error when saving a generated XMI to DSL [message #1740273 is a reply to message #1740240] Thu, 11 August 2016 06:58 Go to previous messageGo to next message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
So, if I debug toString, the method acceptToken throw the ValueConverterException: what happens is that the method InternalYaafLexer.mTokens() predict the rule ID, while the real rule is STRING. As consequence, the error can be thrown beceause the STRING doesnt follow the ID rules [if (!escapedString.equals(token.getText()))], or because the rules doesnt match [if (!getRuleName().toUpperCase().equals(getRuleName(token)))]. I am currently trying to see why the chosen rule is a wrong one.
Re: Error when saving a generated XMI to DSL [message #1740275 is a reply to message #1740273] Thu, 11 August 2016 07:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
as i cannot reproduce this with what you have shared so much i cannot give any hints sry

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error when saving a generated XMI to DSL [message #1740276 is a reply to message #1740275] Thu, 11 August 2016 07:13 Go to previous message
Vincent Achard is currently offline Vincent AchardFriend
Messages: 14
Registered: August 2016
Junior Member
I understand. The fact is that I dont know how much I am allowed to share, but you already gave me some precious help, thank you for it!
I will post the solution when I find it.
Thank you again,

Vincent
Previous Topic:Accessing the Abstract Syntax Tree of imported files
Next Topic:Serialization of unordered group yields invalid model code
Goto Forum:
  


Current Time: Thu Mar 28 10:11:28 GMT 2024

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

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

Back to the top