Ver código fonte

Issue 917 (#921)

* #917 - Extracted GeneratorExecutor from Generator

Removed Xpand code generator since Xpand is no longer supported
changed the wax code generator injection works.
Andreas Mülder 9 anos atrás
pai
commit
987d259417
100 arquivos alterados com 976 adições e 2219 exclusões
  1. 2 20
      plugins/org.yakindu.sct.domain.generic.generator/src/org/yakindu/sct/domain/generic/generator/GenericGeneratorModule.java
  2. 1 4
      plugins/org.yakindu.sct.domain/src/org/yakindu/sct/domain/extension/IDomain.java
  3. 5 10
      plugins/org.yakindu.sct.domain/src/org/yakindu/sct/domain/extension/impl/DomainImpl.java
  4. 53 0
      plugins/org.yakindu.sct.generator.builder/src/org/yakindu/sct/generator/builder/EclipseContextGeneratorExecutorLookup.java
  5. 1 19
      plugins/org.yakindu.sct.generator.builder/src/org/yakindu/sct/generator/builder/SCTBuilder.java
  6. 5 23
      plugins/org.yakindu.sct.generator.builder/src/org/yakindu/sct/generator/builder/action/GenerateModelAction.java
  7. 0 21
      plugins/org.yakindu.sct.generator.c/library/FeatureTypeLibraryDep.xmi
  8. 3 1
      plugins/org.yakindu.sct.generator.c/plugin.xml
  9. 0 107
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CCodeGenerator.java
  10. 52 0
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CCodeGeneratorModule.java
  11. 7 15
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CGenerator.xtend
  12. 1 7
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CNamingService.xtend
  13. 26 66
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/GenArtifactConfigurations.java
  14. 27 14
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/IGenArtifactConfigurations.java
  15. 1 2
      plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineHeader.xtend
  16. 0 1
      plugins/org.yakindu.sct.generator.core/META-INF/MANIFEST.MF
  17. 12 2
      plugins/org.yakindu.sct.generator.core/schema/generator.exsd
  18. 0 27
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/GeneratorActivator.java
  19. 27 0
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/GeneratorModule.java
  20. 1 1
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/IExecutionFlowGenerator.java
  21. 5 11
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/ISCTGenerator.java
  22. 1 1
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/ISGraphGenerator.java
  23. 53 0
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/AbstractGeneratorEntryExecutor.java
  24. 8 80
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/impl/AbstractSExecModelGenerator.java
  25. 33 33
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/GeneratorExecutor.java
  26. 24 0
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/IGeneratorEntryExecutor.java
  27. 81 0
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/SExecGeneratorEntryExecutor.java
  28. 34 0
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/SGraphGeneratorEntryExecutor.java
  29. 37 4
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/extensions/GeneratorExtensions.java
  30. 8 2
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/extensions/IGeneratorDescriptor.java
  31. 78 0
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/filesystem/DefaultFileSystemAccessFactory.java
  32. 3 11
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/filesystem/SCTJavaIoFileSystemAccess.java
  33. 0 237
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/impl/AbstractSGraphModelGenerator.java
  34. 1 1
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/library/ICoreLibraryHelper.java
  35. 1 1
      plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/library/impl/DefaultCoreLibraryHelper.java
  36. 2 26
      plugins/org.yakindu.sct.generator.cpp/plugin.xml
  37. 0 78
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/CppCodeGenerator.java
  38. 37 0
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/CppCodeGeneratorModule.java
  39. 5 13
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/CppGenerator.xtend
  40. 1 3
      plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/CppNamingService.xtend
  41. 1 1
      plugins/org.yakindu.sct.generator.csharp/.classpath
  42. 3 3
      plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.jdt.core.prefs
  43. 7 7
      plugins/org.yakindu.sct.generator.csharp/plugin.xml
  44. 0 51
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpCodeGenerator.java
  45. 36 0
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpGeneratorModule.java
  46. 7 12
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RunnableWrapper.xtend
  47. 20 22
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RuntimeService.xtend
  48. 0 1
      plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/features/CSharpFeatureValueProvider.java
  49. 0 1
      plugins/org.yakindu.sct.generator.genmodel.ui/.settings/org.eclipse.core.resources.prefs
  50. 0 8
      plugins/org.yakindu.sct.generator.genmodel.ui/plugin.xml
  51. 4 4
      plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/GeneratorComposite.java
  52. 24 50
      plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/GeneratorProjectTemplate.xtend
  53. 1 1
      plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/GeneratorType.java
  54. 0 38
      plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/WorkspaceGeneratorProjectWizard.java
  55. 0 28
      plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandDefaultTemplate.xpt
  56. 0 89
      plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandGeneratorProjectWizard.java
  57. 0 151
      plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandGeneratorWizardPage1.java
  58. 8 7
      plugins/org.yakindu.sct.generator.java/plugin.xml
  59. 0 35
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/AbstractJavaCodeGenerator.java
  60. 1 1
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/IStatemachine.xtend
  61. 0 61
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/JavaCodeGenerator.java
  62. 42 0
      plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/JavaGeneratorModule.java
  63. 11 4
      plugins/org.yakindu.sct.generator.runner/library/GenericJavaFeatureTypeLibrary.xmi
  64. 2 1
      plugins/org.yakindu.sct.generator.runner/plugin.xml
  65. 0 144
      plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/GenericJavaBasedGenerator.java
  66. 10 8
      plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/RunnerActivator.java
  67. 30 0
      plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/RunnerModule.java
  68. 87 0
      plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/WorkspaceGeneratorExecutor.java
  69. 5 1
      plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/lib/IGenericJavaFeatureConstants.java
  70. 0 7
      plugins/org.yakindu.sct.generator.xpand/.classpath
  71. 0 2
      plugins/org.yakindu.sct.generator.xpand/.gitignore
  72. 0 28
      plugins/org.yakindu.sct.generator.xpand/.project
  73. 0 7
      plugins/org.yakindu.sct.generator.xpand/.settings/org.eclipse.jdt.core.prefs
  74. 0 15
      plugins/org.yakindu.sct.generator.xpand/META-INF/MANIFEST.MF
  75. 0 7
      plugins/org.yakindu.sct.generator.xpand/build.properties
  76. BIN
      plugins/org.yakindu.sct.generator.xpand/icons/sct.png
  77. 0 7
      plugins/org.yakindu.sct.generator.xpand/library/XpandFeatureTypeLibrary.xmi
  78. 0 37
      plugins/org.yakindu.sct.generator.xpand/plugin.xml
  79. 0 15
      plugins/org.yakindu.sct.generator.xpand/pom.xml
  80. 0 164
      plugins/org.yakindu.sct.generator.xpand/src/org/yakindu/sct/generator/xpand/AbstractXpandBasedCodeGenerator.java
  81. 0 86
      plugins/org.yakindu.sct.generator.xpand/src/org/yakindu/sct/generator/xpand/GenericXpandCodeGenerator.java
  82. 0 24
      plugins/org.yakindu.sct.generator.xpand/src/org/yakindu/sct/generator/xpand/features/IXpandFeatureConstants.java
  83. 0 63
      plugins/org.yakindu.sct.generator.xpand/src/org/yakindu/sct/generator/xpand/features/XpandLibraryDefaultFeatureValueProvider.java
  84. 0 9
      plugins/org.yakindu.sct.model.resource/plugin.xml
  85. 8 1
      plugins/org.yakindu.sct.model.stext/plugin.xml
  86. 2 2
      plugins/org.yakindu.sct.model.resource/src/org/yakindu/sct/model/resource/SCTResourceFactory.java
  87. 0 1
      releng/org.yakindu.sct.releng/pom.xml
  88. 29 51
      test-plugins/org.yakindu.sct.generator.c.test/src/org/yakindu/sct/generator/c/gtest/GTestHelper.java
  89. 1 1
      test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/AllTestsTest.java
  90. 1 1
      test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/StringExpressionsTest.java
  91. 0 9
      test-plugins/org.yakindu.sct.generator.csharp.test/.classpath
  92. 0 2
      test-plugins/org.yakindu.sct.generator.csharp.test/.gitignore
  93. 0 51
      test-plugins/org.yakindu.sct.generator.csharp.test/.project
  94. 0 2
      test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.core.resources.prefs
  95. 0 2
      test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.core.runtime.prefs
  96. 0 11
      test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.jdt.core.prefs
  97. 0 8
      test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.xtend.core.Xtend.prefs
  98. 0 17
      test-plugins/org.yakindu.sct.generator.csharp.test/META-INF/MANIFEST.MF
  99. 0 19
      test-plugins/org.yakindu.sct.generator.csharp.test/all C# generator tests.launch
  100. 0 0
      test-plugins/org.yakindu.sct.generator.csharp.test/build.properties

+ 2 - 20
plugins/org.yakindu.sct.domain.generic.generator/src/org/yakindu/sct/domain/generic/generator/GenericGeneratorModule.java

@@ -12,15 +12,10 @@
 package org.yakindu.sct.domain.generic.generator;
 
 import org.eclipse.xtext.naming.IQualifiedNameProvider;
-import org.eclipse.xtext.parser.IEncodingProvider;
-import org.eclipse.xtext.resource.IResourceDescriptions;
-import org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions;
 import org.eclipse.xtext.service.AbstractGenericModule;
-import org.yakindu.base.types.inferrer.ITypeSystemInferrer;
 import org.yakindu.base.types.typesystem.GenericTypeSystem;
 import org.yakindu.base.types.typesystem.ITypeSystem;
-import org.yakindu.sct.model.sgraph.naming.SGraphNameProvider;
-import org.yakindu.sct.model.stext.inferrer.STextTypeInferrer;
+import org.yakindu.sct.model.stext.naming.StextNameProvider;
 
 import com.google.inject.Binder;
 
@@ -40,20 +35,7 @@ public class GenericGeneratorModule extends AbstractGenericModule {
 	}
 
 	public Class<? extends IQualifiedNameProvider> bindIQualifiedNameProvider() {
-		return SGraphNameProvider.class;
-	}
-
-	public Class<? extends ITypeSystemInferrer> bindITypeSystemInferrer() {
-		return STextTypeInferrer.class;
-	}
-
-	public Class<? extends IResourceDescriptions> bindIResourceDescriptions() {
-		return ResourceSetBasedResourceDescriptions.class;
-	}
-	
-	
-	public Class<? extends IEncodingProvider> bindIEncodingProvider() {
-		return IEncodingProvider.Runtime.class;
+		return StextNameProvider.class;
 	}
 
 }

+ 1 - 4
plugins/org.yakindu.sct.domain/src/org/yakindu/sct/domain/extension/IDomain.java

@@ -37,10 +37,7 @@ public interface IDomain {
 	 */
 	Injector getInjector(String feature, String... options);
 
-	/**
-	 * when an overrides Module is provided, injectors are not cached
-	 */
-	Injector getInjector(String feature, Module overrides, String... options);
+	Module getModule(String feature, String... options);
 
 	URL getImagePath();
 

+ 5 - 10
plugins/org.yakindu.sct.domain/src/org/yakindu/sct/domain/extension/impl/DomainImpl.java

@@ -137,16 +137,12 @@ public class DomainImpl implements IDomain {
 		return Guice.createInjector();
 	}
 
-	@Override
-	public Injector getInjector(String feature, Module overrides, String... options) {
-		return createInjector(feature, overrides, options);
-	}
-
 	public Injector createInjector(String feature, String... options) {
-		return getInjector(feature, null, options);
+		return Guice.createInjector(getModule(feature, options));
 	}
 
-	public Injector createInjector(String feature, Module overrides, String... options) {
+	@Override
+	public Module getModule(String feature, String... options) {
 		List<Module> modules = new ArrayList<>();
 		for (ModuleContribution module : this.modules) {
 			if (feature.equals(module.getFeature())) {
@@ -154,9 +150,8 @@ public class DomainImpl implements IDomain {
 			}
 		}
 		Module result = Modules.combine(modules);
-		if (overrides != null)
-			result = Modules.override(result).with(overrides);
-		return Guice.createInjector(result);
+		return result;
+
 	}
 
 }

+ 53 - 0
plugins/org.yakindu.sct.generator.builder/src/org/yakindu/sct/generator/builder/EclipseContextGeneratorExecutorLookup.java

@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2011 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.generator.builder;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.xtext.ui.shared.SharedStateModule;
+import org.yakindu.sct.generator.core.execution.GeneratorExecutorLookup;
+import org.yakindu.sct.model.sgen.GeneratorModel;
+
+import com.google.inject.Module;
+import com.google.inject.util.Modules;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class EclipseContextGeneratorExecutorLookup extends GeneratorExecutorLookup {
+
+	@Override
+	protected Module getContextModule() {
+		return Modules.combine(new EclipseContextModule(), new SharedStateModule());
+	}
+
+	public void executeGenerator(IFile file) {
+		final GeneratorModel model = GenModelLoader.load(file);
+		Job generatorJob = new Job("Execute SCT Genmodel " + file.getName()) {
+			@Override
+			protected IStatus run(IProgressMonitor monitor) {
+				try {
+					execute(model);
+				} catch (Exception ex) {
+					return new Status(IStatus.ERROR, BuilderActivator.PLUGIN_ID, ex.getMessage(), ex);
+				}
+				return Status.OK_STATUS;
+			}
+		};
+		generatorJob.setRule(file.getProject().getWorkspace().getRoot());
+		generatorJob.schedule();
+	}
+}

+ 1 - 19
plugins/org.yakindu.sct.generator.builder/src/org/yakindu/sct/generator/builder/SCTBuilder.java

@@ -13,7 +13,6 @@ package org.yakindu.sct.generator.builder;
 import java.util.Map;
 import java.util.Set;
 
-import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
@@ -26,7 +25,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.common.util.WrappedException;
 import org.eclipse.emf.ecore.EObject;
@@ -35,9 +33,7 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
 import org.eclipse.emf.ecore.util.EcoreUtil;
 import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.xtext.ui.shared.SharedStateModule;
 import org.yakindu.sct.generator.core.GeneratorActivator;
-import org.yakindu.sct.generator.core.execution.GeneratorExecutor;
 import org.yakindu.sct.model.sgen.GeneratorEntry;
 import org.yakindu.sct.model.sgen.GeneratorModel;
 import org.yakindu.sct.model.sgraph.Statechart;
@@ -45,7 +41,6 @@ import org.yakindu.sct.model.sgraph.Statechart;
 import com.google.common.base.Predicate;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Sets;
-import com.google.inject.util.Modules;
 
 /**
  * 
@@ -218,20 +213,7 @@ public class SCTBuilder extends IncrementalProjectBuilder {
 	}
 
 	protected void executeGenmodelGenerator(IResource resource) {
-		IFile file = resource.getProject().getFile(resource.getProjectRelativePath());
-		final GeneratorModel model = GenModelLoader.load(file);
-		if (model != null) {
-			Job generatorJob = new Job("Execute SCT Genmodel " + file.getName()) {
-				@Override
-				protected IStatus run(IProgressMonitor monitor) {
-					new GeneratorExecutor().executeGenerator(model,
-							Modules.combine(new SharedStateModule(), new EclipseContextModule()));
-					return Status.OK_STATUS;
-				}
-			};
-			generatorJob.setRule(file.getProject().getWorkspace().getRuleFactory().buildRule());
-			generatorJob.schedule();
-		}
+		new EclipseContextGeneratorExecutorLookup().executeGenerator(resource.getProject().getFile(resource.getProjectRelativePath()));
 	}
 
 	protected void logGenmodelError(String resource) {

+ 5 - 23
plugins/org.yakindu.sct.generator.builder/src/org/yakindu/sct/generator/builder/action/GenerateModelAction.java

@@ -14,10 +14,8 @@ import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IMarker;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.emf.common.util.Diagnostic;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.resource.Resource;
@@ -32,15 +30,9 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IObjectActionDelegate;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.xtext.ui.shared.SharedStateModule;
 import org.yakindu.sct.generator.builder.BuilderActivator;
-import org.yakindu.sct.generator.builder.EclipseContextModule;
-import org.yakindu.sct.generator.builder.GenModelLoader;
+import org.yakindu.sct.generator.builder.EclipseContextGeneratorExecutorLookup;
 import org.yakindu.sct.generator.core.GeneratorActivator;
-import org.yakindu.sct.generator.core.execution.GeneratorExecutor;
-import org.yakindu.sct.model.sgen.GeneratorModel;
-
-import com.google.inject.util.Modules;
 
 /**
  * 
@@ -51,7 +43,10 @@ public class GenerateModelAction implements IObjectActionDelegate {
 
 	private ISelection selection;
 
+	private EclipseContextGeneratorExecutorLookup generatorExecutor;
+	
 	public GenerateModelAction() {
+		generatorExecutor = new EclipseContextGeneratorExecutorLookup();
 	}
 
 	public void run(IAction action) {
@@ -63,20 +58,7 @@ public class GenerateModelAction implements IObjectActionDelegate {
 					new Status(IStatus.ERROR, GeneratorActivator.PLUGIN_ID, "The file contains errors"));
 			return;
 		}
-		final GeneratorModel model = GenModelLoader.load(file);
-		if (model != null) {
-			Job generatorJob = new Job("Execute SCT Genmodel " + file.getName()) {
-				@Override
-				protected IStatus run(IProgressMonitor monitor) {
-					new GeneratorExecutor().executeGenerator(model,
-							Modules.combine(new SharedStateModule(), new EclipseContextModule()));
-					return Status.OK_STATUS;
-				}
-			};
-			generatorJob.setRule(file.getProject().getWorkspace().getRuleFactory().buildRule());
-			generatorJob.schedule();
-
-		}
+		generatorExecutor.executeGenerator(file);
 	}
 
 	private boolean hasError(IFile file) {

+ 0 - 21
plugins/org.yakindu.sct.generator.c/library/FeatureTypeLibraryDep.xmi

@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<sgen:FeatureTypeLibrary
-    xmi:version="2.0"
-    xmlns:xmi="http://www.omg.org/XMI"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xmlns:sgen="http://www.yakindu.org/sct/statechart/SGen"
-    xsi:schemaLocation="http://www.yakindu.org/sct/statechart/SGen ../../org.yakindu.sct.model.sgen/model/emf/sgen.ecore"
-    name="C Generator (deprecated)">
-  <types name="CCodeFeature"
-      optional="true">
-    <parameters
-        name="InterfaceEventListener"
-        parameterType="BOOLEAN"/>
-    <parameters
-        name="Singleton"
-        parameterType="BOOLEAN"/>
-    <parameters
-        name="DebugType"
-        optional="true"/>
-  </types>
-</sgen:FeatureTypeLibrary>

+ 3 - 1
plugins/org.yakindu.sct.generator.c/plugin.xml

@@ -4,10 +4,12 @@
    <extension
          point="org.yakindu.sct.generator.core.generator">
       <SCTGenerator
+            bindings="org.yakindu.sct.generator.c.CCodeGeneratorModule"
             class="org.yakindu.sct.generator.c.CCodeGenerator"
             contentType="statechart"
-            elementRefType="org.yakindu.sct.model.sgraph.Statechart"
             description="YAKINDU SCT C Code Generator"
+            elementRefType="org.yakindu.sct.model.sgraph.Statechart"
+            executor="org.yakindu.sct.generator.core.execution.SExecGeneratorEntryExecutor"
             icon="icons/sct.png"
             id="yakindu::c"
             name="YAKINDU SCT C Code Generator">

+ 0 - 107
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CCodeGenerator.java

@@ -1,107 +0,0 @@
-/**
- * Copyright (c) 2012-2016 Committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	
- * Andreas Mülder  - Initial API and implementation
- * Alexander Nyßen - Support for 'Tracing' feature
- * 
- */
-package org.yakindu.sct.generator.c;
-
-import org.yakindu.sct.generator.c.features.ICFeatureConstants;
-import org.yakindu.sct.generator.c.types.CTypeSystemAccess;
-import org.yakindu.sct.generator.core.impl.AbstractSExecModelGenerator;
-import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.naming.INamingService;
-import org.yakindu.sct.model.sexec.transformation.IModelSequencer;
-import org.yakindu.sct.model.sgen.FeatureConfiguration;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgraph.Statechart;
-
-import com.google.inject.Binder;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.google.inject.name.Names;
-import com.google.inject.util.Modules;
-
-/**
- * Provides a C code generator implementation that is based on SExec.
- * 
- * @author Andreas Mülder
- * @author Alexander Nyßen
- * @author axel terfloth
- * 
- */
-public class CCodeGenerator extends AbstractSExecModelGenerator {
-
-	public static String GENERATOR_ID = "yakindu::c";
-
-	@Inject
-	private CGenerator delegate;
-
-	@Inject
-	private IGenArtifactConfigurations artifactConfigs;
-
-	@Override
-	protected void prepareGenerator(GeneratorEntry entry) {
-		super.prepareGenerator(entry);
-		initGenArtifactConfigurations();
-	}
-
-	protected void initGenArtifactConfigurations() {
-		artifactConfigs.setFileSystemAccess(sctFsa);
-	}
-
-	@Override
-	public void runGenerator(Statechart statechart, GeneratorEntry entry) {
-		ExecutionFlow flow = createExecutionFlow(statechart, entry);
-		if (coreFeatureHelper.isDumpSexec(entry)) {
-			dumpSexec(entry, flow);
-		}
-		delegate.generate(flow, entry, sctFsa, artifactConfigs);
-	}
-
-	@Override
-	public Module getOverridesModule(final GeneratorEntry entry) {
-		Module module = super.getOverridesModule(entry);
-
-		return Modules.override(module).with(new Module() {
-			public void configure(Binder binder) {
-
-				binder.bind(GeneratorEntry.class).toInstance(entry);
-				binder.bind(INamingService.class).to(CNamingService.class);
-				binder.bind(ICodegenTypeSystemAccess.class).to(CTypeSystemAccess.class);
-
-				binder.bind(IGenArtifactConfigurations.class).to(GenArtifactConfigurations.class);
-				// default binding to ensure consistency of already used API
-				binder.bind(IGenArtifactConfigurations.class)
-						.annotatedWith(Names.named(IGenArtifactConfigurations.DEFAULT))
-						.toInstance(GenArtifactConfigurations.DEFAULT);
-
-				// Enable generation of trace steps in case the Tracing feature
-				// is specified and at least one of enter/exit states is
-				// enabled.
-				FeatureConfiguration tracingFeatureConfiguration = entry
-						.getFeatureConfiguration(ICFeatureConstants.FEATURE_TRACING);
-				if (tracingFeatureConfiguration != null && ((tracingFeatureConfiguration
-						.getParameterValue(ICFeatureConstants.PARAMETER_TRACING_ENTER_STATE) != null
-						&& tracingFeatureConfiguration
-								.getParameterValue(ICFeatureConstants.PARAMETER_TRACING_ENTER_STATE)
-								.getBooleanValue() == true)
-						|| (tracingFeatureConfiguration
-								.getParameterValue(ICFeatureConstants.PARAMETER_TRACING_EXIT_STATE) != null
-								&& tracingFeatureConfiguration
-										.getParameterValue(ICFeatureConstants.PARAMETER_TRACING_EXIT_STATE)
-										.getBooleanValue() == true))) {
-					binder.bind(Boolean.class).annotatedWith(Names.named(IModelSequencer.ADD_TRACES))
-							.toInstance(Boolean.TRUE);
-				}
-			}
-		});
-	}
-}

+ 52 - 0
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CCodeGeneratorModule.java

@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.c;
+
+import static org.yakindu.sct.generator.c.features.ICFeatureConstants.FEATURE_TRACING;
+import static org.yakindu.sct.generator.c.features.ICFeatureConstants.PARAMETER_TRACING_ENTER_STATE;
+import static org.yakindu.sct.generator.c.features.ICFeatureConstants.PARAMETER_TRACING_EXIT_STATE;
+import static org.yakindu.sct.model.sexec.transformation.IModelSequencer.ADD_TRACES;
+
+import org.yakindu.sct.generator.c.types.CTypeSystemAccess;
+import org.yakindu.sct.generator.core.GeneratorModule;
+import org.yakindu.sct.generator.core.IExecutionFlowGenerator;
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess;
+import org.yakindu.sct.model.sexec.naming.INamingService;
+import org.yakindu.sct.model.sgen.FeatureParameterValue;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+import com.google.inject.Binder;
+import com.google.inject.name.Names;
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class CCodeGeneratorModule implements GeneratorModule {
+
+	@Override
+	public void configure(GeneratorEntry entry, Binder binder) {
+		binder.bind(GeneratorEntry.class).toInstance(entry);
+		binder.bind(IExecutionFlowGenerator.class).to(CGenerator.class);
+		binder.bind(INamingService.class).to(CNamingService.class);
+		binder.bind(ICodegenTypeSystemAccess.class).to(CTypeSystemAccess.class);
+		binder.bind(IGenArtifactConfigurations.class).to(DefaultGenArtifactConfigurations.class);
+		FeatureParameterValue traceEnterFeature = entry.getFeatureParameterValue(FEATURE_TRACING,
+				PARAMETER_TRACING_ENTER_STATE);
+		FeatureParameterValue traceExitFeature = entry.getFeatureParameterValue(FEATURE_TRACING,
+				PARAMETER_TRACING_EXIT_STATE);
+		boolean traceEnter = traceEnterFeature != null ? traceEnterFeature.getBooleanValue() : false;
+		boolean traceExit = traceExitFeature != null ? traceEnterFeature.getBooleanValue() : false;
+		binder.bind(Boolean.class).annotatedWith(Names.named(ADD_TRACES)).toInstance(traceEnter || traceExit);
+
+	}
+
+}

+ 7 - 15
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CGenerator.xtend

@@ -11,14 +11,14 @@
 package org.yakindu.sct.generator.c
 
 import com.google.inject.Inject
-import com.google.inject.name.Named
 import org.eclipse.xtext.generator.IFileSystemAccess
-import org.yakindu.sct.generator.c.GenArtifactConfigurations.GenArtifactConfiguration
+import org.yakindu.sct.generator.c.DefaultGenArtifactConfigurations.GenArtifactConfiguration
 import org.yakindu.sct.generator.core.IExecutionFlowGenerator
 import org.yakindu.sct.generator.core.library.ICoreLibraryHelper
 import org.yakindu.sct.model.sexec.ExecutionFlow
 import org.yakindu.sct.model.sgen.GeneratorEntry
-import static org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess.*;
+
+import static org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess.*
 
 /**
  * This is the C code generators main class. 
@@ -36,20 +36,12 @@ class CGenerator implements IExecutionFlowGenerator {
 	@Inject extension Naming
 	@Inject extension ICoreLibraryHelper
 
-	@Inject @Named(IGenArtifactConfigurations.DEFAULT)
-	IGenArtifactConfigurations defaultConfigs
+	@Inject
+	IGenArtifactConfigurations configs
 	
-	/**
-	 * @Deprecated use {@link #generate(ExecutionFlow, GeneratorEntry, IFileSystemAccess, ArtifactLocationProvider)} instead
-	 */
-	@Deprecated
 	override generate(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
-		generate(flow, entry, fsa, defaultConfigs)
-	}
-	
-	def generate(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa, IGenArtifactConfigurations locations) {
-		initGenerationArtifacts(flow, entry, locations)
-		generateArtifacts(flow, entry, fsa, locations);
+		initGenerationArtifacts(flow, entry, configs)
+		generateArtifacts(flow, entry, fsa, configs)
 	}
 	
 	def generateArtifacts(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa, IGenArtifactConfigurations locations) {

+ 1 - 7
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/CNamingService.xtend

@@ -31,16 +31,10 @@ public class CNamingService extends DefaultNamingService {
 	
 	@Inject
 	extension GenmodelEntries
-	
 	@Inject
 	extension SExecExtensions
-	
-	var protected GeneratorEntry entry
-	
 	@Inject
-	new (GeneratorEntry entry) {
-		this.entry = entry
-	}
+	var GeneratorEntry entry
 	
 	override void initializeNamingService(Statechart statechart) {
 		if (entry.identifierLength != null) {

+ 26 - 66
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/GenArtifactConfigurations.java

@@ -19,74 +19,35 @@ import org.eclipse.core.runtime.Path;
 import org.eclipse.emf.common.util.URI;
 import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
 
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
 /**
  * 
  * @author thomas kutz - Initial API and contribution
  *
  */
-public class GenArtifactConfigurations implements IGenArtifactConfigurations {
+@Singleton
+public class DefaultGenArtifactConfigurations implements IGenArtifactConfigurations {
 
-	private static final String MSG_FSA_NOT_CONFIGURED = "File system access needs to be configured before artifact locations can be computed.";
 	private static final String MSG_LOCATION_NOT_FOUND = "Artifact location for {0} not configured";
-	private ISCTFileSystemAccess sctFsa;
-
-	public static class GenArtifactConfiguration {
-		
-		private String outputName;
-		private String name;
-		private IContentTemplate contentTemplate;
-		
-		public GenArtifactConfiguration(String name, String outputConfigName, IContentTemplate contentTemplate) {
-			this.name = name;
-			this.outputName = outputConfigName;
-			this.contentTemplate = contentTemplate;
-		}
 
-		public String getName() {
-			return name;
-		}
+	@Inject
+	private ISCTFileSystemAccess sctFsa;
 
-		public String getOutputName() {
-			return outputName;
-		}
-		
-		public IContentTemplate getContentTemplate() {
-			return contentTemplate;
-		}
-	}
-	
-	/**
-	 * Default instance which does not compute any relative paths and hence does not need to be configured in any way.
-	 * This is useful when an API needs to be served but relative path computation is not relevant.
-	 */
-	public static final IGenArtifactConfigurations DEFAULT = new GenArtifactConfigurations() {
-		/**
-		 * As default behavior, this will always return the target path/artifact instead of a relative path.
-		 */
-		public String relativeTo(String target, String fromArtifact) {
-			return target;
-		};
-	};
-	
-	@Override
-	public void setFileSystemAccess(ISCTFileSystemAccess sctFsa) {
-		this.sctFsa = sctFsa;
-	}
-	
 	protected List<GenArtifactConfiguration> generationArtifacts = new ArrayList<GenArtifactConfiguration>();
-	
+
 	@Override
 	public List<GenArtifactConfiguration> getConfigurations() {
 		return generationArtifacts;
 	}
-	
+
 	@Override
 	public void configure(String artifactName, String outputConfigName, IContentTemplate contentTemplate) {
 		generationArtifacts.add(new GenArtifactConfiguration(artifactName, outputConfigName, contentTemplate));
 	}
 
 	protected URI getOutputFolder(String artifactName) {
-		checkFSA();
 		for (GenArtifactConfiguration artifact : generationArtifacts) {
 			if (artifact.getName().equals(artifactName)) {
 				return sctFsa.getURI("", artifact.getOutputName());
@@ -94,9 +55,8 @@ public class GenArtifactConfigurations implements IGenArtifactConfigurations {
 		}
 		return null;
 	}
-	
+
 	protected URI getURI(String artifactName) {
-		checkFSA();
 		for (GenArtifactConfiguration artifact : generationArtifacts) {
 			if (artifact.getName().equals(artifactName)) {
 				return sctFsa.getURI(artifact.getName(), artifact.getOutputName());
@@ -105,15 +65,16 @@ public class GenArtifactConfigurations implements IGenArtifactConfigurations {
 		return null;
 	}
 
-	private void checkFSA() {
-		if (sctFsa == null)
-			throw new IllegalStateException(MSG_FSA_NOT_CONFIGURED);
-	}
-	
 	/**
-	 * @param target either target artifact name or absolute target path which will be transformed to a relative path based on <code>fromArtifact</code> location
-	 * @param fromArtifact artifact name whose location is used as base for relative path computation
-	 * @return the relative path from <code>fromArtifact</code> to <code>toTarget</code>
+	 * @param target
+	 *            either target artifact name or absolute target path which will
+	 *            be transformed to a relative path based on
+	 *            <code>fromArtifact</code> location
+	 * @param fromArtifact
+	 *            artifact name whose location is used as base for relative path
+	 *            computation
+	 * @return the relative path from <code>fromArtifact</code> to
+	 *         <code>toTarget</code>
 	 */
 	@Override
 	public String relativeTo(String target, String fromArtifact) {
@@ -121,29 +82,28 @@ public class GenArtifactConfigurations implements IGenArtifactConfigurations {
 		if (baseUri == null) {
 			throw new IllegalArgumentException(MessageFormat.format(MSG_LOCATION_NOT_FOUND, fromArtifact));
 		}
-		
+
 		Path targetPath = new Path(target);
 		if (targetPath.isAbsolute()) {
 			return relativePath(target, relative(baseUri));
 		}
-		
+
 		URI absUri = getURI(target);
 		if (absUri != null) {
 			return relativePath(relative(absUri), relative(baseUri));
 		}
 		throw new IllegalArgumentException(MessageFormat.format(MSG_LOCATION_NOT_FOUND, target));
 	}
-	
-	protected String relative(URI uri){
-		if(uri.isFile()){
+
+	protected String relative(URI uri) {
+		if (uri.isFile()) {
 			return uri.toFileString();
-		}
-		else if(uri.isPlatform()){
+		} else if (uri.isPlatform()) {
 			return uri.toPlatformString(true);
 		}
 		throw new IllegalArgumentException("Unknown URI " + uri);
 	}
-	
+
 	protected String relativePath(String to, String from) {
 		IPath basePath = new Path(from);
 		IPath toPath = new Path(to);

+ 27 - 14
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/IGenArtifactConfigurations.java

@@ -12,8 +12,7 @@ package org.yakindu.sct.generator.c;
 
 import java.util.List;
 
-import org.yakindu.sct.generator.c.GenArtifactConfigurations.GenArtifactConfiguration;
-import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
+import com.google.inject.ImplementedBy;
 
 /**
  * Holds the configuration of generation artifacts. A configuration comprises
@@ -23,20 +22,9 @@ import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
  * @author thomas kutz - Initial API and contribution
  *
  */
+@ImplementedBy(DefaultGenArtifactConfigurations.class)
 public interface IGenArtifactConfigurations {
 
-	/**
-	 * Used as key in Guice to mark a default configuration instance
-	 */
-	String DEFAULT = "DefaultGenArtifactConfigurations";
-
-	/**
-	 * A file system access is needed to define the target location of a
-	 * generation artifact. Without this, relative paths via
-	 * {@link getRelativePath(String, String)} will not work.
-	 */
-	void setFileSystemAccess(ISCTFileSystemAccess sctFsa);
-
 	/**
 	 * Adds a configuration for a generation artifact.
 	 */
@@ -54,4 +42,29 @@ public interface IGenArtifactConfigurations {
 	 */
 	String relativeTo(String target, String fromArtifact);
 
+	public static class GenArtifactConfiguration {
+
+		private String outputName;
+		private String name;
+		private IContentTemplate contentTemplate;
+
+		public GenArtifactConfiguration(String name, String outputConfigName, IContentTemplate contentTemplate) {
+			this.name = name;
+			this.outputName = outputConfigName;
+			this.contentTemplate = contentTemplate;
+		}
+
+		public String getName() {
+			return name;
+		}
+
+		public String getOutputName() {
+			return outputName;
+		}
+
+		public IContentTemplate getContentTemplate() {
+			return contentTemplate;
+		}
+	}
+
 }

+ 1 - 2
plugins/org.yakindu.sct.generator.c/src/org/yakindu/sct/generator/c/StatemachineHeader.xtend

@@ -11,7 +11,6 @@
 package org.yakindu.sct.generator.c
 
 import com.google.inject.Inject
-import com.google.inject.name.Named
 import org.yakindu.base.types.Declaration
 import org.yakindu.base.types.Direction
 import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
@@ -36,7 +35,7 @@ class StatemachineHeader implements IContentTemplate {
 	@Inject extension GenmodelEntries
 	@Inject extension INamingService
 	
-	@Inject @Named(IGenArtifactConfigurations.DEFAULT)
+	@Inject
 	IGenArtifactConfigurations defaultConfigs
 	
 	override content(ExecutionFlow it, GeneratorEntry entry , IGenArtifactConfigurations artifactConfigs) {

+ 0 - 1
plugins/org.yakindu.sct.generator.core/META-INF/MANIFEST.MF

@@ -21,7 +21,6 @@ Export-Package: org.yakindu.sct.generator.core,
  org.yakindu.sct.generator.core.execution,
  org.yakindu.sct.generator.core.extensions,
  org.yakindu.sct.generator.core.filesystem,
- org.yakindu.sct.generator.core.impl,
  org.yakindu.sct.generator.core.library,
  org.yakindu.sct.generator.core.library.impl,
  org.yakindu.sct.generator.core.types

+ 12 - 2
plugins/org.yakindu.sct.generator.core/schema/generator.exsd

@@ -52,13 +52,23 @@
          <sequence minOccurs="0" maxOccurs="unbounded">
             <element ref="FeatureLibrary"/>
          </sequence>
-         <attribute name="class" type="string" use="required">
+         <attribute name="executor" type="string" use="required">
             <annotation>
                <documentation>
                   
                </documentation>
                <appinfo>
-                  <meta.attribute kind="java" basedOn=":org.yakindu.sct.generator.core.ISCTGenerator"/>
+                  <meta.attribute kind="java" basedOn=":org.yakindu.sct.generator.core.execution.IGenModelExecutor"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+         <attribute name="bindings" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn=":org.yakindu.sct.generator.core.GeneratorModule"/>
                </appinfo>
             </annotation>
          </attribute>

+ 0 - 27
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/GeneratorActivator.java

@@ -13,12 +13,8 @@ package org.yakindu.sct.generator.core;
 import org.eclipse.core.runtime.Plugin;
 import org.osgi.framework.BundleContext;
 
-/**
- * The activator class controls the plug-in life cycle
- */
 public class GeneratorActivator extends Plugin {
 
-	// The plug-in ID
 	public static final String PLUGIN_ID = "org.yakindu.sct.generator.core"; //$NON-NLS-1$
 
 	// The shared instance
@@ -26,39 +22,16 @@ public class GeneratorActivator extends Plugin {
 	// Preference constant for automatic code generation
 	public static final String PREF_GENERATE_AUTOMATICALLY = "generate.automatically";
 
-	/**
-	 * The constructor
-	 */
-	public GeneratorActivator() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.
-	 * BundleContext)
-	 */
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
 		plugin = this;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.
-	 * BundleContext)
-	 */
 	public void stop(BundleContext context) throws Exception {
 		plugin = null;
 		super.stop(context);
 	}
 
-	/**
-	 * Returns the shared instance
-	 *
-	 * @return the shared instance
-	 */
 	public static GeneratorActivator getDefault() {
 		return plugin;
 	}

+ 27 - 0
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/GeneratorModule.java

@@ -0,0 +1,27 @@
+/** 
+ * Copyright (c) 2016 committers of YAKINDU and others. 
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0 
+ * which accompanies this distribution, and is available at 
+ * http://www.eclipse.org/legal/epl-v10.html 
+ * Contributors:
+ * committers of YAKINDU - initial API and implementation
+ *
+*/
+package org.yakindu.sct.generator.core;
+
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+import com.google.inject.Binder;
+
+/**
+ * Provides bindings for Code Generators based on {@link GeneratorEntry}s
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface GeneratorModule {
+
+	public abstract void configure(GeneratorEntry entry, Binder binder);
+
+}

+ 1 - 1
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/IExecutionFlowGenerator.java

@@ -21,7 +21,7 @@ import org.yakindu.sct.model.sgen.GeneratorEntry;
  * @author andreas muelder - Initial contribution and API
  * 
  */
-public interface IExecutionFlowGenerator {
+public interface IExecutionFlowGenerator extends ISCTGenerator{
 
 	/**
 	 * 

+ 5 - 11
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/ISCTGenerator.java

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2011 committers of YAKINDU and others.
+ * Copyright (c) 2016 committers of YAKINDU and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,20 +10,14 @@
  */
 package org.yakindu.sct.generator.core;
 
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgen.GeneratorModel;
-
 /**
- * Basic interface for all CodeGenerators
+ * Basic marker interface for all CodeGenerators extended by
+ * {@link IExecutionFlowGenerator} and {@link ISGraphGenerator}
+ * 
  * 
  * @author andreas muelder - Initial contribution and API
  * 
  */
 public interface ISCTGenerator {
-	/**
-	 * 
-	 * @param entry
-	 *            The {@link GeneratorEntry} from the {@link GeneratorModel}
-	 */
-	public void generate(GeneratorEntry entry);
+
 }

+ 1 - 1
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/ISGraphGenerator.java

@@ -20,7 +20,7 @@ import org.yakindu.sct.model.sgraph.Statechart;
  * @author andreas muelder - Initial contribution and API
  * 
  */
-public interface ISGraphGenerator {
+public interface ISGraphGenerator extends ISCTGenerator {
 
 	void generate(Statechart statechart, GeneratorEntry entry, IFileSystemAccess fsa);
 

+ 53 - 0
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/AbstractGeneratorEntryExecutor.java

@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.core.execution;
+
+import org.yakindu.base.base.NamedElement;
+import org.yakindu.sct.generator.core.console.IConsoleLogger;
+import org.yakindu.sct.generator.core.filesystem.DefaultFileSystemAccessFactory;
+import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
+import org.yakindu.sct.generator.core.library.ICoreLibraryHelper;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+import com.google.inject.Inject;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public abstract class AbstractGeneratorEntryExecutor implements IGeneratorEntryExecutor {
+
+	@Inject
+	protected DefaultFileSystemAccessFactory factory;
+	@Inject
+	protected IConsoleLogger logger;
+	@Inject
+	protected ICoreLibraryHelper helper;
+
+	protected abstract void execute(ISCTFileSystemAccess access, GeneratorEntry generatorEntry);
+
+	@Override
+	public void execute(GeneratorEntry entry) {
+		NamedElement element = (NamedElement) entry.getElementRef();
+		logger.log("Generating '" + element.getName() + "' to target project ..."
+				+ helper.getTargetProjectValue(entry).getStringValue());
+		try {
+			execute(factory.create(entry), entry);
+		} catch (Exception ex) {
+			logger.logError(ex);
+		} finally {
+			logger.log("done...");
+		}
+
+	}
+
+}

+ 8 - 80
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/impl/AbstractSExecModelGenerator.java

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2011 committers of YAKINDU and others.
+ * Copyright (c) 2016 committers of YAKINDU and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
  * Contributors:
  *     committers of YAKINDU - initial API and implementation
  */
-package org.yakindu.sct.generator.core.impl;
+package org.yakindu.sct.generator.core.execution;
 
 import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE;
 import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_CHOICES;
@@ -21,81 +21,26 @@ import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCT
 import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_EXIT_SEQUENCES;
 import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_REACTIONS;
 
-import java.io.IOException;
-import java.util.Collections;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
-import org.yakindu.sct.generator.core.IExecutionFlowGenerator;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
 import org.yakindu.sct.model.sexec.transformation.FlowOptimizer;
-import org.yakindu.sct.model.sexec.transformation.IModelSequencer;
 import org.yakindu.sct.model.sgen.FeatureConfiguration;
 import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgraph.Statechart;
 
-import com.google.inject.Binder;
 import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.google.inject.name.Names;
-import com.google.inject.util.Modules;
+import com.google.inject.Provider;
 
 /**
- * abstract base class for all code generators that want to generate code based
- * on the {@link ExecutionFlow}
  * 
  * @author andreas muelder - Initial contribution and API
  * 
  */
-public abstract class AbstractSExecModelGenerator extends AbstractSGraphModelGenerator {
-
-	private static final String SEXEC_FILE_EXTENSION = "sexec";
-	public static final String ADD_TRACES = "ADD_TRACES";
+public class FlowOptimizerFactory {
 
 	@Inject
-	private FlowOptimizer optimizer;
-	@Inject
-	private IModelSequencer sequencer;
-
-	public AbstractSExecModelGenerator() {
-		super();
-	}
-
-	@Override
-	protected void runGenerator(Statechart statechart, GeneratorEntry entry) {
-		if (this instanceof IExecutionFlowGenerator) {
-			IExecutionFlowGenerator flowGenerator = (IExecutionFlowGenerator) this;
-			flowGenerator.generate(createExecutionFlow(statechart, entry), entry, sctFsa);
-		}
-		super.runGenerator(statechart, entry);
-	}
-
-	@Override
-	public Module getOverridesModule(GeneratorEntry entry) {
-		Module module = super.getOverridesModule(entry);
-
-		return Modules.override(module).with(new Module() {
-			public void configure(Binder binder) {
-				// by default, traces should not be generated
-				binder.bind(Boolean.class).annotatedWith(Names.named(ADD_TRACES))
-						.toInstance(Boolean.FALSE);
-			}
-		});
-	}
-
-	/**
-	 * Transforms the {@link Statechart} model to a {@link ExecutionFlow} model
-	 */
-	protected ExecutionFlow createExecutionFlow(Statechart statechart, GeneratorEntry entry) {
-		ExecutionFlow flow = sequencer.transform(statechart);
-		Assert.isNotNull(flow, "Error creation ExecutionFlow");
+	private Provider<FlowOptimizer> optimizerProvider;
 
+	public FlowOptimizer create(GeneratorEntry entry) {
+		FlowOptimizer optimizer = optimizerProvider.get();
 		FeatureConfiguration optimizeConfig = entry.getFeatureConfiguration(FUNCTION_INLINING_FEATURE);
-
 		optimizer.inlineReactions(getBoolValue(optimizeConfig, FUNCTION_INLINING_FEATURE_INLINE_REACTIONS, false));
 		optimizer.inlineExitActions(getBoolValue(optimizeConfig, FUNCTION_INLINING_FEATURE_INLINE_EXIT_ACTIONS, false));
 		optimizer.inlineEntryActions(
@@ -108,10 +53,7 @@ public abstract class AbstractSExecModelGenerator extends AbstractSGraphModelGen
 		optimizer.inlineEntries(getBoolValue(optimizeConfig, FUNCTION_INLINING_FEATURE_INLINE_ENTRIES, false));
 		optimizer.inlineEnterRegion(getBoolValue(optimizeConfig, FUNCTION_INLINING_FEATURE_INLINE_ENTER_REGION, false));
 		optimizer.inlineExitRegion(getBoolValue(optimizeConfig, FUNCTION_INLINING_FEATURE_INLINE_EXIT_REGION, false));
-
-		flow = optimizer.transform(flow);
-
-		return flow;
+		return optimizer;
 	}
 
 	protected boolean getBoolValue(FeatureConfiguration conf, String param, boolean defaultValue) {
@@ -122,18 +64,4 @@ public abstract class AbstractSExecModelGenerator extends AbstractSGraphModelGen
 		return defaultValue;
 	}
 
-	protected void dumpSexec(GeneratorEntry entry, ExecutionFlow flow) {
-		ResourceSet resourceSet = new ResourceSetImpl();
-		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
-				.put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
-		URI fileURI = entry.getElementRef().eResource().getURI().trimFileExtension()
-				.appendFileExtension(SEXEC_FILE_EXTENSION);
-		Resource resource = resourceSet.createResource(fileURI);
-		resource.getContents().add(flow);
-		try {
-			resource.save(Collections.EMPTY_MAP);
-		} catch (IOException e) {
-		}
-	}
-
 }

+ 33 - 33
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/GeneratorExecutor.java

@@ -1,5 +1,5 @@
 /**
- * Copyright (c) 2011 committers of YAKINDU and others.
+ * Copyright (c) 2016 committers of YAKINDU and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
  */
 package org.yakindu.sct.generator.core.execution;
 
+import org.eclipse.core.runtime.Assert;
 import org.eclipse.emf.common.util.EList;
 import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.emf.ecore.util.EcoreUtil;
@@ -17,14 +18,13 @@ import org.yakindu.base.types.typesystem.AbstractTypeSystem;
 import org.yakindu.base.types.typesystem.ITypeSystem;
 import org.yakindu.sct.domain.extension.DomainRegistry;
 import org.yakindu.sct.domain.extension.IDomain;
-import org.yakindu.sct.generator.core.ISCTGenerator;
 import org.yakindu.sct.generator.core.extensions.GeneratorExtensions;
 import org.yakindu.sct.generator.core.extensions.IGeneratorDescriptor;
-import org.yakindu.sct.generator.core.impl.AbstractSGraphModelGenerator;
 import org.yakindu.sct.model.sgen.GeneratorEntry;
 import org.yakindu.sct.model.sgen.GeneratorModel;
 
 import com.google.inject.Binder;
+import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
 import com.google.inject.util.Modules;
@@ -32,53 +32,53 @@ import com.google.inject.util.Modules;
 /**
  * 
  * @author andreas muelder - Initial contribution and API
- * @author holger willebrandt - refactoring
- * @author markus muehlbrandt - added executeGenerator for generator models
+ * 
  */
-public class GeneratorExecutor {
+public class GeneratorExecutorLookup {
 
-	public void executeGenerator(GeneratorModel model, Module overrides) {
-		final EList<GeneratorEntry> entries = model.getEntries();
-		for (GeneratorEntry generatorEntry : entries) {
-			final ISCTGenerator generator = getGenerator(model, generatorEntry, overrides);
-			generator.generate(generatorEntry);
-		}
-	}
-	
-	public void executeGenerator(GeneratorModel model) {
-		executeGenerator(model, new Module() {
+	protected Module getContextModule() {
+		return new Module() {
 			@Override
 			public void configure(Binder binder) {
 			}
-		});
+		};
 	}
 
-	protected ISCTGenerator getGenerator(GeneratorModel model, GeneratorEntry entry, Module overrides) {
-		String generatorId = model.getGeneratorId();
+	public void execute(GeneratorModel model) {
+		EList<GeneratorEntry> entries = model.getEntries();
+		for (GeneratorEntry generatorEntry : entries) {
+			final IGeneratorEntryExecutor executor = createExecutor(generatorEntry, model.getGeneratorId());
+			executor.execute(generatorEntry);
+		}
+	}
+
+	public IGeneratorEntryExecutor createExecutor(GeneratorEntry entry, String generatorId) {
 		IGeneratorDescriptor description = GeneratorExtensions.getGeneratorDescriptor(generatorId);
 		if (description == null)
 			throw new RuntimeException("No generator registered for ID: " + generatorId);
-		final ISCTGenerator generator = description.createGenerator();
-		if (generator == null)
-			throw new RuntimeException("Failed to create Generator instance for ID:" + generatorId);
-		IDomain domain = DomainRegistry.getDomain(entry.getElementRef());
-		Module overridesModule = overrides;
-		if (generator instanceof AbstractSGraphModelGenerator) {
-			overridesModule = Modules.combine(overridesModule,
-					((AbstractSGraphModelGenerator) generator).getOverridesModule(entry));
-		}
-		Injector injector = domain.getInjector(IDomain.FEATURE_GENERATOR, overridesModule, model.getGeneratorId());
-		injector.injectMembers(generator);
-
-		// TODO: refactor location for adding type system resource.
+		final IGeneratorEntryExecutor executor = description.createExecutor();
+		if (executor == null)
+			throw new RuntimeException("Failed to create generator instance for ID:" + generatorId);
+		Injector injector = createInjector(entry, description, generatorId);
+		injector.injectMembers(executor);
 		ITypeSystem typeSystem = injector.getInstance(ITypeSystem.class);
 		if (typeSystem instanceof AbstractTypeSystem) {
 			ResourceSet set = entry.getElementRef().eResource().getResourceSet();
 			set.getResources().add(((AbstractTypeSystem) typeSystem).getResource());
 			EcoreUtil.resolveAll(set);
 		}
+		Assert.isNotNull(entry.getElementRef().eResource());
 
-		return generator;
+		return executor;
 	}
 
+	protected Injector createInjector(GeneratorEntry entry, IGeneratorDescriptor description, String generatorId) {
+		Module generatorSpecificModule = description.getBindings(entry);
+		Module executionContextModule = getContextModule();
+		Module domainModule = DomainRegistry.getDomain(entry.getElementRef()).getModule(IDomain.FEATURE_GENERATOR,
+				generatorId);
+		Module combined = Modules.override(Modules.combine(generatorSpecificModule, executionContextModule))
+				.with(domainModule);
+		return Guice.createInjector(combined);
+	}
 }

+ 24 - 0
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/IGeneratorEntryExecutor.java

@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.core.execution;
+
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public interface IGeneratorEntryExecutor {
+
+	public void execute(GeneratorEntry entry);
+
+}

+ 81 - 0
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/SExecGeneratorEntryExecutor.java

@@ -0,0 +1,81 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.core.execution;
+
+import java.io.IOException;
+import java.util.Collections;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+import org.yakindu.sct.generator.core.IExecutionFlowGenerator;
+import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
+import org.yakindu.sct.generator.core.library.ICoreLibraryHelper;
+import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.transformation.FlowOptimizer;
+import org.yakindu.sct.model.sexec.transformation.IModelSequencer;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+import org.yakindu.sct.model.sgraph.Statechart;
+
+import com.google.inject.Inject;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class SExecGeneratorEntryExecutor extends AbstractGeneratorEntryExecutor implements IGeneratorEntryExecutor {
+
+	private static final String SEXEC_FILE_EXTENSION = "sexec";
+
+	@Inject
+	private IExecutionFlowGenerator generator;
+	@Inject
+	private IModelSequencer sequencer;
+	@Inject
+	private FlowOptimizerFactory optimizerFactory;
+	@Inject
+	protected ICoreLibraryHelper helper;
+
+	@Override
+	protected void execute(ISCTFileSystemAccess access, GeneratorEntry generatorEntry) {
+		ExecutionFlow flow = createExecutionFlow(generatorEntry);
+		generator.generate(flow, generatorEntry, access);
+		if (helper.serializeExecutionFlow(generatorEntry)) {
+			serializeExecutionFlow(generatorEntry, flow);
+		}
+	}
+
+	protected ExecutionFlow createExecutionFlow(GeneratorEntry entry) {
+		ExecutionFlow flow = sequencer.transform((Statechart) entry.getElementRef());
+		Assert.isNotNull(flow, "Error creation ExecutionFlow");
+		FlowOptimizer optimizer = optimizerFactory.create(entry);
+		return optimizer.transform(flow);
+	}
+
+	protected void serializeExecutionFlow(GeneratorEntry entry, ExecutionFlow flow) {
+		ResourceSet resourceSet = new ResourceSetImpl();
+		resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap()
+				.put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
+		URI fileURI = entry.getElementRef().eResource().getURI().trimFileExtension()
+				.appendFileExtension(SEXEC_FILE_EXTENSION);
+		Resource resource = resourceSet.createResource(fileURI);
+		resource.getContents().add(flow);
+		try {
+			resource.save(Collections.EMPTY_MAP);
+		} catch (IOException e) {
+		}
+	}
+
+}

+ 34 - 0
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/execution/SGraphGeneratorEntryExecutor.java

@@ -0,0 +1,34 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.core.execution;
+
+import org.yakindu.sct.generator.core.ISGraphGenerator;
+import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+import org.yakindu.sct.model.sgraph.Statechart;
+
+import com.google.inject.Inject;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class SGraphGeneratorEntryExecutor extends AbstractGeneratorEntryExecutor implements IGeneratorEntryExecutor {
+
+	@Inject
+	private ISGraphGenerator generator;
+	
+	@Override
+	protected void execute(ISCTFileSystemAccess access, GeneratorEntry generatorEntry) {
+		generator.generate((Statechart)generatorEntry.getElementRef(), generatorEntry, access);
+	}
+}

+ 37 - 4
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/extensions/GeneratorExtensions.java

@@ -19,11 +19,15 @@ import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IConfigurationElement;
 import org.eclipse.core.runtime.Platform;
 import org.osgi.framework.Bundle;
-import org.yakindu.sct.generator.core.ISCTGenerator;
+import org.yakindu.sct.generator.core.GeneratorModule;
+import org.yakindu.sct.generator.core.execution.IGeneratorEntryExecutor;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
 
 import com.google.common.base.Predicate;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
+import com.google.inject.Binder;
+import com.google.inject.Module;
 
 /**
  * @author holger willebrandt - Initial contribution and API
@@ -31,7 +35,8 @@ import com.google.common.collect.Lists;
 public class GeneratorExtensions {
 
 	private static final String EXTENSION_POINT_ID = "org.yakindu.sct.generator.core.generator";
-	private static final String ATTRIBUTE_CLASS = "class";
+	private static final String ATTRIBUTE_GENERATOR_EXECUTOR = "executor";
+	private static final String ATTRIBUTE_BINDINGS = "bindings";
 	private static final String ATTRIBUTE_ID = "id";
 	private static final String LIBRARY_CONFIG_ELEMENT = "FeatureLibrary";
 	private static final String ATTRIBUTE_LIBRARY_ID = "library_id";
@@ -54,9 +59,20 @@ public class GeneratorExtensions {
 		}
 
 		@Override
-		public ISCTGenerator createGenerator() {
+		public IGeneratorEntryExecutor createExecutor() {
 			try {
-				return (ISCTGenerator) configElement.createExecutableExtension(ATTRIBUTE_CLASS);
+				return (IGeneratorEntryExecutor) configElement.createExecutableExtension(ATTRIBUTE_GENERATOR_EXECUTOR);
+			} catch (CoreException e) {
+				e.printStackTrace();
+			}
+			return null;
+		}
+
+		@Override
+		public Module getBindings(GeneratorEntry entry) {
+			try {
+				GeneratorModule module = (GeneratorModule) configElement.createExecutableExtension(ATTRIBUTE_BINDINGS);
+				return new GeneratorModuleAdapter(module, entry);
 			} catch (CoreException e) {
 				e.printStackTrace();
 			}
@@ -153,4 +169,21 @@ public class GeneratorExtensions {
 		}
 	}
 
+	public static class GeneratorModuleAdapter implements Module {
+
+		private GeneratorEntry entry;
+		private GeneratorModule module;
+
+		public GeneratorModuleAdapter(GeneratorModule module, GeneratorEntry entry) {
+			this.module = module;
+			this.entry = entry;
+		}
+
+		@Override
+		public void configure(Binder binder) {
+			module.configure(entry, binder);
+		}
+
+	}
+
 }

+ 8 - 2
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/extensions/IGeneratorDescriptor.java

@@ -14,7 +14,11 @@ package org.yakindu.sct.generator.core.extensions;
 import java.net.URL;
 import java.util.List;
 
-import org.yakindu.sct.generator.core.ISCTGenerator;
+import org.yakindu.sct.generator.core.execution.IGeneratorEntryExecutor;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+import com.google.inject.Module;
+
 /**
  * 
  * @author andreas muelder - Initial contribution and API
@@ -22,7 +26,9 @@ import org.yakindu.sct.generator.core.ISCTGenerator;
  */
 public interface IGeneratorDescriptor {
 
-	ISCTGenerator createGenerator();
+	IGeneratorEntryExecutor createExecutor();
+
+	Module getBindings(GeneratorEntry entry);
 
 	List<String> getLibraryIDs();
 

+ 78 - 0
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/filesystem/DefaultFileSystemAccessFactory.java

@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * 		committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.generator.core.filesystem;
+
+import static org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess.API_TARGET_FOLDER_OUTPUT;
+import static org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess.LIBRARY_TARGET_FOLDER_OUTPUT;
+import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.OUTLET_FEATURE_TARGET_PROJECT;
+
+import org.eclipse.xtext.generator.IFileSystemAccess;
+import org.eclipse.xtext.generator.OutputConfiguration;
+import org.yakindu.sct.generator.core.library.ICoreLibraryHelper;
+import org.yakindu.sct.model.sgen.FeatureParameterValue;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+/**
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class DefaultFileSystemAccessFactory {
+
+	@Inject
+	private Provider<ISCTFileSystemAccess> fileSystemProvider;
+	@Inject
+	private ICoreLibraryHelper helper;
+
+	public ISCTFileSystemAccess create(GeneratorEntry entry) {
+		ISCTFileSystemAccess result = fileSystemProvider.get();
+		initTargetProject(result, entry);
+		initDefaultOutput(result, entry);
+		initLibraryTargetFolder(result, entry);
+		initApiTargetFolder(result, entry);
+		return result;
+	}
+
+	protected void initTargetProject(ISCTFileSystemAccess access, GeneratorEntry entry) {
+		String targetProjectName = helper.getTargetProjectValue(entry).getStringValue();
+		access.setContext(targetProjectName);
+		access.setOutputPath(OUTLET_FEATURE_TARGET_PROJECT, targetProjectName);
+	}
+
+	protected void initDefaultOutput(ISCTFileSystemAccess access, GeneratorEntry entry) {
+		access.setOutputPath(IFileSystemAccess.DEFAULT_OUTPUT,
+				helper.getTargetFolderValue(entry).getExpression().toString());
+		access.getOutputConfigurations().get(IFileSystemAccess.DEFAULT_OUTPUT).setCreateOutputDirectory(true);
+	}
+
+	protected void initLibraryTargetFolder(ISCTFileSystemAccess access, GeneratorEntry entry) {
+		FeatureParameterValue libraryTargetFolderValue = helper.getLibraryTargetFolderValue(entry);
+		if (libraryTargetFolderValue != null) {
+			access.setOutputPath(LIBRARY_TARGET_FOLDER_OUTPUT, libraryTargetFolderValue.getStringValue());
+			OutputConfiguration output = access.getOutputConfigurations().get(LIBRARY_TARGET_FOLDER_OUTPUT);
+			output.setCreateOutputDirectory(true);
+			output.setCanClearOutputDirectory(false);
+			output.setOverrideExistingResources(false);
+		}
+	}
+
+	protected void initApiTargetFolder(ISCTFileSystemAccess access, GeneratorEntry entry) {
+		FeatureParameterValue apiTargetFolderValue = helper.getApiTargetFolderValue(entry);
+		if (apiTargetFolderValue != null) {
+			access.setOutputPath(API_TARGET_FOLDER_OUTPUT, apiTargetFolderValue.getStringValue());
+			OutputConfiguration output = access.getOutputConfigurations().get(API_TARGET_FOLDER_OUTPUT);
+			output.setCreateOutputDirectory(true);
+		}
+	}
+}

+ 3 - 11
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/filesystem/SCTJavaIoFileSystemAccess.java

@@ -14,8 +14,6 @@ package org.yakindu.sct.generator.core.filesystem;
 import java.io.File;
 
 import org.eclipse.xtext.generator.JavaIoFileSystemAccess;
-import org.eclipse.xtext.util.RuntimeIOException;
-import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
 
 import com.google.inject.Inject;
 import com.google.inject.name.Named;
@@ -26,8 +24,8 @@ import com.google.inject.name.Named;
  */
 public class SCTJavaIoFileSystemAccess extends JavaIoFileSystemAccess implements ISCTFileSystemAccess {
 
-public static final String BASE_DIR = "filesystemAccess.absolute.baseDir";
-	
+	public static final String BASE_DIR = "filesystemAccess.absolute.baseDir";
+
 	@Inject
 	@Named(BASE_DIR)
 	protected String absoluteBaseDir;
@@ -40,11 +38,5 @@ public static final String BASE_DIR = "filesystemAccess.absolute.baseDir";
 	public void setOutputPath(String outputName, String path) {
 		super.setOutputPath(outputName, absoluteBaseDir + File.separator + path);
 	}
-	@Override
-	public void generateFile(String fileName, String outputConfigName, CharSequence contents)
-			throws RuntimeIOException {
-		File file = getFile(fileName, outputConfigName);
-		System.out.println("generting to " + file.getAbsoluteFile().toPath());
-		super.generateFile(fileName, outputConfigName, contents);
-	}
+
 }

+ 0 - 237
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/impl/AbstractSGraphModelGenerator.java

@@ -1,237 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Andreas Mülder - Initial API and implementation
- *     Alexaner Nyßen - Refactored to use overriding module instead of child injector
- */
-package org.yakindu.sct.generator.core.impl;
-
-import static org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess.API_TARGET_FOLDER_OUTPUT;
-import static org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess.LIBRARY_TARGET_FOLDER_OUTPUT;
-import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.OUTLET_FEATURE_TARGET_PROJECT;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.generator.IFileSystemAccess;
-import org.eclipse.xtext.generator.OutputConfiguration;
-import org.yakindu.sct.generator.core.ISCTGenerator;
-import org.yakindu.sct.generator.core.ISGraphGenerator;
-import org.yakindu.sct.generator.core.console.IConsoleLogger;
-import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
-import org.yakindu.sct.generator.core.filesystem.ISCTWorkspaceAccess;
-import org.yakindu.sct.generator.core.library.ICoreLibraryHelper;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sgen.FeatureParameterValue;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgraph.Statechart;
-
-import com.google.inject.Binder;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.google.inject.util.Modules;
-
-/**
- * abstract base class for all code generators that want to generate code based
- * on the {@link ExecutionFlow}
- * 
- * @author Andreas Mülder - Initial contribution and API
- * @author Johannes Dicks - decouple EFS
- * 
- */
-public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
-
-	@Inject
-	protected IConsoleLogger log;
-	@Inject
-	protected ICoreLibraryHelper coreFeatureHelper;
-	@Inject
-	protected ISCTFileSystemAccess sctFsa;
-	@Inject
-	protected ISCTWorkspaceAccess wsAccess;
-
-	protected void runGenerator(Statechart statechart, GeneratorEntry entry) {
-		if (this instanceof ISGraphGenerator) {
-			ISGraphGenerator graphGenerator = (ISGraphGenerator) this;
-			graphGenerator.generate(statechart, entry, sctFsa);
-		}
-	}
-
-	@Override
-	protected void finalize() throws Throwable {
-		if (log != null)
-			log.close();
-		super.finalize();
-	}
-
-	/**
-	 * This method should not be overridden anymore. It is meant to define a
-	 * general process all generators might follow.
-	 * 
-	 * Use {@link #doGenerate(GeneratorEntry)} instead.
-	 * 
-	 * This method might become final in further versions. Please override
-	 * {@link #doGenerate(GeneratorEntry)}
-	 * 
-	 * @see {@link #doGenerate(GeneratorEntry)}
-	 */
-	public void generate(GeneratorEntry entry) {
-		if (canHandle(entry)) {
-			try {
-				logStart(entry);
-				prepareGenerator(entry);
-				doGenerate(entry);
-				log.log("Done.");
-			} catch (Exception e) {
-				log.logError(e);
-			} finally {
-				finishGenerator(entry);
-			}
-		}
-	}
-
-	/**
-	 * Logs some information about the following generation process.
-	 * 
-	 * @param entry
-	 */
-	protected void logStart(GeneratorEntry entry) {
-		Statechart statechart = (Statechart) entry.getElementRef();
-		log.log(String.format("Generating %s %s ...", Statechart.class.getSimpleName(), statechart.getName()));
-	}
-
-	/**
-	 * Do generate for the given {@link GeneratorEntry}. Sub-classes might
-	 * override this method if they do generation for elements other than
-	 * {@link Statechart}.
-	 * 
-	 * @param entry
-	 */
-	protected void doGenerate(GeneratorEntry entry) {
-		Statechart statechart = (Statechart) entry.getElementRef();
-		runGenerator(statechart, entry);
-	}
-
-	/**
-	 * Per default this method checks if the given {@link GeneratorEntry}
-	 * includes a {@link Statechart}. Sub-classes may override this method if
-	 * they handle elements with type other than @link {@link Statechart}.
-	 * 
-	 * @param entry
-	 *            the upcomming GeneratorEntry
-	 * @return true if this instance can handle the given {@link GeneratorEntry}
-	 */
-	protected boolean canHandle(GeneratorEntry entry) {
-		EObject elementRef = entry.getElementRef();
-		if (elementRef == null || !(elementRef instanceof Statechart)) {
-			log.log("No Statechart selected in genmodel (" + entry + ")");
-			return false;
-		}
-		return true;
-	}
-
-	/**
-	 * Override this method to do any setup needed before generation. In normal
-	 * case sub-classes will call super implementations.
-	 */
-	protected void prepareGenerator(GeneratorEntry entry) {
-		initFileSystemAccess(entry);
-	}
-
-	/**
-	 * Override this method to do any cleanup needed after generation. In normal
-	 * case sub-classes will call super implementations.
-	 */
-	protected void finishGenerator(GeneratorEntry entry) {
-		wsAccess.refreshProject(coreFeatureHelper.getTargetProjectValue(entry).getStringValue());
-	}
-
-	/**
-	 * Sub-classes might override this method to add custom bindings for a
-	 * specific {@link GeneratorEntry}.
-	 * 
-	 * In normal case sub-classes will just override or add custom bindings and
-	 * ensure all other bindings of super-class implementations are still
-	 * available.
-	 * 
-	 * @param entry
-	 *            the next generator entry
-	 * @return a module with custom bindings
-	 * @see sub-classes often use {@link Modules#override(Module...)}
-	 */
-	public Module getOverridesModule(final GeneratorEntry entry) {
-		return new Module() {
-			@Override
-			public void configure(Binder binder) {
-				// currently, do not add additional bindings
-			}
-		};
-	}
-
-	/**
-	 * Initialize the current file system access through generated files are
-	 * written to a particular target location.
-	 * 
-	 * In case of overriding this method it has to be ensured that at least
-	 * {@link IFileSystemAccess#DEFAULT_OUTPUT} will be initialized. Dependent
-	 * on usage of FSA functionality
-	 * <ul>
-	 * <li>{@link IFileSystemAccess#generateFile(String, CharSequence)}</li>
-	 * <li>{@link IFileSystemAccess#generateFile(String, String, CharSequence)}
-	 * </li>
-	 * </ul>
-	 * Optional output configurations has to be registered. How output
-	 * configurations are interpreted is defined by the concrete FSA
-	 * implementation.
-	 */
-	protected void initFileSystemAccess(GeneratorEntry entry) {
-		sctFsa.setContext(coreFeatureHelper.getTargetProjectValue(entry).getStringValue());
-		initFsaTargetProject(entry);
-		initDefaultOutput(entry);
-		initLibraryTargetFolder(entry);
-		initApiTargetFolder(entry);
-	}
-
-	protected void initLibraryTargetFolder(GeneratorEntry entry) {
-		FeatureParameterValue libraryTargetFolderValue = coreFeatureHelper.getLibraryTargetFolderValue(entry);
-		if (libraryTargetFolderValue != null) {
-			sctFsa.setOutputPath(LIBRARY_TARGET_FOLDER_OUTPUT, libraryTargetFolderValue.getStringValue());
-		}
-
-		OutputConfiguration librarytargetFolderOutputConfiguration = sctFsa.getOutputConfigurations()
-				.get(LIBRARY_TARGET_FOLDER_OUTPUT);
-		if (librarytargetFolderOutputConfiguration != null) {
-			librarytargetFolderOutputConfiguration.setCreateOutputDirectory(true);
-			// do not overwrite existing resources and ensure the folder is not
-			// cleaned.
-			librarytargetFolderOutputConfiguration.setCanClearOutputDirectory(false);
-			librarytargetFolderOutputConfiguration.setOverrideExistingResources(false);
-		}
-	}
-
-	protected void initApiTargetFolder(GeneratorEntry entry) {
-		FeatureParameterValue apiTargetFolderValue = coreFeatureHelper.getApiTargetFolderValue(entry);
-		if (apiTargetFolderValue != null) {
-			sctFsa.setOutputPath(API_TARGET_FOLDER_OUTPUT, apiTargetFolderValue.getStringValue());
-		}
-		OutputConfiguration apiTargetFolderOutputConfiguration = sctFsa.getOutputConfigurations()
-				.get(API_TARGET_FOLDER_OUTPUT);
-		if (apiTargetFolderOutputConfiguration != null) {
-			apiTargetFolderOutputConfiguration.setCreateOutputDirectory(true);
-		}
-	}
-
-	protected void initDefaultOutput(GeneratorEntry entry) {
-		sctFsa.setOutputPath(IFileSystemAccess.DEFAULT_OUTPUT,
-				coreFeatureHelper.getTargetFolderValue(entry).getExpression().toString());
-		sctFsa.getOutputConfigurations().get(IFileSystemAccess.DEFAULT_OUTPUT).setCreateOutputDirectory(true);
-	}
-
-	protected void initFsaTargetProject(GeneratorEntry entry) {
-		sctFsa.setOutputPath(OUTLET_FEATURE_TARGET_PROJECT,
-				coreFeatureHelper.getTargetProjectValue(entry).getStringValue());
-	}
-}

+ 1 - 1
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/library/ICoreLibraryHelper.java

@@ -69,5 +69,5 @@ public interface ICoreLibraryHelper {
 	 */
 	String getRelativeApiFolder(GeneratorEntry entry);
 
-	boolean isDumpSexec(GeneratorEntry entry);
+	boolean serializeExecutionFlow(GeneratorEntry entry);
 }

+ 1 - 1
plugins/org.yakindu.sct.generator.core/src/org/yakindu/sct/generator/core/library/impl/DefaultCoreLibraryHelper.java

@@ -70,7 +70,7 @@ public class DefaultCoreLibraryHelper implements ICoreLibraryHelper {
 	}
 
 	@Override
-	public boolean isDumpSexec(GeneratorEntry entry) {
+	public boolean serializeExecutionFlow(GeneratorEntry entry) {
 		FeatureParameterValue dumpSexec = entry.getFeatureParameterValue(DEBUG_FEATURE, DEBUG_FEATURE_DUMP_SEXEC);
 		if (dumpSexec == null) {
 			return false;

+ 2 - 26
plugins/org.yakindu.sct.generator.cpp/plugin.xml

@@ -5,10 +5,12 @@
    <extension
          point="org.yakindu.sct.generator.core.generator">
       <SCTGenerator
+            bindings="org.yakindu.sct.generator.cpp.CppCodeGeneratorModule"
             class="org.yakindu.sct.generator.cpp.CppCodeGenerator"
             contentType="statechart"
             description="YAKINDU SCT C++ Code Generator"
             elementRefType="org.yakindu.sct.model.sgraph.Statechart"
+            executor="org.yakindu.sct.generator.core.execution.SExecGeneratorEntryExecutor"
             icon="icons/sct.png"
             id="yakindu::cpp"
             name="YAKINDU SCT C++ Code Generator">
@@ -38,30 +40,4 @@
             uri="platform:/plugin/org.yakindu.sct.generator.cpp/library/FeatureTypeLibrary.xmi">
       </FeatureLibrary>
    </extension>
-   <!-- extension
-         point="org.yakindu.sct.generator.core.generator">
-      <SCTGenerator
-            class="org.yakindu.sct.generator.cpp.CppCodeGenerator"
-            description="YAKINDU.org C++ Code Generator"
-            contentType="statechart"
-            elementRefType="org.yakindu.sct.model.sgraph.Statechart"
-            id="yakindu::cpp"
-            name="YAKINDU C++ Code Generator">
-      </SCTGenerator>
-   </extension>
-   <extension
-         point="org.yakindu.sct.generator.core.featuretypes">
-      <FeatureLibrary
-            defaultProvider="org.yakindu.sct.generator.cpp.features.CPPDefaultFeatureValueProvider"
-            generatorId="yakindu::cpp"
-            uri="platform:/plugin/org.yakindu.sct.generator.cpp/library/FeatureTypeLibrary.xmi">
-      </FeatureLibrary>
-   </extension>
-   <extension
-         point="org.yakindu.sct.generator.core.extensions">
-      <ExtensionGeneratorMapping
-            fileExtension="sct"
-            generatorId="yakindu::cpp">
-      </ExtensionGeneratorMapping>
-   </extension -->
 </plugin>

+ 0 - 78
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/CppCodeGenerator.java

@@ -1,78 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.generator.cpp;
-
-import org.yakindu.sct.generator.c.GenArtifactConfigurations;
-import org.yakindu.sct.generator.c.IGenArtifactConfigurations;
-import org.yakindu.sct.generator.c.types.CTypeSystemAccess;
-import org.yakindu.sct.generator.core.impl.AbstractSExecModelGenerator;
-import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.naming.INamingService;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgraph.Statechart;
-
-import com.google.inject.Binder;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.google.inject.name.Names;
-import com.google.inject.util.Modules;
-
-/**
- * 
- * @author Markus Mühlbrandt - Initial contribution and API
- * 
- */
-public class CppCodeGenerator extends AbstractSExecModelGenerator {
-
-	@Inject
-	private CppGenerator delegate;
-
-	@Inject
-	private IGenArtifactConfigurations artifactConfigs;
-
-	@Override
-	protected void prepareGenerator(GeneratorEntry entry) {
-		super.prepareGenerator(entry);
-		initGenArtifactConfigurations();
-	}
-
-	protected void initGenArtifactConfigurations() {
-		artifactConfigs.setFileSystemAccess(sctFsa);
-	}
-
-	@Override
-	public void runGenerator(Statechart statechart, GeneratorEntry entry) {
-		ExecutionFlow flow = createExecutionFlow(statechart, entry);
-		if (coreFeatureHelper.isDumpSexec(entry)) {
-			dumpSexec(entry, flow);
-		}
-		delegate.generate(flow, entry, sctFsa, artifactConfigs);
-	}
-
-	@Override
-	public Module getOverridesModule(final GeneratorEntry entry) {
-		Module module = super.getOverridesModule(entry);
-		return Modules.override(module).with(new Module() {
-			public void configure(Binder binder) {
-				binder.bind(ICodegenTypeSystemAccess.class).to(CTypeSystemAccess.class);
-				binder.bind(INamingService.class).to(CppNamingService.class);
-				binder.bind(GeneratorEntry.class).toInstance(entry);
-
-				binder.bind(IGenArtifactConfigurations.class).to(GenArtifactConfigurations.class);
-				// default binding to ensure consistency of already used API
-				binder.bind(IGenArtifactConfigurations.class)
-						.annotatedWith(Names.named(IGenArtifactConfigurations.DEFAULT))
-						.toInstance(GenArtifactConfigurations.DEFAULT);
-			}
-		});
-	}
-}

+ 37 - 0
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/CppCodeGeneratorModule.java

@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.cpp;
+
+import org.yakindu.sct.generator.c.types.CTypeSystemAccess;
+import org.yakindu.sct.generator.core.GeneratorModule;
+import org.yakindu.sct.generator.core.IExecutionFlowGenerator;
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess;
+import org.yakindu.sct.model.sexec.naming.INamingService;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+import com.google.inject.Binder;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class CppCodeGeneratorModule implements GeneratorModule {
+
+	@Override
+	public void configure(GeneratorEntry entry, Binder binder) {
+		binder.bind(GeneratorEntry.class).toInstance(entry);
+		binder.bind(IExecutionFlowGenerator.class).to(CppGenerator.class);
+		binder.bind(ICodegenTypeSystemAccess.class).to(CTypeSystemAccess.class);
+		binder.bind(INamingService.class).to(CppNamingService.class);
+	}
+
+}

+ 5 - 13
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/CppGenerator.xtend

@@ -11,15 +11,15 @@
 package org.yakindu.sct.generator.cpp
 
 import com.google.inject.Inject
-import com.google.inject.name.Named
 import org.eclipse.xtext.generator.IFileSystemAccess
-import org.yakindu.sct.generator.c.GenArtifactConfigurations.GenArtifactConfiguration
 import org.yakindu.sct.generator.c.IGenArtifactConfigurations
+import org.yakindu.sct.generator.c.IGenArtifactConfigurations.GenArtifactConfiguration
 import org.yakindu.sct.generator.core.IExecutionFlowGenerator
 import org.yakindu.sct.generator.core.library.ICoreLibraryHelper
 import org.yakindu.sct.model.sexec.ExecutionFlow
 import org.yakindu.sct.model.sgen.GeneratorEntry
-import static org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess.*;
+
+import static org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess.*
 
 /**
  * This is the CPP code generators main class. 
@@ -38,18 +38,10 @@ class CppGenerator implements IExecutionFlowGenerator {
 	@Inject extension Naming
 	@Inject extension ICoreLibraryHelper
 	
-	@Inject @Named(IGenArtifactConfigurations.DEFAULT)
-	IGenArtifactConfigurations defaultConfigs
+	@Inject
+	IGenArtifactConfigurations locations
 	
-	/**
-	 * @Deprecated use {@link #generate(ExecutionFlow, GeneratorEntry, IFileSystemAccess, ArtifactLocationProvider)} instead
-	 */
-	@Deprecated
 	override generate(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
-		generate(flow, entry, fsa, defaultConfigs)
-	}
-	
-	def generate(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa, IGenArtifactConfigurations locations) {
 		initGenerationArtifacts(flow, entry, locations)
 		generateArtifacts(flow, entry, fsa, locations);
 	}

+ 1 - 3
plugins/org.yakindu.sct.generator.cpp/src/org/yakindu/sct/generator/cpp/CppNamingService.xtend

@@ -32,9 +32,7 @@ class CppNamingService extends CNamingService {
 	@Inject extension SExecExtensions
 
 	@Inject
-	new(GeneratorEntry entry) {
-		super(entry)
-	}
+	GeneratorEntry entry
 
 	override protected prefix(Step it, char separator) {
 		var prefix = ""

+ 1 - 1
plugins/org.yakindu.sct.generator.csharp/.classpath

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="xtend-gen"/>
 	<classpathentry kind="src" path="src"/>

+ 3 - 3
plugins/org.yakindu.sct.generator.csharp/.settings/org.eclipse.jdt.core.prefs

@@ -1,11 +1,11 @@
 eclipse.preferences.version=1
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.compliance=1.7
 org.eclipse.jdt.core.compiler.debug.lineNumber=generate
 org.eclipse.jdt.core.compiler.debug.localVariable=generate
 org.eclipse.jdt.core.compiler.debug.sourceFile=generate
 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7

+ 7 - 7
plugins/org.yakindu.sct.generator.csharp/plugin.xml

@@ -4,13 +4,13 @@
    <extension
          point="org.yakindu.sct.generator.core.generator">
        <SCTGenerator
-            class="org.yakindu.sct.generator.csharp.CSharpCodeGenerator"
-            description="YAKINDU SCT C# Code Generator"
-            contentType="statechart"
-            elementRefType="org.yakindu.sct.model.sgraph.Statechart"
-            icon="icons/sct.png"
-            id="yakindu::csharp"
-            name="YAKINDU SCT C# Code Generator">
+             contentType="statechart"
+             description="YAKINDU SCT C# Code Generator"
+             elementRefType="org.yakindu.sct.model.sgraph.Statechart"
+             executor="org.yakindu.sct.generator.core.execution.SExecGeneratorEntryExecutor"
+             icon="icons/sct.png"
+             id="yakindu::csharp"
+             name="YAKINDU SCT C# Code Generator">
           <FeatureLibrary
                 library_id="org.yakindu.generator.core.features">
           </FeatureLibrary>

+ 0 - 51
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpCodeGenerator.java

@@ -1,51 +0,0 @@
-/**
-  Copyright (c) 2012-2015 committers of YAKINDU and others.
-  All rights reserved. This program and the accompanying materials
-  are made available under the terms of the Eclipse Public License v1.0
-  which accompanies this distribution, and is available at
-  http://www.eclipse.org/legal/epl-v10.html
-  Contributors:
-  	Markus Muehlbrandt - Initial contribution and API
- */
-package org.yakindu.sct.generator.csharp;
-
-import org.yakindu.sct.generator.core.impl.AbstractSExecModelGenerator;
-import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess;
-import org.yakindu.sct.generator.csharp.types.CSharpTypeSystemAccess;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.naming.INamingService;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgraph.Statechart;
-
-import com.google.inject.Binder;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.google.inject.util.Modules;
-
-public class CSharpCodeGenerator extends AbstractSExecModelGenerator {
-
-	@Inject
-	CSharpGenerator delegate;
-
-	@Override
-	public void runGenerator(Statechart statechart, GeneratorEntry entry) {
-		ExecutionFlow flow = createExecutionFlow(statechart, entry);
-		if (coreFeatureHelper.isDumpSexec(entry)) {
-			dumpSexec(entry, flow);
-		}
-		delegate.generate(flow, entry, sctFsa);
-	}
-
-	@Override
-	public Module getOverridesModule(final GeneratorEntry entry) {
-		Module module = super.getOverridesModule(entry);
-		return Modules.override(module).with(new Module() {
-			public void configure(Binder binder) {
-				binder.bind(ICodegenTypeSystemAccess.class).to(CSharpTypeSystemAccess.class);
-				binder.bind(INamingService.class).to(CSharpNamingService.class);
-				binder.bind(GeneratorEntry.class).toInstance(entry);
-			}
-		});
-	}
-
-}

+ 36 - 0
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/CSharpGeneratorModule.java

@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.csharp;
+
+import org.yakindu.sct.generator.core.GeneratorModule;
+import org.yakindu.sct.generator.core.IExecutionFlowGenerator;
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess;
+import org.yakindu.sct.generator.csharp.types.CSharpTypeSystemAccess;
+import org.yakindu.sct.model.sexec.naming.INamingService;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+import com.google.inject.Binder;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class CSharpGeneratorModule implements GeneratorModule {
+
+	@Override
+	public void configure(GeneratorEntry entry, Binder binder) {
+		binder.bind(IExecutionFlowGenerator.class).to(CSharpGenerator.class);
+		binder.bind(ICodegenTypeSystemAccess.class).to(CSharpTypeSystemAccess.class);
+		binder.bind(INamingService.class).to(CSharpNamingService.class);
+		binder.bind(GeneratorEntry.class).toInstance(entry);
+	}
+}

+ 7 - 12
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RunnableWrapper.xtend

@@ -10,15 +10,15 @@
 
 package org.yakindu.sct.generator.csharp
 
-import org.yakindu.sct.model.sexec.ExecutionFlow
-import org.yakindu.sct.model.sgen.GeneratorEntry
-import org.eclipse.xtext.generator.IFileSystemAccess
 import com.google.inject.Inject
-import org.yakindu.sct.model.stext.stext.InterfaceScope
-import org.yakindu.base.types.typesystem.ITypeSystem
+import org.eclipse.xtext.generator.IFileSystemAccess
 import org.yakindu.base.types.Direction
 import org.yakindu.base.types.typesystem.GenericTypeSystem
+import org.yakindu.base.types.typesystem.ITypeSystem
 import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess
+import org.yakindu.sct.model.sexec.ExecutionFlow
+import org.yakindu.sct.model.sgen.GeneratorEntry
+import org.yakindu.sct.model.stext.stext.InterfaceScope
 
 /**
  * Generates the runnable wrapper for the statemachine. This wrapper implies event based execution semantics. 
@@ -33,15 +33,10 @@ class RunnableWrapper {
 	@Inject protected extension ITypeSystem
 	@Inject protected extension ICodegenTypeSystemAccess
 	
-	
-	@Inject Beautifier beautifier
-	
-	
 	def generateRunnableWrapper(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
 		
 		var filename = flow.getImplementationPackagePath(entry) + '/' + flow.runnableWrapperClassName(entry).csharp
 		var content = content(flow, entry)
-//		var content = beautifier.format(filename, content(flow, entry))
 		fsa.generateFile(filename, content)
 	}
 	
@@ -127,7 +122,7 @@ class RunnableWrapper {
 						statemachine.runCycle();
 					}
 				}
-	
+		
 				/**
 				 * This method will start the main execution loop for the statemachine. 
 				 * First it will init and enter the statemachine implicitly and then will start processing events 
@@ -150,7 +145,7 @@ class RunnableWrapper {
 						}
 					}			
 				}
-	
+		
 				
 			}
 		}

+ 20 - 22
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/RuntimeService.xtend

@@ -42,21 +42,19 @@ class RuntimeService {
 			 * 
 			 */
 			public class RuntimeService {
-	
+		
 				private static RuntimeService runtimeService;
-	
-				private Timer timer = null;
-	
+		
+				private Timer timer = null;			
 				private Dictionary<Long, StatemachineTimerTask> timerTasks = new Dictionary<Long, StatemachineTimerTask>();
-	
+		
 				private class StatemachineTimerTask extends TimerTask {
-	
+		
 					private List<IStatemachine> statemachineList = new List<IStatemachine>();
-	
+		
 					private ReaderWriterLock lock = new ReaderWriterLock();
-	
-					private bool isPaused = false;
-	
+		
+					private bool isPaused = false;			
 					public override void run() {
 						lock.AcquireReaderLock(-1);
 						if (!isPaused) {
@@ -66,7 +64,7 @@ class RuntimeService {
 						}
 						lock.ReleaseReaderLock();
 					}
-	
+		
 					/**
 					 * Adds the given state machine to the TimerTask.
 					 * 
@@ -79,7 +77,7 @@ class RuntimeService {
 						lock.ReleaseWriterLock();
 						return true;
 					}
-	
+		
 					/**
 					 * Removes the given state machine from the TimerTask.
 					 * 
@@ -92,20 +90,20 @@ class RuntimeService {
 						lock.ReleaseWriterLock(-1);
 						return ret;
 					}
-	
+		
 					public void pause() {
 						isPaused = true;
 					}
-	
+		
 					public void resume() {
 						isPaused = false;
 					}
 				}
-	
+		
 				private RuntimeService() {
 					// Not intended to be instantiated.
 				}
-	
+		
 				/**
 				 * Returns the {@code RuntimeService} instance as singleton.
 				 * 
@@ -117,7 +115,7 @@ class RuntimeService {
 					}
 					return runtimeService;
 				}
-	
+		
 				/**
 				 * Registers an {@link IStatemachine} for scheduled fixed rate execution
 				 * 
@@ -147,7 +145,7 @@ class RuntimeService {
 						return ret;
 					}
 				}
-	
+		
 				/**
 				 * Removes the given state machine from runtime service.
 				 * 
@@ -167,7 +165,7 @@ class RuntimeService {
 					}
 					return false;
 				}
-	
+		
 				/**
 				 * Cancels the execution of statemachines for the given cycle period. This
 				 * stops the execution of statemachines which are registered for the given
@@ -185,7 +183,7 @@ class RuntimeService {
 					}
 					return false;
 				}
-	
+		
 				/**
 				 * Pauses the execution of all statemachines which are registered for the
 				 * given cyclePeriod.
@@ -201,7 +199,7 @@ class RuntimeService {
 					}
 					return false;
 				}
-	
+		
 				/**
 				 * Resumes the execution of all statemachines which are registered for the
 				 * given cyclePeriod.
@@ -217,7 +215,7 @@ class RuntimeService {
 					}
 					return false;
 				}
-	
+		
 				/**
 				 * Cancels the execution of all registered statemachines. This cancels the
 				 * executing {@link Timer} freeing all allocated resources and terminates

+ 0 - 1
plugins/org.yakindu.sct.generator.csharp/src/org/yakindu/sct/generator/csharp/features/CSharpFeatureValueProvider.java

@@ -33,7 +33,6 @@ import org.yakindu.sct.model.sgen.FeatureTypeLibrary;
 public class CSharpFeatureValueProvider extends
 		AbstractDefaultFeatureValueProvider {
 
-	private static final String PACKAGE_NAME_REGEX = "([a-zA-Z_][a-zA-Z0-9_]*\\.)+[a-zA-Z_][a-zA-Z0-9_]*";
 	private static final String SUFFIX_REGEX = "[a-zA-Z0-9_]*";
 
 	

+ 0 - 1
plugins/org.yakindu.sct.generator.genmodel.ui/.settings/org.eclipse.core.resources.prefs

@@ -1,4 +1,3 @@
 eclipse.preferences.version=1
 encoding//src/org/yakindu/sct/generator/genmodel/ui/wizard/GeneratorProjectTemplate.xtend=UTF-8
-encoding//src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandDefaultTemplate.xpt=ISO-8859-1
 encoding/<project>=UTF-8

+ 0 - 8
plugins/org.yakindu.sct.generator.genmodel.ui/plugin.xml

@@ -374,14 +374,6 @@
             name="Code Generator Model"
             project="false">
       </wizard>
-      <wizard
-            category="YAKINDU"
-            class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.yakindu.sct.generator.genmodel.ui.wizard.XpandGeneratorProjectWizard"
-            icon="icons/GenModel-16.png"
-            id="org.yakindu.sct.generator.genmodel.ui.XtendGeneratorProjectWizard"
-            name="Xpand Generator Project"
-            project="true">
-      </wizard>
       <wizard
             category="YAKINDU"
             class="org.yakindu.sct.generator.genmodel.ui.SGenExecutableExtensionFactory:org.yakindu.sct.generator.genmodel.ui.wizard.WorkspaceGeneratorProjectWizard"

+ 4 - 4
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/GeneratorComposite.java

@@ -12,7 +12,9 @@ package org.yakindu.sct.generator.genmodel.ui.wizard;
 
 import org.eclipse.jface.layout.GridDataFactory;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyAdapter;
 import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -21,8 +23,6 @@ import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Group;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
-import org.yakindu.sct.generator.genmodel.ui.wizard.XpandGeneratorWizardPage1.KeyListenerAdapter;
-import org.yakindu.sct.generator.genmodel.ui.wizard.XpandGeneratorWizardPage1.SelectionListenerAdapter;
 
 public class GeneratorComposite extends Composite {
 
@@ -49,7 +49,7 @@ public class GeneratorComposite extends Composite {
 
 	private final ValidateCallback callback;
 
-	private final KeyListenerAdapter textBoxListener = new KeyListenerAdapter() {
+	private final KeyAdapter textBoxListener = new KeyAdapter() {
 		@Override
 		public void keyReleased(KeyEvent e) {
 			callback.validate();
@@ -72,7 +72,7 @@ public class GeneratorComposite extends Composite {
 		
 		cbGenerator = new Button(generatorCheckboxGroup, SWT.CHECK);
 		cbGenerator.setText("Configure for Plugin Export");
-		cbGenerator.addSelectionListener(new SelectionListenerAdapter() {
+		cbGenerator.addSelectionListener(new SelectionAdapter() {
 
 			public void widgetSelected(SelectionEvent e) {
 				setGroupEnabled(cbGenerator.getSelection());

+ 24 - 50
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/GeneratorProjectTemplate.xtend

@@ -10,6 +10,8 @@
  */ 
 package org.yakindu.sct.generator.genmodel.ui.wizard
 
+import com.google.inject.Inject
+import com.google.inject.Provider
 import java.io.BufferedInputStream
 import java.io.ByteArrayInputStream
 import java.io.ByteArrayOutputStream
@@ -19,18 +21,16 @@ import org.eclipse.core.resources.IContainer
 import org.eclipse.core.resources.IFile
 import org.eclipse.core.resources.IFolder
 import org.eclipse.core.resources.IResource
+import org.eclipse.core.resources.IWorkspace
 import org.eclipse.core.runtime.IProgressMonitor
 import org.eclipse.core.runtime.Path
 import org.eclipse.core.runtime.SubProgressMonitor
 import org.eclipse.emf.common.util.URI
 import org.eclipse.emf.ecore.EObject
 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
+import org.eclipse.xtext.parser.IEncodingProvider
 import org.yakindu.sct.model.sgen.ParameterTypes
 import org.yakindu.sct.model.sgen.SGenFactory
-import com.google.inject.Provider
-import org.eclipse.core.resources.IWorkspace
-import com.google.inject.Inject
-import org.eclipse.xtext.parser.IEncodingProvider
 
 /**
  * 
@@ -69,10 +69,6 @@ class GeneratorProjectTemplate {
 		project.getFile('META-INF/MANIFEST.MF').write(data.manifest)
 		if (data.pluginExport) {
 			project.getFile('plugin.xml').write(data.plugin)
-			if (data.generatorType == GeneratorType::Xpand) {
-				project.getFile('src/'+data.generatorClass.javaFilename)
-					.write(data.xpandGenerator)
-			}
 			if (data.typeLibrary) {
 				project.createFolder('library')
 				project.getFile('library/FeatureTypeLibrary.xmi')
@@ -86,9 +82,6 @@ class GeneratorProjectTemplate {
 		project.getFile('.classpath').write(data.classpath);
 		project.getFile('.project').write(data.projectFile);
 		switch data.generatorType {
-			case GeneratorType::Xpand :
-				project.getFile('src/'+data.targetPackage.asFolder+'/'+data.templateName+'.xpt').
-					write(resource('XpandDefaultTemplate.xpt'.fromMyFolder,'iso-8859-1'))
 			case GeneratorType::Xtend :
 				project.getFile('src/'+data.generatorClass.xtendFilename).
 					write(data.xtendGenerator)
@@ -107,7 +100,7 @@ class GeneratorProjectTemplate {
 	}
 	
 	def templateName(ProjectData data) {
-		if (data.pluginExport || data.generatorType != GeneratorType::Xpand)
+		if (data.pluginExport)
 			data.generatorClass.simpleName
 		else
 			'Main'
@@ -302,33 +295,32 @@ class GeneratorProjectTemplate {
 		Bundle-Name: «data.projectName»
 		Bundle-SymbolicName: «data.projectName»; singleton:=true
 		Bundle-Version: 1.0.0
-		Require-Bundle: org.eclipse.jdt.core;bundle-version="3.5.0",
+		Require-Bundle: org.eclipse.jdt.core,
 		 org.apache.commons.logging,
 		 org.apache.log4j;resolution:=optional,
-		 com.ibm.icu;bundle-version="4.0.1",
-		 org.antlr.runtime;bundle-version="3.0.0",
-		 org.eclipse.core.runtime;bundle-version="3.5.0",
-		 org.eclipse.emf.mwe.utils;bundle-version="0.7.0",
-		 org.eclipse.emf.ecore.xmi;bundle-version="2.5.0",
-		 org.eclipse.jface.text;bundle-version="3.5.0",
-		«IF data.generatorType == GeneratorType::Xpand || data.generatorType == GeneratorType::Xtend»
-			«' '»org.eclipse.xpand;bundle-version="0.7.0",
+		 com.ibm.icu,
+		 org.antlr.runtime,
+		 org.eclipse.core.runtime",
+		 org.eclipse.emf.mwe.utils",
+		 org.eclipse.emf.ecore.xmi",
+		 org.eclipse.jface.text",
+		«IF data.generatorType == GeneratorType::Xtend»
 			«' '»org.eclipse.xtend;bundle-version="0.7.0",
 			«' '»org.eclipse.xtend.typesystem.emf;bundle-version="0.7.0",
 			«' '»org.eclipse.xtend.profiler;resolution:=optional,
 		«ENDIF»
 		«IF data.generatorType == GeneratorType::Xtend»
-			«' '»org.eclipse.xtext.xbase.lib;bundle-version="2.0.1",
-			«' '»org.eclipse.xtend.lib;bundle-version="2.0.1",
+			«' '»org.eclipse.xtext.xbase.lib,
+			«' '»org.eclipse.xtend.lib,
 		«ENDIF»
-		«IF data.pluginExport || data.generatorType != GeneratorType::Xpand»
-			«' '»org.yakindu.sct.generator.core;bundle-version="1.0.0",
+		«IF data.pluginExport»
+			«' '»org.yakindu.sct.generator.core",
 		«ENDIF»
-		 org.yakindu.sct.model.sgen;bundle-version="1.0.0",
-		 org.yakindu.sct.model.sexec;bundle-version="1.0.0",
-		 org.yakindu.sct.model.stext;bundle-version="1.0.0",
-		 org.yakindu.sct.model.sgraph;bundle-version="1.0.0"
-		Bundle-RequiredExecutionEnvironment: J2SE-1.5
+		 org.yakindu.sct.model.sgen",
+		 org.yakindu.sct.model.sexec",
+		 org.yakindu.sct.model.stext",
+		 org.yakindu.sct.model.sgraph"
+		Bundle-RequiredExecutionEnvironment: J2SE-1.7
 	'''
 	
 	def plugin(ProjectData data) '''
@@ -369,24 +361,6 @@ class GeneratorProjectTemplate {
 		 	</extension>
 		</plugin>
 	'''
-	
-	def xpandGenerator(ProjectData data) '''
-		package «data.generatorClass.packageName»;
-		
-		import org.yakindu.sct.generator.core.impl.AbstractXpandBasedCodeGenerator;
-		
-		/**
-		 * Generator using Xpand template "«data.generatorClass.javaPathToXpand»::main"
-		 */
-		public class «data.generatorClass.simpleName» extends AbstractXpandBasedCodeGenerator {
-		
-			@Override
-			public String getTemplatePath() {
-				return "«data.generatorClass.javaPathToXpand»::main";
-			}
-		}
-	'''
-	
 	def javaGenerator(ProjectData data) '''
 		package «data.generatorClass.packageName»;
 
@@ -397,7 +371,7 @@ class GeneratorProjectTemplate {
 		import org.yakindu.sct.generator.core.impl.IExecutionFlowGenerator;
 		import org.eclipse.xtext.generator.IFileSystemAccess;
 		
-		public class «data.generatorClass.simpleName» extends AbstractWorkspaceGenerator implements IExecutionFlowGenerator{
+		public class «data.generatorClass.simpleName» implements IExecutionFlowGenerator{
 			private static final String LBR = "\n\r";
 
 			public void generate(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess fsa) {
@@ -426,7 +400,7 @@ class GeneratorProjectTemplate {
 		import org.yakindu.sct.generator.core.impl.IExecutionFlowGenerator
 		import org.eclipse.xtext.generator.IFileSystemAccess
 		
-		class «data.generatorClass.simpleName» extends AbstractWorkspaceGenerator implements IExecutionFlowGenerator {
+		class «data.generatorClass.simpleName» implements IExecutionFlowGenerator {
 		
 			override generate(ExecutionFlow flow, GeneratorEntry entry, IFileSystemAccess access) {
 				access.generateFile(flow.name+'.txt',flow.info);

+ 1 - 1
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/GeneratorType.java

@@ -14,5 +14,5 @@ package org.yakindu.sct.generator.genmodel.ui.wizard;
  * @author holger willebrandt - Initial contribution and API
  */
 public enum GeneratorType {
-	Java, Xpand, Xtend
+	Java, Xtend
 }

+ 0 - 38
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/WorkspaceGeneratorProjectWizard.java

@@ -1,38 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.generator.genmodel.ui.wizard;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * 
- * @author holger willebrandt - Initial contribution and API
- */
-public class WorkspaceGeneratorProjectWizard extends
-		XpandGeneratorProjectWizard {
-
-	@Override
-	public void init(IWorkbench workbench, IStructuredSelection selection) {
-		setWindowTitle("New YAKINDU Workspace Generator Project");
-		setNeedsProgressMonitor(true);
-	}
-
-	@Override
-	public IProjectWizardPage getProjectPage() {
-		WorkspaceGeneratorWizardPage1 projectPage = new WorkspaceGeneratorWizardPage1(
-				"project"); //$NON-NLS-1$
-		projectPage.setTitle("New YAKINDU Workspace Generator Project");
-		projectPage.setDescription("Configure the Generator Project");
-		return projectPage;
-	}
-
-}

+ 0 - 28
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandDefaultTemplate.xpt

@@ -1,28 +0,0 @@
-«REM»
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-«ENDREM»
-«IMPORT sexec»
-«IMPORT stext»
-«IMPORT sgraph»
-«IMPORT sgen»
- 
-«DEFINE main(sgen::GeneratorEntry entry) FOR sexec::ExecutionFlow-»
-«FILE this.name+'.txt' -»
-The name of the state machine is '«this.name-»'
-
-The state machine has the following states:
-
-«FOREACH this.states AS state-»
-«state.name.replaceFirst(this.name+'\\.','')»
-«ENDFOREACH-»
-«ENDFILE-»
-«ENDDEFINE»

+ 0 - 89
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandGeneratorProjectWizard.java

@@ -1,89 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.generator.genmodel.ui.wizard;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-
-import com.google.inject.Inject;
-
-/**
- * 
- * @author holger willebrandt - Initial contribution and API
- */
-public class XpandGeneratorProjectWizard extends Wizard implements
-		IWorkbenchWizard {
-
-	private IProjectWizardPage projectPage;
-	
-	@Inject
-	private GeneratorProjectTemplate template;
-
-	public void init(IWorkbench workbench, IStructuredSelection selection) {
-		setWindowTitle("New YAKINDU Xpand Generator Project");
-		setNeedsProgressMonitor(true);
-	}
-
-	@Override
-	public void addPages() {
-		projectPage = getProjectPage();
-		addPage(projectPage);
-	}
-
-	protected IProjectWizardPage getProjectPage() {
-		XpandGeneratorWizardPage1 projectPage = new XpandGeneratorWizardPage1(
-				"project"); //$NON-NLS-1$
-		projectPage.setTitle("New YAKINDU Xpand Generator Project");
-		projectPage.setDescription("Configure the Generator Project");
-		return projectPage;
-	}
-
-	@Override
-	public boolean performFinish() {
-
-		final ProjectData projectData = projectPage.getProjectData();
-
-		final IRunnableWithProgress op = new IRunnableWithProgress() {
-			
-			public void run(final IProgressMonitor monitor)
-					throws InvocationTargetException {
-				try {
-					template.setMonitor(monitor);
-					template.generate(projectData);
-				} catch (Exception e) {
-					throw new InvocationTargetException(e);
-				} finally {
-					monitor.done();
-				}
-			}
-		};
-		try {
-			getContainer().run(true, false, op);
-		} catch (final InterruptedException e) {
-			return false;
-		} catch (final InvocationTargetException e) {
-			final Throwable realException = e.getTargetException();
-			realException.printStackTrace();
-			MessageDialog.openError(getShell(), "Failed to create project",
-					realException.getMessage());
-			return false;
-		}
-		return true;
-	}
-
-}

+ 0 - 151
plugins/org.yakindu.sct.generator.genmodel.ui/src/org/yakindu/sct/generator/genmodel/ui/wizard/XpandGeneratorWizardPage1.java

@@ -1,151 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.generator.genmodel.ui.wizard;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.yakindu.sct.generator.genmodel.ui.wizard.GeneratorComposite.ValidateCallback;
-
-/**
- * 
- * @author holger willebrandt - Initial contribution and API
- */
-public class XpandGeneratorWizardPage1 extends IProjectWizardPage {
-	// project will be an OSGI bundle, so there are some name restrictions
-	private static final String PROJECT_REGEX = "[A-Za-z0-9\\._]+"; //$NON-NLS-1$
-	private Text txtProjectName;
-	private final KeyListenerAdapter textBoxListener = new KeyListenerAdapter() {
-
-		@Override
-		public void keyReleased(KeyEvent e) {
-			validate();
-		}
-	};
-	private GeneratorComposite generatorComposite;
-
-	protected XpandGeneratorWizardPage1(String pageName) {
-		super(pageName);
-	}
-
-	public void createControl(Composite container) {
-		Composite parent = new Composite(container, SWT.NULL);
-		setControl(parent);
-		parent.setLayout(new GridLayout(1, false));
-
-		Composite projectNameGroup = new Composite(parent, SWT.NULL);
-		projectNameGroup.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true,
-				false, 1, 1));
-		projectNameGroup.setLayout(new GridLayout(2, false));
-
-		Label lblProjectName = new Label(projectNameGroup, SWT.WRAP);
-		lblProjectName.setText("Project name:");
-		txtProjectName = new Text(projectNameGroup, SWT.SINGLE | SWT.BORDER);
-		txtProjectName.addKeyListener(textBoxListener);
-		GridDataFactory.fillDefaults().grab(true, false)
-				.applyTo(txtProjectName);
-
-		ValidateCallback callback = new ValidateCallback() {
-			public void validate() {
-				XpandGeneratorWizardPage1.this.validate();
-			}
-		};
-		generatorComposite = new GeneratorComposite(parent, SWT.NONE, callback);
-
-		generatorComposite.setGroupEnabled(false);
-		setPageComplete(false);
-	}
-
-	protected final void validate() {
-		setPageComplete(checkPageComplete());
-	}
-
-	protected boolean checkPageComplete() {
-		boolean complete = checkProjectName() && checkGeneratorOptions();
-		if (complete) {
-			setErrorMessage(null);
-		}
-		return complete;
-	}
-
-	private boolean checkProjectName() {
-		if (txtProjectName.getText().isEmpty()) {
-			setErrorMessage("Project name must be set");
-			return false;
-		}
-		if (!txtProjectName.getText().matches(PROJECT_REGEX)) {
-			setErrorMessage("Invalid Project name");
-			return false;
-		}
-		if (ResourcesPlugin.getWorkspace().getRoot()
-				.getProject(txtProjectName.getText()).exists()) {
-			setErrorMessage("Project already exists");
-			return false;
-		}
-		return true;
-	}
-
-	private boolean checkGeneratorOptions() {
-		String message = generatorComposite.validate();
-		if (message != null) {
-			setErrorMessage(message);
-			return false;
-		}
-		return true;
-	}
-
-	@Override
-	public ProjectData getProjectData() {
-		ProjectData data = new ProjectData();
-		data.generatorType = GeneratorType.Xpand;
-		data.projectName = txtProjectName.getText().trim();
-		data.generatorClass = generatorComposite.getTxtGeneratorClass()
-				.getText().trim();
-		data.generatorDescription = generatorComposite.getTxtGeneratorDesc()
-				.getText().trim();
-		data.generatorId = generatorComposite.getTxtGeneratorId().getText()
-				.trim();
-		data.generatorName = generatorComposite.getTxtGeneratorName().getText()
-				.trim();
-		data.pluginExport = generatorComposite.isGeneratePlugin();
-		data.typeLibrary = generatorComposite.isGenerateLibrary();
-		return data;
-	}
-
-	static abstract class SelectionListenerAdapter implements SelectionListener {
-
-		public void widgetDefaultSelected(SelectionEvent e) {
-			widgetSelected(e);
-		}
-	}
-
-	static abstract class KeyListenerAdapter implements KeyListener {
-
-		public void keyPressed(KeyEvent e) {
-			// empty
-		}
-
-		public void keyReleased(KeyEvent e) {
-			// empty
-		}
-
-	}
-
-}

+ 8 - 7
plugins/org.yakindu.sct.generator.java/plugin.xml

@@ -4,13 +4,14 @@
    <extension
          point="org.yakindu.sct.generator.core.generator">
        <SCTGenerator
-            class="org.yakindu.sct.generator.java.JavaCodeGenerator"
-            description="YAKINDU SCT Java Code Generator"
-            contentType="statechart"
-            elementRefType="org.yakindu.sct.model.sgraph.Statechart"
-            icon="icons/sct.png"
-            id="yakindu::java"
-            name="YAKINDU SCT Java Code Generator">
+             bindings="org.yakindu.sct.generator.java.JavaGeneratorModule"
+             contentType="statechart"
+             description="YAKINDU SCT Java Code Generator"
+             elementRefType="org.yakindu.sct.model.sgraph.Statechart"
+             executor="org.yakindu.sct.generator.core.execution.SExecGeneratorEntryExecutor"
+             icon="icons/sct.png"
+             id="yakindu::java"
+             name="YAKINDU SCT Java Code Generator">
           <FeatureLibrary
                 library_id="org.yakindu.generator.core.features">
           </FeatureLibrary>

+ 0 - 35
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/AbstractJavaCodeGenerator.java

@@ -1,35 +0,0 @@
-/**
- * Copyright (c) 2014 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.generator.java;
-
-import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.OUTLET_FEATURE;
-import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.OUTLET_FEATURE_TARGET_FOLDER;
-
-import org.yakindu.sct.generator.core.impl.AbstractSExecModelGenerator;
-import org.yakindu.sct.model.sgen.FeatureConfiguration;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgraph.Statechart;
-
-abstract public class AbstractJavaCodeGenerator extends AbstractSExecModelGenerator {
-
-	abstract public void generate(Statechart statechart, GeneratorEntry entry);
-
-	@Override
-	public final void runGenerator(Statechart statechart, GeneratorEntry entry) {
-		generate(statechart, entry);
-	}
-
-	public String getTargetFolderString(GeneratorEntry entry) {
-		FeatureConfiguration outletConfig = entry.getFeatureConfiguration(OUTLET_FEATURE);
-		String projectName = outletConfig.getParameterValue(OUTLET_FEATURE_TARGET_FOLDER).getStringValue();
-		return projectName;
-	}
-}

+ 1 - 1
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/IStatemachine.xtend

@@ -54,7 +54,7 @@ class IStatemachine {
 			/**
 			 * Initializes the state machine. Used to initialize internal variables etc.
 			 */
-			public void init();
+			public vo id init();
 		
 			/**
 			 * Enters the state machine. Sets the state machine into a defined state.

+ 0 - 61
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/JavaCodeGenerator.java

@@ -1,61 +0,0 @@
-/**
-  Copyright (c) 2012-2015 committers of YAKINDU and others.
-  All rights reserved. This program and the accompanying materials
-  are made available under the terms of the Eclipse Public License v1.0
-  which accompanies this distribution, and is available at
-  http://www.eclipse.org/legal/epl-v10.html
-  Contributors:
-  	Markus Muehlbrandt - Initial contribution and API
- */
-package org.yakindu.sct.generator.java;
-
-import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess;
-import org.yakindu.sct.generator.java.types.JavaTypeSystemAccess;
-import org.yakindu.sct.generator.java.types.OldJavaTypeSystemAccess;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.naming.INamingService;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgraph.Statechart;
-
-import com.google.inject.Binder;
-import com.google.inject.Inject;
-import com.google.inject.Module;
-import com.google.inject.Scopes;
-import com.google.inject.util.Modules;
-
-public class JavaCodeGenerator extends AbstractJavaCodeGenerator {
-
-	@Inject
-	private JavaGenerator delegate;
-	
-	
-	@Override
-	public void generate(Statechart statechart, GeneratorEntry entry) {
-
-		ExecutionFlow flow = createExecutionFlow(statechart, entry);
-
-		if (coreFeatureHelper.isDumpSexec(entry)) {
-			dumpSexec(entry, flow);
-		}
-
-		delegate.generate(flow, entry, sctFsa);
-	}
-
-	@Override
-	public Module getOverridesModule(final GeneratorEntry entry) {
-		Module module = super.getOverridesModule(entry);
-		final GenmodelEntries entries = new GenmodelEntries();
-		return Modules.override(module).with(new Module() {
-			public void configure(Binder binder) {
-				if (entries.useJavaInt(entry)) {
-					binder.bind(ICodegenTypeSystemAccess.class).to(OldJavaTypeSystemAccess.class);
-				} else {
-					binder.bind(ICodegenTypeSystemAccess.class).to(JavaTypeSystemAccess.class);
-				}
-				binder.bind(INamingService.class).to(JavaNamingService.class).in(Scopes.SINGLETON);
-			}
-		});
-
-	}
-
-}

+ 42 - 0
plugins/org.yakindu.sct.generator.java/src/org/yakindu/sct/generator/java/JavaGeneratorModule.java

@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     committers of YAKINDU - initial API and implementation
+ */
+package org.yakindu.sct.generator.java;
+
+import org.yakindu.sct.generator.core.GeneratorModule;
+import org.yakindu.sct.generator.core.IExecutionFlowGenerator;
+import org.yakindu.sct.generator.core.types.ICodegenTypeSystemAccess;
+import org.yakindu.sct.generator.java.types.JavaTypeSystemAccess;
+import org.yakindu.sct.generator.java.types.OldJavaTypeSystemAccess;
+import org.yakindu.sct.model.sexec.naming.INamingService;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+import com.google.inject.Binder;
+import com.google.inject.Scopes;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class JavaGeneratorModule implements GeneratorModule {
+
+	@Override
+	public void configure(GeneratorEntry entry, Binder binder) {
+		binder.bind(IExecutionFlowGenerator.class).to(JavaGenerator.class);
+		final GenmodelEntries entries = new GenmodelEntries();
+		if (entries.useJavaInt(entry)) {
+			binder.bind(ICodegenTypeSystemAccess.class).to(OldJavaTypeSystemAccess.class);
+		} else {
+			binder.bind(ICodegenTypeSystemAccess.class).to(JavaTypeSystemAccess.class);
+		}
+		binder.bind(INamingService.class).to(JavaNamingService.class).in(Scopes.SINGLETON);
+	}
+}

+ 11 - 4
plugins/org.yakindu.sct.generator.runner/library/GenericJavaFeatureTypeLibrary.xmi

@@ -1,8 +1,15 @@
 <?xml version="1.0" encoding="ASCII"?>
-<sgen:FeatureTypeLibrary xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sgen="http://www.yakindu.org/sct/statechart/SGen" xsi:schemaLocation="http://www.yakindu.org/sct/statechart/SGen ../../org.yakindu.sct.model.sgen/model/emf/sgen.ecore" name="Java">
+<sgen:FeatureTypeLibrary
+    xmi:version="2.0"
+    xmlns:xmi="http://www.omg.org/XMI"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:sgen="http://www.yakindu.org/sct/statechart/SGen"
+    xsi:schemaLocation="http://www.yakindu.org/sct/statechart/SGen ../../org.yakindu.sct.model.sgen/model/emf/sgen.ecore"
+    name="Java">
   <types name="Generator">
-    <parameters name="generatorProject"/>
-    <parameters name="generatorClass"/>
-    <parameters name="configurationModule" optional="true"/>
+    <parameters
+        name="generatorProject"/>
+    <parameters
+        name="generatorClass"/>
   </types>
 </sgen:FeatureTypeLibrary>

+ 2 - 1
plugins/org.yakindu.sct.generator.runner/plugin.xml

@@ -12,10 +12,11 @@
  <extension
        point="org.yakindu.sct.generator.core.generator">
    <SCTGenerator
-         class="org.yakindu.sct.generator.runner.GenericJavaBasedGenerator"
+         bindings="org.yakindu.sct.generator.runner.RunnerModule"
          contentType="statechart"
          description="Generate Code using a runtime code generator"
          elementRefType="org.yakindu.sct.model.sgraph.Statechart"
+         executor="org.yakindu.sct.generator.runner.WorkspaceGeneratorExecutor"
          icon="icons/sct.png"
          id="yakindu::generic"
          name="Custom Xtend2/Java-based Generator">

+ 0 - 144
plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/GenericJavaBasedGenerator.java

@@ -1,144 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.generator.runner;
-
-import static org.yakindu.sct.generator.runner.lib.IGenericJavaFeatureConstants.CONFIGURATION_MODULE;
-import static org.yakindu.sct.generator.runner.lib.IGenericJavaFeatureConstants.GENERATOR_CLASS;
-import static org.yakindu.sct.generator.runner.lib.IGenericJavaFeatureConstants.GENERATOR_PROJECT;
-import static org.yakindu.sct.generator.runner.lib.IGenericJavaFeatureConstants.TEMPLATE_FEATURE;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.xtext.util.Strings;
-import org.yakindu.sct.commons.WorkspaceClassLoaderFactory;
-import org.yakindu.sct.generator.core.IExecutionFlowGenerator;
-import org.yakindu.sct.generator.core.ISGraphGenerator;
-import org.yakindu.sct.generator.core.impl.AbstractSExecModelGenerator;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sgen.FeatureConfiguration;
-import org.yakindu.sct.model.sgen.FeatureParameterValue;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgraph.Statechart;
-
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-import com.google.inject.util.Modules;
-
-/**
- * 
- * 
- * @author holger willebrandt - Initial contribution and API
- */
-@Deprecated
-public class GenericJavaBasedGenerator extends AbstractSExecModelGenerator {
-
-	@Inject
-	private Injector injector;
-	
-	@Override
-	public Module getOverridesModule(final GeneratorEntry entry) {
-		Module defaultModule = super.getOverridesModule(entry);
-
-		String overridingModuleClass = null;
-		FeatureConfiguration featureConfiguration = entry.getFeatureConfiguration(TEMPLATE_FEATURE);
-		if (featureConfiguration != null) {
-			FeatureParameterValue parameterValue = featureConfiguration.getParameterValue(CONFIGURATION_MODULE);
-			if (parameterValue != null) {
-				overridingModuleClass = parameterValue.getStringValue();
-			} 
-		}
-		if (!Strings.isEmpty(overridingModuleClass)) {
-			try {
-				Class<?> moduleClass = getClassLoader(entry).loadClass(overridingModuleClass);
-				if (Module.class.isAssignableFrom(moduleClass)) {
-					Module module = (Module) moduleClass.newInstance();
-					defaultModule = Modules.override(defaultModule).with(module);
-				}
-			} catch (Exception e) {
-				e.printStackTrace();
-				log.log("Overriding module not found: " + overridingModuleClass);
-				log.logError(e);
-			}
-		}
-		return defaultModule;
-	}
-
-	protected ClassLoader getClassLoader(GeneratorEntry entry) {
-		IProject project = getLookupRoot(entry);
-		final ClassLoader classLoader = new WorkspaceClassLoaderFactory().createClassLoader(project,
-				getClass().getClassLoader());
-		return classLoader;
-	}
-
-	@Override
-	public void runGenerator(Statechart statechart, GeneratorEntry entry) {
-		String templateClass = getTemplateClassName(entry);
-		final ClassLoader classLoader = getClassLoader(entry);
-		try {
-			Class<?> delegateGeneratorClass = (Class<?>) classLoader.loadClass(templateClass);
-			Object delegate = injector.getInstance(delegateGeneratorClass);
-
-			Class<?> iType_ = (Class<?>) getClass().getClassLoader()
-					.loadClass("org.yakindu.sct.generator.core.impl.IExecutionFlowGenerator");
-			Class<?> iType__ = IExecutionFlowGenerator.class;
-			Class<?> iType = (Class<?>) classLoader
-					.loadClass("org.yakindu.sct.generator.core.impl.IExecutionFlowGenerator");
-
-			ExecutionFlow flow = createExecutionFlow(statechart, entry);
-
-			if (coreFeatureHelper.isDumpSexec(entry)) {
-				dumpSexec(entry, flow);
-			}
-
-
-			if (delegate instanceof IExecutionFlowGenerator) {
-				IExecutionFlowGenerator flowGenerator = (IExecutionFlowGenerator) delegate;
-				flowGenerator.generate(flow, entry, sctFsa);
-			}
-			if (iType.isInstance(delegate)) {
-				IExecutionFlowGenerator flowGenerator = (IExecutionFlowGenerator) delegate;
-				flowGenerator.generate(flow, entry, sctFsa);
-			}
-			if (delegate instanceof ISGraphGenerator) {
-				ISGraphGenerator graphGenerator = (ISGraphGenerator) delegate;
-				graphGenerator.generate(statechart, entry, sctFsa);
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-			log.logError(e);
-		}
-	}
-
-	protected String getTemplateClassName(GeneratorEntry entry) {
-		return entry.getFeatureConfiguration(TEMPLATE_FEATURE).getParameterValue(GENERATOR_CLASS).getStringValue();
-	}
-
-	/**
-	 * resolve the project that defines the lookup path for the XpandFacade
-	 * 
-	 */
-	protected IProject getLookupRoot(GeneratorEntry entry) {
-		IProject project = null;
-		FeatureConfiguration templateConfig = entry.getFeatureConfiguration(TEMPLATE_FEATURE);
-		FeatureParameterValue projectName = templateConfig.getParameterValue(GENERATOR_PROJECT);
-		if (projectName != null) {
-			project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName.getStringValue());
-		} else {
-			URI uri = entry.getElementRef().eResource().getURI();
-			project = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(uri.toPlatformString(true)))
-					.getProject();
-		}
-		return project;
-	}
-}

+ 10 - 8
plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/RunnerActivator.java

@@ -1,3 +1,13 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
 package org.yakindu.sct.generator.runner;
 
 import org.osgi.framework.BundleActivator;
@@ -11,18 +21,10 @@ public class RunnerActivator implements BundleActivator {
 		return context;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
-	 */
 	public void start(BundleContext bundleContext) throws Exception {
 		RunnerActivator.context = bundleContext;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
-	 */
 	public void stop(BundleContext bundleContext) throws Exception {
 		RunnerActivator.context = null;
 	}

+ 30 - 0
plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/RunnerModule.java

@@ -0,0 +1,30 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.generator.runner;
+
+import org.yakindu.sct.generator.core.GeneratorModule;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+
+import com.google.inject.Binder;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class RunnerModule implements GeneratorModule {
+
+	@Override
+	public void configure(GeneratorEntry entry, Binder binder) {
+		// bindings may be specified in the runtime workspace...
+	}
+
+}

+ 87 - 0
plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/WorkspaceGeneratorExecutor.java

@@ -0,0 +1,87 @@
+/**
+ * Copyright (c) 2016 committers of YAKINDU and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * Contributors:
+ * 	committers of YAKINDU - initial API and implementation
+ * 
+ */
+package org.yakindu.sct.generator.runner;
+
+import static org.yakindu.sct.generator.runner.lib.IGenericJavaFeatureConstants.GENERATOR_CLASS;
+import static org.yakindu.sct.generator.runner.lib.IGenericJavaFeatureConstants.GENERATOR_PROJECT;
+import static org.yakindu.sct.generator.runner.lib.IGenericJavaFeatureConstants.TEMPLATE_FEATURE;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.emf.common.util.URI;
+import org.yakindu.sct.commons.WorkspaceClassLoaderFactory;
+import org.yakindu.sct.generator.core.IExecutionFlowGenerator;
+import org.yakindu.sct.generator.core.ISCTGenerator;
+import org.yakindu.sct.generator.core.ISGraphGenerator;
+import org.yakindu.sct.generator.core.execution.AbstractGeneratorEntryExecutor;
+import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
+import org.yakindu.sct.model.sexec.transformation.IModelSequencer;
+import org.yakindu.sct.model.sgen.FeatureConfiguration;
+import org.yakindu.sct.model.sgen.FeatureParameterValue;
+import org.yakindu.sct.model.sgen.GeneratorEntry;
+import org.yakindu.sct.model.sgraph.Statechart;
+
+import com.google.inject.Inject;
+
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
+public class WorkspaceGeneratorExecutor extends AbstractGeneratorEntryExecutor {
+
+	@Inject(optional = true)
+	private IModelSequencer sequencer;
+
+	@Override
+	protected void execute(ISCTFileSystemAccess access, GeneratorEntry entry) {
+		ISCTGenerator codeGenerator = createInstance(entry, getTemplateClassName(entry));
+		if (codeGenerator instanceof ISGraphGenerator) {
+			((ISGraphGenerator) codeGenerator).generate((Statechart) entry.getElementRef(), entry, access);
+		} else if (codeGenerator instanceof IExecutionFlowGenerator) {
+			((IExecutionFlowGenerator) codeGenerator).generate(sequencer.transform((Statechart) entry.getElementRef()),
+					entry, access);
+		}
+	}
+
+	@SuppressWarnings("unchecked")
+	protected <T> T createInstance(GeneratorEntry entry, String className) {
+		try {
+			IProject project = getLookupRoot(entry);
+			final ClassLoader classLoader = new WorkspaceClassLoaderFactory().createClassLoader(project,
+					getClass().getClassLoader());
+			return (T) classLoader.loadClass(className).newInstance();
+		} catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	protected String getTemplateClassName(GeneratorEntry entry) {
+		return entry.getFeatureConfiguration(TEMPLATE_FEATURE).getParameterValue(GENERATOR_CLASS).getStringValue();
+	}
+
+	protected IProject getLookupRoot(GeneratorEntry entry) {
+		IProject project = null;
+		FeatureConfiguration templateConfig = entry.getFeatureConfiguration(TEMPLATE_FEATURE);
+		FeatureParameterValue projectName = templateConfig.getParameterValue(GENERATOR_PROJECT);
+		if (projectName != null) {
+			project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName.getStringValue());
+		} else {
+			URI uri = entry.getElementRef().eResource().getURI();
+			project = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(uri.toPlatformString(true)))
+					.getProject();
+		}
+		return project;
+	}
+
+}

+ 5 - 1
plugins/org.yakindu.sct.generator.runner/src/org/yakindu/sct/generator/runner/lib/IGenericJavaFeatureConstants.java

@@ -10,10 +10,14 @@
  */
 package org.yakindu.sct.generator.runner.lib;
 
+/**
+ * 
+ * @author andreas muelder - Initial contribution and API
+ * 
+ */
 public interface IGenericJavaFeatureConstants {
 	public static final String LIBRARY_NAME = "Java";
 	public static final String TEMPLATE_FEATURE = "Generator";
 	public static final String GENERATOR_PROJECT = "generatorProject";
 	public static final String GENERATOR_CLASS = "generatorClass";
-	public static final String CONFIGURATION_MODULE = "configurationModule";
 }

+ 0 - 7
plugins/org.yakindu.sct.generator.xpand/.classpath

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>

+ 0 - 2
plugins/org.yakindu.sct.generator.xpand/.gitignore

@@ -1,2 +0,0 @@
-/bin/
-/target/

+ 0 - 28
plugins/org.yakindu.sct.generator.xpand/.project

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.yakindu.sct.generator.xpand</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.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>

+ 0 - 7
plugins/org.yakindu.sct.generator.xpand/.settings/org.eclipse.jdt.core.prefs

@@ -1,7 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
-org.eclipse.jdt.core.compiler.compliance=1.7
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7

+ 0 - 15
plugins/org.yakindu.sct.generator.xpand/META-INF/MANIFEST.MF

@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: YAKINDU Xpand Generator
-Bundle-SymbolicName: org.yakindu.sct.generator.xpand;singleton:=true
-Bundle-Version: 2.7.1.qualifier
-Bundle-Vendor: statecharts.org
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Require-Bundle: org.yakindu.sct.generator.core,
- org.yakindu.sct.generator.genmodel,
- org.yakindu.sct.commons,
- org.eclipse.xtend.typesystem.emf,
- org.eclipse.xtend,
- org.yakindu.sct.model.stext,
- org.eclipse.xpand,
- org.eclipse.core.resources

+ 0 - 7
plugins/org.yakindu.sct.generator.xpand/build.properties

@@ -1,7 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
-               .,\
-               plugin.xml,\
-               icons/,\
-               library/

BIN
plugins/org.yakindu.sct.generator.xpand/icons/sct.png


+ 0 - 7
plugins/org.yakindu.sct.generator.xpand/library/XpandFeatureTypeLibrary.xmi

@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<sgen:FeatureTypeLibrary xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:sgen="http://www.yakindu.org/sct/statechart/SGen" xsi:schemaLocation="http://www.yakindu.org/sct/statechart/SGen ../../org.yakindu.sct.model.sgen/model/emf/sgen.ecore" name="Xpand">
-  <types name="Template">
-    <parameters name="templateProject"/>
-    <parameters name="templatePath"/>
-  </types>
-</sgen:FeatureTypeLibrary>

+ 0 - 37
plugins/org.yakindu.sct.generator.xpand/plugin.xml

@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
-         point="org.yakindu.sct.generator.core.featuretypes">
-      <FeatureLibrary
-            library_id="org.yakindu.generator.core.features.xpand"
-            defaultProvider="org.yakindu.sct.generator.xpand.features.XpandLibraryDefaultFeatureValueProvider"
-            uri="platform:/plugin/org.yakindu.sct.generator.xpand/library/XpandFeatureTypeLibrary.xmi">
-      </FeatureLibrary>
- </extension>
- <extension
-       point="org.yakindu.sct.generator.core.generator">
-    <SCTGenerator
-          class="org.yakindu.sct.generator.xpand.GenericXpandCodeGenerator"
-          contentType="statechart"
-          description="Generate Code using Xpand Templates"
-          elementRefType="org.yakindu.sct.model.sgraph.Statechart"
-          icon="icons/sct.png"
-          id="yakindu::xpand"
-          name="Custom Xpand-based Generator">
-       <FeatureLibrary
-             library_id="org.yakindu.generator.core.features">
-       </FeatureLibrary>
-       <FeatureLibrary
-             library_id="org.yakindu.generator.core.features.xpand">
-       </FeatureLibrary>
-    </SCTGenerator>
- </extension>
-    <extension
-         point="org.yakindu.sct.generator.core.extensions">
-      <ExtensionGeneratorMapping
-            fileExtension="sct"
-            generatorId="yakindu::xpand">
-      </ExtensionGeneratorMapping>
-   </extension>
-</plugin>

+ 0 - 15
plugins/org.yakindu.sct.generator.xpand/pom.xml

@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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>
-	<parent>
-		<groupId>org.yakindu.sct</groupId>
-		<artifactId>org.yakindu.sct.releng</artifactId>
-		<version>2.7.1-SNAPSHOT</version>
-		<relativePath>../../releng/org.yakindu.sct.releng/pom.xml</relativePath>
-	</parent>
-	<artifactId>org.yakindu.sct.generator.xpand</artifactId>
-	<groupId>org.yakindu.sct.plugins</groupId>
-	<packaging>eclipse-plugin</packaging>
-</project>

+ 0 - 164
plugins/org.yakindu.sct.generator.xpand/src/org/yakindu/sct/generator/xpand/AbstractXpandBasedCodeGenerator.java

@@ -1,164 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.generator.xpand;
-
-import java.util.Collections;
-import java.util.Set;
-
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.eclipse.xpand2.XpandExecutionContext;
-import org.eclipse.xpand2.XpandExecutionContextImpl;
-import org.eclipse.xpand2.XpandFacade;
-import org.eclipse.xpand2.output.Outlet;
-import org.eclipse.xpand2.output.Output;
-import org.eclipse.xpand2.output.OutputImpl;
-import org.eclipse.xpand2.output.PostProcessor;
-import org.eclipse.xtend.expression.Variable;
-import org.eclipse.xtend.typesystem.Type;
-import org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel;
-import org.yakindu.base.base.BasePackage;
-import org.yakindu.base.types.TypesPackage;
-import org.yakindu.sct.generator.core.impl.AbstractSExecModelGenerator;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.SexecPackage;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-import org.yakindu.sct.model.sgen.SGenPackage;
-import org.yakindu.sct.model.sgraph.SGraphPackage;
-import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.stext.stext.StextPackage;
-
-import com.google.inject.Binder;
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-import com.google.inject.util.Modules;
-
-/**
- * abstract base class for all code generators using Xpand as the template
- * language.
- * 
- * @author andreas muelder - Initial contribution and API
- * 
- */
-public abstract class AbstractXpandBasedCodeGenerator extends AbstractSExecModelGenerator {
-
-	public static final String CONTEXT_INJECTOR_PROPERTY_NAME = "AbstractXpandBasedCodeGenerator.Injector";
-
-	public static final String LIBRARY_TARGET_FOLDER_OUTLET = "LIBRARY_TARGET_FOLDER";
-
-	public abstract String getTemplatePath();
-
-	@Inject
-	private Injector injector;
-
-	/**
-	 * Invokes XPands template engine to generate resources
-	 */
-	public final void runGenerator(Statechart statechart, GeneratorEntry entry) {
-		Output output = createOutput(entry);
-
-		String templatePath = getTemplatePath();
-
-		log.log("Executing Template " + templatePath);
-		XpandExecutionContext context = createXpandContext(entry, output);
-		XpandFacade facade = XpandFacade.create(context);
-
-		// Check, if method exists
-		boolean generatorFound = false;
-		Type targetType = context.getTypeForName("sexec::ExecutionFlow");
-		final Type[] paramTypes = new Type[1];
-		paramTypes[0] = context.getType(entry);
-		if (context.findDefinition(templatePath, targetType, paramTypes) != null) {
-			generatorFound = true;
-			ExecutionFlow flow = createExecutionFlow(statechart, entry);
-			if (coreFeatureHelper.isDumpSexec(entry)) {
-				dumpSexec(entry, flow);
-			}
-			facade.evaluate(templatePath, flow, entry);
-		}
-
-		targetType = context.getTypeForName("sgraph::Statechart");
-		if (context.findDefinition(templatePath, targetType, paramTypes) != null) {
-			generatorFound = true;
-			facade.evaluate(templatePath, statechart, entry);
-		}
-		if (!generatorFound) {
-			log.log("!!! No matching define in Template found.");
-		}
-
-	}
-
-	protected XpandExecutionContext createXpandContext(GeneratorEntry entry, Output output) {
-		XpandExecutionContextImpl execCtx = new XpandExecutionContextImpl(output, null, null, null, null);
-		EmfRegistryMetaModel metamodel = new EmfRegistryMetaModel() {
-			@Override
-			protected EPackage[] allPackages() {
-				return new EPackage[]{SGraphPackage.eINSTANCE, StextPackage.eINSTANCE, EcorePackage.eINSTANCE,
-						SexecPackage.eINSTANCE, SGenPackage.eINSTANCE, TypesPackage.eINSTANCE, BasePackage.eINSTANCE};
-			}
-		};
-		execCtx.registerMetaModel(metamodel);
-		execCtx.getGlobalVariables().put(CONTEXT_INJECTOR_PROPERTY_NAME,
-				new Variable(CONTEXT_INJECTOR_PROPERTY_NAME, injector));
-		return execCtx;
-	}
-
-	protected Output createOutput(GeneratorEntry entry) {
-		String outputPath = coreFeatureHelper.getRelativeTargetFolder(entry);
-
-		String absoluteTargetFolder = sctFsa.getURI(outputPath).toFileString();
-
-		Output output = new OutputImpl();
-
-		Outlet targetFolderOutlet = new Outlet(absoluteTargetFolder);
-		for (PostProcessor postProcessor : getPostProcessors()) {
-			targetFolderOutlet.addPostprocessor(postProcessor);
-		}
-		targetFolderOutlet.setOverwrite(true);
-		output.addOutlet(targetFolderOutlet);
-
-		String relativeLibraryTargetFolder = coreFeatureHelper.getRelativeLibraryFolder(entry);
-
-		String absoluteLibraryTargetFolder = sctFsa.getURI(relativeLibraryTargetFolder).toFileString();
-
-		Outlet libraryTargetFolderOutlet = new Outlet(false, null, LIBRARY_TARGET_FOLDER_OUTLET, false,
-				absoluteLibraryTargetFolder);
-		output.addOutlet(libraryTargetFolderOutlet);
-
-		return output;
-	}
-
-	@Override
-	public Module getOverridesModule(GeneratorEntry entry) {
-		Module baseModule = super.getOverridesModule(entry);
-
-		return Modules.override(baseModule).with(new Module() {
-
-			@Override
-			public void configure(Binder binder) {
-
-			}
-
-		});
-	}
-
-	/**
-	 * Override this Method to add some {@link PostProcessor}s to the XPand
-	 * outlet.
-	 * 
-	 * @return An empty {@link Set} for {@link PostProcessor}s
-	 */
-	protected Set<PostProcessor> getPostProcessors() {
-		return Collections.emptySet();
-	}
-
-}

+ 0 - 86
plugins/org.yakindu.sct.generator.xpand/src/org/yakindu/sct/generator/xpand/GenericXpandCodeGenerator.java

@@ -1,86 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.generator.xpand;
-
-import static org.yakindu.sct.generator.xpand.features.IXpandFeatureConstants.TEMPLATE_FEATURE;
-import static org.yakindu.sct.generator.xpand.features.IXpandFeatureConstants.TEMPLATE_FEATURE_TEMPLATE_PATH;
-import static org.yakindu.sct.generator.xpand.features.IXpandFeatureConstants.TEMPLATE_FEATURE_TEMPLATE_PROJECT;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.mwe.core.resources.ResourceLoader;
-import org.eclipse.emf.mwe.core.resources.ResourceLoaderFactory;
-import org.eclipse.emf.mwe.core.resources.ResourceLoaderImpl;
-import org.yakindu.sct.commons.WorkspaceClassLoaderFactory;
-import org.yakindu.sct.model.sgen.FeatureConfiguration;
-import org.yakindu.sct.model.sgen.FeatureParameterValue;
-import org.yakindu.sct.model.sgen.GeneratorEntry;
-
-/**
- * @author holger willebrandt - Initial contribution and API
- */
-public class GenericXpandCodeGenerator extends AbstractXpandBasedCodeGenerator {
-
-	private String templatePath;
-
-	@Override
-	protected void prepareGenerator(GeneratorEntry entry) {
-		templatePath = entry.getFeatureConfiguration(TEMPLATE_FEATURE)
-				.getParameterValue(TEMPLATE_FEATURE_TEMPLATE_PATH)
-				.getStringValue();
-		ResourceLoaderFactory
-				.setCurrentThreadResourceLoader(createResourceLoader(entry));
-	}
-
-	@Override
-	protected void finishGenerator(GeneratorEntry entry) {
-		ResourceLoaderFactory.setCurrentThreadResourceLoader(null);
-	} 
-
-	/**
-	 * create a {@link ResourceLoader} for the XPandFacade
-	 */
-	protected ResourceLoader createResourceLoader(final GeneratorEntry entry) {
-		IProject project = getLookupRoot(entry);
-		final ClassLoader classLoader = new WorkspaceClassLoaderFactory()
-				.createClassLoader(project, getClass().getClassLoader());
-		return new ResourceLoaderImpl(classLoader);
-	}
-
-	/**
-	 * resolve the project that defines the lookup path for the XpandFacade
-	 * 
-	 */
-	protected IProject getLookupRoot(GeneratorEntry entry) {
-		IProject project = null;
-		FeatureConfiguration templateConfig = entry
-				.getFeatureConfiguration(TEMPLATE_FEATURE);
-		FeatureParameterValue projectName = templateConfig
-				.getParameterValue(TEMPLATE_FEATURE_TEMPLATE_PROJECT);
-		if (projectName != null) {
-			project = ResourcesPlugin.getWorkspace().getRoot()
-					.getProject(projectName.getStringValue());
-		} else {
-			URI uri = entry.getElementRef().eResource().getURI();
-			project = ResourcesPlugin.getWorkspace().getRoot()
-					.getFile(new Path(uri.toPlatformString(true))).getProject();
-		}
-		return project;
-	}
-
-	@Override
-	public String getTemplatePath() {
-		return templatePath;
-	}
-
-}

+ 0 - 24
plugins/org.yakindu.sct.generator.xpand/src/org/yakindu/sct/generator/xpand/features/IXpandFeatureConstants.java

@@ -1,24 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     committers of YAKINDU - initial API and implementation
- */
-package org.yakindu.sct.generator.xpand.features;
-
-/**
- * 
- * @author holger willebrandt - Initial contribution and API
- */
-public interface IXpandFeatureConstants {
-
-	public static final String LIBRARY_NAME = "Xpand";
-	public static final String TEMPLATE_FEATURE = "Template";
-	public static final String TEMPLATE_FEATURE_TEMPLATE_PATH = "templatePath";
-	public static final String TEMPLATE_FEATURE_TEMPLATE_PROJECT = "templateProject";
-
-}

+ 0 - 63
plugins/org.yakindu.sct.generator.xpand/src/org/yakindu/sct/generator/xpand/features/XpandLibraryDefaultFeatureValueProvider.java

@@ -1,63 +0,0 @@
-/**
- * Copyright (c) 2011 committers of YAKINDU and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * Contributors:
- * 	committers of YAKINDU - initial API and implementation
- * 
- */
-package org.yakindu.sct.generator.xpand.features;
-
-import static org.yakindu.sct.generator.xpand.features.IXpandFeatureConstants.LIBRARY_NAME;
-import static org.yakindu.sct.generator.xpand.features.IXpandFeatureConstants.TEMPLATE_FEATURE_TEMPLATE_PATH;
-import static org.yakindu.sct.generator.xpand.features.IXpandFeatureConstants.TEMPLATE_FEATURE_TEMPLATE_PROJECT;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.ecore.EObject;
-import org.yakindu.sct.generator.core.library.AbstractDefaultFeatureValueProvider;
-import org.yakindu.sct.model.sgen.FeatureParameterValue;
-import org.yakindu.sct.model.sgen.FeatureType;
-import org.yakindu.sct.model.sgen.FeatureTypeLibrary;
-
-/**
- * 
- * @author holger willebrandt - Initial contribution and API
- */
-public class XpandLibraryDefaultFeatureValueProvider extends AbstractDefaultFeatureValueProvider {
-
-	// (ID::)+ID
-	private static final String XPAND_TEMPLATE_PATH_REGEX = "([a-zA-Z_][a-zA-Z0-9_]*::)+[a-zA-Z_][a-zA-Z0-9_]*"; //$NON-NLS-1$
-
-	public boolean isProviderFor(final FeatureTypeLibrary library) {
-		return LIBRARY_NAME.equals(library.getName());
-	}
-
-	@Override
-	protected void setDefaultValue(FeatureType featureType, FeatureParameterValue parameterValue,
-			final EObject contextElement) {
-		String parameterName = parameterValue.getParameter().getName();
-		if (TEMPLATE_FEATURE_TEMPLATE_PATH.equals(parameterName)) {
-			parameterValue.setValue("org::yakindu::sct::generator::xpand::Main::main");
-		}
-		if (TEMPLATE_FEATURE_TEMPLATE_PROJECT.equals(parameterName)) {
-			parameterValue.setValue(getProjectName(contextElement));
-		}
-	}
-
-	public IStatus validateParameterValue(FeatureParameterValue parameterValue) {
-		String parameterName = parameterValue.getParameter().getName();
-		String value = parameterValue.getStringValue();
-		if (TEMPLATE_FEATURE_TEMPLATE_PATH.equals(parameterName)
-				&& !parameterValue.getStringValue().matches(XPAND_TEMPLATE_PATH_REGEX)) {
-			return error("Xpand Template Path Syntax Error");
-		}
-		if (TEMPLATE_FEATURE_TEMPLATE_PROJECT.equals(parameterName) && !access.projectExists(value)) {
-			return error(String.format("The Project %s does not exist", value));
-		}
-		return Status.OK_STATUS;
-	}
-
-}

+ 0 - 9
plugins/org.yakindu.sct.model.resource/plugin.xml

@@ -2,15 +2,6 @@
 <?eclipse version="3.4"?>
 <plugin>
 
-<!-- Resource  -->
- <extension
-         point="org.eclipse.emf.ecore.extension_parser">
-      <parser
-            class="org.yakindu.sct.model.resource.SCTResourceFactory"
-            type="sct">
-      </parser>
-   </extension>
-
    <!-- Resource Provider      -->
  <extension point="org.eclipse.xtext.extension_resourceServiceProvider">
         <resourceServiceProvider

+ 8 - 1
plugins/org.yakindu.sct.model.stext/plugin.xml

@@ -9,5 +9,12 @@
        genModel = "model/SText.genmodel" /> 
 	
   </extension>
-   
+   <!-- Resource  -->
+ <extension
+         point="org.eclipse.emf.ecore.extension_parser">
+      <parser
+            class="org.yakindu.sct.model.stext.resource.StextResourceFactory"
+            type="sct">
+      </parser>
+   </extension>
 </plugin>

+ 2 - 2
plugins/org.yakindu.sct.model.resource/src/org/yakindu/sct/model/resource/SCTResourceFactory.java

@@ -8,7 +8,7 @@
  * 	committers of YAKINDU - initial API and implementation
  * 
  */
-package org.yakindu.sct.model.resource;
+package org.yakindu.sct.model.stext.resource;
 
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.resource.Resource;
@@ -25,7 +25,7 @@ import com.google.inject.Injector;
 /**
  * @author andreas muelder - Initial contribution and API
  */
-public class SCTResourceFactory extends XMIResourceFactoryImpl {
+public class StextResourceFactory extends XMIResourceFactoryImpl {
 
 	@Override
 	public Resource createResource(URI uri) {

+ 0 - 1
releng/org.yakindu.sct.releng/pom.xml

@@ -398,7 +398,6 @@
 		<module>../../plugins/org.yakindu.sct.generator.core</module>
 		<module>../../plugins/org.yakindu.sct.generator.builder</module>
 		<module>../../plugins/org.yakindu.sct.generator.runner</module>
-		<module>../../plugins/org.yakindu.sct.generator.xpand</module>
 		<module>../../plugins/org.yakindu.sct.generator.genmodel</module>
 		<module>../../plugins/org.yakindu.sct.generator.genmodel.ui</module>
 		<module>../../plugins/org.yakindu.sct.model.sexec</module>

+ 29 - 51
test-plugins/org.yakindu.sct.generator.c.test/src/org/yakindu/sct/generator/c/gtest/GTestHelper.java

@@ -35,17 +35,13 @@ import org.eclipse.core.runtime.Platform;
 import org.eclipse.emf.common.util.URI;
 import org.eclipse.emf.ecore.resource.Resource;
 import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.xtext.ui.shared.SharedStateModule;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.FrameworkUtil;
-import org.yakindu.sct.generator.builder.EclipseContextModule;
-import org.yakindu.sct.generator.core.execution.GeneratorExecutor;
+import org.yakindu.sct.generator.builder.EclipseContextGeneratorExecutorLookup;
 import org.yakindu.sct.model.sgen.GeneratorModel;
 import org.yakindu.sct.model.sgraph.Statechart;
 import org.yakindu.sct.test.models.SCTUnitTestModels;
 
-import com.google.inject.util.Modules;
-
 /**
  * @author Andreas Unger - Initial contribution and API
  * @author Markus Mühlbrandt
@@ -55,21 +51,17 @@ public class GTestHelper {
 
 	private final Object owner;
 
-	/**
-	 * 
-	 */
 	public GTestHelper(Object owner) {
 		this.owner = owner;
 	}
 
 	public void compile() {
-			copyFilesFromBundleToFolder();
-			IResource resource = ResourcesPlugin.getWorkspace().getRoot()
-					.findMember(getTargetPath());
-			File directory = resource.getLocation().toFile();
-			List<String> command = createCommand();
+		copyFilesFromBundleToFolder();
+		IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(getTargetPath());
+		File directory = resource.getLocation().toFile();
+		List<String> command = createCommand();
 
-			getCommandExecutor().execute(command, directory);
+		getCommandExecutor().execute(command, directory);
 	}
 
 	public void generate() {
@@ -78,25 +70,24 @@ public class GTestHelper {
 
 		// copy model to JUnit workspace
 		copyFileFromBundleToFolder(getModelBundle(), getModelPath(), targetPath);
-		
+
 		String sgenFileName = getTestProgram() + ".sgen";
 		copyFileFromBundleToFolder(getTestBundle(), sgenFileName, targetPath);
-		
+
 		IPath path = new Path(sgenFileName);
 		Resource sgenResource = loadResource(getWorkspaceFileFor(path));
-		GeneratorModel model = (GeneratorModel) sgenResource.getContents().get(
-				0);
+		GeneratorModel model = (GeneratorModel) sgenResource.getContents().get(0);
 		model.getEntries().get(0).setElementRef(getStatechart());
 
 		performFullBuild();
-		
-		new GeneratorExecutor().executeGenerator(model,Modules.combine(new SharedStateModule(), new EclipseContextModule()));
+
+		new EclipseContextGeneratorExecutorLookup().execute(model);
 	}
-	
+
 	protected GCCCommandExecutor getCommandExecutor() {
 		return new GCCCommandExecutor();
 	}
-	
+
 	protected void performFullBuild() {
 		try {
 			ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, null);
@@ -104,14 +95,13 @@ public class GTestHelper {
 			throw new RuntimeException(e);
 		}
 	}
-	
+
 	protected IFile getWorkspaceFileFor(IPath filePath) {
 		return ResourcesPlugin.getWorkspace().getRoot().getFile(getTargetProjectPath().append(filePath));
 	}
 
 	protected Statechart getStatechart() {
-		IPath path = new Path(getTargetPath().toString() + "/"
-				+ getModelPath().lastSegment());
+		IPath path = new Path(getTargetPath().toString() + "/" + getModelPath().lastSegment());
 		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
 		Resource resource = loadResource(file);
 		return (Statechart) resource.getContents().get(0);
@@ -225,44 +215,37 @@ public class GTestHelper {
 	protected String getModelAnnotation() {
 		return owner.getClass().getAnnotation(GTest.class).model();
 	}
-	
+
 	protected String getTestBundleAnnotation() {
 		return owner.getClass().getAnnotation(GTest.class).testBundle();
 	}
-	
+
 	protected IPath getTargetProjectPath() {
 		return new Path(getTestBundleAnnotation());
 	}
 
-	protected void copyFileFromBundleToFolder(Bundle bundle, String sourcePath,
-			String targetPath) {
-		copyFileFromBundleToFolder(bundle, new Path(sourcePath), new Path(
-				targetPath));
+	protected void copyFileFromBundleToFolder(Bundle bundle, String sourcePath, String targetPath) {
+		copyFileFromBundleToFolder(bundle, new Path(sourcePath), new Path(targetPath));
 	}
 
-	protected void copyFileFromBundleToFolder(Bundle bundle, String sourcePath,
-			IPath targetPath) {
+	protected void copyFileFromBundleToFolder(Bundle bundle, String sourcePath, IPath targetPath) {
 		copyFileFromBundleToFolder(bundle, new Path(sourcePath), targetPath);
 	}
 
-	protected void copyFileFromBundleToFolder(Bundle bundle, IPath sourcePath,
-			IPath targetPath) {
+	protected void copyFileFromBundleToFolder(Bundle bundle, IPath sourcePath, IPath targetPath) {
 		String fileName = sourcePath.lastSegment();
 		copyFileFromBundle(bundle, sourcePath, targetPath.append(fileName));
 	}
 
-	protected void copyFileFromBundle(Bundle bundle, String sourcePath,
-			String targetPath) {
+	protected void copyFileFromBundle(Bundle bundle, String sourcePath, String targetPath) {
 		copyFileFromBundle(bundle, sourcePath, new Path(targetPath));
 	}
 
-	protected void copyFileFromBundle(Bundle bundle, String sourcePath,
-			IPath targetPath) {
+	protected void copyFileFromBundle(Bundle bundle, String sourcePath, IPath targetPath) {
 		copyFileFromBundle(bundle, new Path(sourcePath), targetPath);
 	}
 
-	protected void copyFileFromBundle(Bundle bundle, IPath sourcePath,
-			IPath targetPath) {
+	protected void copyFileFromBundle(Bundle bundle, IPath sourcePath, IPath targetPath) {
 		try {
 			InputStream is = FileLocator.openStream(bundle, sourcePath, false);
 			createFile(targetPath, is);
@@ -296,8 +279,7 @@ public class GTestHelper {
 
 	protected void copyFileFromBundle(IPath sourcePath, IFile targetFile) {
 		try {
-			InputStream is = FileLocator.openStream(getTestBundle(),
-					sourcePath, false);
+			InputStream is = FileLocator.openStream(getTestBundle(), sourcePath, false);
 			createFile(targetFile, is);
 		} catch (IOException e) {
 			throw new RuntimeException(e);
@@ -327,13 +309,11 @@ public class GTestHelper {
 	}
 
 	protected IFolder getFolder(String path) {
-		return ensureContainerExists(ResourcesPlugin.getWorkspace().getRoot()
-				.getFolder(new Path(path)));
+		return ensureContainerExists(ResourcesPlugin.getWorkspace().getRoot().getFolder(new Path(path)));
 	}
 
 	protected IFolder getFolder(IPath path) {
-		return ensureContainerExists(ResourcesPlugin.getWorkspace().getRoot()
-				.getFolder(path));
+		return ensureContainerExists(ResourcesPlugin.getWorkspace().getRoot().getFolder(path));
 	}
 
 	protected <T extends IContainer> T ensureContainerExists(T container) {
@@ -341,8 +321,7 @@ public class GTestHelper {
 		IProject project = container.getProject();
 		if (project.exists()) {
 			if (!project.isOpen()) {
-				throw new RuntimeException("Project " + project.getName()
-						+ " closed");
+				throw new RuntimeException("Project " + project.getName() + " closed");
 			}
 		} else {
 			try {
@@ -364,8 +343,7 @@ public class GTestHelper {
 
 	private void doEnsureFolderExists(IFolder folder, IProgressMonitor monitor) {
 		if (!folder.exists()) {
-			if (!folder.getParent().exists()
-					&& folder.getParent() instanceof IFolder) {
+			if (!folder.getParent().exists() && folder.getParent() instanceof IFolder) {
 				doEnsureFolderExists((IFolder) folder.getParent(), monitor);
 			}
 			try {

+ 1 - 1
test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/AllTestsTest.java

@@ -27,7 +27,7 @@ import org.junit.runners.Suite.SuiteClasses;
 		RaiseEventTest.class, ReadOnlyVariableTest.class, SameNameDifferentRegionTest.class, ShallowHistoryTest.class,
 		ShallowHistoryWithDeepEntryTest.class, SimpleEventTest.class, SimpleHierachyTest.class,
 		StatechartActiveTest.class, StatechartLocalReactionsTest.class, StateIsActiveTest.class, StaticChoiceTest.class,
-		STextKeywordsInStatesAndRegionsTest.class, StringExpressionsTest.class, SyncForkTest.class, SyncJoinTest.class,
+		STextKeywordsInStatesAndRegionsTest.class, SyncForkTest.class, SyncJoinTest.class,
 		TransitionWithoutConditionTest.class, TriggerGuardExpressionsTest.class, TriggerExpressionPrecedenceTest.class,
 		ValuedEventsTest.class})
 public class AllTestsTest {

+ 1 - 1
test-plugins/org.yakindu.sct.generator.cpp.test/test-gen/org/yakindu/sct/generator/cpp/test/StringExpressionsTest.java

@@ -15,8 +15,8 @@ import java.util.Collection;
 import org.junit.Before;
 import org.junit.runner.RunWith;
 import org.yakindu.sct.generator.c.gtest.GTest;
-import org.yakindu.sct.generator.c.gtest.GTestRunner;
 import org.yakindu.sct.generator.c.gtest.GTestHelper;
+import org.yakindu.sct.generator.c.gtest.GTestRunner;
 
 @GTest(sourceFile = "gtests/StringExpressionsTest/StringExpressionsTest.cc", program = "gtests/StringExpressionsTest/StringExpressions", model = "testmodels/SCTUnit/StringExpressions.sct")
 @RunWith(GTestRunner.class)

+ 0 - 9
test-plugins/org.yakindu.sct.generator.csharp.test/.classpath

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="src" path="src-gen"/>
-	<classpathentry kind="src" path="test-gen"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>

+ 0 - 2
test-plugins/org.yakindu.sct.generator.csharp.test/.gitignore

@@ -1,2 +0,0 @@
-/bin/
-/target/

+ 0 - 51
test-plugins/org.yakindu.sct.generator.csharp.test/.project

@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.yakindu.sct.generator.csharp.test</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.yakindu.sct.builder.SCTBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.yakindu.sct.builder.SCTNature</nature>
-	</natures>
-	<filteredResources>
-		<filter>
-			<id>1375978357015</id>
-			<name></name>
-			<type>10</type>
-			<matcher>
-				<id>org.eclipse.ui.ide.multiFilter</id>
-				<arguments>1.0-name-matches-false-false-target</arguments>
-			</matcher>
-		</filter>
-	</filteredResources>
-</projectDescription>

+ 0 - 2
test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.core.resources.prefs

@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-encoding/<project>=UTF-8

+ 0 - 2
test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.core.runtime.prefs

@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-line.separator=\n

+ 0 - 11
test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.jdt.core.prefs

@@ -1,11 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.6
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6

+ 0 - 8
test-plugins/org.yakindu.sct.generator.csharp.test/.settings/org.eclipse.xtend.core.Xtend.prefs

@@ -1,8 +0,0 @@
-autobuilding=true
-eclipse.preferences.version=1
-is_project_specific=true
-outlet.DEFAULT_OUTPUT.cleanDirectory=false
-outlet.DEFAULT_OUTPUT.cleanupDerived=true
-outlet.DEFAULT_OUTPUT.createDirectory=true
-outlet.DEFAULT_OUTPUT.derived=false
-outlet.DEFAULT_OUTPUT.override=true

+ 0 - 17
test-plugins/org.yakindu.sct.generator.csharp.test/META-INF/MANIFEST.MF

@@ -1,17 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Yakindu Statechart Tools (SCT) C# Generator Tests
-Bundle-SymbolicName: org.yakindu.sct.generator.csharp.test
-Bundle-Version: 2.5.0.qualifier
-Require-Bundle: org.yakindu.sct.test.models,
- org.junit,
- org.yakindu.sct.generator.csharp,
- org.yakindu.sct.generator.core,
- com.google.inject,
- org.eclipse.xtext.junit4,
- org.yakindu.sct.generator.genmodel,
- org.eclipse.jdt.core,
- org.eclipse.ui,
- org.eclipse.core.resources
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Bundle-Vendor: statecharts.org

+ 0 - 19
test-plugins/org.yakindu.sct.generator.csharp.test/all C# generator tests.launch

@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.yakindu.sct.generator.csharp.test/test-gen/org/yakindu/sct/generator/csharp/test/AllTestsTest.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
-<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
-<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.yakindu.sct.generator.csharp.test.AllTestsTest"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.yakindu.sct.generator.csharp.test"/>
-</launchConfiguration>

+ 0 - 0
test-plugins/org.yakindu.sct.generator.csharp.test/build.properties


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff