Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » CompleteOCL parser problem
CompleteOCL parser problem [message #1001803] Thu, 17 January 2013 11:54 Go to next message
Fi Fi is currently offline Fi FiFriend
Messages: 133
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
This topic is a continuation of this one http://www.eclipse.org/forums/index.php/t/440429/
Best regards,
Fy Za
Re: CompleteOCL parser problem [message #1006003 is a reply to message #1001803] Tue, 29 January 2013 14:20 Go to previous message
Fi Fi is currently offline Fi FiFriend
Messages: 133
Registered: March 2010
Senior Member
In order to resolve my problem,
I identify two different subjects
http://www.eclipse.org/forums/index.php/mv/msg/442759/993174/#msg_993174
and
http://www.eclipse.org/forums/index.php/mv/msg/286882/794048/#msg_794048
I 'd like verify if I am in the good way to resolve my problem.
And If there are the appropriate elements to generate AST in order to be used after by model transformations
Previous Topic:Accessing parent
Next Topic:PIVOT model and method overriding bug
Goto Forum:
  


Current Time: Sun Dec 21 19:37:55 GMT 2014

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

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