| /** |
| * <copyright> |
| * |
| * Copyright (c) 2013 Willink Transformations, University of York and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * Adolfo Sanchez-Barbudo Herrera (University of York) - initial API and implementation |
| * |
| * </copyright> |
| * |
| * |
| */ |
| module GenerateQVToCSModels |
| |
| import org.eclipse.ocl.examples.build.utilities.* |
| import org.eclipse.ocl.examples.build.xtend.* |
| import org.eclipse.emf.mwe.utils.* |
| import org.eclipse.emf.mwe.utils.* |
| import org.eclipse.emf.ecore.resource.impl.* |
| |
| /** |
| * Generate the Concrete Syntax Models used by the Xtext editors. |
| */ |
| var platformURI = ".." |
| |
| /* |
| * Base/Essential OCL Xtext models related configuration variables |
| */ |
| var oclXtextBaseProjectName = "org.eclipse.ocl.xtext.base" |
| var oclXtextBaseGenModelProjectPath = "model/BaseCS.genmodel" |
| |
| var essentialOclXtextProjectName = "org.eclipse.ocl.xtext.essentialocl" |
| var essentialOclXtextGenModelProjectPath = "model/EssentialOCLCS.genmodel" |
| /* |
| * ImperativeOCL Xtext models related configuration variables |
| */ |
| var imperativeOclXtextProjectName = "org.eclipse.qvto.examples.xtext.imperativeocl" |
| var imperativeOclXtextGenModelProjectPath = "model/ImperativeOCLCS.genmodel" |
| |
| /* |
| * QVTOperational Xtext models related configuration variables |
| */ |
| var qvtOperationalXtextProjectName = "org.eclipse.qvto.examples.xtext.qvtoperational" |
| var qvtOperationalXtextGenModelProjectPath = "model/QVTOperationalCS.genmodel" |
| |
| Workflow { |
| bean = ResourceSetImpl : resourceSet {} |
| bean = StandaloneSetup { resourceSet = resourceSet |
| platformUri = platformURI // Common path from which... |
| scanClassPath = true // ... a scan finds all classes |
| |
| uriMap = Mapping { |
| from = "platform:/plugin/org.eclipse.ocl.examples.build/" |
| to = "platform:/resource/org.eclipse.ocl.examples.build/" |
| } |
| } |
| bean = EcoreGenModelSetup { resourceSet = resourceSet } |
| |
| // component = DerivedVisitorPatternWeaver { |
| // resourceSet = resourceSet |
| // in = imperativeOclXtextEcoreURI |
| // in = essentialOclXtextEcoreURI |
| // in = oclXtextBaseEcoreURI |
| // rootVisitorInterfaceName = oclXtextBaseVisitorName |
| // rootVisitorInterfaceQualifiedName = oclXtextBaseVisitorQualifiedName |
| // superVisitorInterfaceName = essentialOclXtextVisitorName |
| // superVisitorInterfaceQualifiedName = essentialOclXtextVisitorQualifiedName |
| // derivedVisitorInterfaceName = "${imperativeOclXtextProjectPrefix}Visitor" |
| // derivedVisitorInterfaceQualifiedName = "${imperativeOclXtextProjectName}.imperativeoclcs.util.${imperativeOclXtextProjectPrefix}Visitor" |
| // } |
| |
| // component = DerivedVisitorPatternWeaver { |
| // resourceSet = resourceSet |
| // in = qvtOperationalXtextEcoreURI |
| // in = essentialOclXtextEcoreURI |
| // in = oclXtextBaseEcoreURI |
| // rootVisitorInterfaceName = oclXtextBaseVisitorName |
| // rootVisitorInterfaceQualifiedName = oclXtextBaseVisitorQualifiedName |
| // superVisitorInterfaceName = "${imperativeOclXtextProjectPrefix}Visitor" |
| // superVisitorInterfaceQualifiedName = "${imperativeOclXtextProjectName}.imperativeoclcs.util.${imperativeOclXtextProjectPrefix}Visitor" |
| // derivedVisitorInterfaceName = "${qvtOperationalXtextProjectPrefix}Visitor" |
| // derivedVisitorInterfaceQualifiedName = "${qvtOperationalXtextProjectName}.qvtoperationalcs.util.${qvtOperationalXtextProjectPrefix}Visitor" |
| // } |
| |
| // component = GenerateModel { resourceSet = resourceSet skipOnErrors = true |
| // genModel = imperativeOclXtextGenModelPath |
| // clearResourceSet = false |
| // } |
| // |
| // component = GenerateModel { resourceSet = resourceSet skipOnErrors = true |
| // genModel = qvtOperationalXtextGenModelPath |
| // clearResourceSet = false |
| // } |
| |
| // component = GenerateCS2ASVisitors { resourceSet = resourceSet |
| // genModelFile = imperativeOclXtextGenModelProjectPath // FIXME change this when changing from automatically generated MM to a manual one located in /model |
| // javaFolder = imperativeOclXtextModelJavaFolder |
| // projectName = imperativeOclXtextProjectName |
| // projectPrefix = imperativeOclXtextProjectPrefix |
| // superProjectName = imperativeOclXtextSuperProjectName |
| // superProjectPrefix = imperativeOclXtextSuperProjectPrefix |
| // superVisitorPackageName = essentialOclXtextVisitorPackage // FIXME if Essential OCL aligns with conventions |
| // superVisitorClassName = essentialOclXtextVisitorName // FIXME if Essential OCL aligns with conventions |
| // visitablePackageName = oclXtextBaseVisitablePackage |
| // visitableClassName = oclXtextBaseVisitableName |
| // } |
| |
| component = @qvto.SubGenerateCSModel { resourceSet = resourceSet |
| projectName = imperativeOclXtextProjectName |
| superProjectName = essentialOclXtextProjectName |
| baseProjectName = oclXtextBaseProjectName |
| genModelFile = imperativeOclXtextGenModelProjectPath |
| superGenModelFile = essentialOclXtextGenModelProjectPath |
| baseGenModelFile = oclXtextBaseGenModelProjectPath |
| } |
| |
| component = @qvto.SubGenerateCSModel { resourceSet = resourceSet |
| projectName = qvtOperationalXtextProjectName |
| superProjectName = imperativeOclXtextProjectName |
| baseProjectName = oclXtextBaseProjectName |
| genModelFile = qvtOperationalXtextGenModelProjectPath |
| superGenModelFile = imperativeOclXtextGenModelProjectPath |
| baseGenModelFile = oclXtextBaseGenModelProjectPath |
| } |
| |
| // component = GenerateCS2ASVisitors { resourceSet = resourceSet |
| // javaFolder = qvtOperationalXtextModelJavaFolder |
| // projectName = qvtOperationalXtextProjectName |
| // projectPrefix = qvtOperationalXtextProjectPrefix |
| // superProjectName = qvtOperationalXtextSuperProjectName |
| // superProjectPrefix = qvtOperationalXtextSuperProjectPrefix |
| // visitablePackageName = oclXtextBaseVisitablePackage |
| // visitableClassName = oclXtextBaseVisitableName |
| // } |
| } |