-
Notifications
You must be signed in to change notification settings - Fork 1
Alf support
Zoltán Ujhelyi edited this page Apr 23, 2015
·
6 revisions
All description here relies on the Alf integration from Papyrus 1.1.0 M6+ #High level overview and installation ##Requirements
- Install Eclipse Modeling Tools (Mars M6+) - http://www.eclipse.org/downloads/packages/eclipse-modeling-tools/marsm6
- Install Papyrus nightly build with Alf support (the Mars M6 version has some serious bugs wrt Alf support) - http://download.eclipse.org/modeling/mdt/papyrus/updates/nightly/mars/main/.
- Checkout this repository
##Executing the Alf parser tests Two set of tests are included:
- Generator Test parses Alf files and generates C++ snippets from Alf expressions.
- Scalability Test provides various sizes of test cases where the scalability of the parser can be evaluated.
Furthermore, a [launch configuration](../../blob/master/com.incquerylabs.emdw.alf.tests/AlfGeneratorTest (plug-in).launch) is also provided that executes all test cases automatically. It can be executed as a JUnit Plug-in test.
#Technical details
In the background, OCL and QVT are used for validation and AlfMapper (basically resolution)
###Dependencies
- org.eclipse.papyrus.uml.alf;bundle-version="1.1.0",
- com.google.inject, -- for Xtext API
- org.eclipse.emf.ecore,
- org.eclipse.ocl.pivot;bundle-version="1.0.0",
- org.eclipse.ocl.uml;bundle-version="5.0.100",
- org.eclipse.uml2.uml.resources;bundle-version="5.1.0",
- org.eclipse.uml2;bundle-version="5.0.0",
- org.eclipse.ocl.xtext.essentialocl;bundle-version="1.0.0",
- org.eclipse.ocl.pivot.uml;bundle-version="1.0.0", -- required for AlfMapper_ (if missing runtime exceptions are thrown)
- org.eclipse.papyrus.uml.alf.to.fuml;bundle-version="1.1.0" -- required for AlfMapper (if missing runtime exceptions are thrown)
###Initial registrations In Eclipse environment, everything should be registered if org.eclipse.papyrus.uml.alf.ui project is loaded. Otherwise, the following registrations are required:
//Once in the application
injector = new AlfStandaloneSetup().createInjectorAndDoEMFRegistration()
EssentialOCLStandaloneSetup.doSetup
OCLstdlib.install()
//Once per resourceset
OCL.initialize(resourceSet)
OCLDelegateDomain.initialize(resourceSet)
var Resource resource = this.resourceSet.createResource(URI.createURI("temp.alf"))
resource.load(new StringInputStream(input), #{})
//Running resolution
val AlfMapper mapper = new AlfMapper()
mapper.map(resource.contents)
To be researched