Browse Source

Added type checker for SGen

Andreas Mülder 13 years ago
parent
commit
5fadc7f9e5
18 changed files with 65273 additions and 2692 deletions
  1. 1 1
      plugins/org.yakindu.sct.generator.genmodel.ui/.settings/org.eclipse.core.resources.prefs
  2. 10536 0
      plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/contentassist/antlr/internal/InternalSGen.g
  3. 103 0
      plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/contentassist/antlr/internal/InternalSGen.tokens
  4. 2357 0
      plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/contentassist/antlr/internal/InternalSGenLexer.java
  5. 31735 0
      plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/contentassist/antlr/internal/InternalSGenParser.java
  6. 82 0
      plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/internal/SGenActivator.java
  7. 0 455
      plugins/org.yakindu.sct.generator.genmodel.ui/xtend-gen/org/yakindu/sct/generator/genmodel/ui/wizard/ProjectTemplate.java
  8. 3509 0
      plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/parser/antlr/internal/InternalSGen.g
  9. 103 0
      plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/parser/antlr/internal/InternalSGen.tokens
  10. 2357 0
      plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/parser/antlr/internal/InternalSGenLexer.java
  11. 12095 0
      plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/parser/antlr/internal/InternalSGenParser.java
  12. 1193 0
      plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/serializer/AbstractSGenSemanticSequencer.java
  13. 129 0
      plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/serializer/AbstractSGenSyntacticSequencer.java
  14. 1050 0
      plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/services/SGenGrammarAccess.java
  15. 23 0
      plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/validation/AbstractSGenJavaValidator.java
  16. 0 291
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/FactoryExtension.java
  17. 0 1672
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java
  18. 0 273
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.java

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

@@ -1,4 +1,4 @@
-#Thu Nov 24 14:19:53 CET 2011
+#Thu Nov 24 14:41:09 CET 2011
 eclipse.preferences.version=1
 encoding//src/org/yakindu/sct/generator/genmodel/ui/wizard/DefaultTemplate.xpt=ISO-8859-1
 encoding//src/org/yakindu/sct/generator/genmodel/ui/wizard/ProjectTemplate.xtend=UTF-8

File diff suppressed because it is too large
+ 10536 - 0
plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/contentassist/antlr/internal/InternalSGen.g


+ 103 - 0
plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/contentassist/antlr/internal/InternalSGen.tokens

@@ -0,0 +1,103 @@
+RULE_ID=4
+T__29=29
+T__28=28
+T__27=27
+T__26=26
+T__25=25
+T__24=24
+T__23=23
+T__22=22
+RULE_ANY_OTHER=10
+T__21=21
+T__20=20
+T__55=55
+T__56=56
+T__19=19
+T__57=57
+T__58=58
+T__51=51
+T__16=16
+T__52=52
+T__15=15
+T__53=53
+T__18=18
+T__54=54
+T__17=17
+T__12=12
+T__11=11
+T__14=14
+T__13=13
+RULE_INT=5
+T__50=50
+T__42=42
+T__43=43
+T__40=40
+T__41=41
+T__46=46
+T__47=47
+T__44=44
+T__45=45
+T__48=48
+T__49=49
+RULE_SL_COMMENT=8
+RULE_ML_COMMENT=7
+T__30=30
+T__31=31
+RULE_STRING=6
+T__32=32
+T__33=33
+T__34=34
+T__35=35
+T__36=36
+T__37=37
+T__38=38
+T__39=39
+RULE_WS=9
+'..'=24
+'instanceof'=41
+'!'=31
+'|'=45
+'>='=19
+'=='=17
+'/'=29
+'val'=32
+'null'=49
+'>'=21
+'||'=13
+'*.'=56
+'&&'=14
+'='=11
+'for'=36
+'GeneratorModel'=35
+'?.'=55
+'::'=15
+'+'=25
+'=>'=51
+')'=44
+'.'=16
+'->'=23
+'%'=30
+'super'=33
+'case'=48
+'true'=58
+'}'=38
+'catch'=50
+'extends'=53
+'+='=12
+'{'=37
+'as'=42
+'?'=52
+'var'=57
+'feature'=40
+'<='=20
+'!='=18
+'false'=34
+'<'=22
+':'=47
+'('=46
+'-'=26
+'*'=27
+'**'=28
+'statechart'=39
+','=43
+'&'=54

File diff suppressed because it is too large
+ 2357 - 0
plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/contentassist/antlr/internal/InternalSGenLexer.java


File diff suppressed because it is too large
+ 31735 - 0
plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/contentassist/antlr/internal/InternalSGenParser.java


+ 82 - 0
plugins/org.yakindu.sct.generator.genmodel.ui/src-gen/org/yakindu/sct/generator/genmodel/ui/internal/SGenActivator.java

@@ -0,0 +1,82 @@
+/*
+ * generated by Xtext
+ */
+package org.yakindu.sct.generator.genmodel.ui.internal;
+
+import static com.google.inject.util.Modules.override;
+import static com.google.inject.Guice.createInjector;
+
+import org.apache.log4j.Logger;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+import com.google.inject.Injector;
+import com.google.inject.Module;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * This class was generated. Customizations should only happen in a newly
+ * introduced subclass. 
+ */
+public class SGenActivator extends AbstractUIPlugin {
+
+	private Map<String,Injector> injectors = new HashMap<String,Injector>();
+	private static SGenActivator INSTANCE;
+
+	public Injector getInjector(String languageName) {
+		return injectors.get(languageName);
+	}
+	
+	@Override
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		INSTANCE = this;
+		try {
+			registerInjectorFor("org.yakindu.sct.generator.genmodel.SGen");
+			
+		} catch (Exception e) {
+			Logger.getLogger(getClass()).error(e.getMessage(), e);
+			throw e;
+		}
+	}
+	
+	protected void registerInjectorFor(String language) throws Exception {
+		injectors.put(language, createInjector(
+		  override(override(getRuntimeModule(language)).with(getSharedStateModule())).with(getUiModule(language))));
+	}
+	
+	@Override
+	public void stop(BundleContext context) throws Exception {
+		injectors.clear();
+		INSTANCE = null;
+		super.stop(context);
+	}
+	
+	public static SGenActivator getInstance() {
+		return INSTANCE;
+	}
+	
+	protected Module getRuntimeModule(String grammar) {
+		if ("org.yakindu.sct.generator.genmodel.SGen".equals(grammar)) {
+		  return new org.yakindu.sct.generator.genmodel.SGenRuntimeModule();
+		}
+		
+		throw new IllegalArgumentException(grammar);
+	}
+	
+	protected Module getUiModule(String grammar) {
+		if ("org.yakindu.sct.generator.genmodel.SGen".equals(grammar)) {
+		  return new org.yakindu.sct.generator.genmodel.ui.SGenUiModule(this);
+		}
+		
+		throw new IllegalArgumentException(grammar);
+	}
+	
+	protected Module getSharedStateModule() {
+		return new org.eclipse.xtext.ui.shared.SharedStateModule();
+	}
+	
+}

+ 0 - 455
plugins/org.yakindu.sct.generator.genmodel.ui/xtend-gen/org/yakindu/sct/generator/genmodel/ui/wizard/ProjectTemplate.java

@@ -1,455 +0,0 @@
-package org.yakindu.sct.generator.genmodel.ui.wizard;
-
-import org.apache.commons.lang.StringEscapeUtils;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.xtend.shared.ui.wizards.EclipseHelper;
-import org.eclipse.xtext.xbase.lib.BooleanExtensions;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
-import org.eclipse.xtext.xbase.lib.ObjectExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.eclipse.xtext.xtend2.lib.StringConcatenation;
-import org.yakindu.sct.generator.genmodel.ui.wizard.ProjectData;
-import org.yakindu.sct.generator.genmodel.ui.wizard.XpandGeneratorProjectWizard;
-
-@SuppressWarnings("all")
-public class ProjectTemplate {
-  
-  public IFile doGenerate(final ProjectData data, final IProgressMonitor monitor) throws CoreException {
-    IFile _xblockexpression = null;
-    {
-      String _targetPackage = this.targetPackage(data);
-      String _asFolder = this.asFolder(_targetPackage);
-      String _operator_plus = StringExtensions.operator_plus("src/", _asFolder);
-      String folderPath = _operator_plus;
-      IProject _project = data.getProject();
-      this.createFolder(folderPath, _project, monitor);
-      IProject _project_1 = data.getProject();
-      Path _path = new Path(folderPath);
-      IFolder _folder = _project_1.getFolder(_path);
-      IFolder generatorFolder = _folder;
-      IProject _project_2 = data.getProject();
-      String _encoding = ResourcesPlugin.getEncoding();
-      StringConcatenation _projectSettings = this.projectSettings(data, _encoding);
-      String _string = _projectSettings.toString();
-      EclipseHelper.createFile(".settings/org.eclipse.core.resources.prefs", _project_2, _string, monitor);
-      IProject _project_3 = data.getProject();
-      StringConcatenation _xpandSettings = this.xpandSettings(data);
-      String _string_1 = _xpandSettings.toString();
-      EclipseHelper.createFile(".settings/org.eclipse.xtend.shared.ui.prefs", _project_3, _string_1, monitor);
-      String _templateName = this.templateName(data);
-      String _operator_plus_1 = StringExtensions.operator_plus(_templateName, ".xpt");
-      String _resource = this.resource("DefaultTemplate.xpt", "iso-8859-1");
-      EclipseHelper.createFile(_operator_plus_1, generatorFolder, _resource, monitor);
-      IFile _xifexpression = null;
-      boolean _isPluginExport = data.isPluginExport();
-      if (_isPluginExport) {
-        IFile _xblockexpression_1 = null;
-        {
-          IProject _project_4 = data.getProject();
-          StringConcatenation _plugin = this.plugin(data);
-          String _string_2 = _plugin.toString();
-          EclipseHelper.createFile("plugin.xml", _project_4, _string_2, monitor);
-          String _generatorClass = data.getGeneratorClass();
-          String _javaFilename = this.javaFilename(_generatorClass);
-          String _operator_plus_2 = StringExtensions.operator_plus("src/", _javaFilename);
-          IProject _project_5 = data.getProject();
-          StringConcatenation _generator = this.generator(data);
-          String _string_3 = _generator.toString();
-          EclipseHelper.createFile(_operator_plus_2, _project_5, _string_3, monitor);
-          boolean _isTypeLibrary = data.isTypeLibrary();
-          if (_isTypeLibrary) {
-            IProject _project_6 = data.getProject();
-            this.createFolder("library", _project_6, monitor);
-          }
-          IProject _project_7 = data.getProject();
-          StringConcatenation _buildProperties = this.buildProperties(data);
-          String _string_4 = _buildProperties.toString();
-          IFile _createFile = EclipseHelper.createFile("build.properties", _project_7, _string_4, monitor);
-          _xblockexpression_1 = (_createFile);
-        }
-        _xifexpression = _xblockexpression_1;
-      }
-      _xblockexpression = (_xifexpression);
-    }
-    return _xblockexpression;
-  }
-  
-  public String templateName(final ProjectData data) {
-    String _xifexpression = null;
-    boolean _isPluginExport = data.isPluginExport();
-    if (_isPluginExport) {
-      String _generatorClass = data.getGeneratorClass();
-      String _simpleName = this.simpleName(_generatorClass);
-      _xifexpression = _simpleName;
-    } else {
-      _xifexpression = "Main";
-    }
-    return _xifexpression;
-  }
-  
-  public String resource(final String name, final String encoding) {
-    String _resourceContents = XpandGeneratorProjectWizard.getResourceContents(name, encoding);
-    return _resourceContents;
-  }
-  
-  public String targetPackage(final ProjectData data) {
-    String _xifexpression = null;
-    boolean _isPluginExport = data.isPluginExport();
-    if (_isPluginExport) {
-      String _generatorClass = data.getGeneratorClass();
-      String _packageName = this.packageName(_generatorClass);
-      _xifexpression = _packageName;
-    } else {
-      _xifexpression = "org.yakindu.sct.generator.xpand";
-    }
-    return _xifexpression;
-  }
-  
-  public String asFolder(final String s) {
-    String _replaceAll = s.replaceAll("\\.", "/");
-    return _replaceAll;
-  }
-  
-  public String javaPathToXpand(final String s) {
-    String _replaceAll = s.replaceAll("\\.", "::");
-    return _replaceAll;
-  }
-  
-  public String simpleName(final String s) {
-    int _lastIndexOf = s.lastIndexOf(".");
-    int _operator_plus = IntegerExtensions.operator_plus(((Integer)_lastIndexOf), ((Integer)1));
-    String _substring = s.substring(_operator_plus);
-    return _substring;
-  }
-  
-  public String packageName(final String s) {
-    int _lastIndexOf = s.lastIndexOf(".");
-    String _substring = s.substring(0, _lastIndexOf);
-    return _substring;
-  }
-  
-  public String providerClass(final ProjectData data) {
-    String _generatorClass = data.getGeneratorClass();
-    String _operator_plus = StringExtensions.operator_plus(_generatorClass, "DefaultValueProvider");
-    return _operator_plus;
-  }
-  
-  public String javaFilename(final String s) {
-    String _replaceAll = s.replaceAll("\\.", "/");
-    String _operator_plus = StringExtensions.operator_plus(_replaceAll, ".java");
-    return _operator_plus;
-  }
-  
-  public Object createFolder(final String folderPath, final IContainer container, final IProgressMonitor monitor) throws CoreException {
-    Path _path = new Path(folderPath);
-    IFolder _folder = container.getFolder(_path);
-    Object _createFolderHierarchy = this.createFolderHierarchy(_folder, monitor);
-    return _createFolderHierarchy;
-  }
-  
-  public Object createFolderHierarchy(final IFolder folder, final IProgressMonitor monitor) throws CoreException {
-    Object _xifexpression = null;
-    boolean _exists = folder.exists();
-    boolean _operator_not = BooleanExtensions.operator_not(_exists);
-    if (_operator_not) {
-      {
-        boolean _operator_and = false;
-        IContainer _parent = folder.getParent();
-        boolean _exists_1 = _parent.exists();
-        boolean _operator_not_1 = BooleanExtensions.operator_not(_exists_1);
-        if (!_operator_not_1) {
-          _operator_and = false;
-        } else {
-          IContainer _parent_1 = folder.getParent();
-          int _type = _parent_1.getType();
-          boolean _operator_equals = ObjectExtensions.operator_equals(((Integer)_type), ((Integer)IResource.FOLDER));
-          _operator_and = BooleanExtensions.operator_and(_operator_not_1, _operator_equals);
-        }
-        if (_operator_and) {
-          IContainer _parent_2 = folder.getParent();
-          this.createFolderHierarchy(((IFolder) _parent_2), monitor);
-        }
-        folder.create(true, true, monitor);
-      }
-    }
-    return _xifexpression;
-  }
-  
-  public String escapeForXml(final String s) {
-    String _escapeXml = StringEscapeUtils.escapeXml(s);
-    return _escapeXml;
-  }
-  
-  public StringConcatenation plugin(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-    _builder.newLine();
-    _builder.append("<?eclipse version=\"3.4\"?>");
-    _builder.newLine();
-    _builder.append("<plugin>");
-    _builder.newLine();
-    _builder.append("   ");
-    _builder.append("<extension");
-    _builder.newLine();
-    _builder.append("         ");
-    _builder.append("point=\"org.yakindu.sct.generator.core.generator\">");
-    _builder.newLine();
-    _builder.append("      ");
-    _builder.append("<SCTGenerator class=\"");
-    String _generatorClass = data.getGeneratorClass();
-    _builder.append(_generatorClass, "      ");
-    _builder.append("\"");
-    _builder.newLineIfNotEmpty();
-    _builder.append("            ");
-    _builder.append("description=\"");
-    String _generatorDescription = data.getGeneratorDescription();
-    String _escapeForXml = this.escapeForXml(_generatorDescription);
-    _builder.append(_escapeForXml, "            ");
-    _builder.append("\"");
-    _builder.newLineIfNotEmpty();
-    _builder.append("            ");
-    _builder.append("id=\"");
-    String _generatorId = data.getGeneratorId();
-    _builder.append(_generatorId, "            ");
-    _builder.append("\"");
-    _builder.newLineIfNotEmpty();
-    _builder.append("            ");
-    _builder.append("name=\"");
-    String _generatorName = data.getGeneratorName();
-    String _escapeForXml_1 = this.escapeForXml(_generatorName);
-    _builder.append(_escapeForXml_1, "            ");
-    _builder.append("\">");
-    _builder.newLineIfNotEmpty();
-    _builder.append("      ");
-    _builder.append("</SCTGenerator>");
-    _builder.newLine();
-    _builder.append("   ");
-    _builder.append("</extension>");
-    _builder.newLine();
-    {
-      boolean _isTypeLibrary = data.isTypeLibrary();
-      if (_isTypeLibrary) {
-        _builder.append("<extension");
-        _builder.newLine();
-        _builder.append("      ");
-        _builder.append("point=\"org.yakindu.sct.generator.core.featuretypes\">");
-        _builder.newLine();
-        _builder.append("   ");
-        _builder.append("<FeatureLibrary generatorId=\"");
-        String _generatorId_1 = data.getGeneratorId();
-        _builder.append(_generatorId_1, "   ");
-        _builder.append("\" ");
-        _builder.newLineIfNotEmpty();
-        _builder.append("   ");
-        _builder.append("defaultProvider=\"");
-        String _providerClass = this.providerClass(data);
-        _builder.append(_providerClass, "   ");
-        _builder.append("\"");
-        _builder.newLineIfNotEmpty();
-        _builder.append("         ");
-        _builder.append("uri=\"platform:/plugin/");
-        IProject _project = data.getProject();
-        String _name = _project.getName();
-        _builder.append(_name, "         ");
-        _builder.append("/library/FeatureTypeLibrary.xmi\">");
-        _builder.newLineIfNotEmpty();
-        _builder.append("   ");
-        _builder.append("</FeatureLibrary>");
-        _builder.newLine();
-        _builder.append("</extension>");
-        _builder.newLine();
-      }
-    }
-    _builder.append("</plugin>");
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation generator(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("package ");
-    String _generatorClass = data.getGeneratorClass();
-    String _packageName = this.packageName(_generatorClass);
-    _builder.append(_packageName, "");
-    _builder.append(";");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    _builder.append("import org.yakindu.sct.generator.core.impl.AbstractXpandBasedCodeGenerator;");
-    _builder.newLine();
-    _builder.newLine();
-    _builder.append("/**");
-    _builder.newLine();
-    _builder.append(" ");
-    _builder.append("* Generator using Xpand template \"");
-    String _generatorClass_1 = data.getGeneratorClass();
-    String _javaPathToXpand = this.javaPathToXpand(_generatorClass_1);
-    _builder.append(_javaPathToXpand, " ");
-    _builder.append("::main\"");
-    _builder.newLineIfNotEmpty();
-    _builder.append(" ");
-    _builder.append("*/");
-    _builder.newLine();
-    _builder.append("public class ");
-    String _generatorClass_2 = data.getGeneratorClass();
-    String _simpleName = this.simpleName(_generatorClass_2);
-    _builder.append(_simpleName, "");
-    _builder.append(" extends AbstractXpandBasedCodeGenerator {");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("@Override");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("public String getTemplatePath() {");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("return \"");
-    String _generatorClass_3 = data.getGeneratorClass();
-    String _javaPathToXpand_1 = this.javaPathToXpand(_generatorClass_3);
-    _builder.append(_javaPathToXpand_1, "		");
-    _builder.append("::main\";");
-    _builder.newLineIfNotEmpty();
-    _builder.append("\t");
-    _builder.append("}");
-    _builder.newLine();
-    _builder.append("}");
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation defaultProvider(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("package ");
-    String _providerClass = this.providerClass(data);
-    String _packageName = this.packageName(_providerClass);
-    _builder.append(_packageName, "");
-    _builder.append(";");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    _builder.append("import org.yakindu.sct.generator.core.features.AbstractDefaultFeatureValueProvider;");
-    _builder.newLine();
-    _builder.newLine();
-    _builder.append("/**");
-    _builder.newLine();
-    _builder.append(" ");
-    _builder.append("* Default value proivder for ");
-    String _generatorName = data.getGeneratorName();
-    _builder.append(_generatorName, " ");
-    _builder.append(" feature library");
-    _builder.newLineIfNotEmpty();
-    _builder.append(" ");
-    _builder.append("*/");
-    _builder.newLine();
-    _builder.append("public class ");
-    String _providerClass_1 = this.providerClass(data);
-    String _simpleName = this.simpleName(_providerClass_1);
-    _builder.append(_simpleName, "");
-    _builder.append(" extends AbstractDefaultFeatureValueProvider {");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("private static final String LIBRARY_NAME = \"");
-    String _generatorName_1 = data.getGeneratorName();
-    _builder.append(_generatorName_1, "	");
-    _builder.append("\";");
-    _builder.newLineIfNotEmpty();
-    _builder.append("\t");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("@Override");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("protected void setDefaultValue(FeatureParameterValue parameterValue,");
-    _builder.newLine();
-    _builder.append("\t\t\t");
-    _builder.append("Statechart statechart) {");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("String parameterName = parameterValue.getParameter().getName();");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("//TODO: set the default values");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("}");
-    _builder.newLine();
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("public boolean isProviderFor(FeatureTypeLibrary library) {");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("return library.getName().equals(LIBRARY_NAME);");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("}");
-    _builder.newLine();
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("public IStatus validateParameterValue(FeatureParameterValue value) {");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("String name = value.getParameter().getName();");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("//TODO implement validation");
-    _builder.newLine();
-    _builder.append("\t\t");
-    _builder.append("return Status.OK_STATUS;");
-    _builder.newLine();
-    _builder.append("\t");
-    _builder.append("}");
-    _builder.newLine();
-    _builder.append("}");
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation projectSettings(final ProjectData data, final String encoding) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("eclipse.preferences.version=1");
-    _builder.newLine();
-    _builder.append("encoding/<project>=");
-    _builder.append(encoding, "");
-    _builder.newLineIfNotEmpty();
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation xpandSettings(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("eclipse.preferences.version=1");
-    _builder.newLine();
-    _builder.append("project.specific.metamodel=true");
-    _builder.newLine();
-    _builder.append("metamodelContributor=org.eclipse.xtend.typesystem.emf.ui.EmfMetamodelContributor");
-    _builder.newLine();
-    _builder.newLine();
-    return _builder;
-  }
-  
-  public StringConcatenation buildProperties(final ProjectData data) {
-    StringConcatenation _builder = new StringConcatenation();
-    _builder.append("source.. = src/,\\");
-    _builder.newLine();
-    _builder.append("           ");
-    _builder.append("src-gen");
-    _builder.newLine();
-    _builder.append("bin.includes = META-INF/,\\");
-    _builder.newLine();
-    _builder.append("               ");
-    _builder.append(".,\\");
-    _builder.newLine();
-    _builder.append("               ");
-    _builder.append("plugin.xml");
-    _builder.newLine();
-    return _builder;
-  }
-}

File diff suppressed because it is too large
+ 3509 - 0
plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/parser/antlr/internal/InternalSGen.g


+ 103 - 0
plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/parser/antlr/internal/InternalSGen.tokens

@@ -0,0 +1,103 @@
+RULE_ID=4
+T__29=29
+T__28=28
+T__27=27
+T__26=26
+T__25=25
+T__24=24
+T__23=23
+T__22=22
+RULE_ANY_OTHER=10
+T__21=21
+T__20=20
+T__55=55
+T__56=56
+T__19=19
+T__57=57
+T__58=58
+T__51=51
+T__16=16
+T__52=52
+T__15=15
+T__53=53
+T__18=18
+T__54=54
+T__17=17
+T__12=12
+T__11=11
+T__14=14
+T__13=13
+RULE_INT=5
+T__50=50
+T__42=42
+T__43=43
+T__40=40
+T__41=41
+T__46=46
+T__47=47
+T__44=44
+T__45=45
+T__48=48
+T__49=49
+RULE_SL_COMMENT=8
+RULE_ML_COMMENT=7
+T__30=30
+T__31=31
+RULE_STRING=6
+T__32=32
+T__33=33
+T__34=34
+T__35=35
+T__36=36
+T__37=37
+T__38=38
+T__39=39
+RULE_WS=9
+'..'=31
+'!'=38
+'instanceof'=25
+'|'=45
+'>='=26
+'/'=36
+'=='=23
+'val'=49
+'null'=53
+'>'=28
+'||'=21
+'*.'=41
+'&&'=22
+'='=17
+'for'=12
+'GeneratorModel'=11
+'?.'=40
+'::'=18
+'+'=32
+'=>'=55
+')'=44
+'.'=19
+'%'=37
+'->'=30
+'super'=50
+'case'=46
+'true'=52
+'}'=14
+'catch'=54
+'extends'=57
+'+='=20
+'{'=13
+'as'=39
+'?'=56
+'var'=48
+'feature'=16
+'<='=27
+'!='=24
+'false'=51
+'<'=29
+':'=47
+'('=43
+'-'=33
+'*'=34
+'**'=35
+'statechart'=15
+','=42
+'&'=58

File diff suppressed because it is too large
+ 2357 - 0
plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/parser/antlr/internal/InternalSGenLexer.java


File diff suppressed because it is too large
+ 12095 - 0
plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/parser/antlr/internal/InternalSGenParser.java


File diff suppressed because it is too large
+ 1193 - 0
plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/serializer/AbstractSGenSemanticSequencer.java


+ 129 - 0
plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/serializer/AbstractSGenSyntacticSequencer.java

@@ -0,0 +1,129 @@
+package org.yakindu.sct.generator.genmodel.serializer;
+
+import com.google.inject.Inject;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.xtext.IGrammarAccess;
+import org.eclipse.xtext.RuleCall;
+import org.eclipse.xtext.nodemodel.INode;
+import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias;
+import org.eclipse.xtext.serializer.analysis.GrammarAlias.GroupAlias;
+import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias;
+import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition;
+import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer;
+import org.yakindu.sct.generator.genmodel.services.SGenGrammarAccess;
+
+@SuppressWarnings("restriction")
+public class AbstractSGenSyntacticSequencer extends AbstractSyntacticSequencer {
+
+	protected SGenGrammarAccess grammarAccess;
+	protected AbstractElementAlias match_XBlockExpression_SemicolonKeyword_2_1_q;
+	protected AbstractElementAlias match_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_FalseKeyword_1_0_RightParenthesisKeyword_2_p;
+	protected AbstractElementAlias match_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_FalseKeyword_1_0_RightParenthesisKeyword_2_p;
+	protected AbstractElementAlias match_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_NullKeyword_1_RightParenthesisKeyword_2_p;
+	protected AbstractElementAlias match_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_NullKeyword_1_RightParenthesisKeyword_2_p;
+	protected AbstractElementAlias match_XParenthesizedExpression_LeftParenthesisKeyword_0_a;
+	protected AbstractElementAlias match_XParenthesizedExpression_LeftParenthesisKeyword_0_p;
+	
+	@Inject
+	protected void init(IGrammarAccess access) {
+		grammarAccess = (SGenGrammarAccess) access;
+		match_XBlockExpression_SemicolonKeyword_2_1_q = new TokenAlias(true, false, grammarAccess.getXBlockExpressionAccess().getSemicolonKeyword_2_1());
+		match_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_FalseKeyword_1_0_RightParenthesisKeyword_2_p = new GroupAlias(false, false, new TokenAlias(true, true, grammarAccess.getXParenthesizedExpressionAccess().getLeftParenthesisKeyword_0()), new TokenAlias(false, false, grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()), new TokenAlias(false, true, grammarAccess.getXParenthesizedExpressionAccess().getRightParenthesisKeyword_2()));
+		match_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_FalseKeyword_1_0_RightParenthesisKeyword_2_p = new GroupAlias(false, false, new TokenAlias(false, true, grammarAccess.getXParenthesizedExpressionAccess().getLeftParenthesisKeyword_0()), new TokenAlias(false, false, grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()), new TokenAlias(false, true, grammarAccess.getXParenthesizedExpressionAccess().getRightParenthesisKeyword_2()));
+		match_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_NullKeyword_1_RightParenthesisKeyword_2_p = new GroupAlias(false, false, new TokenAlias(true, true, grammarAccess.getXParenthesizedExpressionAccess().getLeftParenthesisKeyword_0()), new TokenAlias(false, false, grammarAccess.getXNullLiteralAccess().getNullKeyword_1()), new TokenAlias(false, true, grammarAccess.getXParenthesizedExpressionAccess().getRightParenthesisKeyword_2()));
+		match_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_NullKeyword_1_RightParenthesisKeyword_2_p = new GroupAlias(false, false, new TokenAlias(false, true, grammarAccess.getXParenthesizedExpressionAccess().getLeftParenthesisKeyword_0()), new TokenAlias(false, false, grammarAccess.getXNullLiteralAccess().getNullKeyword_1()), new TokenAlias(false, true, grammarAccess.getXParenthesizedExpressionAccess().getRightParenthesisKeyword_2()));
+		match_XParenthesizedExpression_LeftParenthesisKeyword_0_a = new TokenAlias(true, true, grammarAccess.getXParenthesizedExpressionAccess().getLeftParenthesisKeyword_0());
+		match_XParenthesizedExpression_LeftParenthesisKeyword_0_p = new TokenAlias(false, true, grammarAccess.getXParenthesizedExpressionAccess().getLeftParenthesisKeyword_0());
+	}
+	
+	@Override
+	protected String getUnassignedRuleCallToken(RuleCall ruleCall, INode node) {
+		if(ruleCall.getRule() == grammarAccess.getOpSingleAssignRule())
+			return getOpSingleAssignToken(ruleCall, node);
+		return "";
+	}
+	
+	protected String getOpSingleAssignToken(RuleCall ruleCall, INode node) {
+		if (node != null)
+			return getTokenText(node);
+		return "=";
+	}
+	
+	@Override
+	protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
+		if (!transition.isSyntacticallyAmbiguous())
+			return;
+		if(match_XBlockExpression_SemicolonKeyword_2_1_q.equals(transition.getAmbiguousSyntax()))
+			emit_XBlockExpression_SemicolonKeyword_2_1_q(semanticObject, transition, fromNode, toNode);
+		else if(match_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_FalseKeyword_1_0_RightParenthesisKeyword_2_p.equals(transition.getAmbiguousSyntax()))
+			emit_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_FalseKeyword_1_0_RightParenthesisKeyword_2_p(semanticObject, transition, fromNode, toNode);
+		else if(match_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_FalseKeyword_1_0_RightParenthesisKeyword_2_p.equals(transition.getAmbiguousSyntax()))
+			emit_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_FalseKeyword_1_0_RightParenthesisKeyword_2_p(semanticObject, transition, fromNode, toNode);
+		else if(match_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_NullKeyword_1_RightParenthesisKeyword_2_p.equals(transition.getAmbiguousSyntax()))
+			emit_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_NullKeyword_1_RightParenthesisKeyword_2_p(semanticObject, transition, fromNode, toNode);
+		else if(match_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_NullKeyword_1_RightParenthesisKeyword_2_p.equals(transition.getAmbiguousSyntax()))
+			emit_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_NullKeyword_1_RightParenthesisKeyword_2_p(semanticObject, transition, fromNode, toNode);
+		else if(match_XParenthesizedExpression_LeftParenthesisKeyword_0_a.equals(transition.getAmbiguousSyntax()))
+			emit_XParenthesizedExpression_LeftParenthesisKeyword_0_a(semanticObject, transition, fromNode, toNode);
+		else if(match_XParenthesizedExpression_LeftParenthesisKeyword_0_p.equals(transition.getAmbiguousSyntax()))
+			emit_XParenthesizedExpression_LeftParenthesisKeyword_0_p(semanticObject, transition, fromNode, toNode);
+		else acceptNodes(transition, fromNode, toNode);
+	}
+
+	/**
+	 * Syntax:
+	 *     ';'?
+	 */
+	protected void emit_XBlockExpression_SemicolonKeyword_2_1_q(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
+		acceptNodes(transition, fromNode, toNode);
+	}
+	
+	/**
+	 * Syntax:
+	 *     '('* 'false' ')'+
+	 */
+	protected void emit_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_FalseKeyword_1_0_RightParenthesisKeyword_2_p(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
+		acceptNodes(transition, fromNode, toNode);
+	}
+	
+	/**
+	 * Syntax:
+	 *     '('+ 'false' ')'+
+	 */
+	protected void emit_XBooleanLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_FalseKeyword_1_0_RightParenthesisKeyword_2_p(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
+		acceptNodes(transition, fromNode, toNode);
+	}
+	
+	/**
+	 * Syntax:
+	 *     '('* 'null' ')'+
+	 */
+	protected void emit_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_a_NullKeyword_1_RightParenthesisKeyword_2_p(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
+		acceptNodes(transition, fromNode, toNode);
+	}
+	
+	/**
+	 * Syntax:
+	 *     '('+ 'null' ')'+
+	 */
+	protected void emit_XNullLiteral_XParenthesizedExpression_LeftParenthesisKeyword_0_p_NullKeyword_1_RightParenthesisKeyword_2_p(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
+		acceptNodes(transition, fromNode, toNode);
+	}
+	
+	/**
+	 * Syntax:
+	 *     '('*
+	 */
+	protected void emit_XParenthesizedExpression_LeftParenthesisKeyword_0_a(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
+		acceptNodes(transition, fromNode, toNode);
+	}
+	
+	/**
+	 * Syntax:
+	 *     '('+
+	 */
+	protected void emit_XParenthesizedExpression_LeftParenthesisKeyword_0_p(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
+		acceptNodes(transition, fromNode, toNode);
+	}
+	
+}

File diff suppressed because it is too large
+ 1050 - 0
plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/services/SGenGrammarAccess.java


+ 23 - 0
plugins/org.yakindu.sct.generator.genmodel/src-gen/org/yakindu/sct/generator/genmodel/validation/AbstractSGenJavaValidator.java

@@ -0,0 +1,23 @@
+package org.yakindu.sct.generator.genmodel.validation;
+ 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.xtext.xbase.validation.XbaseJavaValidator;
+import org.eclipse.xtext.validation.ComposedChecks;
+
+@ComposedChecks(validators= {org.eclipse.xtext.validation.ImportUriValidator.class, org.eclipse.xtext.validation.NamesAreUniqueValidator.class})
+public class AbstractSGenJavaValidator extends XbaseJavaValidator {
+
+	@Override
+	protected List<EPackage> getEPackages() {
+	    List<EPackage> result = new ArrayList<EPackage>();
+	    result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.yakindu.org/sct/statechart/SGen"));
+	    result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/xtext/xbase/Xbase"));
+	    result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/xtext/common/JavaVMTypes"));
+	    result.add(EPackage.Registry.INSTANCE.getEPackage("http://www.eclipse.org/xtext/xbase/Xtype"));
+		return result;
+	}
+
+}

+ 0 - 291
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/FactoryExtension.java

@@ -1,291 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.inject.Inject;
-import java.util.ArrayList;
-import java.util.HashMap;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.xtext.naming.IQualifiedNameProvider;
-import org.eclipse.xtext.naming.QualifiedName;
-import org.eclipse.xtext.xbase.lib.CollectionLiterals;
-import org.eclipse.xtext.xbase.lib.ObjectExtensions;
-import org.yakindu.sct.model.sexec.Call;
-import org.yakindu.sct.model.sexec.Check;
-import org.yakindu.sct.model.sexec.CheckRef;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.ScheduleTimeEvent;
-import org.yakindu.sct.model.sexec.SexecFactory;
-import org.yakindu.sct.model.sexec.Step;
-import org.yakindu.sct.model.sexec.TimeEvent;
-import org.yakindu.sct.model.sexec.UnscheduleTimeEvent;
-import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
-import org.yakindu.sct.model.sgraph.Reaction;
-import org.yakindu.sct.model.sgraph.Scope;
-import org.yakindu.sct.model.sgraph.State;
-import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.Statement;
-import org.yakindu.sct.model.sgraph.Transition;
-import org.yakindu.sct.model.stext.stext.EventDefinition;
-import org.yakindu.sct.model.stext.stext.InterfaceScope;
-import org.yakindu.sct.model.stext.stext.InternalScope;
-import org.yakindu.sct.model.stext.stext.LocalReaction;
-import org.yakindu.sct.model.stext.stext.ReactionTrigger;
-import org.yakindu.sct.model.stext.stext.StextFactory;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-
-@SuppressWarnings("all")
-public class FactoryExtension {
-  
-  @Inject
-  private IQualifiedNameProvider qfnProvider;
-  
-  @Inject
-  private StatechartExtensions sce;
-  
-  private final HashMap<ArrayList<?>,ExecutionFlow> _createCache_create = new HashMap<ArrayList<?>,ExecutionFlow>();
-  
-  public ExecutionFlow create(final Statechart statechart) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(statechart);
-    ExecutionFlow r;
-    synchronized (_createCache_create) {
-      if (_createCache_create.containsKey(_cacheKey)) {
-        return _createCache_create.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionFlow _createExecutionFlow = _sexecFactory.createExecutionFlow();
-      r = _createExecutionFlow;
-      _createCache_create.put(_cacheKey, r);
-    }
-    String _name = statechart.getName();
-    r.setName(_name);
-    return r;
-  }
-  
-  private final HashMap<ArrayList<?>,InterfaceScope> _createCache_create_1 = new HashMap<ArrayList<?>,InterfaceScope>();
-  
-  protected Scope _create(final InterfaceScope scope) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(scope);
-    InterfaceScope r;
-    synchronized (_createCache_create_1) {
-      if (_createCache_create_1.containsKey(_cacheKey)) {
-        return _createCache_create_1.get(_cacheKey);
-      }
-      StextFactory _stextFactory = this.stextFactory();
-      InterfaceScope _createInterfaceScope = _stextFactory.createInterfaceScope();
-      r = _createInterfaceScope;
-      _createCache_create_1.put(_cacheKey, r);
-    }
-    String _name = scope.getName();
-    r.setName(_name);
-    return r;
-  }
-  
-  private final HashMap<ArrayList<?>,InternalScope> _createCache_create_2 = new HashMap<ArrayList<?>,InternalScope>();
-  
-  protected Scope _create(final InternalScope scope) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(scope);
-    InternalScope r;
-    synchronized (_createCache_create_2) {
-      if (_createCache_create_2.containsKey(_cacheKey)) {
-        return _createCache_create_2.get(_cacheKey);
-      }
-      StextFactory _stextFactory = this.stextFactory();
-      InternalScope _createInternalScope = _stextFactory.createInternalScope();
-      r = _createInternalScope;
-      _createCache_create_2.put(_cacheKey, r);
-    }
-    return r;
-  }
-  
-  private final HashMap<ArrayList<?>,EventDefinition> _createCache_create_3 = new HashMap<ArrayList<?>,EventDefinition>();
-  
-  public EventDefinition create(final EventDefinition event) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(event);
-    EventDefinition r;
-    synchronized (_createCache_create_3) {
-      if (_createCache_create_3.containsKey(_cacheKey)) {
-        return _createCache_create_3.get(_cacheKey);
-      }
-      EventDefinition _copy = EcoreUtil.<EventDefinition>copy(event);
-      r = _copy;
-      _createCache_create_3.put(_cacheKey, r);
-    }
-    return r;
-  }
-  
-  private final HashMap<ArrayList<?>,VariableDefinition> _createCache_create_4 = new HashMap<ArrayList<?>,VariableDefinition>();
-  
-  public VariableDefinition create(final VariableDefinition v) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(v);
-    VariableDefinition r;
-    synchronized (_createCache_create_4) {
-      if (_createCache_create_4.containsKey(_cacheKey)) {
-        return _createCache_create_4.get(_cacheKey);
-      }
-      VariableDefinition _copy = EcoreUtil.<VariableDefinition>copy(v);
-      r = _copy;
-      _createCache_create_4.put(_cacheKey, r);
-    }
-    return r;
-  }
-  
-  private final HashMap<ArrayList<?>,ExecutionState> _createCache_create_5 = new HashMap<ArrayList<?>,ExecutionState>();
-  
-  public ExecutionState create(final State state) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(state);
-    ExecutionState r;
-    synchronized (_createCache_create_5) {
-      if (_createCache_create_5.containsKey(_cacheKey)) {
-        return _createCache_create_5.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionState _createExecutionState = _sexecFactory.createExecutionState();
-      r = _createExecutionState;
-      _createCache_create_5.put(_cacheKey, r);
-    }
-    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(state, null);
-    if (_operator_notEquals) {
-      {
-        String _name = state.getName();
-        r.setSimpleName(_name);
-        QualifiedName _fullyQualifiedName = this.qfnProvider.getFullyQualifiedName(state);
-        String _string = _fullyQualifiedName.toString();
-        String _replaceAll = _string.replaceAll(" ", "");
-        r.setName(_replaceAll);
-      }
-    }
-    return r;
-  }
-  
-  private final HashMap<ArrayList<?>,Check> _createCache_createCheck = new HashMap<ArrayList<?>,Check>();
-  
-  public Check createCheck(final ReactionTrigger tr) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(tr);
-    Check r;
-    synchronized (_createCache_createCheck) {
-      if (_createCache_createCheck.containsKey(_cacheKey)) {
-        return _createCache_createCheck.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      Check _createCheck = _sexecFactory.createCheck();
-      r = _createCheck;
-      _createCache_createCheck.put(_cacheKey, r);
-    }
-    Reaction _reaction = this.sce.reaction(tr);
-    String _id = this.sce.id(_reaction);
-    r.setName(_id);
-    return r;
-  }
-  
-  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_6 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
-  
-  public org.yakindu.sct.model.sexec.Reaction create(final Transition tr) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(tr);
-    org.yakindu.sct.model.sexec.Reaction r;
-    synchronized (_createCache_create_6) {
-      if (_createCache_create_6.containsKey(_cacheKey)) {
-        return _createCache_create_6.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
-      r = _createReaction;
-      _createCache_create_6.put(_cacheKey, r);
-    }
-    {
-      String _id = this.sce.id(tr);
-      r.setName(_id);
-      r.setTransition(true);
-    }
-    return r;
-  }
-  
-  private final HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_7 = new HashMap<ArrayList<?>,org.yakindu.sct.model.sexec.Reaction>();
-  
-  public org.yakindu.sct.model.sexec.Reaction create(final LocalReaction lr) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(lr);
-    org.yakindu.sct.model.sexec.Reaction r;
-    synchronized (_createCache_create_7) {
-      if (_createCache_create_7.containsKey(_cacheKey)) {
-        return _createCache_create_7.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
-      r = _createReaction;
-      _createCache_create_7.put(_cacheKey, r);
-    }
-    {
-      String _id = this.sce.id(lr);
-      r.setName(_id);
-      r.setTransition(false);
-    }
-    return r;
-  }
-  
-  public CheckRef newRef(final Check check) {
-    CheckRef _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      CheckRef _createCheckRef = _sexecFactory.createCheckRef();
-      final CheckRef r = _createCheckRef;
-      r.setCheck(check);
-      _xblockexpression = (r);
-    }
-    return _xblockexpression;
-  }
-  
-  public Call newCall(final Step step) {
-    Call _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      Call _createCall = _sexecFactory.createCall();
-      final Call r = _createCall;
-      r.setStep(step);
-      _xblockexpression = (r);
-    }
-    return _xblockexpression;
-  }
-  
-  public ScheduleTimeEvent newScheduleTimeEvent(final TimeEvent te, final Statement timeValue) {
-    ScheduleTimeEvent _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ScheduleTimeEvent _createScheduleTimeEvent = _sexecFactory.createScheduleTimeEvent();
-      final ScheduleTimeEvent r = _createScheduleTimeEvent;
-      r.setTimeEvent(te);
-      r.setTimeValue(timeValue);
-      _xblockexpression = (r);
-    }
-    return _xblockexpression;
-  }
-  
-  public UnscheduleTimeEvent newUnscheduleTimeEvent(final TimeEvent te) {
-    UnscheduleTimeEvent _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      UnscheduleTimeEvent _createUnscheduleTimeEvent = _sexecFactory.createUnscheduleTimeEvent();
-      final UnscheduleTimeEvent r = _createUnscheduleTimeEvent;
-      r.setTimeEvent(te);
-      _xblockexpression = (r);
-    }
-    return _xblockexpression;
-  }
-  
-  public SexecFactory sexecFactory() {
-    return SexecFactory.eINSTANCE;
-  }
-  
-  public StextFactory stextFactory() {
-    return StextFactory.eINSTANCE;
-  }
-  
-  public Scope create(final Scope scope) {
-    if ((scope instanceof InterfaceScope)) {
-      return _create((InterfaceScope)scope);
-    } else if ((scope instanceof InternalScope)) {
-      return _create((InternalScope)scope);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(scope).toString());
-    }
-  }
-}

File diff suppressed because it is too large
+ 0 - 1672
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java


+ 0 - 273
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.java

@@ -1,273 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.EcoreUtil2;
-import org.eclipse.xtext.xbase.lib.ComparableExtensions;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.Functions.Function2;
-import org.eclipse.xtext.xbase.lib.IntegerExtensions;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.ObjectExtensions;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.yakindu.sct.model.sgraph.Reaction;
-import org.yakindu.sct.model.sgraph.ReactiveElement;
-import org.yakindu.sct.model.sgraph.Region;
-import org.yakindu.sct.model.sgraph.Scope;
-import org.yakindu.sct.model.sgraph.State;
-import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.Transition;
-import org.yakindu.sct.model.sgraph.Trigger;
-import org.yakindu.sct.model.sgraph.Vertex;
-import org.yakindu.sct.model.stext.stext.LocalReaction;
-import org.yakindu.sct.model.stext.stext.TimeEventSpec;
-
-@SuppressWarnings("all")
-public class StatechartExtensions {
-  
-  public int maxOrthogonality(final Statechart sc) {
-    EList<Region> _regions = sc.getRegions();
-    final Function2<Integer,Region,Integer> _function = new Function2<Integer,Region,Integer>() {
-        public Integer apply(final Integer o , final Region r) {
-          int _maxOrthogonality = StatechartExtensions.this.maxOrthogonality(r);
-          int _operator_plus = IntegerExtensions.operator_plus(((Integer)_maxOrthogonality), o);
-          return ((Integer)_operator_plus);
-        }
-      };
-    Integer _fold = IterableExtensions.<Region, Integer>fold(_regions, ((Integer)0), _function);
-    return _fold;
-  }
-  
-  public int maxOrthogonality(final Region r) {
-    EList<Vertex> _vertices = r.getVertices();
-    final Function2<Integer,Vertex,Integer> _function = new Function2<Integer,Vertex,Integer>() {
-        public Integer apply(final Integer s , final Vertex v) {
-          int _xblockexpression = (int) 0;
-          {
-            int _maxOrthogonality = StatechartExtensions.this.maxOrthogonality(v);
-            final int mo = _maxOrthogonality;
-            int _xifexpression = (int) 0;
-            boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)mo), s);
-            if (_operator_greaterThan) {
-              _xifexpression = mo;
-            } else {
-              _xifexpression = s;
-            }
-            _xblockexpression = (_xifexpression);
-          }
-          return ((Integer)_xblockexpression);
-        }
-      };
-    Integer _fold = IterableExtensions.<Vertex, Integer>fold(_vertices, ((Integer)0), _function);
-    return _fold;
-  }
-  
-  protected int _maxOrthogonality(final Vertex v) {
-    return 0;
-  }
-  
-  protected int _maxOrthogonality(final State s) {
-    Integer _xifexpression = null;
-    EList<Region> _subRegions = s.getSubRegions();
-    int _size = _subRegions.size();
-    boolean _operator_greaterThan = ComparableExtensions.<Integer>operator_greaterThan(((Integer)_size), ((Integer)0));
-    if (_operator_greaterThan) {
-      EList<Region> _subRegions_1 = s.getSubRegions();
-      final Function2<Integer,Region,Integer> _function = new Function2<Integer,Region,Integer>() {
-          public Integer apply(final Integer o , final Region r) {
-            int _maxOrthogonality = StatechartExtensions.this.maxOrthogonality(r);
-            int _operator_plus = IntegerExtensions.operator_plus(((Integer)_maxOrthogonality), o);
-            return ((Integer)_operator_plus);
-          }
-        };
-      Integer _fold = IterableExtensions.<Region, Integer>fold(_subRegions_1, ((Integer)0), _function);
-      _xifexpression = _fold;
-    } else {
-      _xifexpression = 1;
-    }
-    return _xifexpression;
-  }
-  
-  public Reaction reaction(final Trigger tr) {
-    EObject _eContainer = tr.eContainer();
-    return ((Reaction) _eContainer);
-  }
-  
-  public Statechart statechart(final State state) {
-    Region _parentRegion = state.getParentRegion();
-    Statechart _statechart = this.statechart(_parentRegion);
-    return _statechart;
-  }
-  
-  public Statechart statechart(final Region region) {
-    Statechart _xifexpression = null;
-    EObject _eContainer = region.eContainer();
-    if ((_eContainer instanceof org.yakindu.sct.model.sgraph.Statechart)) {
-      EObject _eContainer_1 = region.eContainer();
-      _xifexpression = ((Statechart) _eContainer_1);
-    } else {
-      EObject _eContainer_2 = region.eContainer();
-      Statechart _statechart = this.statechart(((State) _eContainer_2));
-      _xifexpression = _statechart;
-    }
-    return _xifexpression;
-  }
-  
-  public List<TimeEventSpec> timeEventSpecs(final State state) {
-    {
-      ArrayList<TimeEventSpec> _arrayList = new ArrayList<TimeEventSpec>();
-      ArrayList<TimeEventSpec> tesList = _arrayList;
-      EList<Transition> _outgoingTransitions = state.getOutgoingTransitions();
-      final Function2<ArrayList<TimeEventSpec>,Transition,ArrayList<TimeEventSpec>> _function = new Function2<ArrayList<TimeEventSpec>,Transition,ArrayList<TimeEventSpec>>() {
-          public ArrayList<TimeEventSpec> apply(final ArrayList<TimeEventSpec> s , final Transition r) {
-            ArrayList<TimeEventSpec> _xblockexpression = null;
-            {
-              List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(r);
-              Iterable<TimeEventSpec> _filter = IterableExtensions.<TimeEventSpec>filter(_eAllContentsAsList, org.yakindu.sct.model.stext.stext.TimeEventSpec.class);
-              final Function1<TimeEventSpec,Boolean> _function_1 = new Function1<TimeEventSpec,Boolean>() {
-                  public Boolean apply(final TimeEventSpec tes) {
-                    boolean _add = s.add(tes);
-                    return ((Boolean)_add);
-                  }
-                };
-              IterableExtensions.<TimeEventSpec>forEach(_filter, _function_1);
-              _xblockexpression = (s);
-            }
-            return _xblockexpression;
-          }
-        };
-      IterableExtensions.<Transition, ArrayList<TimeEventSpec>>fold(_outgoingTransitions, tesList, _function);
-      EList<Reaction> _localReactions = state.getLocalReactions();
-      final Function2<ArrayList<TimeEventSpec>,Reaction,ArrayList<TimeEventSpec>> _function_2 = new Function2<ArrayList<TimeEventSpec>,Reaction,ArrayList<TimeEventSpec>>() {
-          public ArrayList<TimeEventSpec> apply(final ArrayList<TimeEventSpec> s_1 , final Reaction r_1) {
-            ArrayList<TimeEventSpec> _xblockexpression_1 = null;
-            {
-              List<EObject> _eAllContentsAsList_1 = EcoreUtil2.eAllContentsAsList(r_1);
-              Iterable<TimeEventSpec> _filter_1 = IterableExtensions.<TimeEventSpec>filter(_eAllContentsAsList_1, org.yakindu.sct.model.stext.stext.TimeEventSpec.class);
-              final Function1<TimeEventSpec,Boolean> _function_3 = new Function1<TimeEventSpec,Boolean>() {
-                  public Boolean apply(final TimeEventSpec tes_1) {
-                    boolean _add_1 = s_1.add(tes_1);
-                    return ((Boolean)_add_1);
-                  }
-                };
-              IterableExtensions.<TimeEventSpec>forEach(_filter_1, _function_3);
-              _xblockexpression_1 = (s_1);
-            }
-            return _xblockexpression_1;
-          }
-        };
-      IterableExtensions.<Reaction, ArrayList<TimeEventSpec>>fold(_localReactions, tesList, _function_2);
-      return tesList;
-    }
-  }
-  
-  protected ReactiveElement _reactiveElement(final Reaction r) {
-    Scope _scope = this.scope(r);
-    ReactiveElement _reactiveElement = this.reactiveElement(_scope);
-    return _reactiveElement;
-  }
-  
-  protected ReactiveElement _reactiveElement(final Transition tr) {
-    State _xifexpression = null;
-    Vertex _source = tr.getSource();
-    if ((_source instanceof org.yakindu.sct.model.sgraph.State)) {
-      _xifexpression = ((State) tr);
-    } else {
-      _xifexpression = null;
-    }
-    return _xifexpression;
-  }
-  
-  public Scope scope(final Reaction r) {
-    Scope _xifexpression = null;
-    EObject _eContainer = r.eContainer();
-    if ((_eContainer instanceof org.yakindu.sct.model.sgraph.Scope)) {
-      EObject _eContainer_1 = r.eContainer();
-      _xifexpression = ((Scope) _eContainer_1);
-    }
-    return _xifexpression;
-  }
-  
-  public ReactiveElement reactiveElement(final Scope s) {
-    ReactiveElement _xifexpression = null;
-    EObject _eContainer = s.eContainer();
-    if ((_eContainer instanceof org.yakindu.sct.model.sgraph.ReactiveElement)) {
-      EObject _eContainer_1 = s.eContainer();
-      _xifexpression = ((ReactiveElement) _eContainer_1);
-    }
-    return _xifexpression;
-  }
-  
-  protected String _id(final Object obj) {
-    return null;
-  }
-  
-  protected String _id(final Transition t) {
-    Comparable<? extends Object> _xifexpression = null;
-    Vertex _source = t.getSource();
-    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_source, null);
-    if (_operator_notEquals) {
-      Vertex _source_1 = t.getSource();
-      EList<Transition> _outgoingTransitions = _source_1.getOutgoingTransitions();
-      int _indexOf = _outgoingTransitions.indexOf(t);
-      _xifexpression = _indexOf;
-    } else {
-      _xifexpression = "";
-    }
-    String _operator_plus = StringExtensions.operator_plus("tr", _xifexpression);
-    return _operator_plus;
-  }
-  
-  protected String _id(final LocalReaction t) {
-    Comparable<? extends Object> _xifexpression = null;
-    ReactiveElement _reactiveElement = this.reactiveElement(t);
-    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_reactiveElement, null);
-    if (_operator_notEquals) {
-      ReactiveElement _reactiveElement_1 = this.reactiveElement(t);
-      EList<Reaction> _localReactions = _reactiveElement_1.getLocalReactions();
-      int _indexOf = _localReactions.indexOf(t);
-      _xifexpression = _indexOf;
-    } else {
-      _xifexpression = "";
-    }
-    String _operator_plus = StringExtensions.operator_plus("lr", _xifexpression);
-    return _operator_plus;
-  }
-  
-  public int maxOrthogonality(final Vertex s) {
-    if ((s instanceof State)) {
-      return _maxOrthogonality((State)s);
-    } else if ((s instanceof Vertex)) {
-      return _maxOrthogonality((Vertex)s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(s).toString());
-    }
-  }
-  
-  public ReactiveElement reactiveElement(final Reaction tr) {
-    if ((tr instanceof Transition)) {
-      return _reactiveElement((Transition)tr);
-    } else if ((tr instanceof Reaction)) {
-      return _reactiveElement((Reaction)tr);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(tr).toString());
-    }
-  }
-  
-  public String id(final Object t) {
-    if ((t instanceof LocalReaction)) {
-      return _id((LocalReaction)t);
-    } else if ((t instanceof Transition)) {
-      return _id((Transition)t);
-    } else if ((t instanceof Object)) {
-      return _id((Object)t);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        java.util.Arrays.<Object>asList(t).toString());
-    }
-  }
-}