Merge branch 'master' into hhoyos/executors
diff --git a/.gitignore b/.gitignore
index b0bd381..823d799 100644
--- a/.gitignore
+++ b/.gitignore
@@ -90,3 +90,7 @@
# Backup files from Emacs
*~
+
+# IDE Stuff
+*.idea
+*.iml
diff --git a/plugins/org.eclipse.epsilon.emc.emf/src/org/eclipse/epsilon/emc/emf/EmfModel.java b/plugins/org.eclipse.epsilon.emc.emf/src/org/eclipse/epsilon/emc/emf/EmfModel.java
index e1a8ef2..bff5eac 100644
--- a/plugins/org.eclipse.epsilon.emc.emf/src/org/eclipse/epsilon/emc/emf/EmfModel.java
+++ b/plugins/org.eclipse.epsilon.emc.emf/src/org/eclipse/epsilon/emc/emf/EmfModel.java
@@ -27,9 +27,13 @@
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceImpl;
import org.eclipse.emf.ecore.util.EContentAdapter;
import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.ecore.xmi.XMIResource;
+import org.eclipse.emf.ecore.xmi.XMLParserPool;
import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl;
import org.eclipse.epsilon.common.util.CollectionUtil;
import org.eclipse.epsilon.common.util.StringProperties;
import org.eclipse.epsilon.eol.compile.m3.Metamodel;
@@ -124,6 +128,13 @@
protected static Map<String, Long> fileBasedMetamodelTimestamps = new HashMap<>();
+ /**
+ * Share an XML parser pool between models
+ * @since 1.6
+ */
+ private static XMLParserPool parserPool = new XMLParserPoolImpl();
+
+
@Override
public Collection<String> getPropertiesOf(String type) throws EolModelElementTypeNotFoundException {
Collection<EStructuralFeature> features = featuresForType(type);
@@ -368,6 +379,7 @@
determinePackagesFrom(resourceSet);
// Note that AbstractEmfModel#getPackageRegistry() is not usable yet, as modelImpl is not set
+ // Note that if the modelImpl is not set AbstractEmfModel#getPackageRegistry() will return the EPackage.Registry
for (EPackage ep : packages) {
String nsUri = ep.getNsURI();
if (nsUri == null || nsUri.trim().length() == 0) {
@@ -379,8 +391,15 @@
Resource model = resourceSet.createResource(modelUri);
if (this.readOnLoad) {
+ // @since 1.6
+ Map<Object, Object> emfLoadOptions = new HashMap<>();
+ emfLoadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true);
+ emfLoadOptions.put(XMLResource.OPTION_USE_PARSER_POOL, parserPool);
+ if (model instanceof ResourceImpl) {
+ ((ResourceImpl) model).setIntrinsicIDToEObjectMap(new HashMap<>());
+ }
try {
- model.load(null);
+ model.load(emfLoadOptions);
if (expand) {
EcoreUtil.resolveAll(model);
}
@@ -677,9 +696,8 @@
public boolean store() {
if (modelImpl == null) return false;
try {
- Map<String, Boolean> options = null;
+ Map<String, Boolean> options = new HashMap<>();
if (!metamodelFileUris.isEmpty()) {
- options = new HashMap<>();
options.put(XMLResource.OPTION_SCHEMA_LOCATION, true);
}
modelImpl.save(options);
diff --git a/plugins/org.eclipse.epsilon.executors.emf/.classpath b/plugins/org.eclipse.epsilon.executors.emf/.classpath
new file mode 100644
index 0000000..6a5eab8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/.classpath
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.epsilon.executors.emf/.project b/plugins/org.eclipse.epsilon.executors.emf/.project
new file mode 100644
index 0000000..c195823
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.epsilon.executors.emf</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.epsilon.executors.emf/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.epsilon.executors.emf/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.epsilon.executors.emf/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.epsilon.executors.emf/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..b8947ec
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/plugins/org.eclipse.epsilon.executors.emf/EPL-2.0.html b/plugins/org.eclipse.epsilon.executors.emf/EPL-2.0.html
new file mode 100644
index 0000000..f5d138c
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/EPL-2.0.html
@@ -0,0 +1,307 @@
+<!--
+ ~ Copyright (c) 2008-2018 The University of York.
+ ~ This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License 2.0
+ ~ which is available at https://www.eclipse.org/legal/epl-2.0/
+ -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Eclipse Public License - Version 2.0</title>
+ <style type="text/css">
+ body {
+ margin: 1.5em 3em;
+ }
+ h1{
+ font-size:1.5em;
+ }
+ h2{
+ font-size:1em;
+ margin-bottom:0.5em;
+ margin-top:1em;
+ }
+ p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ ul, ol{
+ list-style-type:none;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Eclipse Public License - v 2.0</h1>
+ <p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+ PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ </p>
+ <h2 id="definitions">1. DEFINITIONS</h2>
+ <p>“Contribution” means:</p>
+ <ul>
+ <li>a) in the case of the initial Contributor, the initial content
+ Distributed under this Agreement, and
+ </li>
+ <li>
+ b) in the case of each subsequent Contributor:
+ <ul>
+ <li>i) changes to the Program, and</li>
+ <li>ii) additions to the Program;</li>
+ </ul>
+ where such changes and/or additions to the Program originate from
+ and are Distributed by that particular Contributor. A Contribution
+ “originates” from a Contributor if it was added to the Program by such
+ Contributor itself or anyone acting on such Contributor's behalf.
+ Contributions do not include changes or additions to the Program that
+ are not Modified Works.
+ </li>
+ </ul>
+ <p>“Contributor” means any person or entity that Distributes the Program.</p>
+ <p>“Licensed Patents” mean patent claims licensable by a Contributor which
+ are necessarily infringed by the use or sale of its Contribution alone
+ or when combined with the Program.
+ </p>
+ <p>“Program” means the Contributions Distributed in accordance with this
+ Agreement.
+ </p>
+ <p>“Recipient” means anyone who receives the Program under this Agreement
+ or any Secondary License (as applicable), including Contributors.
+ </p>
+ <p>“Derivative Works” shall mean any work, whether in Source Code or other
+ form, that is based on (or derived from) the Program and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship.
+ </p>
+ <p>“Modified Works” shall mean any work in Source Code or other form that
+ results from an addition to, deletion from, or modification of the
+ contents of the Program, including, for purposes of clarity any new file
+ in Source Code form that contains any contents of the Program. Modified
+ Works shall not include works that contain only declarations, interfaces,
+ types, classes, structures, or files of the Program solely in each case
+ in order to link to, bind by name, or subclass the Program or Modified
+ Works thereof.
+ </p>
+ <p>“Distribute” means the acts of a) distributing or b) making available
+ in any manner that enables the transfer of a copy.
+ </p>
+ <p>“Source Code” means the form of a Program preferred for making
+ modifications, including but not limited to software source code,
+ documentation source, and configuration files.
+ </p>
+ <p>“Secondary License” means either the GNU General Public License,
+ Version 2.0, or any later versions of that license, including any
+ exceptions or additional permissions as identified by the initial
+ Contributor.
+ </p>
+ <h2 id="grant-of-rights">2. GRANT OF RIGHTS</h2>
+ <ul>
+ <li>a) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
+ license to reproduce, prepare Derivative Works of, publicly display,
+ publicly perform, Distribute and sublicense the Contribution of such
+ Contributor, if any, and such Derivative Works.
+ </li>
+ <li>b) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
+ license under Licensed Patents to make, use, sell, offer to sell,
+ import and otherwise transfer the Contribution of such Contributor,
+ if any, in Source Code or other form. This patent license shall
+ apply to the combination of the Contribution and the Program if,
+ at the time the Contribution is added by the Contributor, such
+ addition of the Contribution causes such combination to be covered
+ by the Licensed Patents. The patent license shall not apply to any
+ other combinations which include the Contribution. No hardware per
+ se is licensed hereunder.
+ </li>
+ <li>c) Recipient understands that although each Contributor grants the
+ licenses to its Contributions set forth herein, no assurances are
+ provided by any Contributor that the Program does not infringe the
+ patent or other intellectual property rights of any other entity.
+ Each Contributor disclaims any liability to Recipient for claims
+ brought by any other entity based on infringement of intellectual
+ property rights or otherwise. As a condition to exercising the rights
+ and licenses granted hereunder, each Recipient hereby assumes sole
+ responsibility to secure any other intellectual property rights needed,
+ if any. For example, if a third party patent license is required to
+ allow Recipient to Distribute the Program, it is Recipient's
+ responsibility to acquire that license before distributing the Program.
+ </li>
+ <li>d) Each Contributor represents that to its knowledge it has sufficient
+ copyright rights in its Contribution, if any, to grant the copyright
+ license set forth in this Agreement.
+ </li>
+ <li>e) Notwithstanding the terms of any Secondary License, no Contributor
+ makes additional grants to any Recipient (other than those set forth
+ in this Agreement) as a result of such Recipient's receipt of the
+ Program under the terms of a Secondary License (if permitted under
+ the terms of Section 3).
+ </li>
+ </ul>
+ <h2 id="requirements">3. REQUIREMENTS</h2>
+ <p>3.1 If a Contributor Distributes the Program in any form, then:</p>
+ <ul>
+ <li>a) the Program must also be made available as Source Code, in
+ accordance with section 3.2, and the Contributor must accompany
+ the Program with a statement that the Source Code for the Program
+ is available under this Agreement, and informs Recipients how to
+ obtain it in a reasonable manner on or through a medium customarily
+ used for software exchange; and
+ </li>
+ <li>
+ b) the Contributor may Distribute the Program under a license
+ different than this Agreement, provided that such license:
+ <ul>
+ <li>i) effectively disclaims on behalf of all other Contributors all
+ warranties and conditions, express and implied, including warranties
+ or conditions of title and non-infringement, and implied warranties
+ or conditions of merchantability and fitness for a particular purpose;
+ </li>
+ <li>ii) effectively excludes on behalf of all other Contributors all
+ liability for damages, including direct, indirect, special, incidental
+ and consequential damages, such as lost profits;
+ </li>
+ <li>iii) does not attempt to limit or alter the recipients' rights in the
+ Source Code under section 3.2; and
+ </li>
+ <li>iv) requires any subsequent distribution of the Program by any party
+ to be under a license that satisfies the requirements of this section 3.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>3.2 When the Program is Distributed as Source Code:</p>
+ <ul>
+ <li>a) it must be made available under this Agreement, or if the Program (i)
+ is combined with other material in a separate file or files made available
+ under a Secondary License, and (ii) the initial Contributor attached to
+ the Source Code the notice described in Exhibit A of this Agreement,
+ then the Program may be made available under the terms of such
+ Secondary Licenses, and
+ </li>
+ <li>b) a copy of this Agreement must be included with each copy of the Program.</li>
+ </ul>
+ <p>3.3 Contributors may not remove or alter any copyright, patent, trademark,
+ attribution notices, disclaimers of warranty, or limitations of liability
+ (‘notices’) contained within the Program from any copy of the Program which
+ they Distribute, provided that Contributors may add their own appropriate
+ notices.
+ </p>
+ <h2 id="commercial-distribution">4. COMMERCIAL DISTRIBUTION</h2>
+ <p>Commercial distributors of software may accept certain responsibilities
+ with respect to end users, business partners and the like. While this
+ license is intended to facilitate the commercial use of the Program, the
+ Contributor who includes the Program in a commercial product offering should
+ do so in a manner which does not create potential liability for other
+ Contributors. Therefore, if a Contributor includes the Program in a
+ commercial product offering, such Contributor (“Commercial Contributor”)
+ hereby agrees to defend and indemnify every other Contributor
+ (“Indemnified Contributor”) against any losses, damages and costs
+ (collectively “Losses”) arising from claims, lawsuits and other legal actions
+ brought by a third party against the Indemnified Contributor to the extent
+ caused by the acts or omissions of such Commercial Contributor in connection
+ with its distribution of the Program in a commercial product offering.
+ The obligations in this section do not apply to any claims or Losses relating
+ to any actual or alleged intellectual property infringement. In order to
+ qualify, an Indemnified Contributor must: a) promptly notify the
+ Commercial Contributor in writing of such claim, and b) allow the Commercial
+ Contributor to control, and cooperate with the Commercial Contributor in,
+ the defense and any related settlement negotiations. The Indemnified
+ Contributor may participate in any such claim at its own expense.
+ </p>
+ <p>For example, a Contributor might include the Program
+ in a commercial product offering, Product X. That Contributor is then a
+ Commercial Contributor. If that Commercial Contributor then makes performance
+ claims, or offers warranties related to Product X, those performance claims
+ and warranties are such Commercial Contributor's responsibility alone.
+ Under this section, the Commercial Contributor would have to defend claims
+ against the other Contributors related to those performance claims and
+ warranties, and if a court requires any other Contributor to pay any damages
+ as a result, the Commercial Contributor must pay those damages.
+ </p>
+ <h2 id="warranty">5. NO WARRANTY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+ WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+ solely responsible for determining the appropriateness of using and
+ distributing the Program and assumes all risks associated with its
+ exercise of rights under this Agreement, including but not limited to the
+ risks and costs of program errors, compliance with applicable laws, damage
+ to or loss of data, programs or equipment, and unavailability or
+ interruption of operations.
+ </p>
+ <h2 id="disclaimer">6. DISCLAIMER OF LIABILITY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY
+ LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS),
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+ GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ </p>
+ <h2 id="general">7. GENERAL</h2>
+ <p>If any provision of this Agreement is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of the
+ remainder of the terms of this Agreement, and without further action by the
+ parties hereto, such provision shall be reformed to the minimum extent
+ necessary to make such provision valid and enforceable.
+ </p>
+ <p>If Recipient institutes patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Program itself
+ (excluding combinations of the Program with other software or hardware)
+ infringes such Recipient's patent(s), then such Recipient's rights granted
+ under Section 2(b) shall terminate as of the date such litigation is filed.
+ </p>
+ <p>All Recipient's rights under this Agreement shall terminate if it fails to
+ comply with any of the material terms or conditions of this Agreement and
+ does not cure such failure in a reasonable period of time after becoming
+ aware of such noncompliance. If all Recipient's rights under this Agreement
+ terminate, Recipient agrees to cease use and distribution of the Program
+ as soon as reasonably practicable. However, Recipient's obligations under
+ this Agreement and any licenses granted by Recipient relating to the
+ Program shall continue and survive.
+ </p>
+ <p>Everyone is permitted to copy and distribute copies of this Agreement,
+ but in order to avoid inconsistency the Agreement is copyrighted and may
+ only be modified in the following manner. The Agreement Steward reserves
+ the right to publish new versions (including revisions) of this Agreement
+ from time to time. No one other than the Agreement Steward has the right
+ to modify this Agreement. The Eclipse Foundation is the initial Agreement
+ Steward. The Eclipse Foundation may assign the responsibility to serve as
+ the Agreement Steward to a suitable separate entity. Each new version of
+ the Agreement will be given a distinguishing version number. The Program
+ (including Contributions) may always be Distributed subject to the version
+ of the Agreement under which it was received. In addition, after a new
+ version of the Agreement is published, Contributor may elect to Distribute
+ the Program (including its Contributions) under the new version.
+ </p>
+ <p>Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
+ receives no rights or licenses to the intellectual property of any
+ Contributor under this Agreement, whether expressly, by implication,
+ estoppel or otherwise. All rights in the Program not expressly granted
+ under this Agreement are reserved. Nothing in this Agreement is intended
+ to be enforceable by any entity that is not a Contributor or Recipient.
+ No third-party beneficiary rights are created under this Agreement.
+ </p>
+ <h2 id="exhibit-a">Exhibit A – Form of Secondary Licenses Notice</h2>
+ <p>“This Source Code may also be made available under the following
+ Secondary Licenses when the conditions for such availability set forth
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
+ version(s), and exceptions or additional permissions here}.”
+ </p>
+ <blockquote>
+ <p>Simply including a copy of this Agreement, including this Exhibit A
+ is not sufficient to license the Source Code under Secondary Licenses.
+ </p>
+ <p>If it is not possible or desirable to put the notice in a particular file,
+ then You may include the notice in a location (such as a LICENSE file in a
+ relevant directory) where a recipient would be likely to look for
+ such a notice.
+ </p>
+ <p>You may add additional accurate notices of copyright ownership.</p>
+ </blockquote>
+ </body>
+</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.epsilon.executors.emf/META-INF/MANIFEST.MF b/plugins/org.eclipse.epsilon.executors.emf/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..95174d2
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Emf
+Bundle-SymbolicName: org.eclipse.epsilon.executors.emf
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Automatic-Module-Name: org.eclipse.epsilon.executors
+Require-Bundle: org.eclipse.epsilon.eol.engine;bundle-version="1.6.0",
+ org.eclipse.epsilon.executors;bundle-version="1.0.0",
+ org.eclipse.epsilon.emc.emf;bundle-version="1.6.0",
+ org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.xmi
+Export-Package: org.eclipse.epsilon.executors.model,
+ org.eclipse.epsilon.executors.model.util
+Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.epsilon.executors.emf/build.properties b/plugins/org.eclipse.epsilon.executors.emf/build.properties
new file mode 100644
index 0000000..a505bb8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/build.properties
@@ -0,0 +1,3 @@
+source.. = src
+bin.includes = META-INF/,\
+ .
diff --git a/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/AbstractEmfModelBuilder.java b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/AbstractEmfModelBuilder.java
new file mode 100644
index 0000000..b702141
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/AbstractEmfModelBuilder.java
@@ -0,0 +1,33 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model;
+
+import org.eclipse.epsilon.emc.emf.EmfModel;
+import org.eclipse.epsilon.executors.model.CachedModelBuilder;
+import org.eclipse.epsilon.executors.model.ICachedModelBuilder;
+
+/**
+ * Base class for EMF model builder. By default EMF models are expanded.
+ * @param <T> The type of model builder
+ * @param <M> The type of model being built
+ *
+ * @author Horacio Hoyos Rodriguez
+ * @author Beatriz Sanchez Piña
+ */
+public abstract class AbstractEmfModelBuilder<M extends EmfModel, T extends AbstractEmfModelBuilder<M, T>>
+ extends CachedModelBuilder<M, T> implements ICachedModelBuilder<M, T> {
+
+ protected boolean expand = true;
+
+ public T withExpand(boolean expand) {
+ this.expand = expand;
+ return self();
+ }
+}
diff --git a/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/EmfModelBuilder.java b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/EmfModelBuilder.java
new file mode 100644
index 0000000..ef19107
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/EmfModelBuilder.java
@@ -0,0 +1,117 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model;
+
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.epsilon.emc.emf.EmfModel;
+
+/**
+ * Implementaiton of the Emf Model Builder. By default metamodels are reused (@see {@link #reuseMetamodels}).
+ *
+ * @author Horacio Hoyos Rodriguez
+ * @author Beatriz Sanchez Piña
+ */
+public class EmfModelBuilder extends AbstractEmfModelBuilder<EmfModel, EmfModelBuilder>
+ implements IEmfModelBuilder<EmfModel, EmfModelBuilder> {
+
+ protected List<String> meteamodelUris;
+ protected List<String> fileBasedMetamodelUris;
+ protected boolean reuseMetamodels = true;
+
+ public EmfModelBuilder() {
+ meteamodelUris = new ArrayList<>();
+ fileBasedMetamodelUris = new ArrayList<>();
+ }
+
+ @Override
+ public String getName() {
+ return "Emf";
+ }
+
+ @Override
+ public EmfModelBuilder self() {
+ return this;
+ }
+
+ @Override
+ public EmfModelBuilder withName(String name) {
+ this.name = name;
+ return self();
+ }
+
+ @Override
+ public EmfModelBuilder withModelPath(Path modelpath) {
+ this.modelUri = modelpath.toString();
+ return self();
+ }
+
+ @Override
+ public EmfModelBuilder reuseUnmodifiedFileBasedMetamodels(boolean reuse) {
+ this.reuseMetamodels = reuse;
+ return self();
+ }
+
+ @Override
+ public EmfModelBuilder withMetamodelUri(String metamodelUri) {
+ this.meteamodelUris.add(metamodelUri);
+ return self();
+ }
+
+ @Override
+ public EmfModelBuilder withMetamodelUris(String... metamodelUris) {
+ this.meteamodelUris.addAll(Arrays.asList(metamodelUris));
+ return self();
+ }
+
+ @Override
+ public EmfModelBuilder withMetamodelPath(Path metamodelFile) {
+ this.fileBasedMetamodelUris.add(metamodelFile.toString());
+ return self();
+ }
+
+ @Override
+ public EmfModelBuilder withMetamodelPaths(Path... metamodelFiles) {
+ Arrays.stream(metamodelFiles).map(Path::toString).forEach(fileBasedMetamodelUris::add);
+ return self();
+ }
+
+ // Add validation
+ @Override
+ public EmfModel build() {
+ // Xcore needs to be setup for standalone
+ // Epsilon EMF needs to play nicer for this to work.
+// new org.eclipse.emf.mwe.utils.StandaloneSetup().setPlatformUri("../");
+// Injector injector = new XcoreStandaloneSetup().createInjectorAndDoEMFRegistration();
+// XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
+// resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
+// //load genmodel from class org.eclipse.emf.ecore
+// URL ecoreGenmodelResource = getClass().getResource("Ecore.genmodel");
+// URI uri = URI.createFileURI(ecoreGenmodelResource.getPath());
+// GenModel genmodel = (GenModel)resourceSet.getResource(uri, true).getContents().get(0);
+// EPackage.Registry.INSTANCE.put("platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel", genmodel);
+
+ EmfModel model = new EmfModel();
+ model.setName(name);
+ model.setReadOnLoad(this.readOnLoad);
+ model.setStoredOnDisposal(this.storeOnDisposal);
+ model.setCachingEnabled(this.useCache);
+ model.setExpand(this.expand);
+ model.setModelFile(this.modelUri);
+ model.setMetamodelUris(this.meteamodelUris);
+ model.setMetamodelFiles(this.fileBasedMetamodelUris);
+ model.setReuseUnmodifiedFileBasedMetamodels(this.reuseMetamodels);
+ return model;
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/IEmfModelBuilder.java b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/IEmfModelBuilder.java
new file mode 100644
index 0000000..c16a8e2
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/IEmfModelBuilder.java
@@ -0,0 +1,69 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model;
+
+import org.eclipse.epsilon.emc.emf.EmfModel;
+import org.eclipse.epsilon.executors.model.ICachedModelBuilder;
+
+import java.nio.file.Path;
+
+/**
+ * A ModelBuilder for EMF Models
+ * @param <T> The type of model builder
+ * @param <M> The type of model being built
+ *
+ * @author Horacio Hoyos Rodriguez
+ * @author Beatriz Sanchez Piña
+ */
+public interface IEmfModelBuilder<M extends EmfModel, T extends IEmfModelBuilder<M, T>> extends ICachedModelBuilder<M, T> {
+
+ /**
+ * Resolve proxies when loading the EMF model
+ * @param expand Set to True to resolve proxies
+ * @return the builder
+ */
+ T withExpand(boolean expand);
+
+ /**
+ * If set to <code>true</code> (the default), the model tries to reuse previously registered
+ * file-based EPackages that have not been modified since the last time they were registered.
+ * @param reuse Set to true to enable metamodel reuse
+ * @return the builder
+ */
+ T reuseUnmodifiedFileBasedMetamodels(boolean reuse);
+
+ /**
+ * Use the given metamodel URI
+ * @param metamodelUri the EMF URI to the metamodel
+ * @return the builder
+ */
+ T withMetamodelUri(String metamodelUri);
+
+ /**
+ * Use the given metamodel URIs
+ * @param metamodelUris the EMF URIs to the metamodels
+ * @return the builder
+ */
+ T withMetamodelUris(String... metamodelUris);
+
+ /**
+ * Use the given metamodel Path (file based)
+ * @param metamodelFile the Path of the metamodel file
+ * @return the builder
+ */
+ T withMetamodelPath(Path metamodelFile);
+
+ /**
+ * USe the given metamodel Paths (file based)
+ * @param metamodelFiles the Paths of the metamodel files
+ * @return the builder
+ */
+ T withMetamodelPaths(Path... metamodelFiles);
+}
diff --git a/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/IInMemoryEmfModelBuilder.java b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/IInMemoryEmfModelBuilder.java
new file mode 100644
index 0000000..32af510
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/IInMemoryEmfModelBuilder.java
@@ -0,0 +1,62 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.epsilon.emc.emf.EmfModel;
+
+// TODO: Auto-generated Javadoc
+/**
+ * A ModelBuilder for EMF Models.
+ *
+ * @author Horacio Hoyos Rodriguez
+ * @author Beatriz Sanchez Piña
+ * @param <T> The type of model builder
+ * @param <M> The type of model being built
+ */
+public interface IInMemoryEmfModelBuilder<M extends EmfModel, T extends IInMemoryEmfModelBuilder<M, T>>
+ extends ICachedModelBuilder<M, T> {
+
+ /**
+ * Use the given resource with the model
+ *
+ * @param resource the resource
+ * @return the t
+ */
+ T withResource(Resource resource);
+
+ /**
+ * Register the provided EPackages in the model's registry
+ *
+ * @param ePackages the e packages
+ * @return the t
+ */
+ T withEPackages(EPackage... ePackages);
+
+ /**
+ * Use the provided NS URIs from the global registry in the model's registry. If both NS URIs
+ * and EPackages are provided, the EPackages list will be preferred.
+ *
+ * @param nsUris the NS URIs
+ * @return the t
+ */
+ T withNsUris(String... nsUris);
+
+ /**
+ * Add a notification adapter to all objects in the model so that they get moved when their
+ * containment changes. Default true.
+ *
+ * @param enabled the enabled
+ * @return the t
+ */
+ T withContainerListenerEnabled(boolean enabled);
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/InMemoryEmfModelBuilder.java b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/InMemoryEmfModelBuilder.java
new file mode 100644
index 0000000..9738886
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/InMemoryEmfModelBuilder.java
@@ -0,0 +1,80 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.epsilon.emc.emf.InMemoryEmfModel;
+
+public class InMemoryEmfModelBuilder extends AbstractEmfModelBuilder<InMemoryEmfModel, InMemoryEmfModelBuilder>
+ implements IInMemoryEmfModelBuilder<InMemoryEmfModel, InMemoryEmfModelBuilder> {
+
+ protected Resource resource;
+ protected List<EPackage> ePackages;
+ protected List<String> nsUris;
+ protected boolean containerListener = true;
+
+
+
+ public InMemoryEmfModelBuilder() {
+ ePackages = new ArrayList<>();
+ nsUris = new ArrayList<>();
+ }
+
+ @Override
+ public InMemoryEmfModelBuilder self() {
+ return this;
+ }
+
+ @Override
+ public InMemoryEmfModel build() throws Exception {
+ if ((!ePackages.isEmpty()) && (!nsUris.isEmpty())) {
+ System.out.println("Both EPackages and nsURIs were providede, only EPackages will be used.");
+ }
+ if (name == null) {
+ name = "Model";
+ }
+ if (!ePackages.isEmpty()) {
+ return new InMemoryEmfModel(name, resource, ePackages.toArray(new EPackage[0]));
+ }
+ else {
+ return new InMemoryEmfModel(name, resource, nsUris.toArray(new String[0]));
+ }
+ }
+
+ @Override
+ public InMemoryEmfModelBuilder withResource(Resource resource) {
+ this.resource = resource;
+ return this;
+ }
+
+ @Override
+ public InMemoryEmfModelBuilder withEPackages(EPackage... ePackages) {
+ this.ePackages.addAll(Arrays.asList(ePackages));
+ return this;
+ }
+
+ @Override
+ public InMemoryEmfModelBuilder withNsUris(String... nsUris) {
+ this.nsUris.addAll(Arrays.asList(nsUris));
+ return this;
+ }
+
+ @Override
+ public InMemoryEmfModelBuilder withContainerListenerEnabled(boolean enabled) {
+ this.containerListener = enabled;
+ return this;
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/util/EmfModelUtil.java b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/util/EmfModelUtil.java
new file mode 100644
index 0000000..6c266f4
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.emf/src/org/eclipse/epsilon/executors/model/util/EmfModelUtil.java
@@ -0,0 +1,287 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.PathMatcher;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.Resource.Factory;
+import org.eclipse.emf.ecore.resource.Resource.Factory.Registry;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.XMLParserPool;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMLParserPoolImpl;
+
+
+/**
+ * Set of utility methods for working with EMF models.
+ * @author Horacio Hoyos Rodriguez
+ *
+ */
+public class EmfModelUtil {
+
+ private static XMLParserPool parserPool = new XMLParserPoolImpl();
+
+ private static Map<Object, Object> emfLoadOptions;
+ static {
+ HashMap<Object, Object> aMap = new HashMap<>();
+ aMap.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true);
+ aMap.put(XMLResource.OPTION_USE_PARSER_POOL, parserPool);
+ emfLoadOptions = Collections.unmodifiableMap(aMap);
+ }
+
+ /**
+ * Register the XMI resource factory locally into a specific ResourceSet. The ResourceSet
+ * should be created via <code>ResourceSet rs = new ResourceSetImpl();</code>
+ *
+ * @param rs the rs
+ */
+ public static void registerXMIFactoryLocally(ResourceSet rs) {
+ registerResourceFactoryLocally("xmi", new XMIResourceFactoryImpl(), rs);
+ }
+
+ /**
+ * Register the XMI resource factory globally.
+ */
+ public static void registerXMIFactoryGlobally() {
+ registerResourceFactoryGlobally("xmi", new XMIResourceFactoryImpl());
+ }
+
+ /**
+ * Register the Ecore resource factory locally into a specific ResourceSet. The ResourceSet
+ * should be created via <code>ResourceSet rs = new ResourceSetImpl();</code>
+ *
+ * @param rs the rs
+ */
+ public static void registerEcoreFactoryLocally(ResourceSet rs) {
+ registerResourceFactoryLocally("ecore", new EcoreResourceFactoryImpl(), rs);
+ }
+
+ /**
+ * Register the Ecore resource factory globally.
+ */
+ public static void registerEcoreFactoryGlobally() {
+ registerResourceFactoryGlobally("ecore", new EcoreResourceFactoryImpl());
+ }
+
+ /**
+ * Register the ".model" extension as XMI resources locally into a specific ResourceSet. The
+ * ResourceSet should be created via <code>ResourceSet rs = new ResourceSetImpl();</code>
+ *
+ * @param rs the rs
+ */
+ public static void registerModelExtensionLocally(ResourceSet rs) {
+ registerResourceFactoryLocally("model", new XMIResourceFactoryImpl(), rs);
+ }
+
+ /**
+ * Register the ".model" extension as XMI resources globally
+ */
+ public static void registerModelExtensionGlobally() {
+ registerResourceFactoryGlobally("model", new XMIResourceFactoryImpl());
+ }
+
+ /**
+ * Register a Factory for a specific extension locally.
+ *
+ * @param extension the file extension
+ * @param factory the factory to handle files with the given extension
+ * @param rs the resource set where the factory is registered
+ */
+ public static void registerResourceFactoryLocally(String extension, Factory factory, ResourceSet rs) {
+ rs.getResourceFactoryRegistry().getExtensionToFactoryMap().put(extension, factory);
+ }
+
+ /**
+ * Register a Factory for a specific extension blobally.
+ *
+ * @param extension the file extension
+ * @param factory the factory to handle files with the given extension
+ */
+ public static void registerResourceFactoryGlobally(String extension, Factory factory) {
+ Registry registry = Resource.Factory.Registry.INSTANCE;
+ registry.getExtensionToFactoryMap().put(extension, factory);
+ }
+
+ /** The matcher. */
+ public static PathMatcher matcher = FileSystems.getDefault().getPathMatcher("glob:*.ecore");
+
+
+ /**
+ * Register all the packages found in the given Ecore metamodel locally.
+ *
+ * @param location the metamodel location, must be a valid file system path
+ * @param rs the Resource Set
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ public static void registerEcoreMetamodelLocally(Path location, ResourceSet rs) throws IOException {
+ registerEcoreMetamodelLocally(location, rs, emfLoadOptions);
+ }
+
+ /**
+ * Register all the packages found in the given Ecore metamodel locally.
+ *
+ * @param location the metamodel location, must be a valid file system path
+ * @param rs the Resource Set
+ * @param options the options
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ public static void registerEcoreMetamodelLocally(
+ Path location,
+ ResourceSet rs,
+ Map<?,?> options) throws IOException {
+ if (!matcher.matches(location)) {
+ System.out.println("Attempting to load a metamodel without an *.ecore name, make sure the appropiate facotry has been registered.");
+ }
+ if (location.toString().contains("!")) {
+ throw new IllegalStateException("The provided path is jar resource, you need to copy the"
+ + " contents to a file or use the InputStream alternative method.");
+ }
+ Resource r = rs.createResource(URI.createFileURI(location.toString()));
+ r.load(options);
+ for (EObject eo : r.getContents()) {
+ if (eo instanceof EPackage) {
+ registerEPackage((EPackage) eo, rs.getPackageRegistry());
+ }
+ }
+ }
+
+ /**
+ * Register all the packages found in the given Ecore metamodel locally.
+ *
+ * @param location the metamodel location, must be a valid file system path
+ * @param rs the Resource Set
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ public static void registerEcoreMetamodelGlobally(Path location) throws IOException {
+ registerEcoreMetamodelGlobally(location, emfLoadOptions);
+ }
+
+ /**
+ * Register all the packages found in the given Ecore metamodel globally
+ *
+ * @param location the metamodel location, must be a valid file system path
+ * @param rs the Resource Set
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ public static void registerEcoreMetamodelGlobally(Path location, Map<?,?> options) throws IOException {
+ if (!matcher.matches(location)) {
+ System.out.println("Attempting to load a metamodel without an *.ecore name, make sure the appropiate facotry has been registered.");
+ }
+ if (location.toString().contains("!")) {
+ throw new IllegalStateException("The provided path is jar resource, you need to copy the"
+ + " contents to a file or use the InputStream alternative method.");
+ }
+ ResourceSet rs = new ResourceSetImpl();
+ Resource r = rs.createResource(URI.createFileURI(location.toString()));
+ r.load(options);
+ org.eclipse.emf.ecore.EPackage.Registry registry = EPackage.Registry.INSTANCE;
+ for (EObject eo : r.getContents()) {
+ if (eo instanceof EPackage) {
+ registerEPackage((EPackage) eo, registry);
+ }
+ }
+ }
+
+
+ /**
+ * Register all the packages found in the given Ecore metamodel locally. The metamodel is read
+ * from an input stream. This method is useful when loading metamodel from Class resources.
+ *
+ * @param name the name of the metamodel
+ * @param stream the input stream from with the metamodel can be loaded
+ * @param rs the Resource Set
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ public static void registerEcoreMetamodelLocally(
+ String name,
+ InputStream stream,
+ ResourceSet rs) throws IOException {
+ registerEcoreMetamodelLocally(name, stream, rs, emfLoadOptions);
+ }
+
+ /**
+ * Register all the packages found in the given Ecore metamodel locally. The metamodel is read
+ * from an input stream. This method is useful when loading metamodel from Class resources.
+ *
+ * @param name the name of the metamodel
+ * @param stream the input stream from with the metamodel can be loaded
+ * @param rs the Resource Set
+ * @param options the options
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ public static void registerEcoreMetamodelLocally(
+ String name,
+ final InputStream stream,
+ final ResourceSet rs,
+ final Map<?,?> options) throws IOException {
+ boolean append = false;
+ try {
+ String ext = name.substring(name.lastIndexOf("."));
+ if (ext.equals(".ecore")) {
+ append = true;
+ }
+ }
+ catch (IndexOutOfBoundsException ex) {
+ append = true;
+ }
+ if (append) {
+ name = name + ".ecore";
+ }
+ Resource r = rs.createResource(URI.createFileURI(name));
+ r.load(options);
+ for (EObject eo : r.getContents()) {
+ if (eo instanceof EPackage) {
+ registerEPackage((EPackage) eo, rs.getPackageRegistry());
+ }
+ }
+ }
+
+
+ /**
+ * Register the EPackage and its nested packages in the given EPackage.Registry
+ * @param ep The EPackage
+ * @param registry The Registry
+ */
+ public static void registerEPackage(EPackage ep, org.eclipse.emf.ecore.EPackage.Registry registry) {
+ registry.put(ep.getNsURI(), ep);
+ for (EPackage nep : ep.getESubpackages()) {
+ registerEPackage(nep, registry);
+ }
+ }
+
+
+ /**
+ * Register the EPackage and its nested packages in the given EPackage.Registry
+ * @param ep The EPackage
+ * @param registry The Registry
+ */
+ public static void registerEPackageGlobally(EPackage ep) {
+ org.eclipse.emf.ecore.EPackage.Registry.INSTANCE.put(ep.getNsURI(), ep);
+ for (EPackage nep : ep.getESubpackages()) {
+ registerEPackageGlobally(nep);
+ }
+ }
+
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/.classpath b/plugins/org.eclipse.epsilon.executors.simulink/.classpath
new file mode 100644
index 0000000..6a5eab8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/.classpath
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/.project b/plugins/org.eclipse.epsilon.executors.simulink/.project
new file mode 100644
index 0000000..9963f32
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.epsilon.executors.simulink</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.epsilon.executors.simulink/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.epsilon.executors.simulink/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..b8947ec
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.epsilon.executors.simulink/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/EPL-2.0.html b/plugins/org.eclipse.epsilon.executors.simulink/EPL-2.0.html
new file mode 100644
index 0000000..f5d138c
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/EPL-2.0.html
@@ -0,0 +1,307 @@
+<!--
+ ~ Copyright (c) 2008-2018 The University of York.
+ ~ This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License 2.0
+ ~ which is available at https://www.eclipse.org/legal/epl-2.0/
+ -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Eclipse Public License - Version 2.0</title>
+ <style type="text/css">
+ body {
+ margin: 1.5em 3em;
+ }
+ h1{
+ font-size:1.5em;
+ }
+ h2{
+ font-size:1em;
+ margin-bottom:0.5em;
+ margin-top:1em;
+ }
+ p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ ul, ol{
+ list-style-type:none;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Eclipse Public License - v 2.0</h1>
+ <p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+ PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ </p>
+ <h2 id="definitions">1. DEFINITIONS</h2>
+ <p>“Contribution” means:</p>
+ <ul>
+ <li>a) in the case of the initial Contributor, the initial content
+ Distributed under this Agreement, and
+ </li>
+ <li>
+ b) in the case of each subsequent Contributor:
+ <ul>
+ <li>i) changes to the Program, and</li>
+ <li>ii) additions to the Program;</li>
+ </ul>
+ where such changes and/or additions to the Program originate from
+ and are Distributed by that particular Contributor. A Contribution
+ “originates” from a Contributor if it was added to the Program by such
+ Contributor itself or anyone acting on such Contributor's behalf.
+ Contributions do not include changes or additions to the Program that
+ are not Modified Works.
+ </li>
+ </ul>
+ <p>“Contributor” means any person or entity that Distributes the Program.</p>
+ <p>“Licensed Patents” mean patent claims licensable by a Contributor which
+ are necessarily infringed by the use or sale of its Contribution alone
+ or when combined with the Program.
+ </p>
+ <p>“Program” means the Contributions Distributed in accordance with this
+ Agreement.
+ </p>
+ <p>“Recipient” means anyone who receives the Program under this Agreement
+ or any Secondary License (as applicable), including Contributors.
+ </p>
+ <p>“Derivative Works” shall mean any work, whether in Source Code or other
+ form, that is based on (or derived from) the Program and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship.
+ </p>
+ <p>“Modified Works” shall mean any work in Source Code or other form that
+ results from an addition to, deletion from, or modification of the
+ contents of the Program, including, for purposes of clarity any new file
+ in Source Code form that contains any contents of the Program. Modified
+ Works shall not include works that contain only declarations, interfaces,
+ types, classes, structures, or files of the Program solely in each case
+ in order to link to, bind by name, or subclass the Program or Modified
+ Works thereof.
+ </p>
+ <p>“Distribute” means the acts of a) distributing or b) making available
+ in any manner that enables the transfer of a copy.
+ </p>
+ <p>“Source Code” means the form of a Program preferred for making
+ modifications, including but not limited to software source code,
+ documentation source, and configuration files.
+ </p>
+ <p>“Secondary License” means either the GNU General Public License,
+ Version 2.0, or any later versions of that license, including any
+ exceptions or additional permissions as identified by the initial
+ Contributor.
+ </p>
+ <h2 id="grant-of-rights">2. GRANT OF RIGHTS</h2>
+ <ul>
+ <li>a) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
+ license to reproduce, prepare Derivative Works of, publicly display,
+ publicly perform, Distribute and sublicense the Contribution of such
+ Contributor, if any, and such Derivative Works.
+ </li>
+ <li>b) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
+ license under Licensed Patents to make, use, sell, offer to sell,
+ import and otherwise transfer the Contribution of such Contributor,
+ if any, in Source Code or other form. This patent license shall
+ apply to the combination of the Contribution and the Program if,
+ at the time the Contribution is added by the Contributor, such
+ addition of the Contribution causes such combination to be covered
+ by the Licensed Patents. The patent license shall not apply to any
+ other combinations which include the Contribution. No hardware per
+ se is licensed hereunder.
+ </li>
+ <li>c) Recipient understands that although each Contributor grants the
+ licenses to its Contributions set forth herein, no assurances are
+ provided by any Contributor that the Program does not infringe the
+ patent or other intellectual property rights of any other entity.
+ Each Contributor disclaims any liability to Recipient for claims
+ brought by any other entity based on infringement of intellectual
+ property rights or otherwise. As a condition to exercising the rights
+ and licenses granted hereunder, each Recipient hereby assumes sole
+ responsibility to secure any other intellectual property rights needed,
+ if any. For example, if a third party patent license is required to
+ allow Recipient to Distribute the Program, it is Recipient's
+ responsibility to acquire that license before distributing the Program.
+ </li>
+ <li>d) Each Contributor represents that to its knowledge it has sufficient
+ copyright rights in its Contribution, if any, to grant the copyright
+ license set forth in this Agreement.
+ </li>
+ <li>e) Notwithstanding the terms of any Secondary License, no Contributor
+ makes additional grants to any Recipient (other than those set forth
+ in this Agreement) as a result of such Recipient's receipt of the
+ Program under the terms of a Secondary License (if permitted under
+ the terms of Section 3).
+ </li>
+ </ul>
+ <h2 id="requirements">3. REQUIREMENTS</h2>
+ <p>3.1 If a Contributor Distributes the Program in any form, then:</p>
+ <ul>
+ <li>a) the Program must also be made available as Source Code, in
+ accordance with section 3.2, and the Contributor must accompany
+ the Program with a statement that the Source Code for the Program
+ is available under this Agreement, and informs Recipients how to
+ obtain it in a reasonable manner on or through a medium customarily
+ used for software exchange; and
+ </li>
+ <li>
+ b) the Contributor may Distribute the Program under a license
+ different than this Agreement, provided that such license:
+ <ul>
+ <li>i) effectively disclaims on behalf of all other Contributors all
+ warranties and conditions, express and implied, including warranties
+ or conditions of title and non-infringement, and implied warranties
+ or conditions of merchantability and fitness for a particular purpose;
+ </li>
+ <li>ii) effectively excludes on behalf of all other Contributors all
+ liability for damages, including direct, indirect, special, incidental
+ and consequential damages, such as lost profits;
+ </li>
+ <li>iii) does not attempt to limit or alter the recipients' rights in the
+ Source Code under section 3.2; and
+ </li>
+ <li>iv) requires any subsequent distribution of the Program by any party
+ to be under a license that satisfies the requirements of this section 3.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>3.2 When the Program is Distributed as Source Code:</p>
+ <ul>
+ <li>a) it must be made available under this Agreement, or if the Program (i)
+ is combined with other material in a separate file or files made available
+ under a Secondary License, and (ii) the initial Contributor attached to
+ the Source Code the notice described in Exhibit A of this Agreement,
+ then the Program may be made available under the terms of such
+ Secondary Licenses, and
+ </li>
+ <li>b) a copy of this Agreement must be included with each copy of the Program.</li>
+ </ul>
+ <p>3.3 Contributors may not remove or alter any copyright, patent, trademark,
+ attribution notices, disclaimers of warranty, or limitations of liability
+ (‘notices’) contained within the Program from any copy of the Program which
+ they Distribute, provided that Contributors may add their own appropriate
+ notices.
+ </p>
+ <h2 id="commercial-distribution">4. COMMERCIAL DISTRIBUTION</h2>
+ <p>Commercial distributors of software may accept certain responsibilities
+ with respect to end users, business partners and the like. While this
+ license is intended to facilitate the commercial use of the Program, the
+ Contributor who includes the Program in a commercial product offering should
+ do so in a manner which does not create potential liability for other
+ Contributors. Therefore, if a Contributor includes the Program in a
+ commercial product offering, such Contributor (“Commercial Contributor”)
+ hereby agrees to defend and indemnify every other Contributor
+ (“Indemnified Contributor”) against any losses, damages and costs
+ (collectively “Losses”) arising from claims, lawsuits and other legal actions
+ brought by a third party against the Indemnified Contributor to the extent
+ caused by the acts or omissions of such Commercial Contributor in connection
+ with its distribution of the Program in a commercial product offering.
+ The obligations in this section do not apply to any claims or Losses relating
+ to any actual or alleged intellectual property infringement. In order to
+ qualify, an Indemnified Contributor must: a) promptly notify the
+ Commercial Contributor in writing of such claim, and b) allow the Commercial
+ Contributor to control, and cooperate with the Commercial Contributor in,
+ the defense and any related settlement negotiations. The Indemnified
+ Contributor may participate in any such claim at its own expense.
+ </p>
+ <p>For example, a Contributor might include the Program
+ in a commercial product offering, Product X. That Contributor is then a
+ Commercial Contributor. If that Commercial Contributor then makes performance
+ claims, or offers warranties related to Product X, those performance claims
+ and warranties are such Commercial Contributor's responsibility alone.
+ Under this section, the Commercial Contributor would have to defend claims
+ against the other Contributors related to those performance claims and
+ warranties, and if a court requires any other Contributor to pay any damages
+ as a result, the Commercial Contributor must pay those damages.
+ </p>
+ <h2 id="warranty">5. NO WARRANTY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+ WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+ solely responsible for determining the appropriateness of using and
+ distributing the Program and assumes all risks associated with its
+ exercise of rights under this Agreement, including but not limited to the
+ risks and costs of program errors, compliance with applicable laws, damage
+ to or loss of data, programs or equipment, and unavailability or
+ interruption of operations.
+ </p>
+ <h2 id="disclaimer">6. DISCLAIMER OF LIABILITY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY
+ LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS),
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+ GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ </p>
+ <h2 id="general">7. GENERAL</h2>
+ <p>If any provision of this Agreement is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of the
+ remainder of the terms of this Agreement, and without further action by the
+ parties hereto, such provision shall be reformed to the minimum extent
+ necessary to make such provision valid and enforceable.
+ </p>
+ <p>If Recipient institutes patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Program itself
+ (excluding combinations of the Program with other software or hardware)
+ infringes such Recipient's patent(s), then such Recipient's rights granted
+ under Section 2(b) shall terminate as of the date such litigation is filed.
+ </p>
+ <p>All Recipient's rights under this Agreement shall terminate if it fails to
+ comply with any of the material terms or conditions of this Agreement and
+ does not cure such failure in a reasonable period of time after becoming
+ aware of such noncompliance. If all Recipient's rights under this Agreement
+ terminate, Recipient agrees to cease use and distribution of the Program
+ as soon as reasonably practicable. However, Recipient's obligations under
+ this Agreement and any licenses granted by Recipient relating to the
+ Program shall continue and survive.
+ </p>
+ <p>Everyone is permitted to copy and distribute copies of this Agreement,
+ but in order to avoid inconsistency the Agreement is copyrighted and may
+ only be modified in the following manner. The Agreement Steward reserves
+ the right to publish new versions (including revisions) of this Agreement
+ from time to time. No one other than the Agreement Steward has the right
+ to modify this Agreement. The Eclipse Foundation is the initial Agreement
+ Steward. The Eclipse Foundation may assign the responsibility to serve as
+ the Agreement Steward to a suitable separate entity. Each new version of
+ the Agreement will be given a distinguishing version number. The Program
+ (including Contributions) may always be Distributed subject to the version
+ of the Agreement under which it was received. In addition, after a new
+ version of the Agreement is published, Contributor may elect to Distribute
+ the Program (including its Contributions) under the new version.
+ </p>
+ <p>Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
+ receives no rights or licenses to the intellectual property of any
+ Contributor under this Agreement, whether expressly, by implication,
+ estoppel or otherwise. All rights in the Program not expressly granted
+ under this Agreement are reserved. Nothing in this Agreement is intended
+ to be enforceable by any entity that is not a Contributor or Recipient.
+ No third-party beneficiary rights are created under this Agreement.
+ </p>
+ <h2 id="exhibit-a">Exhibit A – Form of Secondary Licenses Notice</h2>
+ <p>“This Source Code may also be made available under the following
+ Secondary Licenses when the conditions for such availability set forth
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
+ version(s), and exceptions or additional permissions here}.”
+ </p>
+ <blockquote>
+ <p>Simply including a copy of this Agreement, including this Exhibit A
+ is not sufficient to license the Source Code under Secondary Licenses.
+ </p>
+ <p>If it is not possible or desirable to put the notice in a particular file,
+ then You may include the notice in a location (such as a LICENSE file in a
+ relevant directory) where a recipient would be likely to look for
+ such a notice.
+ </p>
+ <p>You may add additional accurate notices of copyright ownership.</p>
+ </blockquote>
+ </body>
+</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/META-INF/MANIFEST.MF b/plugins/org.eclipse.epsilon.executors.simulink/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..5eec937
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Simulink
+Bundle-SymbolicName: org.eclipse.epsilon.executors.simulink
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Automatic-Module-Name: org.eclipse.epsilon.executors
+Export-Package: org.eclipse.epsilon.engine.standalone.simulink
+Require-Bundle: org.eclipse.epsilon.eol.engine;bundle-version="1.6.0",
+ org.eclipse.epsilon.executors;bundle-version="1.0.0",
+ org.eclipse.epsilon.emc.simulink;bundle-version="1.6.0"
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/build.properties b/plugins/org.eclipse.epsilon.executors.simulink/build.properties
new file mode 100644
index 0000000..a505bb8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/build.properties
@@ -0,0 +1,3 @@
+source.. = src
+bin.includes = META-INF/,\
+ .
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/src/org/eclipse/epsilon/engine/standalone/simulink/ISimulinkModelBuilder.java b/plugins/org.eclipse.epsilon.executors.simulink/src/org/eclipse/epsilon/engine/standalone/simulink/ISimulinkModelBuilder.java
new file mode 100644
index 0000000..31a93ba
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/src/org/eclipse/epsilon/engine/standalone/simulink/ISimulinkModelBuilder.java
@@ -0,0 +1,27 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.engine.standalone.simulink;
+
+import java.io.File;
+
+import org.eclipse.epsilon.emc.simulink.model.SimulinkModel;
+import org.eclipse.epsilon.executors.model.ICachedModelBuilder;
+
+public interface ISimulinkModelBuilder<T extends ISimulinkModelBuilder<T>> extends ICachedModelBuilder<SimulinkModel, T> {
+
+ T engineJarPath(String engineJarPath);
+
+ T showMatlabEditor(boolean hiddenEditor);
+
+ T file(File file);
+
+ T libraryPath(String libraryPath);
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors.simulink/src/org/eclipse/epsilon/engine/standalone/simulink/SimulinkModelBuilder.java b/plugins/org.eclipse.epsilon.executors.simulink/src/org/eclipse/epsilon/engine/standalone/simulink/SimulinkModelBuilder.java
new file mode 100644
index 0000000..69f28da
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.simulink/src/org/eclipse/epsilon/engine/standalone/simulink/SimulinkModelBuilder.java
@@ -0,0 +1,72 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.engine.standalone.simulink;
+
+import java.io.File;
+
+import org.eclipse.epsilon.emc.simulink.model.SimulinkModel;
+import org.eclipse.epsilon.executors.model.CachedModelBuilder;
+
+
+public class SimulinkModelBuilder extends CachedModelBuilder<SimulinkModel, SimulinkModelBuilder>
+ implements ISimulinkModelBuilder<SimulinkModelBuilder> {
+
+ private String engineJarPath;
+ private String libraryPath;
+ private File file;
+ private boolean showEditor = true;
+
+ public SimulinkModelBuilder() {}
+
+ @Override
+ public SimulinkModelBuilder engineJarPath(String engineJarPath) {
+ this.engineJarPath = engineJarPath;
+ return self();
+ }
+
+ @Override
+ public SimulinkModelBuilder showMatlabEditor(boolean hiddenEditor) {
+ this.showEditor = hiddenEditor;
+ return self();
+ }
+
+ @Override
+ public SimulinkModelBuilder libraryPath(String libraryPath) {
+ this.libraryPath = libraryPath;
+ return self();
+ }
+
+ @Override
+ public SimulinkModelBuilder file(File file) {
+ this.file = file;
+ return self();
+ }
+
+ @Override
+ public SimulinkModel build() throws Exception {
+ SimulinkModel model = new SimulinkModel();
+ model.setName(name);
+ model.setReadOnLoad(this.readOnLoad);
+ model.setStoredOnDisposal(this.storeOnDisposal);
+ model.setCachingEnabled(this.useCache);
+ model.setEngineJarPath(this.engineJarPath);
+ model.setLibraryPath(this.libraryPath);
+ model.setShowInMatlabEditor(this.showEditor);
+ model.setFile(this.file);
+ return model;
+ }
+
+ @Override
+ public SimulinkModelBuilder self() {
+ return this;
+ }
+
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.classpath b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.classpath
new file mode 100644
index 0000000..6a5eab8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.classpath
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.project b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.project
new file mode 100644
index 0000000..1365f6f
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.epsilon.executors.spreadsheets.excel</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..b8947ec
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/EPL-2.0.html b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/EPL-2.0.html
new file mode 100644
index 0000000..f5d138c
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/EPL-2.0.html
@@ -0,0 +1,307 @@
+<!--
+ ~ Copyright (c) 2008-2018 The University of York.
+ ~ This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License 2.0
+ ~ which is available at https://www.eclipse.org/legal/epl-2.0/
+ -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Eclipse Public License - Version 2.0</title>
+ <style type="text/css">
+ body {
+ margin: 1.5em 3em;
+ }
+ h1{
+ font-size:1.5em;
+ }
+ h2{
+ font-size:1em;
+ margin-bottom:0.5em;
+ margin-top:1em;
+ }
+ p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ ul, ol{
+ list-style-type:none;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Eclipse Public License - v 2.0</h1>
+ <p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+ PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ </p>
+ <h2 id="definitions">1. DEFINITIONS</h2>
+ <p>“Contribution” means:</p>
+ <ul>
+ <li>a) in the case of the initial Contributor, the initial content
+ Distributed under this Agreement, and
+ </li>
+ <li>
+ b) in the case of each subsequent Contributor:
+ <ul>
+ <li>i) changes to the Program, and</li>
+ <li>ii) additions to the Program;</li>
+ </ul>
+ where such changes and/or additions to the Program originate from
+ and are Distributed by that particular Contributor. A Contribution
+ “originates” from a Contributor if it was added to the Program by such
+ Contributor itself or anyone acting on such Contributor's behalf.
+ Contributions do not include changes or additions to the Program that
+ are not Modified Works.
+ </li>
+ </ul>
+ <p>“Contributor” means any person or entity that Distributes the Program.</p>
+ <p>“Licensed Patents” mean patent claims licensable by a Contributor which
+ are necessarily infringed by the use or sale of its Contribution alone
+ or when combined with the Program.
+ </p>
+ <p>“Program” means the Contributions Distributed in accordance with this
+ Agreement.
+ </p>
+ <p>“Recipient” means anyone who receives the Program under this Agreement
+ or any Secondary License (as applicable), including Contributors.
+ </p>
+ <p>“Derivative Works” shall mean any work, whether in Source Code or other
+ form, that is based on (or derived from) the Program and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship.
+ </p>
+ <p>“Modified Works” shall mean any work in Source Code or other form that
+ results from an addition to, deletion from, or modification of the
+ contents of the Program, including, for purposes of clarity any new file
+ in Source Code form that contains any contents of the Program. Modified
+ Works shall not include works that contain only declarations, interfaces,
+ types, classes, structures, or files of the Program solely in each case
+ in order to link to, bind by name, or subclass the Program or Modified
+ Works thereof.
+ </p>
+ <p>“Distribute” means the acts of a) distributing or b) making available
+ in any manner that enables the transfer of a copy.
+ </p>
+ <p>“Source Code” means the form of a Program preferred for making
+ modifications, including but not limited to software source code,
+ documentation source, and configuration files.
+ </p>
+ <p>“Secondary License” means either the GNU General Public License,
+ Version 2.0, or any later versions of that license, including any
+ exceptions or additional permissions as identified by the initial
+ Contributor.
+ </p>
+ <h2 id="grant-of-rights">2. GRANT OF RIGHTS</h2>
+ <ul>
+ <li>a) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
+ license to reproduce, prepare Derivative Works of, publicly display,
+ publicly perform, Distribute and sublicense the Contribution of such
+ Contributor, if any, and such Derivative Works.
+ </li>
+ <li>b) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
+ license under Licensed Patents to make, use, sell, offer to sell,
+ import and otherwise transfer the Contribution of such Contributor,
+ if any, in Source Code or other form. This patent license shall
+ apply to the combination of the Contribution and the Program if,
+ at the time the Contribution is added by the Contributor, such
+ addition of the Contribution causes such combination to be covered
+ by the Licensed Patents. The patent license shall not apply to any
+ other combinations which include the Contribution. No hardware per
+ se is licensed hereunder.
+ </li>
+ <li>c) Recipient understands that although each Contributor grants the
+ licenses to its Contributions set forth herein, no assurances are
+ provided by any Contributor that the Program does not infringe the
+ patent or other intellectual property rights of any other entity.
+ Each Contributor disclaims any liability to Recipient for claims
+ brought by any other entity based on infringement of intellectual
+ property rights or otherwise. As a condition to exercising the rights
+ and licenses granted hereunder, each Recipient hereby assumes sole
+ responsibility to secure any other intellectual property rights needed,
+ if any. For example, if a third party patent license is required to
+ allow Recipient to Distribute the Program, it is Recipient's
+ responsibility to acquire that license before distributing the Program.
+ </li>
+ <li>d) Each Contributor represents that to its knowledge it has sufficient
+ copyright rights in its Contribution, if any, to grant the copyright
+ license set forth in this Agreement.
+ </li>
+ <li>e) Notwithstanding the terms of any Secondary License, no Contributor
+ makes additional grants to any Recipient (other than those set forth
+ in this Agreement) as a result of such Recipient's receipt of the
+ Program under the terms of a Secondary License (if permitted under
+ the terms of Section 3).
+ </li>
+ </ul>
+ <h2 id="requirements">3. REQUIREMENTS</h2>
+ <p>3.1 If a Contributor Distributes the Program in any form, then:</p>
+ <ul>
+ <li>a) the Program must also be made available as Source Code, in
+ accordance with section 3.2, and the Contributor must accompany
+ the Program with a statement that the Source Code for the Program
+ is available under this Agreement, and informs Recipients how to
+ obtain it in a reasonable manner on or through a medium customarily
+ used for software exchange; and
+ </li>
+ <li>
+ b) the Contributor may Distribute the Program under a license
+ different than this Agreement, provided that such license:
+ <ul>
+ <li>i) effectively disclaims on behalf of all other Contributors all
+ warranties and conditions, express and implied, including warranties
+ or conditions of title and non-infringement, and implied warranties
+ or conditions of merchantability and fitness for a particular purpose;
+ </li>
+ <li>ii) effectively excludes on behalf of all other Contributors all
+ liability for damages, including direct, indirect, special, incidental
+ and consequential damages, such as lost profits;
+ </li>
+ <li>iii) does not attempt to limit or alter the recipients' rights in the
+ Source Code under section 3.2; and
+ </li>
+ <li>iv) requires any subsequent distribution of the Program by any party
+ to be under a license that satisfies the requirements of this section 3.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>3.2 When the Program is Distributed as Source Code:</p>
+ <ul>
+ <li>a) it must be made available under this Agreement, or if the Program (i)
+ is combined with other material in a separate file or files made available
+ under a Secondary License, and (ii) the initial Contributor attached to
+ the Source Code the notice described in Exhibit A of this Agreement,
+ then the Program may be made available under the terms of such
+ Secondary Licenses, and
+ </li>
+ <li>b) a copy of this Agreement must be included with each copy of the Program.</li>
+ </ul>
+ <p>3.3 Contributors may not remove or alter any copyright, patent, trademark,
+ attribution notices, disclaimers of warranty, or limitations of liability
+ (‘notices’) contained within the Program from any copy of the Program which
+ they Distribute, provided that Contributors may add their own appropriate
+ notices.
+ </p>
+ <h2 id="commercial-distribution">4. COMMERCIAL DISTRIBUTION</h2>
+ <p>Commercial distributors of software may accept certain responsibilities
+ with respect to end users, business partners and the like. While this
+ license is intended to facilitate the commercial use of the Program, the
+ Contributor who includes the Program in a commercial product offering should
+ do so in a manner which does not create potential liability for other
+ Contributors. Therefore, if a Contributor includes the Program in a
+ commercial product offering, such Contributor (“Commercial Contributor”)
+ hereby agrees to defend and indemnify every other Contributor
+ (“Indemnified Contributor”) against any losses, damages and costs
+ (collectively “Losses”) arising from claims, lawsuits and other legal actions
+ brought by a third party against the Indemnified Contributor to the extent
+ caused by the acts or omissions of such Commercial Contributor in connection
+ with its distribution of the Program in a commercial product offering.
+ The obligations in this section do not apply to any claims or Losses relating
+ to any actual or alleged intellectual property infringement. In order to
+ qualify, an Indemnified Contributor must: a) promptly notify the
+ Commercial Contributor in writing of such claim, and b) allow the Commercial
+ Contributor to control, and cooperate with the Commercial Contributor in,
+ the defense and any related settlement negotiations. The Indemnified
+ Contributor may participate in any such claim at its own expense.
+ </p>
+ <p>For example, a Contributor might include the Program
+ in a commercial product offering, Product X. That Contributor is then a
+ Commercial Contributor. If that Commercial Contributor then makes performance
+ claims, or offers warranties related to Product X, those performance claims
+ and warranties are such Commercial Contributor's responsibility alone.
+ Under this section, the Commercial Contributor would have to defend claims
+ against the other Contributors related to those performance claims and
+ warranties, and if a court requires any other Contributor to pay any damages
+ as a result, the Commercial Contributor must pay those damages.
+ </p>
+ <h2 id="warranty">5. NO WARRANTY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+ WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+ solely responsible for determining the appropriateness of using and
+ distributing the Program and assumes all risks associated with its
+ exercise of rights under this Agreement, including but not limited to the
+ risks and costs of program errors, compliance with applicable laws, damage
+ to or loss of data, programs or equipment, and unavailability or
+ interruption of operations.
+ </p>
+ <h2 id="disclaimer">6. DISCLAIMER OF LIABILITY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY
+ LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS),
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+ GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ </p>
+ <h2 id="general">7. GENERAL</h2>
+ <p>If any provision of this Agreement is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of the
+ remainder of the terms of this Agreement, and without further action by the
+ parties hereto, such provision shall be reformed to the minimum extent
+ necessary to make such provision valid and enforceable.
+ </p>
+ <p>If Recipient institutes patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Program itself
+ (excluding combinations of the Program with other software or hardware)
+ infringes such Recipient's patent(s), then such Recipient's rights granted
+ under Section 2(b) shall terminate as of the date such litigation is filed.
+ </p>
+ <p>All Recipient's rights under this Agreement shall terminate if it fails to
+ comply with any of the material terms or conditions of this Agreement and
+ does not cure such failure in a reasonable period of time after becoming
+ aware of such noncompliance. If all Recipient's rights under this Agreement
+ terminate, Recipient agrees to cease use and distribution of the Program
+ as soon as reasonably practicable. However, Recipient's obligations under
+ this Agreement and any licenses granted by Recipient relating to the
+ Program shall continue and survive.
+ </p>
+ <p>Everyone is permitted to copy and distribute copies of this Agreement,
+ but in order to avoid inconsistency the Agreement is copyrighted and may
+ only be modified in the following manner. The Agreement Steward reserves
+ the right to publish new versions (including revisions) of this Agreement
+ from time to time. No one other than the Agreement Steward has the right
+ to modify this Agreement. The Eclipse Foundation is the initial Agreement
+ Steward. The Eclipse Foundation may assign the responsibility to serve as
+ the Agreement Steward to a suitable separate entity. Each new version of
+ the Agreement will be given a distinguishing version number. The Program
+ (including Contributions) may always be Distributed subject to the version
+ of the Agreement under which it was received. In addition, after a new
+ version of the Agreement is published, Contributor may elect to Distribute
+ the Program (including its Contributions) under the new version.
+ </p>
+ <p>Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
+ receives no rights or licenses to the intellectual property of any
+ Contributor under this Agreement, whether expressly, by implication,
+ estoppel or otherwise. All rights in the Program not expressly granted
+ under this Agreement are reserved. Nothing in this Agreement is intended
+ to be enforceable by any entity that is not a Contributor or Recipient.
+ No third-party beneficiary rights are created under this Agreement.
+ </p>
+ <h2 id="exhibit-a">Exhibit A – Form of Secondary Licenses Notice</h2>
+ <p>“This Source Code may also be made available under the following
+ Secondary Licenses when the conditions for such availability set forth
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
+ version(s), and exceptions or additional permissions here}.”
+ </p>
+ <blockquote>
+ <p>Simply including a copy of this Agreement, including this Exhibit A
+ is not sufficient to license the Source Code under Secondary Licenses.
+ </p>
+ <p>If it is not possible or desirable to put the notice in a particular file,
+ then You may include the notice in a location (such as a LICENSE file in a
+ relevant directory) where a recipient would be likely to look for
+ such a notice.
+ </p>
+ <p>You may add additional accurate notices of copyright ownership.</p>
+ </blockquote>
+ </body>
+</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/META-INF/MANIFEST.MF b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..f3bc80f
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/META-INF/MANIFEST.MF
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Excel
+Bundle-SymbolicName: org.eclipse.epsilon.executors.spreadsheets.excel
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Automatic-Module-Name: org.eclipse.epsilon.executors
+Export-Package: org.eclipse.epsilon.executors.spreadsheets.excel
+Require-Bundle: org.apache.poi_3.10.1;bundle-version="3.10.1",
+ org.eclipse.epsilon.eol.engine;bundle-version="1.6.0",
+ org.eclipse.epsilon.emc.spreadsheets;bundle-version="1.6.0",
+ org.eclipse.epsilon.emc.spreadsheets.excel;bundle-version="1.6.0",
+ org.eclipse.epsilon.executors;bundle-version="1.0.0",
+ org.eclipse.epsilon.executors.spreadsheets
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/build.properties b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/build.properties
new file mode 100644
index 0000000..a505bb8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/build.properties
@@ -0,0 +1,3 @@
+source.. = src
+bin.includes = META-INF/,\
+ .
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/src/org/eclipse/epsilon/executors/spreadsheets/excel/ExcelModelBuilder.java b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/src/org/eclipse/epsilon/executors/spreadsheets/excel/ExcelModelBuilder.java
new file mode 100644
index 0000000..da88f27
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/src/org/eclipse/epsilon/executors/spreadsheets/excel/ExcelModelBuilder.java
@@ -0,0 +1,83 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.spreadsheets.excel;
+
+import java.io.File;
+
+import org.apache.poi.ss.usermodel.Workbook;
+import org.eclipse.epsilon.emc.spreadsheets.SpreadsheetReference;
+import org.eclipse.epsilon.emc.spreadsheets.SpreadsheetWorksheet;
+import org.eclipse.epsilon.emc.spreadsheets.excel.ExcelModel;
+import org.eclipse.epsilon.executors.spreadsheets.SpreadsheetModelBuilder;
+
+
+public class ExcelModelBuilder extends SpreadsheetModelBuilder<ExcelModel, ExcelModelBuilder>
+ implements IExcelModelBuilder<ExcelModelBuilder> {
+
+ protected Workbook workbook;
+ private File spreadsheetFile;
+ private File configurationFile;
+ private String password;
+
+ public ExcelModelBuilder() {
+ super();
+ }
+
+ @Override
+ public ExcelModel build() throws Exception {
+ ExcelModel model = new ExcelModel();
+ // From Model
+ model.setName(this.name);
+ model.setReadOnLoad(this.readOnLoad);
+ model.setStoredOnDisposal(this.storeOnDisposal);
+ // From Spreadsheet Model
+ for (SpreadsheetReference reference : this.references) {
+ model.addReference(reference);
+ }
+ for (SpreadsheetWorksheet worksheet : this.worksheets) {
+ model.addWorksheet(worksheet);
+ }
+ // From Excel Spreadsheet Model
+ model.setConfigurationFile(this.configurationFile.getAbsolutePath());
+ model.setPassword(this.password);
+ model.setSpreadsheetFile(this.spreadsheetFile.getAbsolutePath());
+
+ return model;
+ }
+
+ @Override
+ public ExcelModelBuilder setWorkbook(Workbook workbook) {
+ this.workbook = workbook;
+ return self();
+ }
+
+ @Override
+ public ExcelModelBuilder setSpreadsheetFile(File spreadsheetFile) {
+ this.spreadsheetFile = spreadsheetFile;
+ return self();
+ }
+
+ @Override
+ public ExcelModelBuilder setConfgurationFile(File configurationFile) {
+ this.configurationFile = configurationFile;
+ return self();
+ }
+
+ @Override
+ public ExcelModelBuilder setPassword(String password) {
+ this.password = password;
+ return self();
+ }
+
+ @Override
+ public ExcelModelBuilder self() {
+ return this;
+ }
+}
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/src/org/eclipse/epsilon/executors/spreadsheets/excel/IExcelModelBuilder.java b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/src/org/eclipse/epsilon/executors/spreadsheets/excel/IExcelModelBuilder.java
new file mode 100644
index 0000000..d71323a
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets.excel/src/org/eclipse/epsilon/executors/spreadsheets/excel/IExcelModelBuilder.java
@@ -0,0 +1,28 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.spreadsheets.excel;
+
+import java.io.File;
+
+import org.apache.poi.ss.usermodel.Workbook;
+import org.eclipse.epsilon.emc.spreadsheets.excel.ExcelModel;
+import org.eclipse.epsilon.executors.spreadsheets.ISpreadsheetModelBuilder;
+
+public interface IExcelModelBuilder<T extends IExcelModelBuilder<T>> extends ISpreadsheetModelBuilder<ExcelModel, T> {
+
+ T setWorkbook(Workbook workbook);
+
+ T setSpreadsheetFile(File spreadsheetFile);
+
+ T setConfgurationFile(File configurationFile);
+
+ T setPassword(String password);
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/.classpath b/plugins/org.eclipse.epsilon.executors.spreadsheets/.classpath
new file mode 100644
index 0000000..6a5eab8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/.classpath
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/.project b/plugins/org.eclipse.epsilon.executors.spreadsheets/.project
new file mode 100644
index 0000000..07fda35
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.epsilon.executors.spreadsheets</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.epsilon.executors.spreadsheets/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.epsilon.executors.spreadsheets/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..b8947ec
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.epsilon.executors.spreadsheets/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/EPL-2.0.html b/plugins/org.eclipse.epsilon.executors.spreadsheets/EPL-2.0.html
new file mode 100644
index 0000000..f5d138c
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/EPL-2.0.html
@@ -0,0 +1,307 @@
+<!--
+ ~ Copyright (c) 2008-2018 The University of York.
+ ~ This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License 2.0
+ ~ which is available at https://www.eclipse.org/legal/epl-2.0/
+ -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Eclipse Public License - Version 2.0</title>
+ <style type="text/css">
+ body {
+ margin: 1.5em 3em;
+ }
+ h1{
+ font-size:1.5em;
+ }
+ h2{
+ font-size:1em;
+ margin-bottom:0.5em;
+ margin-top:1em;
+ }
+ p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ ul, ol{
+ list-style-type:none;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Eclipse Public License - v 2.0</h1>
+ <p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+ PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ </p>
+ <h2 id="definitions">1. DEFINITIONS</h2>
+ <p>“Contribution” means:</p>
+ <ul>
+ <li>a) in the case of the initial Contributor, the initial content
+ Distributed under this Agreement, and
+ </li>
+ <li>
+ b) in the case of each subsequent Contributor:
+ <ul>
+ <li>i) changes to the Program, and</li>
+ <li>ii) additions to the Program;</li>
+ </ul>
+ where such changes and/or additions to the Program originate from
+ and are Distributed by that particular Contributor. A Contribution
+ “originates” from a Contributor if it was added to the Program by such
+ Contributor itself or anyone acting on such Contributor's behalf.
+ Contributions do not include changes or additions to the Program that
+ are not Modified Works.
+ </li>
+ </ul>
+ <p>“Contributor” means any person or entity that Distributes the Program.</p>
+ <p>“Licensed Patents” mean patent claims licensable by a Contributor which
+ are necessarily infringed by the use or sale of its Contribution alone
+ or when combined with the Program.
+ </p>
+ <p>“Program” means the Contributions Distributed in accordance with this
+ Agreement.
+ </p>
+ <p>“Recipient” means anyone who receives the Program under this Agreement
+ or any Secondary License (as applicable), including Contributors.
+ </p>
+ <p>“Derivative Works” shall mean any work, whether in Source Code or other
+ form, that is based on (or derived from) the Program and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship.
+ </p>
+ <p>“Modified Works” shall mean any work in Source Code or other form that
+ results from an addition to, deletion from, or modification of the
+ contents of the Program, including, for purposes of clarity any new file
+ in Source Code form that contains any contents of the Program. Modified
+ Works shall not include works that contain only declarations, interfaces,
+ types, classes, structures, or files of the Program solely in each case
+ in order to link to, bind by name, or subclass the Program or Modified
+ Works thereof.
+ </p>
+ <p>“Distribute” means the acts of a) distributing or b) making available
+ in any manner that enables the transfer of a copy.
+ </p>
+ <p>“Source Code” means the form of a Program preferred for making
+ modifications, including but not limited to software source code,
+ documentation source, and configuration files.
+ </p>
+ <p>“Secondary License” means either the GNU General Public License,
+ Version 2.0, or any later versions of that license, including any
+ exceptions or additional permissions as identified by the initial
+ Contributor.
+ </p>
+ <h2 id="grant-of-rights">2. GRANT OF RIGHTS</h2>
+ <ul>
+ <li>a) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
+ license to reproduce, prepare Derivative Works of, publicly display,
+ publicly perform, Distribute and sublicense the Contribution of such
+ Contributor, if any, and such Derivative Works.
+ </li>
+ <li>b) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
+ license under Licensed Patents to make, use, sell, offer to sell,
+ import and otherwise transfer the Contribution of such Contributor,
+ if any, in Source Code or other form. This patent license shall
+ apply to the combination of the Contribution and the Program if,
+ at the time the Contribution is added by the Contributor, such
+ addition of the Contribution causes such combination to be covered
+ by the Licensed Patents. The patent license shall not apply to any
+ other combinations which include the Contribution. No hardware per
+ se is licensed hereunder.
+ </li>
+ <li>c) Recipient understands that although each Contributor grants the
+ licenses to its Contributions set forth herein, no assurances are
+ provided by any Contributor that the Program does not infringe the
+ patent or other intellectual property rights of any other entity.
+ Each Contributor disclaims any liability to Recipient for claims
+ brought by any other entity based on infringement of intellectual
+ property rights or otherwise. As a condition to exercising the rights
+ and licenses granted hereunder, each Recipient hereby assumes sole
+ responsibility to secure any other intellectual property rights needed,
+ if any. For example, if a third party patent license is required to
+ allow Recipient to Distribute the Program, it is Recipient's
+ responsibility to acquire that license before distributing the Program.
+ </li>
+ <li>d) Each Contributor represents that to its knowledge it has sufficient
+ copyright rights in its Contribution, if any, to grant the copyright
+ license set forth in this Agreement.
+ </li>
+ <li>e) Notwithstanding the terms of any Secondary License, no Contributor
+ makes additional grants to any Recipient (other than those set forth
+ in this Agreement) as a result of such Recipient's receipt of the
+ Program under the terms of a Secondary License (if permitted under
+ the terms of Section 3).
+ </li>
+ </ul>
+ <h2 id="requirements">3. REQUIREMENTS</h2>
+ <p>3.1 If a Contributor Distributes the Program in any form, then:</p>
+ <ul>
+ <li>a) the Program must also be made available as Source Code, in
+ accordance with section 3.2, and the Contributor must accompany
+ the Program with a statement that the Source Code for the Program
+ is available under this Agreement, and informs Recipients how to
+ obtain it in a reasonable manner on or through a medium customarily
+ used for software exchange; and
+ </li>
+ <li>
+ b) the Contributor may Distribute the Program under a license
+ different than this Agreement, provided that such license:
+ <ul>
+ <li>i) effectively disclaims on behalf of all other Contributors all
+ warranties and conditions, express and implied, including warranties
+ or conditions of title and non-infringement, and implied warranties
+ or conditions of merchantability and fitness for a particular purpose;
+ </li>
+ <li>ii) effectively excludes on behalf of all other Contributors all
+ liability for damages, including direct, indirect, special, incidental
+ and consequential damages, such as lost profits;
+ </li>
+ <li>iii) does not attempt to limit or alter the recipients' rights in the
+ Source Code under section 3.2; and
+ </li>
+ <li>iv) requires any subsequent distribution of the Program by any party
+ to be under a license that satisfies the requirements of this section 3.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>3.2 When the Program is Distributed as Source Code:</p>
+ <ul>
+ <li>a) it must be made available under this Agreement, or if the Program (i)
+ is combined with other material in a separate file or files made available
+ under a Secondary License, and (ii) the initial Contributor attached to
+ the Source Code the notice described in Exhibit A of this Agreement,
+ then the Program may be made available under the terms of such
+ Secondary Licenses, and
+ </li>
+ <li>b) a copy of this Agreement must be included with each copy of the Program.</li>
+ </ul>
+ <p>3.3 Contributors may not remove or alter any copyright, patent, trademark,
+ attribution notices, disclaimers of warranty, or limitations of liability
+ (‘notices’) contained within the Program from any copy of the Program which
+ they Distribute, provided that Contributors may add their own appropriate
+ notices.
+ </p>
+ <h2 id="commercial-distribution">4. COMMERCIAL DISTRIBUTION</h2>
+ <p>Commercial distributors of software may accept certain responsibilities
+ with respect to end users, business partners and the like. While this
+ license is intended to facilitate the commercial use of the Program, the
+ Contributor who includes the Program in a commercial product offering should
+ do so in a manner which does not create potential liability for other
+ Contributors. Therefore, if a Contributor includes the Program in a
+ commercial product offering, such Contributor (“Commercial Contributor”)
+ hereby agrees to defend and indemnify every other Contributor
+ (“Indemnified Contributor”) against any losses, damages and costs
+ (collectively “Losses”) arising from claims, lawsuits and other legal actions
+ brought by a third party against the Indemnified Contributor to the extent
+ caused by the acts or omissions of such Commercial Contributor in connection
+ with its distribution of the Program in a commercial product offering.
+ The obligations in this section do not apply to any claims or Losses relating
+ to any actual or alleged intellectual property infringement. In order to
+ qualify, an Indemnified Contributor must: a) promptly notify the
+ Commercial Contributor in writing of such claim, and b) allow the Commercial
+ Contributor to control, and cooperate with the Commercial Contributor in,
+ the defense and any related settlement negotiations. The Indemnified
+ Contributor may participate in any such claim at its own expense.
+ </p>
+ <p>For example, a Contributor might include the Program
+ in a commercial product offering, Product X. That Contributor is then a
+ Commercial Contributor. If that Commercial Contributor then makes performance
+ claims, or offers warranties related to Product X, those performance claims
+ and warranties are such Commercial Contributor's responsibility alone.
+ Under this section, the Commercial Contributor would have to defend claims
+ against the other Contributors related to those performance claims and
+ warranties, and if a court requires any other Contributor to pay any damages
+ as a result, the Commercial Contributor must pay those damages.
+ </p>
+ <h2 id="warranty">5. NO WARRANTY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+ WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+ solely responsible for determining the appropriateness of using and
+ distributing the Program and assumes all risks associated with its
+ exercise of rights under this Agreement, including but not limited to the
+ risks and costs of program errors, compliance with applicable laws, damage
+ to or loss of data, programs or equipment, and unavailability or
+ interruption of operations.
+ </p>
+ <h2 id="disclaimer">6. DISCLAIMER OF LIABILITY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY
+ LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS),
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+ GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ </p>
+ <h2 id="general">7. GENERAL</h2>
+ <p>If any provision of this Agreement is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of the
+ remainder of the terms of this Agreement, and without further action by the
+ parties hereto, such provision shall be reformed to the minimum extent
+ necessary to make such provision valid and enforceable.
+ </p>
+ <p>If Recipient institutes patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Program itself
+ (excluding combinations of the Program with other software or hardware)
+ infringes such Recipient's patent(s), then such Recipient's rights granted
+ under Section 2(b) shall terminate as of the date such litigation is filed.
+ </p>
+ <p>All Recipient's rights under this Agreement shall terminate if it fails to
+ comply with any of the material terms or conditions of this Agreement and
+ does not cure such failure in a reasonable period of time after becoming
+ aware of such noncompliance. If all Recipient's rights under this Agreement
+ terminate, Recipient agrees to cease use and distribution of the Program
+ as soon as reasonably practicable. However, Recipient's obligations under
+ this Agreement and any licenses granted by Recipient relating to the
+ Program shall continue and survive.
+ </p>
+ <p>Everyone is permitted to copy and distribute copies of this Agreement,
+ but in order to avoid inconsistency the Agreement is copyrighted and may
+ only be modified in the following manner. The Agreement Steward reserves
+ the right to publish new versions (including revisions) of this Agreement
+ from time to time. No one other than the Agreement Steward has the right
+ to modify this Agreement. The Eclipse Foundation is the initial Agreement
+ Steward. The Eclipse Foundation may assign the responsibility to serve as
+ the Agreement Steward to a suitable separate entity. Each new version of
+ the Agreement will be given a distinguishing version number. The Program
+ (including Contributions) may always be Distributed subject to the version
+ of the Agreement under which it was received. In addition, after a new
+ version of the Agreement is published, Contributor may elect to Distribute
+ the Program (including its Contributions) under the new version.
+ </p>
+ <p>Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
+ receives no rights or licenses to the intellectual property of any
+ Contributor under this Agreement, whether expressly, by implication,
+ estoppel or otherwise. All rights in the Program not expressly granted
+ under this Agreement are reserved. Nothing in this Agreement is intended
+ to be enforceable by any entity that is not a Contributor or Recipient.
+ No third-party beneficiary rights are created under this Agreement.
+ </p>
+ <h2 id="exhibit-a">Exhibit A – Form of Secondary Licenses Notice</h2>
+ <p>“This Source Code may also be made available under the following
+ Secondary Licenses when the conditions for such availability set forth
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
+ version(s), and exceptions or additional permissions here}.”
+ </p>
+ <blockquote>
+ <p>Simply including a copy of this Agreement, including this Exhibit A
+ is not sufficient to license the Source Code under Secondary Licenses.
+ </p>
+ <p>If it is not possible or desirable to put the notice in a particular file,
+ then You may include the notice in a location (such as a LICENSE file in a
+ relevant directory) where a recipient would be likely to look for
+ such a notice.
+ </p>
+ <p>You may add additional accurate notices of copyright ownership.</p>
+ </blockquote>
+ </body>
+</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/META-INF/MANIFEST.MF b/plugins/org.eclipse.epsilon.executors.spreadsheets/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..0edc554
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/META-INF/MANIFEST.MF
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Spreadsheets
+Bundle-SymbolicName: org.eclipse.epsilon.executors.spreadsheets
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Automatic-Module-Name: org.eclipse.epsilon.executors
+Export-Package: org.eclipse.epsilon.executors.spreadsheets
+Require-Bundle: org.eclipse.epsilon.emc.spreadsheets;bundle-version="1.6.0",
+ org.eclipse.epsilon.eol.engine;bundle-version="1.6.0",
+ org.eclipse.epsilon.executors;bundle-version="1.0.0"
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/build.properties b/plugins/org.eclipse.epsilon.executors.spreadsheets/build.properties
new file mode 100644
index 0000000..a505bb8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/build.properties
@@ -0,0 +1,3 @@
+source.. = src
+bin.includes = META-INF/,\
+ .
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/src/org/eclipse/epsilon/executors/spreadsheets/ISpreadsheetModelBuilder.java b/plugins/org.eclipse.epsilon.executors.spreadsheets/src/org/eclipse/epsilon/executors/spreadsheets/ISpreadsheetModelBuilder.java
new file mode 100644
index 0000000..f789dae
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/src/org/eclipse/epsilon/executors/spreadsheets/ISpreadsheetModelBuilder.java
@@ -0,0 +1,24 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.spreadsheets;
+
+import org.eclipse.epsilon.emc.spreadsheets.SpreadsheetReference;
+import org.eclipse.epsilon.emc.spreadsheets.SpreadsheetWorksheet;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.executors.model.IModelBuilder;
+
+public interface ISpreadsheetModelBuilder<M extends IModel, T extends ISpreadsheetModelBuilder<M, T>>
+ extends IModelBuilder<M, T> {
+
+ T addWorksheet(final SpreadsheetWorksheet worksheet);
+
+ T addReference(final SpreadsheetReference reference);
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors.spreadsheets/src/org/eclipse/epsilon/executors/spreadsheets/SpreadsheetModelBuilder.java b/plugins/org.eclipse.epsilon.executors.spreadsheets/src/org/eclipse/epsilon/executors/spreadsheets/SpreadsheetModelBuilder.java
new file mode 100644
index 0000000..949a02a
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors.spreadsheets/src/org/eclipse/epsilon/executors/spreadsheets/SpreadsheetModelBuilder.java
@@ -0,0 +1,37 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.spreadsheets;
+
+import java.util.List;
+
+import org.eclipse.epsilon.emc.spreadsheets.SpreadsheetModel;
+import org.eclipse.epsilon.emc.spreadsheets.SpreadsheetReference;
+import org.eclipse.epsilon.emc.spreadsheets.SpreadsheetWorksheet;
+import org.eclipse.epsilon.executors.model.ModelBuilder;
+
+public abstract class SpreadsheetModelBuilder<M extends SpreadsheetModel, T extends SpreadsheetModelBuilder<M, T>>
+ extends ModelBuilder<M, T> implements ISpreadsheetModelBuilder<M, T> {
+
+ protected List<SpreadsheetWorksheet> worksheets;
+ protected List<SpreadsheetReference> references;
+
+ @Override
+ public T addWorksheet(SpreadsheetWorksheet worksheet) {
+ this.worksheets.add(worksheet);
+ return self();
+ }
+
+ @Override
+ public T addReference(SpreadsheetReference reference) {
+ this.references.add(reference);
+ return self();
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/.classpath b/plugins/org.eclipse.epsilon.executors/.classpath
new file mode 100644
index 0000000..6a5eab8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/.classpath
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.epsilon.executors/.project b/plugins/org.eclipse.epsilon.executors/.project
new file mode 100644
index 0000000..272d59e
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.epsilon.executors</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.epsilon.executors/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.epsilon.executors/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.epsilon.executors/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.epsilon.executors/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..b8947ec
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.release=disabled
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/plugins/org.eclipse.epsilon.executors/.settings/org.eclipse.m2e.core.prefs b/plugins/org.eclipse.epsilon.executors/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/plugins/org.eclipse.epsilon.executors/EPL-2.0.html b/plugins/org.eclipse.epsilon.executors/EPL-2.0.html
new file mode 100644
index 0000000..f5d138c
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/EPL-2.0.html
@@ -0,0 +1,307 @@
+<!--
+ ~ Copyright (c) 2008-2018 The University of York.
+ ~ This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License 2.0
+ ~ which is available at https://www.eclipse.org/legal/epl-2.0/
+ -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Eclipse Public License - Version 2.0</title>
+ <style type="text/css">
+ body {
+ margin: 1.5em 3em;
+ }
+ h1{
+ font-size:1.5em;
+ }
+ h2{
+ font-size:1em;
+ margin-bottom:0.5em;
+ margin-top:1em;
+ }
+ p {
+ margin-top: 0.5em;
+ margin-bottom: 0.5em;
+ }
+ ul, ol{
+ list-style-type:none;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>Eclipse Public License - v 2.0</h1>
+ <p>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
+ PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+ </p>
+ <h2 id="definitions">1. DEFINITIONS</h2>
+ <p>“Contribution” means:</p>
+ <ul>
+ <li>a) in the case of the initial Contributor, the initial content
+ Distributed under this Agreement, and
+ </li>
+ <li>
+ b) in the case of each subsequent Contributor:
+ <ul>
+ <li>i) changes to the Program, and</li>
+ <li>ii) additions to the Program;</li>
+ </ul>
+ where such changes and/or additions to the Program originate from
+ and are Distributed by that particular Contributor. A Contribution
+ “originates” from a Contributor if it was added to the Program by such
+ Contributor itself or anyone acting on such Contributor's behalf.
+ Contributions do not include changes or additions to the Program that
+ are not Modified Works.
+ </li>
+ </ul>
+ <p>“Contributor” means any person or entity that Distributes the Program.</p>
+ <p>“Licensed Patents” mean patent claims licensable by a Contributor which
+ are necessarily infringed by the use or sale of its Contribution alone
+ or when combined with the Program.
+ </p>
+ <p>“Program” means the Contributions Distributed in accordance with this
+ Agreement.
+ </p>
+ <p>“Recipient” means anyone who receives the Program under this Agreement
+ or any Secondary License (as applicable), including Contributors.
+ </p>
+ <p>“Derivative Works” shall mean any work, whether in Source Code or other
+ form, that is based on (or derived from) the Program and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship.
+ </p>
+ <p>“Modified Works” shall mean any work in Source Code or other form that
+ results from an addition to, deletion from, or modification of the
+ contents of the Program, including, for purposes of clarity any new file
+ in Source Code form that contains any contents of the Program. Modified
+ Works shall not include works that contain only declarations, interfaces,
+ types, classes, structures, or files of the Program solely in each case
+ in order to link to, bind by name, or subclass the Program or Modified
+ Works thereof.
+ </p>
+ <p>“Distribute” means the acts of a) distributing or b) making available
+ in any manner that enables the transfer of a copy.
+ </p>
+ <p>“Source Code” means the form of a Program preferred for making
+ modifications, including but not limited to software source code,
+ documentation source, and configuration files.
+ </p>
+ <p>“Secondary License” means either the GNU General Public License,
+ Version 2.0, or any later versions of that license, including any
+ exceptions or additional permissions as identified by the initial
+ Contributor.
+ </p>
+ <h2 id="grant-of-rights">2. GRANT OF RIGHTS</h2>
+ <ul>
+ <li>a) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
+ license to reproduce, prepare Derivative Works of, publicly display,
+ publicly perform, Distribute and sublicense the Contribution of such
+ Contributor, if any, and such Derivative Works.
+ </li>
+ <li>b) Subject to the terms of this Agreement, each Contributor hereby
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
+ license under Licensed Patents to make, use, sell, offer to sell,
+ import and otherwise transfer the Contribution of such Contributor,
+ if any, in Source Code or other form. This patent license shall
+ apply to the combination of the Contribution and the Program if,
+ at the time the Contribution is added by the Contributor, such
+ addition of the Contribution causes such combination to be covered
+ by the Licensed Patents. The patent license shall not apply to any
+ other combinations which include the Contribution. No hardware per
+ se is licensed hereunder.
+ </li>
+ <li>c) Recipient understands that although each Contributor grants the
+ licenses to its Contributions set forth herein, no assurances are
+ provided by any Contributor that the Program does not infringe the
+ patent or other intellectual property rights of any other entity.
+ Each Contributor disclaims any liability to Recipient for claims
+ brought by any other entity based on infringement of intellectual
+ property rights or otherwise. As a condition to exercising the rights
+ and licenses granted hereunder, each Recipient hereby assumes sole
+ responsibility to secure any other intellectual property rights needed,
+ if any. For example, if a third party patent license is required to
+ allow Recipient to Distribute the Program, it is Recipient's
+ responsibility to acquire that license before distributing the Program.
+ </li>
+ <li>d) Each Contributor represents that to its knowledge it has sufficient
+ copyright rights in its Contribution, if any, to grant the copyright
+ license set forth in this Agreement.
+ </li>
+ <li>e) Notwithstanding the terms of any Secondary License, no Contributor
+ makes additional grants to any Recipient (other than those set forth
+ in this Agreement) as a result of such Recipient's receipt of the
+ Program under the terms of a Secondary License (if permitted under
+ the terms of Section 3).
+ </li>
+ </ul>
+ <h2 id="requirements">3. REQUIREMENTS</h2>
+ <p>3.1 If a Contributor Distributes the Program in any form, then:</p>
+ <ul>
+ <li>a) the Program must also be made available as Source Code, in
+ accordance with section 3.2, and the Contributor must accompany
+ the Program with a statement that the Source Code for the Program
+ is available under this Agreement, and informs Recipients how to
+ obtain it in a reasonable manner on or through a medium customarily
+ used for software exchange; and
+ </li>
+ <li>
+ b) the Contributor may Distribute the Program under a license
+ different than this Agreement, provided that such license:
+ <ul>
+ <li>i) effectively disclaims on behalf of all other Contributors all
+ warranties and conditions, express and implied, including warranties
+ or conditions of title and non-infringement, and implied warranties
+ or conditions of merchantability and fitness for a particular purpose;
+ </li>
+ <li>ii) effectively excludes on behalf of all other Contributors all
+ liability for damages, including direct, indirect, special, incidental
+ and consequential damages, such as lost profits;
+ </li>
+ <li>iii) does not attempt to limit or alter the recipients' rights in the
+ Source Code under section 3.2; and
+ </li>
+ <li>iv) requires any subsequent distribution of the Program by any party
+ to be under a license that satisfies the requirements of this section 3.
+ </li>
+ </ul>
+ </li>
+ </ul>
+ <p>3.2 When the Program is Distributed as Source Code:</p>
+ <ul>
+ <li>a) it must be made available under this Agreement, or if the Program (i)
+ is combined with other material in a separate file or files made available
+ under a Secondary License, and (ii) the initial Contributor attached to
+ the Source Code the notice described in Exhibit A of this Agreement,
+ then the Program may be made available under the terms of such
+ Secondary Licenses, and
+ </li>
+ <li>b) a copy of this Agreement must be included with each copy of the Program.</li>
+ </ul>
+ <p>3.3 Contributors may not remove or alter any copyright, patent, trademark,
+ attribution notices, disclaimers of warranty, or limitations of liability
+ (‘notices’) contained within the Program from any copy of the Program which
+ they Distribute, provided that Contributors may add their own appropriate
+ notices.
+ </p>
+ <h2 id="commercial-distribution">4. COMMERCIAL DISTRIBUTION</h2>
+ <p>Commercial distributors of software may accept certain responsibilities
+ with respect to end users, business partners and the like. While this
+ license is intended to facilitate the commercial use of the Program, the
+ Contributor who includes the Program in a commercial product offering should
+ do so in a manner which does not create potential liability for other
+ Contributors. Therefore, if a Contributor includes the Program in a
+ commercial product offering, such Contributor (“Commercial Contributor”)
+ hereby agrees to defend and indemnify every other Contributor
+ (“Indemnified Contributor”) against any losses, damages and costs
+ (collectively “Losses”) arising from claims, lawsuits and other legal actions
+ brought by a third party against the Indemnified Contributor to the extent
+ caused by the acts or omissions of such Commercial Contributor in connection
+ with its distribution of the Program in a commercial product offering.
+ The obligations in this section do not apply to any claims or Losses relating
+ to any actual or alleged intellectual property infringement. In order to
+ qualify, an Indemnified Contributor must: a) promptly notify the
+ Commercial Contributor in writing of such claim, and b) allow the Commercial
+ Contributor to control, and cooperate with the Commercial Contributor in,
+ the defense and any related settlement negotiations. The Indemnified
+ Contributor may participate in any such claim at its own expense.
+ </p>
+ <p>For example, a Contributor might include the Program
+ in a commercial product offering, Product X. That Contributor is then a
+ Commercial Contributor. If that Commercial Contributor then makes performance
+ claims, or offers warranties related to Product X, those performance claims
+ and warranties are such Commercial Contributor's responsibility alone.
+ Under this section, the Commercial Contributor would have to defend claims
+ against the other Contributors related to those performance claims and
+ warranties, and if a court requires any other Contributor to pay any damages
+ as a result, the Commercial Contributor must pay those damages.
+ </p>
+ <h2 id="warranty">5. NO WARRANTY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS” BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
+ WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
+ MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
+ solely responsible for determining the appropriateness of using and
+ distributing the Program and assumes all risks associated with its
+ exercise of rights under this Agreement, including but not limited to the
+ risks and costs of program errors, compliance with applicable laws, damage
+ to or loss of data, programs or equipment, and unavailability or
+ interruption of operations.
+ </p>
+ <h2 id="disclaimer">6. DISCLAIMER OF LIABILITY</h2>
+ <p>EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT PERMITTED
+ BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY
+ LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS),
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+ GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ </p>
+ <h2 id="general">7. GENERAL</h2>
+ <p>If any provision of this Agreement is invalid or unenforceable under
+ applicable law, it shall not affect the validity or enforceability of the
+ remainder of the terms of this Agreement, and without further action by the
+ parties hereto, such provision shall be reformed to the minimum extent
+ necessary to make such provision valid and enforceable.
+ </p>
+ <p>If Recipient institutes patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Program itself
+ (excluding combinations of the Program with other software or hardware)
+ infringes such Recipient's patent(s), then such Recipient's rights granted
+ under Section 2(b) shall terminate as of the date such litigation is filed.
+ </p>
+ <p>All Recipient's rights under this Agreement shall terminate if it fails to
+ comply with any of the material terms or conditions of this Agreement and
+ does not cure such failure in a reasonable period of time after becoming
+ aware of such noncompliance. If all Recipient's rights under this Agreement
+ terminate, Recipient agrees to cease use and distribution of the Program
+ as soon as reasonably practicable. However, Recipient's obligations under
+ this Agreement and any licenses granted by Recipient relating to the
+ Program shall continue and survive.
+ </p>
+ <p>Everyone is permitted to copy and distribute copies of this Agreement,
+ but in order to avoid inconsistency the Agreement is copyrighted and may
+ only be modified in the following manner. The Agreement Steward reserves
+ the right to publish new versions (including revisions) of this Agreement
+ from time to time. No one other than the Agreement Steward has the right
+ to modify this Agreement. The Eclipse Foundation is the initial Agreement
+ Steward. The Eclipse Foundation may assign the responsibility to serve as
+ the Agreement Steward to a suitable separate entity. Each new version of
+ the Agreement will be given a distinguishing version number. The Program
+ (including Contributions) may always be Distributed subject to the version
+ of the Agreement under which it was received. In addition, after a new
+ version of the Agreement is published, Contributor may elect to Distribute
+ the Program (including its Contributions) under the new version.
+ </p>
+ <p>Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
+ receives no rights or licenses to the intellectual property of any
+ Contributor under this Agreement, whether expressly, by implication,
+ estoppel or otherwise. All rights in the Program not expressly granted
+ under this Agreement are reserved. Nothing in this Agreement is intended
+ to be enforceable by any entity that is not a Contributor or Recipient.
+ No third-party beneficiary rights are created under this Agreement.
+ </p>
+ <h2 id="exhibit-a">Exhibit A – Form of Secondary Licenses Notice</h2>
+ <p>“This Source Code may also be made available under the following
+ Secondary Licenses when the conditions for such availability set forth
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
+ version(s), and exceptions or additional permissions here}.”
+ </p>
+ <blockquote>
+ <p>Simply including a copy of this Agreement, including this Exhibit A
+ is not sufficient to license the Source Code under Secondary Licenses.
+ </p>
+ <p>If it is not possible or desirable to put the notice in a particular file,
+ then You may include the notice in a location (such as a LICENSE file in a
+ relevant directory) where a recipient would be likely to look for
+ such a notice.
+ </p>
+ <p>You may add additional accurate notices of copyright ownership.</p>
+ </blockquote>
+ </body>
+</html>
\ No newline at end of file
diff --git a/plugins/org.eclipse.epsilon.executors/META-INF/MANIFEST.MF b/plugins/org.eclipse.epsilon.executors/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..563b068
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/META-INF/MANIFEST.MF
@@ -0,0 +1,25 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Executors
+Bundle-SymbolicName: org.eclipse.epsilon.executors
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Automatic-Module-Name: org.eclipse.epsilon.executors
+Export-Package: org.eclipse.epsilon.executors,
+ org.eclipse.epsilon.executors.ecl,
+ org.eclipse.epsilon.executors.egl,
+ org.eclipse.epsilon.executors.eml,
+ org.eclipse.epsilon.executors.eol,
+ org.eclipse.epsilon.executors.etl,
+ org.eclipse.epsilon.executors.evl,
+ org.eclipse.epsilon.executors.model,
+ org.eclipse.epsilon.executors.util
+Require-Bundle: org.slf4j.api;bundle-version="1.7.2",
+ org.eclipse.epsilon.common;bundle-version="1.6.0",
+ org.eclipse.epsilon.eol.engine;bundle-version="1.6.0",
+ org.eclipse.epsilon.egl.engine;bundle-version="1.6.0",
+ org.eclipse.epsilon.etl.engine;bundle-version="1.6.0",
+ org.eclipse.epsilon.evl.engine;bundle-version="1.6.0",
+ org.eclipse.epsilon.ecl.engine,
+ org.eclipse.epsilon.eml.engine,
+ org.eclipse.epsilon.erl.engine
diff --git a/plugins/org.eclipse.epsilon.executors/build.properties b/plugins/org.eclipse.epsilon.executors/build.properties
new file mode 100644
index 0000000..a505bb8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/build.properties
@@ -0,0 +1,3 @@
+source.. = src
+bin.includes = META-INF/,\
+ .
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonEngineExecutorFactory.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonEngineExecutorFactory.java
new file mode 100644
index 0000000..fec9035
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonEngineExecutorFactory.java
@@ -0,0 +1,49 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors;
+
+import org.eclipse.epsilon.executors.ecl.SimpleEclExecutor;
+import org.eclipse.epsilon.executors.egl.SimpleEglExecutor;
+import org.eclipse.epsilon.executors.egl.SimpleEgxExecutor;
+import org.eclipse.epsilon.executors.eol.SimpleEolExecutor;
+import org.eclipse.epsilon.executors.etl.SimpleEtlExecutor;
+import org.eclipse.epsilon.executors.evl.SimpleEvlExecutor;
+
+
+/**
+ * A factory for the different executors.
+ *
+ * @author Horacio Hoyos Rodriguez
+ */
+@Deprecated
+public class EpsilonEngineExecutorFactory {
+
+ @SuppressWarnings("unchecked")
+ public <E extends EpsilonLanguageExecutor> E getExecutor(String engineName) {
+
+ switch (engineName.substring(0, 3).toUpperCase()) {
+ case "ECL":
+ return (E) new SimpleEclExecutor();
+ case "EGL":
+ return (E) new SimpleEglExecutor();
+ case "EGX":
+ return (E) new SimpleEgxExecutor();
+ case "EOL":
+ return (E) new SimpleEolExecutor();
+ case "ETL":
+ return (E) new SimpleEtlExecutor();
+ case "EVL":
+ return (E) new SimpleEvlExecutor();
+ default:
+ return null;
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonExecutor.java
new file mode 100644
index 0000000..49f6ddf
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonExecutor.java
@@ -0,0 +1,479 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors;
+
+import static org.eclipse.epsilon.common.util.OperatingSystem.getJavaVersion;
+import static org.eclipse.epsilon.common.util.OperatingSystem.getOsNameAndVersion;
+import static org.eclipse.epsilon.common.util.profiling.BenchmarkUtils.getCpuName;
+import static org.eclipse.epsilon.common.util.profiling.BenchmarkUtils.getNumberOfHardwareThreads;
+import static org.eclipse.epsilon.common.util.profiling.BenchmarkUtils.getTime;
+
+import java.nio.file.Path;
+import java.time.Duration;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Optional;
+import java.util.Set;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.dom.NamedRule;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The Epsilon Executor is used to run the different Language executors.
+ *
+ * @author Horacio Hoyos Rodriguez
+ *
+ */
+public class EpsilonExecutor {
+
+ public static final ExecutionTimeData NO_TIME_DATA = new ExecutionTimeData();
+
+ private static final Logger logger = LoggerFactory.getLogger(EpsilonExecutor.class);
+
+ /**
+ * The Epsilon Module that implements the specific language engine.
+ */
+ private final EpsilonLanguageExecutor<?> languageExecutor;
+
+ /**
+ * The Script to be executed. Alternatively a block of code can be provided, see {@link #code}
+ */
+ private final Optional<Path> script;
+
+ /**
+ * The Code to be executed. Alternatively a script file can be provided, see {@link #script}.
+ */
+ private final Optional<String> code;
+
+ /**
+ * The runtime parameters.
+ */
+ private final Map<String, Object> parameters; // = new HashMap<>(4);
+
+ /**
+ * The Models used during execution.
+ */
+ private final Set<IModel> models; // = new HashSet<>(4);
+
+ /**
+ * The Result of the execution. Not all models provide a result.
+ */
+ //private Object result;
+
+ /**
+ * The Native Type delegates used during execution.
+ */
+ private final Set<IToolNativeTypeDelegate> nativeDelegates; // = new HashSet<>(8);
+
+ /**
+ * The Dispose Models flag indicates if models will be disposed after execution.
+ */
+ private final boolean disposeModels; // = true;
+
+ /**
+ * The Profile Execution flag indicates if the execution should be measured.
+ */
+ private final boolean profileExecution; // = false;
+
+
+ private final Optional<ExecutionTimeData> timeData;
+
+
+ // Constructors with script
+ public EpsilonExecutor(
+ EpsilonLanguageExecutor<?> languageExecutor,
+ Path scriptPath) throws EpsilonExecutorException {
+ this(languageExecutor, scriptPath, Collections.emptySet(), Collections.emptyMap(), Collections.emptySet(), true, false);
+ }
+
+ public EpsilonExecutor(
+ EpsilonLanguageExecutor<?> languageExecutor,
+ Path scriptPath,
+ Collection<IModel> models) throws EpsilonExecutorException {
+ this(languageExecutor, scriptPath, models, Collections.emptyMap(), Collections.emptySet(), true, false);
+ }
+
+
+ public EpsilonExecutor(
+ EpsilonLanguageExecutor<?> languageExecutor,
+ Path scriptPath,
+ Collection<IModel> models,
+ Map<String, Object> parameters,
+ Collection<IToolNativeTypeDelegate> nativeDelegates) throws EpsilonExecutorException {
+ this(languageExecutor, scriptPath, models, parameters, nativeDelegates, true, false);
+ }
+
+ public EpsilonExecutor(
+ EpsilonLanguageExecutor<?> languageExecutor,
+ Path scriptPath,
+ Collection<IModel> models,
+ Map<String, Object> parameters,
+ Collection<IToolNativeTypeDelegate> nativeDelegates,
+ boolean disposeModels,
+ boolean profileExecution) throws EpsilonExecutorException {
+ super();
+ this.languageExecutor = languageExecutor;
+ this.script = Optional.of(scriptPath);
+ this.code = Optional.empty();
+ this.models = new HashSet<>(models);
+ this.parameters = parameters;
+ this.nativeDelegates = new HashSet<>(nativeDelegates);
+ this.disposeModels = disposeModels;
+ this.profileExecution = profileExecution;
+ this.timeData = profileExecution ? Optional.of(new ExecutionTimeData()) : Optional.empty();
+ parseSource();
+ }
+
+
+ // Constructors with code
+ public EpsilonExecutor(
+ EpsilonLanguageExecutor<?> languageExecutor,
+ String code) throws EpsilonExecutorException {
+ this(languageExecutor, code, Collections.emptySet(), Collections.emptyMap(), Collections.emptySet(), true, false);
+ }
+
+ public EpsilonExecutor(
+ EpsilonLanguageExecutor<?> languageExecutor,
+ String code,
+ Collection<IModel> models) throws EpsilonExecutorException {
+ this(languageExecutor, code, models, Collections.emptyMap(), Collections.emptySet(), true, false);
+ }
+
+ public EpsilonExecutor(
+ EpsilonLanguageExecutor<?> languageExecutor,
+ String code,
+ Collection<IModel> models,
+ Map<String, Object> parameters,
+ Collection<IToolNativeTypeDelegate> nativeDelegates) throws EpsilonExecutorException {
+ this(languageExecutor, code, models, parameters, nativeDelegates, true, false);
+ }
+
+ public EpsilonExecutor(
+ EpsilonLanguageExecutor<?> languageExecutor,
+ String code,
+ Collection<IModel> models,
+ Map<String, Object> parameters,
+ Collection<IToolNativeTypeDelegate> nativeDelegates,
+ boolean disposeModels,
+ boolean profileExecution) throws EpsilonExecutorException {
+ super();
+ this.languageExecutor = languageExecutor;
+ this.script = Optional.empty();
+ this.code = Optional.of(code);
+ parseSource();
+ this.models = new HashSet<>(models);
+ this.parameters = parameters;
+ this.nativeDelegates = new HashSet<>(nativeDelegates);
+ this.disposeModels = disposeModels;
+ this.profileExecution = profileExecution;
+ this.timeData = profileExecution ? Optional.of(new ExecutionTimeData()) : Optional.empty();
+ }
+
+ /**
+ * A class that keeps track of the execution durations of the different stages of execution, and
+ * about the execution of the scripts and its rules (if rule based language).
+ * @author Horacio Hoyos Rodriguez
+ *
+ */
+ public static class ExecutionTimeData {
+ private static String logMessagesSeparator = "-----------------------------------------------------";
+ private final String osNameAndVersion;
+ private final String javaVersion;
+ private final String cpuName;
+ private final int logicalProcessors;
+ private final String date;
+ private Long startNanos;
+ /**
+ * The measured execution information.
+ */
+ private Map<String, Duration> profiledStages = new HashMap<>();
+ private Map<String, Duration> profiledRules = new HashMap<>();
+ private Map<String, Long> started = new HashMap<>();
+ private Duration duration;
+
+ ExecutionTimeData() {
+ osNameAndVersion = getOsNameAndVersion();
+ javaVersion = getJavaVersion();
+ cpuName = getCpuName();
+ logicalProcessors = getNumberOfHardwareThreads();
+ date = getTime();
+ }
+
+ void logStart() {
+ startNanos = System.nanoTime();
+ logger.info(buildLines(
+ osNameAndVersion,
+ javaVersion,
+ cpuName,
+ "Logical processors: " + logicalProcessors,
+ "Starting execution at " + date,
+ logMessagesSeparator
+ ));
+ }
+
+ void logEnd() {
+ long endTimeNanos = System.nanoTime();
+ this.duration = Duration.ofNanos(endTimeNanos-startNanos);
+ logger.info(buildLines("",
+ "Profiled processes:",
+ profiledStages.entrySet().stream().map(e -> String.format("%s:%s", e.getKey(), e.getValue())),
+ "Finished execution at " + getTime(),
+ logMessagesSeparator
+ ));
+ logger.info(buildLines("",
+ "Profiled rules:",
+ profiledRules.entrySet().stream().map(e -> String.format("%s:%s", e.getKey(), e.getValue())),
+ logMessagesSeparator
+ ));
+
+ }
+
+ String buildLines(Object... lines) {
+ StringBuilder linesAsStr = new StringBuilder();
+ String nL = System.lineSeparator();
+ for (Object line : lines) {
+ linesAsStr.append(line).append(nL);
+ }
+ return linesAsStr.toString();
+ }
+
+ void startStage(String name) {
+ started.put(name, System.nanoTime());
+ }
+
+ void endStage(String name) {
+ long endTimeNanos = System.nanoTime();
+ Long startTime = started.getOrDefault(name, endTimeNanos);
+ profiledStages.put(name, Duration.ofNanos(endTimeNanos-startTime));
+ }
+
+ void endModule(EpsilonLanguageExecutor<?> languageExecutor) {
+ Optional<RuleProfiler> ruleProfiler = languageExecutor.getRuleProfiler();
+ if(ruleProfiler.isPresent()) {
+ for (Entry<NamedRule, Duration> entry : ruleProfiler.get().getExecutionTimes().entrySet()) {
+ Duration oldValue = profiledRules.put(entry.getKey().getName(), entry.getValue());
+ if (oldValue != null) {
+ System.err.println("Value for rule " + entry.getKey().getName() + " was replaced.");
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Return the duration of the "prepareExecution" stage. A negative value indicates that the
+ * stage was not signalled as finished.
+ * @return
+ */
+ public Optional<Duration> getPrepareExecutionDuration() {
+ return Optional.ofNullable(profiledStages.get("prepareExecution"));
+ }
+
+ /**
+ * Return the duration of the "preProcess" stage. A negative value indicates that the
+ * stage was not signalled as finished.
+ * @return
+ */
+ public Optional<Duration> getPreProcessDuration() {
+ return Optional.ofNullable(profiledStages.get("preProcess"));
+ }
+
+ /**
+ * Return the duration of the "postProcess" stage. A negative value indicates that the
+ * stage was not signalled as finished.
+ * @return
+ */
+ public Optional<Duration> getPostProcessDuration() {
+ return Optional.ofNullable(profiledStages.get("postProcess"));
+ }
+
+ /**
+ * Return the duration of the Epsilon module execution. A negative value indicates that the
+ * stage was not signalled as finished.
+ * @return
+ */
+ public Optional<Duration> getScrpitExecutionDuration() {
+ return Optional.ofNullable(profiledStages.get("execute"));
+ }
+
+ public Optional<Duration> getTotalDuration() {
+ return Optional.ofNullable(this.duration);
+ }
+
+ public Optional<Duration> getRuleDuration(String name) {
+ return Optional.ofNullable(profiledRules.get(name));
+ }
+
+ public Iterator<Entry<String, Duration>> getRulesDurations() {
+ return profiledRules.entrySet().iterator();
+ }
+
+
+ }
+
+
+ public Optional<ExecutionTimeData> getExecutionTimeData() {
+ return timeData;
+ }
+
+ /**
+ * Create a Runnable so the executor can be executed in a thread. Internally the
+ * {@link #invoqueExecutor()} is called. Any exceptions will be wrapped inside a
+ * {@link RuntimeException}.
+ */
+ public <T> Runnable executeInThread() {
+ class OneShotTask implements Runnable {
+ private T result;
+ public void run() {
+ try {
+ result = invoqueExecutor();
+ } catch (EpsilonExecutorException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ @SuppressWarnings("unused")
+ public T getResult() { return result;}
+ }
+ return new OneShotTask();
+ }
+
+ /**
+ * Execute the specific executor by executing all the execution stages.
+ * @param executor
+ * @return
+ * @throws EpsilonExecutorException
+ */
+ public <R> R invoqueExecutor() throws EpsilonExecutorException {
+ logger.info("Executing engine.");
+ preProfile();
+ prepareExecution();
+ logger.info("Pre-process execution");
+ timeData.ifPresent(td -> td.startStage("preProcess"));
+ languageExecutor.preProcess();
+ R result;
+ if (profileExecution) {
+ timeData.ifPresent(td -> td.endStage("preProcess"));
+ }
+ try {
+ if (profileExecution) {
+ timeData.ifPresent(td -> td.startStage("execute"));
+ }
+ result = (R) languageExecutor.execute();
+ }
+ catch (EolRuntimeException e) {
+ String msg = "Error executing the module.";
+ logger.error(msg, e);
+ throw new EpsilonExecutorException(msg, e);
+ }
+ finally {
+ if (profileExecution) {
+ timeData.ifPresent(td -> td.endStage("execute"));
+ }
+ }
+ logger.info("Post-process execution.");
+ if (profileExecution) {
+ timeData.ifPresent(td -> td.startStage("postProcess"));
+ }
+ languageExecutor.postProcess();
+ if (profileExecution) {
+ timeData.ifPresent(td -> td.endStage("postProcess"));
+ }
+
+ if (profileExecution) {
+ timeData.ifPresent(td -> td.endModule(languageExecutor));
+ timeData.ifPresent(td -> td.logEnd());
+ }
+ return result;
+ }
+
+ /**
+ * Disposes the executor. Implementing classes should perform any clean actions.
+ * This method should be invoked after execute.
+ * It is not invoked automatically because in some cases the user may need
+ * to access execution information that is still in the executor's context.
+ * The disposeModels flag determines if the models used by the module are also
+ * disposed (default true).
+ */
+ public void dispose() {
+ if (disposeModels) {
+ logger.info("Disposing models");
+ languageExecutor.disposeModelRepository();
+ }
+ else {
+ logger.info("Removing models from context models");
+ languageExecutor.clearModelRepository();
+ }
+ models.clear();
+ parameters.clear();
+ logger.info("Dispose context");
+ languageExecutor.dispose();
+ }
+
+ private void preProfile() {
+ timeData.ifPresent(ExecutionTimeData::logStart);
+ }
+
+ private void prepareExecution() throws EpsilonExecutorException {
+ if (!(script.isPresent() || code.isPresent())) {
+ throw new EpsilonExecutorException("No script or code to execute");
+ }
+ timeData.ifPresent(ei -> ei.startStage("prepareExecution"));
+ logger.info("Adding models to executor");
+ languageExecutor.addModels(models);
+ logger.info("Adding parameters to context.");
+ languageExecutor.addParamters(parameters);
+
+ logger.info("Adding Native Type Delegates");
+ languageExecutor.addNativeTypeDelegates(nativeDelegates);
+ if (profileExecution) {
+ timeData.ifPresent(td -> td.endStage("prepareExecution"));
+ }
+ }
+
+ // public Object getResult() {
+ // return result;
+ //}
+
+ private void parseSource() throws EpsilonExecutorException {
+ // Think this should be part of constructor, so object is correct at construction
+ try {
+ if (script.isPresent()) {
+ languageExecutor.parse(script.get().toFile());
+ }
+ else {
+ languageExecutor.parse(code.get());
+ }
+ }
+ catch (Exception e) {
+ String culprit = script.isPresent() ? "script" : "code";
+ logger.error("Failed to parse provided {}", culprit, e);
+ throw new EpsilonExecutorException("Failed to parse script or code", e);
+ }
+ if (!languageExecutor.getParseProblems().isEmpty()) {
+ logger.error("Parse errors occurred");
+ System.err.println("Parse errors occurred...");
+ for (ParseProblem problem : languageExecutor.getParseProblems()) {
+ System.err.println(problem);
+ }
+ throw new EpsilonExecutorException("Parse errors occurred.");
+ }
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonExecutorException.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonExecutorException.java
new file mode 100644
index 0000000..b168fc1
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonExecutorException.java
@@ -0,0 +1,62 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors;
+
+/**
+ * A base exception to wrap different exceptions that can be
+ * thrown during execution of an executor
+ *
+ * @author Horacio Hoyos Rodriguez
+ */
+public class EpsilonExecutorException extends Exception {
+
+ private static final long serialVersionUID = -7589325573726453221L;
+
+
+ /**
+ * Instantiates a new epsilon executor exception.
+ */
+ public EpsilonExecutorException() {
+ super();
+ }
+
+
+ /**
+ * Instantiates a new epsilon executor exception.
+ *
+ * @param message the message
+ * @param cause the cause
+ */
+ public EpsilonExecutorException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+
+ /**
+ * Instantiates a new epsilon executor exception.
+ *
+ * @param message the message
+ */
+ public EpsilonExecutorException(String message) {
+ super(message);
+ }
+
+
+ /**
+ * Instantiates a new epsilon executor exception.
+ *
+ * @param cause the cause
+ */
+ public EpsilonExecutorException(Throwable cause) {
+ super(cause);
+ }
+
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonLanguageExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonLanguageExecutor.java
new file mode 100644
index 0000000..d03b2cd
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/EpsilonLanguageExecutor.java
@@ -0,0 +1,77 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+
+/**
+ * The IEpsilonLanguageExecutor defines a common executor API that the different Epsilon languages
+ * can use to facilitate running Epsilon scripts in standalone applications.
+ * <p>
+ * The API provides 4 phases to the execution of an Epsilon Module: {@link #preProcess}, {@link #execute},
+ * {@link #postProcess}, and {@link #dispose}.
+ * The 4 phases should provide enough flexibility for specific executors to correctly prepare
+ * execution, execute, do any post execution processing and finally dispose the executor.
+ *
+ * @author Horacio Hoyos Rodriguez
+ *
+ */
+public interface EpsilonLanguageExecutor<R> {
+
+ // Methods to interact with the underlying module
+ boolean parse(File file) throws Exception;
+
+ // boolean parse(URI uri) throws Exception;
+
+ boolean parse(String code) throws Exception;
+
+ List<ParseProblem> getParseProblems();
+
+ void addModels(Collection<IModel> models);
+
+ void addParamters(final Map<String, ?> parameters);
+
+ void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates);
+
+ Optional<RuleProfiler> getRuleProfiler();
+
+ void disposeModelRepository();
+
+ void clearModelRepository();
+
+ void dispose();
+
+ /**
+ * This method will be invoked before execution of the script
+ */
+ void preProcess();
+
+ /**
+ * This method will be invoked after execution of the script
+ */
+ void postProcess();
+
+ /**
+ * Execute the provided script, against the list of models using the executor's module.
+ * @throws EpsilonExecutorException
+ */
+ R execute() throws EolRuntimeException;
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ExecutorHelper.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ExecutorHelper.java
new file mode 100644
index 0000000..49838b1
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ExecutorHelper.java
@@ -0,0 +1,89 @@
+package org.eclipse.epsilon.executors;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.eol.IEolModule;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.IErlModule;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+
+public class ExecutorHelper implements EpsilonLanguageExecutor<Object> {
+
+ final IEolModule module;
+
+ public ExecutorHelper(IEolModule module) {
+ this.module = module;
+ }
+
+ @Override
+ public boolean parse(File file) throws Exception {
+ return module.parse(file);
+ }
+
+ @Override
+ public boolean parse(String code) throws Exception {
+ return module.parse(code);
+ }
+
+ @Override
+ public List<ParseProblem> getParseProblems() {
+ return module.getParseProblems();
+ }
+
+ @Override
+ public void addModels(Collection<IModel> models) {
+ this.module.getContext().getModelRepository().addModels(models.toArray(new IModel[0]));
+ }
+
+ @Override
+ public void addParamters(Map<String, ?> parameters) {
+ this.module.getContext().getFrameStack().put(parameters, true);
+ }
+
+ @Override
+ public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
+ this.module.getContext().getNativeTypeDelegates().addAll(nativeDelegates);
+ }
+
+ @Override
+ public Optional<RuleProfiler> getRuleProfiler() {
+ if (module instanceof IErlModule) {
+ return Optional.of(((IErlModule)module).getContext().getExecutorFactory().getRuleProfiler());
+ }
+ return Optional.empty();
+ }
+
+ @Override
+ public void disposeModelRepository() {
+ module.getContext().getModelRepository().dispose();
+ }
+
+ @Override
+ public void clearModelRepository() {
+ module.getContext().getModelRepository().getModels().clear();
+ }
+
+ @Override
+ public void dispose() {
+ module.getContext().dispose();
+ }
+
+ @Override
+ public void preProcess() { }
+
+ @Override
+ public void postProcess() { }
+
+ @Override
+ public Object execute() throws EolRuntimeException {
+ throw new RuntimeException("The ExecutorHelper does not support the execute method.");
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ecl/SimpleEclExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ecl/SimpleEclExecutor.java
new file mode 100644
index 0000000..0e77742
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/ecl/SimpleEclExecutor.java
@@ -0,0 +1,106 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.ecl;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.ecl.EclModule;
+import org.eclipse.epsilon.ecl.IEclModule;
+import org.eclipse.epsilon.ecl.trace.MatchTrace;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+import org.eclipse.epsilon.executors.EpsilonLanguageExecutor;
+import org.eclipse.epsilon.executors.ExecutorHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The ECL executor
+ * @author Sina Madani
+ * @since 1.6
+ */
+public class SimpleEclExecutor implements EpsilonLanguageExecutor<MatchTrace> {
+
+ static final Logger logger = LoggerFactory.getLogger(SimpleEclExecutor.class);
+ private final IEclModule module;
+ private final ExecutorHelper helper;
+
+ public SimpleEclExecutor() {
+ this(new EclModule());
+ }
+
+ public SimpleEclExecutor(IEclModule mdl) {
+ logger.info("Creating the EclExecutor");
+ module = mdl;
+ helper = new ExecutorHelper(module);
+ }
+
+ @Override
+ public MatchTrace execute() throws EolRuntimeException {
+ logger.info("Executing ECL module.");
+ return module.execute();
+ }
+
+ public boolean parse(File file) throws Exception {
+ return helper.parse(file);
+ }
+
+ public boolean parse(String code) throws Exception {
+ return helper.parse(code);
+ }
+
+ public List<ParseProblem> getParseProblems() {
+ return helper.getParseProblems();
+ }
+
+ public void addModels(Collection<IModel> models) {
+ helper.addModels(models);
+ }
+
+ public void addParamters(Map<String, ?> parameters) {
+ helper.addParamters(parameters);
+ }
+
+ public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
+ helper.addNativeTypeDelegates(nativeDelegates);
+ }
+
+ public Optional<RuleProfiler> getRuleProfiler() {
+ return helper.getRuleProfiler();
+ }
+
+ public void disposeModelRepository() {
+ helper.disposeModelRepository();
+ }
+
+ public void clearModelRepository() {
+ helper.clearModelRepository();
+ }
+
+ public void dispose() {
+ helper.dispose();
+ }
+
+ public void preProcess() {
+ helper.preProcess();
+ }
+
+ public void postProcess() {
+ helper.postProcess();
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEglExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEglExecutor.java
new file mode 100644
index 0000000..66e12e2
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEglExecutor.java
@@ -0,0 +1,121 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.egl;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.egl.EglTemplateFactory;
+import org.eclipse.epsilon.egl.EglTemplateFactoryModuleAdapter;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+import org.eclipse.epsilon.executors.EpsilonLanguageExecutor;
+import org.eclipse.epsilon.executors.ExecutorHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The EGL executor
+ * @author Horacio Hoyos Rodriguez
+ */
+public class SimpleEglExecutor implements EpsilonLanguageExecutor<Optional<String>> {
+
+ private static final Logger logger = LoggerFactory.getLogger(SimpleEglExecutor.class);
+ private EglTemplateFactoryModuleAdapter module;
+ private ExecutorHelper helper;
+
+ public SimpleEglExecutor() {
+ this(new EglTemplateFactoryModuleAdapter(new EglTemplateFactory()));
+ }
+
+ public SimpleEglExecutor(EglTemplateFactory templateFactory) {
+ this(new EglTemplateFactoryModuleAdapter(templateFactory));
+ }
+
+ public SimpleEglExecutor(EglTemplateFactoryModuleAdapter mdl) {
+ logger.info("Creating the EglExecutor");
+ module = mdl;
+ helper = new ExecutorHelper(module);
+ }
+
+ @Override
+ public Optional<String> execute() throws EolRuntimeException {
+ logger.info("Executing current EGL template.");
+ String r = (String) ((EglTemplateFactoryModuleAdapter)module).execute();
+ return Optional.ofNullable(r);
+ }
+
+ @Override
+ public boolean parse(File file) throws Exception {
+ return helper.parse(file);
+ }
+
+ @Override
+ public boolean parse(String code) throws Exception {
+ return helper.parse(code);
+ }
+
+ @Override
+ public List<ParseProblem> getParseProblems() {
+ return helper.getParseProblems();
+ }
+
+ @Override
+ public void addModels(Collection<IModel> models) {
+ helper.addModels(models);
+ }
+
+ @Override
+ public void addParamters(Map<String, ?> parameters) {
+ helper.addParamters(parameters);
+ }
+
+ @Override
+ public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
+ helper.addNativeTypeDelegates(nativeDelegates);
+ }
+
+ @Override
+ public Optional<RuleProfiler> getRuleProfiler() {
+ return helper.getRuleProfiler();
+ }
+
+ @Override
+ public void disposeModelRepository() {
+ helper.disposeModelRepository();
+ }
+
+ @Override
+ public void clearModelRepository() {
+ helper.clearModelRepository();
+ }
+
+ @Override
+ public void dispose() {
+ helper.dispose();
+ }
+
+ @Override
+ public void preProcess() {
+ helper.preProcess();
+ }
+
+ @Override
+ public void postProcess() {
+ helper.postProcess();
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEgxExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEgxExecutor.java
new file mode 100644
index 0000000..94616cd
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/egl/SimpleEgxExecutor.java
@@ -0,0 +1,109 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.egl;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.egl.EglTemplateFactory;
+import org.eclipse.epsilon.egl.EgxModule;
+import org.eclipse.epsilon.egl.IEgxModule;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+import org.eclipse.epsilon.executors.EpsilonLanguageExecutor;
+import org.eclipse.epsilon.executors.ExecutorHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The EGX executor
+ * @author Horacio Hoyos Rodriguez
+ */
+public class SimpleEgxExecutor implements EpsilonLanguageExecutor<Object> {
+
+ private static final Logger logger = LoggerFactory.getLogger(SimpleEgxExecutor.class);
+ private IEgxModule module;
+ private ExecutorHelper helper;
+
+ public SimpleEgxExecutor() {
+ this(new EgxModule());
+ }
+
+ public SimpleEgxExecutor(EglTemplateFactory templateFactory) {
+ this(new EgxModule(templateFactory));
+ }
+
+ public SimpleEgxExecutor(IEgxModule mdl) {
+ logger.info("Creating the EgxExecutor");
+ module = mdl;
+ helper = new ExecutorHelper(module);
+ }
+
+ @Override
+ public Object execute() throws EolRuntimeException {
+ logger.info("Executing EGX Script.");
+ return module.execute();
+ }
+
+ public boolean parse(File file) throws Exception {
+ return helper.parse(file);
+ }
+
+ public boolean parse(String code) throws Exception {
+ return helper.parse(code);
+ }
+
+ public List<ParseProblem> getParseProblems() {
+ return helper.getParseProblems();
+ }
+
+ public void addModels(Collection<IModel> models) {
+ helper.addModels(models);
+ }
+
+ public void addParamters(Map<String, ?> parameters) {
+ helper.addParamters(parameters);
+ }
+
+ public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
+ helper.addNativeTypeDelegates(nativeDelegates);
+ }
+
+ public Optional<RuleProfiler> getRuleProfiler() {
+ return helper.getRuleProfiler();
+ }
+
+ public void disposeModelRepository() {
+ helper.disposeModelRepository();
+ }
+
+ public void clearModelRepository() {
+ helper.clearModelRepository();
+ }
+
+ public void dispose() {
+ helper.dispose();
+ }
+
+ public void preProcess() {
+ helper.preProcess();
+ }
+
+ public void postProcess() {
+ helper.postProcess();
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/EmlTraces.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/EmlTraces.java
new file mode 100644
index 0000000..01026f3
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/EmlTraces.java
@@ -0,0 +1,38 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.eml;
+
+import org.eclipse.epsilon.ecl.trace.MatchTrace;
+import org.eclipse.epsilon.eml.trace.MergeTrace;
+
+/**
+ * A helper class to hold the EML results
+ * @author Horacio Hoyos
+ *
+ */
+public class EmlTraces {
+
+ private final MatchTrace matchTrace;
+ private final MergeTrace mergeTrace;
+
+ public EmlTraces(MatchTrace matchTrace, MergeTrace mergeTrace) {
+ this.matchTrace = matchTrace;
+ this.mergeTrace = mergeTrace;
+ }
+
+ public MatchTrace getMatchTrace() {
+ return matchTrace;
+ }
+
+ public MergeTrace getMergeTrace() {
+ return mergeTrace;
+ }
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/SimpleEmlExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/SimpleEmlExecutor.java
new file mode 100644
index 0000000..fe93484
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eml/SimpleEmlExecutor.java
@@ -0,0 +1,112 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.eml;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.eml.execute.context.EmlContext;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+import org.eclipse.epsilon.etl.EtlModule;
+import org.eclipse.epsilon.etl.IEtlModule;
+import org.eclipse.epsilon.executors.EpsilonLanguageExecutor;
+import org.eclipse.epsilon.executors.ExecutorHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The EML executor
+ *
+ * @author Horacio Hoyos Rodriguez
+ */
+public class SimpleEmlExecutor implements EpsilonLanguageExecutor<EmlTraces> {
+
+ private static final Logger logger = LoggerFactory.getLogger(SimpleEmlExecutor.class);
+ private IEtlModule module;
+ private ExecutorHelper helper;
+
+ public SimpleEmlExecutor() {
+ this(new EtlModule());
+ }
+
+ public SimpleEmlExecutor(IEtlModule mdl) {
+ logger.info("Creating the EtlExecutor");
+ module = mdl;
+ helper = new ExecutorHelper(module);
+ }
+
+ @Override
+ public EmlTraces execute() throws EolRuntimeException {
+ module.execute();
+ EmlContext c = (EmlContext) module.getContext();
+ return new EmlTraces(c.getMatchTrace(), c.getMergeTrace());
+ }
+
+ public boolean parse(File file) throws Exception {
+ return helper.parse(file);
+ }
+
+ public boolean parse(String code) throws Exception {
+ return helper.parse(code);
+ }
+
+ public List<ParseProblem> getParseProblems() {
+ return helper.getParseProblems();
+ }
+
+ public void addModels(Collection<IModel> models) {
+ helper.addModels(models);
+ }
+
+ public void addParamters(Map<String, ?> parameters) {
+ helper.addParamters(parameters);
+ }
+
+ public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
+ helper.addNativeTypeDelegates(nativeDelegates);
+ }
+
+ public Optional<RuleProfiler> getRuleProfiler() {
+ return helper.getRuleProfiler();
+ }
+
+ public void disposeModelRepository() {
+ helper.disposeModelRepository();
+ }
+
+ public void clearModelRepository() {
+ helper.clearModelRepository();
+ }
+
+ public void dispose() {
+ helper.dispose();
+ }
+
+ public void preProcess() {
+ helper.preProcess();
+ }
+
+ public void postProcess() {
+ helper.postProcess();
+ }
+
+ public boolean equals(Object obj) {
+ return helper.equals(obj);
+ }
+
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/EolExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/EolExecutor.java
new file mode 100644
index 0000000..73c0a5f
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/EolExecutor.java
@@ -0,0 +1,49 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.eol;
+
+import org.eclipse.epsilon.executors.EpsilonLanguageExecutor;
+import java.util.List;
+
+/**
+ * The IEolExecutor API provides additional methods to invoke a single operation inside an EOL
+ * script. The desired operation can be set using {@link #setOperationName(String)} and any
+ * required parameters for the operation passed via {@link #setOperationArguments(List)}. Setting
+ * the operation name with a non-empty string will set the execution mode to {@link EolMode#OPERATION}.
+ * Executing in {@link EolMode#OPERATION} without previously setting the operation name
+ * (via {@link #setOperationName(String)} will result in an {@link EolRuntimeException}.
+ *
+ * Setting the operation name to an empty string will result in the execution mode to change to
+ * {@link EolMode#SCRIPT}. Alternatively the {@link #setMode(EolMode)} method can be used to
+ * change the execution mode.
+ *
+ * @author Horacio Hoyos Rodriguez
+ *
+ */
+public interface EolExecutor extends EpsilonLanguageExecutor<Object> {
+
+ public static enum EolMode {
+ SCRIPT,
+ OPERATION
+ }
+
+ /**
+ * Set the operation name to invoke and any parameters to pass to the operation being invoked.
+ * @param arguments
+ */
+ SimpleEolExecutor changeOperation(String operationName, List<Object> arguments);
+
+ /**
+ * Set the operation name to invoke. This method can be used for operations with no parameters.
+ * @param arguments
+ */
+ SimpleEolExecutor changeOperation(String operationName);
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/SimpleEolExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/SimpleEolExecutor.java
new file mode 100644
index 0000000..725d573
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/eol/SimpleEolExecutor.java
@@ -0,0 +1,153 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.eol;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.eol.IEolModule;
+import org.eclipse.epsilon.eol.concurrent.EolModuleParallel;
+import org.eclipse.epsilon.eol.dom.Operation;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+import org.eclipse.epsilon.executors.ExecutorHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The EOL executor
+ *
+ * By default the complete EOL script is executed. Alternatively, a specific operation can be
+ * invoked by setting the desired operationName name (see {@link #setOperationName(String)}).
+ *
+ * Additionally, the {@link #setOperationArguments(List)} method can be used to provide a list of
+ * arguments to use for invocation of the operation. The arguments are considered to be in the same
+ * order and of the correct type of the operation signature.
+ *
+ * @author Horacio Hoyos Rodriguez
+ */
+public class SimpleEolExecutor implements EolExecutor {
+
+ private static final Logger logger = LoggerFactory.getLogger(SimpleEolExecutor.class);
+
+ private final Optional<String> operationName;
+ private final List<Object> arguments;
+ private final EolMode mode;
+ private IEolModule module;
+ private ExecutorHelper helper;
+
+ public SimpleEolExecutor() {
+ this(null, Collections.emptyList());
+ }
+
+ public SimpleEolExecutor(IEolModule mdl) {
+ this(null, Collections.emptyList(), mdl);
+ }
+
+ public SimpleEolExecutor(String oprtnNm, List<Object> arguments) {
+ this(oprtnNm, arguments, 1);
+ }
+
+ public SimpleEolExecutor(String oprtnNm, List<Object> argmnts, int nmbrThrds) {
+ this(oprtnNm, argmnts, new EolModuleParallel(nmbrThrds));
+ }
+
+ public SimpleEolExecutor(String oprtnNm, List<Object> argmnts, IEolModule mdl) {
+ operationName = Optional.ofNullable(oprtnNm);
+ mode = operationName.isPresent() ? EolMode.OPERATION : EolMode.SCRIPT;
+ arguments = argmnts;
+ module = mdl;
+ helper = new ExecutorHelper(module);
+ }
+
+ @Override
+ public Object execute() throws EolRuntimeException {
+ switch(mode) {
+ case SCRIPT:
+ logger.info("Executing complete EOL script.");
+ return module.execute();
+ case OPERATION:
+ Operation operation = module
+ .getDeclaredOperations()
+ .getOperation(operationName.orElseThrow(() -> new EolRuntimeException("Can not invoke executor in OPERATION mode without an operation name assigned.")));
+ logger.info("Executing EOL operation {} with arguments: {}.", operationName, arguments);
+ return operation.execute(null, arguments, module.getContext());
+ }
+ return null;
+ }
+
+ @Override
+ public SimpleEolExecutor changeOperation(String operationName, List<Object> arguments) {
+ return new SimpleEolExecutor(operationName, arguments);
+ }
+
+ @Override
+ public SimpleEolExecutor changeOperation(String operationName) {
+ return new SimpleEolExecutor(operationName, Collections.emptyList());
+ }
+
+ public boolean parse(File file) throws Exception {
+ return helper.parse(file);
+ }
+
+ public boolean parse(String code) throws Exception {
+ return helper.parse(code);
+ }
+
+ public List<ParseProblem> getParseProblems() {
+ return helper.getParseProblems();
+ }
+
+ public void addModels(Collection<IModel> models) {
+ helper.addModels(models);
+ }
+
+ public void addParamters(Map<String, ?> parameters) {
+ helper.addParamters(parameters);
+ }
+
+ public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
+ helper.addNativeTypeDelegates(nativeDelegates);
+ }
+
+ public Optional<RuleProfiler> getRuleProfiler() {
+ return helper.getRuleProfiler();
+ }
+
+ public void disposeModelRepository() {
+ helper.disposeModelRepository();
+ }
+
+ public void clearModelRepository() {
+ helper.clearModelRepository();
+ }
+
+ public void dispose() {
+ helper.dispose();
+ }
+
+ public void preProcess() {
+ helper.preProcess();
+ }
+
+ public void postProcess() {
+ helper.postProcess();
+ }
+
+
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/EtlSimpleTrace.ecore b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/EtlSimpleTrace.ecore
new file mode 100644
index 0000000..8fec375
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/EtlSimpleTrace.ecore
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="EtlSimpleTrace" nsURI="http://www.eclipse.org/epsilon/etl/EtlSimpleTrace"
+ nsPrefix="etltr">
+ <eClassifiers xsi:type="ecore:EClass" name="Trace">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="links" upperBound="-1"
+ eType="#//TraceLink" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="TraceLink">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="sources" upperBound="-1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="targets" upperBound="-1"
+ eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/EtlSimpleTrace.emf b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/EtlSimpleTrace.emf
new file mode 100644
index 0000000..b487f55
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/EtlSimpleTrace.emf
@@ -0,0 +1,12 @@
+@namespace(uri="http://www.eclipse.org/epsilon/etl/EtlSimpleTrace", prefix="etltr")
+package EtlSimpleTrace;
+
+class Trace {
+ val TraceLink[*] links;
+}
+
+class TraceLink {
+ ref EObject[*] sources;
+ ref EObject[*] targets;
+ attr String description;
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/SimpleEtlExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/SimpleEtlExecutor.java
new file mode 100644
index 0000000..1a7537c
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/etl/SimpleEtlExecutor.java
@@ -0,0 +1,107 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.etl;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+import org.eclipse.epsilon.etl.EtlModule;
+import org.eclipse.epsilon.etl.IEtlModule;
+import org.eclipse.epsilon.etl.trace.TransformationTrace;
+import org.eclipse.epsilon.executors.EpsilonLanguageExecutor;
+import org.eclipse.epsilon.executors.ExecutorHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The ETL executor
+ *
+ * @author Horacio Hoyos Rodriguez
+ */
+public class SimpleEtlExecutor implements EpsilonLanguageExecutor<TransformationTrace> {
+
+ private static final Logger logger = LoggerFactory.getLogger(SimpleEtlExecutor.class);
+ private IEtlModule module;
+ private ExecutorHelper helper;
+
+ public SimpleEtlExecutor() {
+ this(new EtlModule());
+
+ }
+
+ public SimpleEtlExecutor(IEtlModule mdl) {
+ logger.info("Creating the Etl Executor");
+ module = mdl;
+ helper = new ExecutorHelper(module);
+ }
+
+
+ @Override
+ public TransformationTrace execute() throws EolRuntimeException {
+ return (TransformationTrace) module.execute();
+ }
+
+ public boolean parse(File file) throws Exception {
+ return helper.parse(file);
+ }
+
+ public boolean parse(String code) throws Exception {
+ return helper.parse(code);
+ }
+
+ public List<ParseProblem> getParseProblems() {
+ return helper.getParseProblems();
+ }
+
+ public void addModels(Collection<IModel> models) {
+ helper.addModels(models);
+ }
+
+ public void addParamters(Map<String, ?> parameters) {
+ helper.addParamters(parameters);
+ }
+
+ public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
+ helper.addNativeTypeDelegates(nativeDelegates);
+ }
+
+ public Optional<RuleProfiler> getRuleProfiler() {
+ return helper.getRuleProfiler();
+ }
+
+ public void disposeModelRepository() {
+ helper.disposeModelRepository();
+ }
+
+ public void clearModelRepository() {
+ helper.clearModelRepository();
+ }
+
+ public void dispose() {
+ helper.dispose();
+ }
+
+ public void preProcess() {
+ helper.preProcess();
+ }
+
+ public void postProcess() {
+ helper.postProcess();
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/EvlExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/EvlExecutor.java
new file mode 100644
index 0000000..bca0bfa
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/EvlExecutor.java
@@ -0,0 +1,46 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.evl;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.epsilon.evl.dom.Constraint;
+import org.eclipse.epsilon.evl.dom.ConstraintContext;
+import org.eclipse.epsilon.evl.execute.UnsatisfiedConstraint;
+import org.eclipse.epsilon.executors.EpsilonLanguageExecutor;
+
+/**
+ * The IEvlExecutor API provides additional methods to print the validation results.
+ *
+ */
+public interface EvlExecutor extends EpsilonLanguageExecutor<Collection<UnsatisfiedConstraint>> {
+
+
+ /**
+ * Send the unsatisfied constraints to the log
+ */
+ void logUnsatisfied(Collection<UnsatisfiedConstraint> unsatisfiedConstraints);
+
+ /**
+ * Pretty print the unsatisfied constraints
+ */
+ void printUnsatisfied(Collection<UnsatisfiedConstraint> unsatisfiedConstraints);
+
+ List<Constraint> getConstraints();
+
+ List<ConstraintContext> getConstraintContexts();
+
+ ConstraintContext getConstraintContext(String name);
+
+ Set<UnsatisfiedConstraint> getUnsatisfiedConstraints();
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/SimpleEvlExecutor.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/SimpleEvlExecutor.java
new file mode 100644
index 0000000..59f889a
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/evl/SimpleEvlExecutor.java
@@ -0,0 +1,220 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.evl;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+
+import org.eclipse.epsilon.common.parse.problem.ParseProblem;
+import org.eclipse.epsilon.eol.exceptions.EolRuntimeException;
+import org.eclipse.epsilon.eol.models.IModel;
+import org.eclipse.epsilon.eol.types.IToolNativeTypeDelegate;
+import org.eclipse.epsilon.erl.execute.RuleProfiler;
+import org.eclipse.epsilon.evl.EvlModule;
+import org.eclipse.epsilon.evl.IEvlFixer;
+import org.eclipse.epsilon.evl.IEvlModule;
+import org.eclipse.epsilon.evl.concurrent.EvlModuleParallelElements;
+import org.eclipse.epsilon.evl.dom.Constraint;
+import org.eclipse.epsilon.evl.dom.ConstraintContext;
+import org.eclipse.epsilon.evl.execute.CommandLineFixer;
+import org.eclipse.epsilon.evl.execute.UnsatisfiedConstraint;
+import org.eclipse.epsilon.executors.ExecutorHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The EVL executor
+ * @author Horacio Hoyos Rodriguez
+ */
+public class SimpleEvlExecutor implements EvlExecutor {
+
+ private static final Logger logger = LoggerFactory.getLogger(SimpleEvlExecutor.class);
+ private final IEvlModule module;
+ private ExecutorHelper helper;
+
+ public SimpleEvlExecutor(IEvlModule mdl) {
+ logger.info("Creating the EvlExecutor");
+ module = mdl;
+ helper = new ExecutorHelper(module);
+ }
+
+ public SimpleEvlExecutor() {
+ this(false, 0, null);
+ }
+
+ public SimpleEvlExecutor(IEvlFixer evlFixer) {
+ this(false, 0, evlFixer);
+ }
+
+
+ public SimpleEvlExecutor(boolean useParallel) {
+ this(useParallel, 1, new CommandLineFixer());
+ }
+
+
+ public SimpleEvlExecutor(boolean useParallel, int parallelism, IEvlFixer evlFixer) {
+ this(useParallel ? new EvlModuleParallelElements(parallelism) : new EvlModule());
+ module.setUnsatisfiedConstraintFixer(evlFixer);
+ }
+
+ @Override
+ public Collection<UnsatisfiedConstraint> execute() throws EolRuntimeException {
+ return module.execute();
+ }
+
+ @Override
+ public List<Constraint> getConstraints() {
+ return module.getConstraints();
+ }
+
+ @Override
+ public List<ConstraintContext> getConstraintContexts() {
+ return module.getConstraintContexts();
+ }
+
+ @Override
+ public ConstraintContext getConstraintContext(String name) {
+ return module.getConstraintContext(name);
+ }
+
+ @Override
+ public Set<UnsatisfiedConstraint> getUnsatisfiedConstraints() {
+ return module.getContext().getUnsatisfiedConstraints();
+ }
+
+ public boolean parse(File file) throws Exception {
+ return helper.parse(file);
+ }
+
+ public boolean parse(String code) throws Exception {
+ return helper.parse(code);
+ }
+
+ public List<ParseProblem> getParseProblems() {
+ return helper.getParseProblems();
+ }
+
+ public void addModels(Collection<IModel> models) {
+ helper.addModels(models);
+ }
+
+ public void addParamters(Map<String, ?> parameters) {
+ helper.addParamters(parameters);
+ }
+
+ public void addNativeTypeDelegates(Collection<IToolNativeTypeDelegate> nativeDelegates) {
+ helper.addNativeTypeDelegates(nativeDelegates);
+ }
+
+ public Optional<RuleProfiler> getRuleProfiler() {
+ return helper.getRuleProfiler();
+ }
+
+ public void disposeModelRepository() {
+ helper.disposeModelRepository();
+ }
+
+ public void clearModelRepository() {
+ helper.clearModelRepository();
+ }
+
+ public void dispose() {
+ helper.dispose();
+ }
+
+ public void preProcess() {
+ helper.preProcess();
+ }
+
+ public void postProcess() {
+ helper.postProcess();
+ }
+
+ @Override
+ public void logUnsatisfied(Collection<UnsatisfiedConstraint> unsatisfiedConstraints) {
+ int numUnsatisfied = unsatisfiedConstraints.size();
+ if (numUnsatisfied > 0) {
+ // Separate critiques from constraints
+ List<UnsatisfiedConstraint> consraints = new ArrayList<>();
+ List<UnsatisfiedConstraint> critiques = new ArrayList<>();
+ unsatisfiedConstraints.stream()
+ .forEach(uc -> {
+ if (uc.getConstraint().isCritique()) {
+ critiques.add(uc);
+ } else {
+ consraints.add(uc);}
+ }
+ );
+ logger.warn(String.format("There %s %s unsatisfied Constraint(s).",
+ numUnsatisfied > 1 ? "were" : "was",
+ numUnsatisfied));
+ for (UnsatisfiedConstraint uc : unsatisfiedConstraints) {
+ if (uc.getConstraint().isCritique()) {
+ logger.warn(uc.getMessage());
+ }
+ else {
+ logger.error(uc.getMessage());
+ }
+ }
+ }
+ else {
+ logger.info("All constraints have been satisfied.");
+ }
+ }
+
+ @Override
+ public void printUnsatisfied(Collection<UnsatisfiedConstraint> unsatisfiedConstraints) {
+ int numUnsatisfied = unsatisfiedConstraints.size();
+ if (numUnsatisfied > 0) {
+ // Separate critiques from constraints
+ List<UnsatisfiedConstraint> consraints = new ArrayList<>();
+ List<UnsatisfiedConstraint> critiques = new ArrayList<>();
+ unsatisfiedConstraints.stream()
+ .forEach(uc -> {
+ if (uc.getConstraint().isCritique()) {
+ critiques.add(uc);
+ } else {
+ consraints.add(uc);
+ }
+ });
+ Optional<String> maxWidth = unsatisfiedConstraints.stream()
+ .map(uc -> uc.getConstraint().getName())
+ .max(Comparator.comparingInt(String::length));
+ int tabDivision = maxWidth.orElse(" ").length();
+ String msg = "Unsatisfied Contraints";
+ String division = new String(new char[msg.length()]).replace("\0", "=");
+ System.out.println(msg);
+ System.out.println(division);
+ for (UnsatisfiedConstraint uc : consraints) {
+ System.out.format("\u16D6 %-"+tabDivision+"s %s%n", uc.getConstraint().getName(), uc.getMessage());
+ }
+ msg = "Unsatisfied Critiques";
+ division = new String(new char[msg.length()]).replace("\0", "=");
+ System.out.println(msg);
+ System.out.println(division);
+ for (UnsatisfiedConstraint uc : consraints) {
+ System.out.format("\u16B9 %-"+tabDivision+"s %s%n", uc.getConstraint().getName(), uc.getMessage());
+ }
+ }
+ else {
+ String msg = "All constraints have been satisfied";
+ String division = new String(new char[msg.length()]).replace("\0", "=");
+ System.out.println(msg);
+ System.out.println(division);
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/CachedModelBuilder.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/CachedModelBuilder.java
new file mode 100644
index 0000000..7a1535b
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/CachedModelBuilder.java
@@ -0,0 +1,30 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model;
+
+import org.eclipse.epsilon.eol.models.IModel;
+
+/**
+ * Base class for Cached model builders
+ * @param <T>
+ * @param <M>
+ *
+ */
+public abstract class CachedModelBuilder<M extends IModel, T extends CachedModelBuilder<M, T>>
+ extends ModelBuilder<M, T> implements ICachedModelBuilder<M, T> {
+
+ protected boolean useCache = true;
+
+ @Override
+ public T useCache(boolean useCache) {
+ this.useCache = useCache;
+ return self();
+ }
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ICachedModelBuilder.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ICachedModelBuilder.java
new file mode 100644
index 0000000..4bdccb9
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ICachedModelBuilder.java
@@ -0,0 +1,26 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model;
+
+import org.eclipse.epsilon.eol.models.IModel;
+
+/**
+ * A model builder for models that support cache
+ * @param <T> The type of model builder
+ * @param <M> The type of model being built
+ *
+ * @author Horacio Hoyos Rodriguez
+ * @author Beatriz Sanchez Piña
+ */
+public interface ICachedModelBuilder<M extends IModel, T extends ICachedModelBuilder<M, T>> extends IModelBuilder<M, T> {
+
+ T useCache(boolean useCache);
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/IModelBuilder.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/IModelBuilder.java
new file mode 100644
index 0000000..3a9ead8
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/IModelBuilder.java
@@ -0,0 +1,91 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model;
+
+import org.eclipse.epsilon.eol.models.IModel;
+
+import java.lang.reflect.ParameterizedType;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * A builder to build different type of EMC models.
+ *
+ * @param <M> The type of model being built
+ * @param <T> The type of model builder
+ *
+ * @author Horacio Hoyos Rodriguez
+ * @author Beatriz Sanchez Piña
+ */
+public interface IModelBuilder<M extends IModel, T extends IModelBuilder<M, T>> {
+
+ /**
+ * Utility method to return "this" that allows extending models to return an appropriate T
+ * @return the model builder
+ */
+ T self();
+
+ /**
+ * Return a human readable name for the builder. By default the name of the specific IModel returned by the builder
+ * is used.
+ * @return The name of the builder
+ */
+ default String getName() {
+ return ((Class<?>)
+ ((ParameterizedType)getClass().getGenericSuperclass())
+ .getActualTypeArguments()[1]).getName();
+ }
+
+ /**
+ * Set the model aliases
+ * @param aliases the aliases to use for the model
+ * @return the builder
+ */
+ T withAliases(String... aliases);
+
+ /**
+ * Store the model on disposal
+ * @param storeOnDisposal True to store the model
+ * @return the builder
+ */
+ T storeOnDisposal(boolean storeOnDisposal);
+
+ /**
+ * Read the model on load
+ * @param readOnLoad True to read the model
+ * @return the builder
+ */
+ T readOnLoad(boolean readOnLoad);
+
+ /**
+ * Use the provided name as the model name
+ * @param name The name for the model
+ * @return the builder
+ */
+ T withName(String name);
+
+ /**
+ * The Path of the model
+ * @param modelPath The Path of the model
+ * @return the builder
+ */
+ T withModelPath(Path modelPath);
+
+ default T withModelPath(String modelPath) {
+ return withModelPath(Paths.get(modelPath));
+ }
+
+ /**
+ * Build the model
+ * @return The M model configured based on the provided values.
+ * @throws Exception
+ */
+ M build() throws Exception;
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ModelBuilder.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ModelBuilder.java
new file mode 100644
index 0000000..fbf223a
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/model/ModelBuilder.java
@@ -0,0 +1,61 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.model;
+
+import java.nio.file.Path;
+import java.util.Arrays;
+import java.util.Collection;
+import org.eclipse.epsilon.eol.models.IModel;
+
+/**
+ * Base class for the model builders.
+ *
+ * @author Horacio Hoyos Rodriguez
+ * @author Beatriz Sanchez Piña
+ */
+public abstract class ModelBuilder<M extends IModel, T extends ModelBuilder<M, T>> implements IModelBuilder<M, T> {
+
+ protected String name;
+ protected String modelUri;
+ protected Collection<String> aliases;
+ protected boolean storeOnDisposal = false;
+ protected boolean readOnLoad = true;
+
+ @Override
+ public T withAliases(String ... aliases) {
+ this.aliases = Arrays.asList(aliases);
+ return self();
+ }
+
+ @Override
+ public T storeOnDisposal(boolean storeOnDisposal) {
+ this.storeOnDisposal = storeOnDisposal;
+ return self();
+ }
+
+ @Override
+ public T readOnLoad(boolean readOnLoad) {
+ this.readOnLoad = readOnLoad;
+ return self();
+ }
+
+ @Override
+ public T withName(String name) {
+ this.name = name;
+ return self();
+ }
+
+ @Override
+ public T withModelPath(Path modelPath) {
+ this.modelUri = modelPath.toString();
+ return self();
+ }
+
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/util/BasePathResolver.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/util/BasePathResolver.java
new file mode 100644
index 0000000..3d4ca9f
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/util/BasePathResolver.java
@@ -0,0 +1,37 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.util;
+
+import org.eclipse.epsilon.eol.models.IRelativePathResolver;
+
+/**
+ * A base path resolver that uses a prefix (basePath) to create full paths.
+ */
+public class BasePathResolver implements IRelativePathResolver {
+
+ private String basePath;
+
+ public BasePathResolver(String basePath) {
+ this.basePath = basePath;
+ }
+
+ public String getBasePath() {
+ return basePath;
+ }
+
+ public void setBasePath(String basePath) {
+ this.basePath = basePath;
+ }
+
+ @Override
+ public String resolve(String relativePath) {
+ return basePath + relativePath;
+ }
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/util/JavaRelativePathResolver.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/util/JavaRelativePathResolver.java
new file mode 100644
index 0000000..c8b3083
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/util/JavaRelativePathResolver.java
@@ -0,0 +1,80 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.util;
+
+import org.eclipse.epsilon.eol.models.IRelativePathResolver;
+
+import java.util.regex.Pattern;
+
+/**
+ * An IRelativePathResolver that resolves resource URLs in the gen(bin/target) folder to the src folder.
+ * NOTE: This class is intended to be used in testing environments where it is desirable to access/modify
+ * scripts in the src folder as opposed to the gen folder. In deployment stick to the resources as loaded
+ * form the class or provide other means to access the scripts.
+ * NOTE: The implemented strategy only works with resources added side-by-side with the Java code (i.e. in the
+ * same folders).
+ * NOTE: If your maven build changes the default locations of resources in the target folder then using the provided
+ * find regex and replace value will fail to resolve the original files correctly. In this case you can provide your
+ * own find regex and replace values (see {@link #setGenFolder(Pattern)} and {@link #setSrcFolder(String)}).
+ *
+ * This RelativePathResolver can be used to resolve ExL scripts or model locations, in the output folder of a Java
+ * project to the original source folder. The gen folder lookup is a regex expression, which can be useful to match
+ * complex structures.
+ *
+ * The class provides static fields for the basic java style (bin -> src) and for maven like structures
+ * (target/classes/ -> src/main/java). By default java style resolution is used.
+
+ *
+ * <pre>
+ * {@code
+ * URL scriptUrl = SomeClass.getClass().getResource(/some/resource/location/myScript.eol);
+ * // scriptUrl = "some/path/bin/some/resource/location/myScript.eol"
+ * // Resolve
+ * IRelativePathResolver pr = new JavaRelativePathResolver();
+ * String srcPath = pr.resolve(scriptUrl.toString();
+ * System.out.println(srcPath); // prints: some/path/src/some/resource/location/myScript.eol"
+ * }
+ * </pre>
+ *
+ */
+public class JavaRelativePathResolver extends BasePathResolver implements IRelativePathResolver {
+
+ public static final Pattern JAVA_GEN_FOLDER = Pattern.compile("/bin/");
+ public static final String JAVA_SRC_FOLDER = "/src/";
+ public static final Pattern MAVEN_GEN_FOLDER = Pattern.compile("/target/classes/");
+ public static final String MAVEN_SRC_FOLDER = "/src/main/java";
+
+ private Pattern genFolder;
+ private String srcFolder;
+
+ public JavaRelativePathResolver() {
+ super("");
+ genFolder = JAVA_GEN_FOLDER;
+ srcFolder = JAVA_SRC_FOLDER;
+ }
+
+ public JavaRelativePathResolver(String basePath) {
+ super(basePath);
+ }
+
+ public void setGenFolder(Pattern genFolder) {
+ this.genFolder = genFolder;
+ }
+
+ public void setSrcFolder(String srcFolder) {
+ this.srcFolder = srcFolder;
+ }
+
+ @Override
+ public String resolve(String s) {
+ String fullPath = super.resolve(s);
+ return genFolder.matcher(fullPath).replaceAll(srcFolder);
+ }
+}
diff --git a/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/util/ParameterUtil.java b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/util/ParameterUtil.java
new file mode 100644
index 0000000..1b3eacd
--- /dev/null
+++ b/plugins/org.eclipse.epsilon.executors/src/org/eclipse/epsilon/executors/util/ParameterUtil.java
@@ -0,0 +1,16 @@
+/*********************************************************************
+* Copyright (c) 2019 The University of York.
+*
+* This program and the accompanying materials are made
+* available under the terms of the Eclipse Public License 2.0
+* which is available at https://www.eclipse.org/legal/epl-2.0/
+*
+* SPDX-License-Identifier: EPL-2.0
+**********************************************************************/
+package org.eclipse.epsilon.executors.util;
+
+/**
+ * The Parameter util provides utility methods for creating parameters.
+ */
+public class ParameterUtil {
+}
diff --git a/plugins/org.eclipse.epsilon.targetplatform/org.eclipse.epsilon.targetplatform.target b/plugins/org.eclipse.epsilon.targetplatform/org.eclipse.epsilon.targetplatform.target
index 53dde89..7fe31ed 100644
--- a/plugins/org.eclipse.epsilon.targetplatform/org.eclipse.epsilon.targetplatform.target
+++ b/plugins/org.eclipse.epsilon.targetplatform/org.eclipse.epsilon.targetplatform.target
@@ -5,20 +5,16 @@
<repository location="http://download.eclipse.org/emfatic/update/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
-<unit id="org.eclipse.e4.core.tools.feature.feature.group" version="4.8.0.v20180512-1132"/>
-<unit id="org.eclipse.emf.sdk.feature.group" version="2.14.0.v20180529-1157"/>
-<unit id="org.eclipse.emf.validation.sdk.feature.group" version="1.12.0.201805030717"/>
-<unit id="org.eclipse.equinox.sdk.feature.group" version="3.14.0.v20180518-2029"/>
-<unit id="org.eclipse.gef.sdk.feature.group" version="3.11.0.201606061308"/>
-<unit id="org.eclipse.gmf.feature.group" version="1.12.0.201806010809"/>
-<unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.12.0.201805221301"/>
-<unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.12.0.201806010809"/>
-<unit id="org.eclipse.jdt.feature.group" version="3.14.0.v20180611-0500"/>
-<unit id="org.eclipse.platform.feature.group" version="4.8.0.v20180611-0656"/>
-<unit id="org.eclipse.platform.sdk" version="4.8.0.I20180611-0500"/>
-<unit id="org.eclipse.rcp.feature.group" version="4.8.0.v20180611-0656"/>
-<unit id="org.eclipse.sdk.ide" version="4.8.0.I20180611-0500"/>
<repository location="http://download.eclipse.org/releases/photon/"/>
+ <unit id="org.eclipse.emf.sdk.feature.group" version="2.14.0.v20180529-1157"/>
+ <unit id="org.eclipse.emf.validation.sdk.feature.group" version="1.12.0.201805030717"/>
+ <unit id="org.eclipse.equinox.sdk.feature.group" version="3.14.0.v20180518-2029"/>
+ <unit id="org.eclipse.gef.sdk.feature.group" version="3.11.0.201606061308"/>
+ <unit id="org.eclipse.gmf.feature.group" version="1.12.0.201806010809"/>
+ <unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.12.0.201805221301"/>
+ <unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.12.0.201806010809"/>
+ <unit id="org.eclipse.jdt.feature.group" version="3.14.0.v20180611-0500"/>
+ <unit id="org.eclipse.modisco.sdk.feature.feature.group" version="1.2.0.201805182005"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.gmf.sdk.feature.group" version="3.2.1.201409171321"/>
@@ -27,15 +23,11 @@
<unit id="org.eclipse.gmf.tooling.runtime.feature.group" version="3.2.1.201409171321"/>
<repository location="http://download.eclipse.org/modeling/gmp/gmf-tooling/updates/releases"/>
</location>
-<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
-<unit id="org.eclipse.emf.compare.ide.ui.source.feature.group" version="3.3.3.201805161152"/>
-<unit id="org.eclipse.emf.compare.uml2.source.feature.group" version="3.3.3.201805161152"/>
-<unit id="org.eclipse.ocl.all.sdk.feature.group" version="5.4.0.v20180611-1119"/>
-<unit id="org.eclipse.sirius.runtime.feature.group" version="6.0.0.201806111309"/>
-<unit id="org.eclipse.sirius.runtime.ide.ui.feature.group" version="6.0.0.201806111309"/>
-<unit id="org.eclipse.xsd.sdk.feature.group" version="2.14.0.v20180131-0817"/>
-<unit id="org.eclipse.xtext.sdk.feature.group" version="2.14.0.v20180523-0937"/>
+<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="http://download.eclipse.org/releases/photon/"/>
+ <unit id="org.eclipse.ocl.all.sdk.feature.group" version="5.4.0.v20180611-1119"/>
+ <unit id="org.eclipse.xsd.sdk.feature.group" version="2.14.0.v20180131-0817"/>
+ <unit id="org.eclipse.xtext.sdk.feature.group" version="2.14.0.v20180523-0937"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="false" type="InstallableUnit">
<unit id="org.eclipse.pde.feature.group" version="3.13.100.v20180611-0826"/>
diff --git a/standalone/org.eclipse.epsilon.standalone.engine/.gitignore b/standalone/org.eclipse.epsilon.standalone.engine/.gitignore
new file mode 100644
index 0000000..dbef52f
--- /dev/null
+++ b/standalone/org.eclipse.epsilon.standalone.engine/.gitignore
@@ -0,0 +1,3 @@
+*.settings
+*.project
+*.classpath
\ No newline at end of file
diff --git a/standalone/org.eclipse.epsilon.standalone.engine/.settings/org.eclipse.core.resources.prefs b/standalone/org.eclipse.epsilon.standalone.engine/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/standalone/org.eclipse.epsilon.standalone.engine/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/<project>=UTF-8
diff --git a/standalone/org.eclipse.epsilon.standalone.engine/.settings/org.eclipse.m2e.core.prefs b/standalone/org.eclipse.epsilon.standalone.engine/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/standalone/org.eclipse.epsilon.standalone.engine/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/standalone/org.eclipse.epsilon.standalone.engine/pom.xml b/standalone/org.eclipse.epsilon.standalone.engine/pom.xml
new file mode 100644
index 0000000..6b4d715
--- /dev/null
+++ b/standalone/org.eclipse.epsilon.standalone.engine/pom.xml
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright (c) 2008-2018 The University of York.
+ ~ This program and the accompanying materials
+ ~ are made available under the terms of the Eclipse Public License 2.0
+ ~ which is available at https://www.eclipse.org/legal/epl-2.0/
+ -->
+
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.eclipse.epsilon</groupId>
+ <artifactId>standalone.engine.parent</artifactId>
+ <version>0.0.6</version>
+ <packaging>pom</packaging>
+ <url>https://eclipse.org/epsilon/</url>
+
+ <licenses>
+ <license>
+ <name>Eclipse Public License 2.0</name>
+ <url>https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt</url>
+ </license>
+ </licenses>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <epsilonVersion>1.6.0-SNAPSHOT</epsilonVersion>
+ <slf4jVersion>1.7.25</slf4jVersion>
+ <junitVersion>4.12</junitVersion>
+ </properties>
+
+ <repositories>
+ <repository>
+ <id>oss-sonatype</id>
+ <name>oss-sonatype</name>
+ <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>ojo-snapshots</id>
+ <name>oss-jfrog-artifactory-snapshots</name>
+ <url>https://oss.jfrog.org/artifactory/oss-snapshot-local</url>
+ </snapshotRepository>
+ <repository>
+ <id>bintray-epsilonlabs-epsilon-standalone</id>
+ <url>https://api.bintray.com/maven/epsilonlabs/epsilon-standalone/standalone-engine/;publish=1</url>
+ </repository>
+
+ </distributionManagement>
+
+ <modules>
+ <module>org.eclipse.epsilon.standalone.engine</module>
+ <module>org.eclipse.epsilon.standalone.engine.emf</module>
+ <module>org.eclipse.epsilon.standalone.engine.simulink</module>
+ <module>org.eclipse.epsilon.standalone.engine.spreadsheets</module>
+ <module>org.eclipse.epsilon.standalone.engine.spreadsheets.excel</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.7.0</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>3.0.1</version>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>3.0.0</version>
+ <configuration>
+ <additionalparam>${javadoc.opts}</additionalparam>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.5.3</version>
+ <configuration>
+ <tagNameFormat>@{project.version}</tagNameFormat>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>java8-doclint-disabled</id>
+ <activation>
+ <jdk>[1.8,)</jdk>
+ </activation>
+ <properties>
+ <javadoc.opts>-Xdoclint:none</javadoc.opts>
+ </properties>
+ </profile>
+ </profiles>
+</project>
diff --git a/standalone/org.eclipse.epsilon.standalone/jarmodel.xml b/standalone/org.eclipse.epsilon.standalone/jarmodel.xml
index 743b68f..5a8b491 100644
--- a/standalone/org.eclipse.epsilon.standalone/jarmodel.xml
+++ b/standalone/org.eclipse.epsilon.standalone/jarmodel.xml
@@ -48,6 +48,10 @@
groupId="org.eclipse.emf"
artifactId="org.eclipse.emf.ecore.xmi"
version="2.12.0" />
+ <plugin name="org.eclipse.core.runtime"
+ groupId="org.eclipse.platform"
+ artifactId="org.eclipse.core.runtime"
+ version="3.12.0" />
<plugin name="org.eclipse.xsd"
groupId="org.eclipse.xsd"
artifactId="org.eclipse.xsd"
diff --git a/tests/org.eclipse.epsilon.ecl.engine.test.acceptance/src/org/eclipse/epsilon/ecl/engine/test/acceptance/graphs/Graph.ecore b/tests/org.eclipse.epsilon.ecl.engine.test.acceptance/src/org/eclipse/epsilon/ecl/engine/test/acceptance/graphs/Graph.ecore
new file mode 100644
index 0000000..ef92c26
--- /dev/null
+++ b/tests/org.eclipse.epsilon.ecl.engine.test.acceptance/src/org/eclipse/epsilon/ecl/engine/test/acceptance/graphs/Graph.ecore
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="Graph"
+ nsURI="Graph" nsPrefix="Graph">
+ <eClassifiers xsi:type="ecore:EClass" name="Graph">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="nodes" upperBound="-1"
+ eType="#//Node" containment="true"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Node">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="outgoing" upperBound="-1"
+ eType="#//Edge" containment="true" eOpposite="#//Edge/source"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="incoming" upperBound="-1"
+ eType="#//Edge" eOpposite="#//Edge/target"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Edge">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="source" eType="#//Node"
+ eOpposite="#//Node/outgoing"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="target" eType="#//Node"
+ eOpposite="#//Node/incoming"/>
+ </eClassifiers>
+</ecore:EPackage>
diff --git a/tests/org.eclipse.epsilon.ecl.engine.test.acceptance/src/org/eclipse/epsilon/ecl/engine/test/acceptance/graphs/graph.ecl b/tests/org.eclipse.epsilon.ecl.engine.test.acceptance/src/org/eclipse/epsilon/ecl/engine/test/acceptance/graphs/graph.ecl
new file mode 100644
index 0000000..9e3037f
--- /dev/null
+++ b/tests/org.eclipse.epsilon.ecl.engine.test.acceptance/src/org/eclipse/epsilon/ecl/engine/test/acceptance/graphs/graph.ecl
@@ -0,0 +1,20 @@
+$parallel (lg.nodes.size() + rg.nodes.size()) > 2000
+rule Graph
+ match lg : Left!Graph with rg : Right!Graph {
+ compare : lg.nodes.asSet().matches(rg.nodes.asSet())
+}
+
+@lazy
+rule Node
+ match ln : Left!Node with rn : Right!Node {
+ guard : ln.name.equalsIgnoreCase(rn.name)
+ compare : ln.outgoing.size() == rn.outgoing.size() and
+ ln.incoming.size() == rn.outgoing.size()
+}
+
+post {
+ matchTrace.getMatches()
+ .parallelSelect(m | m.`rule`.name == "Node")
+ .parallelForAll(m | m.isMatching())
+ .println();
+}
\ No newline at end of file