Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » CompleteOCL parser problem
CompleteOCL parser problem [message #1001801] Thu, 17 January 2013 11:51
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Hi all,
I try to use to atl query to generate a very simple text form a parsed OCL document
conforms to CompleteOCLCST metamodel proposed by OCL MDT community.
I use this Java Parser
package Parser;
import java.io.IOException;

import org.eclipse.emf.common.util.URI;
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.util.EcoreUtil;
import org.eclipse.ocl.examples.pivot.model.OCLstdlib;
import org.eclipse.ocl.examples.xtext.completeocl.CompleteOCLStandaloneSetup;
import org.eclipse.ocl.examples.xtext.oclinecore.OCLinEcoreStandaloneSetup;

public class Parser {

	public static void main(String[] args) throws IOException {

		CompleteOCLStandaloneSetup.doSetup();
		OCLinEcoreStandaloneSetup.doSetup();
		OCLstdlib.install();
		ResourceSet resourceSet = new ResourceSetImpl();
		Resource resource = resourceSet.createResource(URI.createURI(args[0]));
		resource.load(null);
		EcoreUtil.resolveAll(resource);
		Resource resourceAsXmi = resourceSet.createResource(URI.createURI(args[0]+".xmi"));
		resourceAsXmi.getContents().addAll(resource.getContents());
		resourceAsXmi.save(null);

	}
}

an XMI file is generated.
when I use ATL transformation, An error is generated which is
Error loading platform:/resource/CompleteOCL/Test.xmi: The class 'VisitableCS' is not a valid classifier

Note: the problem is in the java parser, and I don't find how can I extend it to generate an appropriate xmi file.
if someone wants to help me, I am truly grateful because I spent a lot of time to try to extend this parser but I don't find anything Sad
Best regards,
Fy Za
Previous Topic:[Announce] Eclipse OCL 4.0.2 (Juno) SR2 RC1 is now available
Next Topic:Accessing parent
Goto Forum:
  


Current Time: Fri Apr 19 10:56:56 GMT 2024

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

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

Back to the top