benjamin.schwertfeger@gmail.com 13 лет назад
Родитель
Сommit
23d88f0b4c
34 измененных файлов с 0 добавлено и 10933 удалено
  1. 0 102
      plugins/org.yakindu.sct.generator.genmodel.ui/xtend-gen/org/yakindu/sct/generator/genmodel/ui/templates/SGenProposalCreator.java
  2. 0 1273
      plugins/org.yakindu.sct.generator.genmodel.ui/xtend-gen/org/yakindu/sct/generator/genmodel/ui/wizard/GeneratorProjectTemplate.java
  3. 0 769
      plugins/org.yakindu.sct.model.sexec.interpreter/xtend-gen/org/yakindu/sct/model/sexec/interpreter/impl/ExecutionFlowInterpreter.java
  4. 0 580
      plugins/org.yakindu.sct.model.sexec.interpreter/xtend-gen/org/yakindu/sct/model/sexec/interpreter/stext/StextStatementInterpreter.java
  5. 0 809
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/extensions/SExecExtensions.java
  6. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.BehaviorMapping.java._trace
  7. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.FlowOptimizer.java._trace
  8. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.ModelSequencer.java._trace
  9. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.ReactionBuilder.java._trace
  10. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.SequenceBuilder.java._trace
  11. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.SexecElementMapping.java._trace
  12. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.SexecExtensions.java._trace
  13. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.SgraphExtensions.java._trace
  14. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.StateVectorBuilder.java._trace
  15. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.StatechartExtensions.java._trace
  16. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.StextExtensions.java._trace
  17. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.StructureMapping.java._trace
  18. BIN
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.TraceExtensions.java._trace
  19. 0 1380
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/BehaviorMapping.java
  20. 0 808
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/FlowOptimizer.java
  21. 0 265
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java
  22. 0 580
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ReactionBuilder.java
  23. 0 1006
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.java
  24. 0 874
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.java
  25. 0 145
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecExtensions.java
  26. 0 236
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SgraphExtensions.java
  27. 0 257
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StateVectorBuilder.java
  28. 0 459
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.java
  29. 0 53
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StextExtensions.java
  30. 0 334
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StructureMapping.java
  31. 0 102
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/TraceExtensions.java
  32. BIN
      plugins/org.yakindu.sct.model.stext/xtend-gen/org/yakindu/sct/model/stext/types/.DefaultSTextTypeInferrer.java._trace
  33. BIN
      plugins/org.yakindu.sct.model.stext/xtend-gen/org/yakindu/sct/model/stext/types/.STextDefaultTypeInferrer.java._trace
  34. 0 901
      plugins/org.yakindu.sct.model.stext/xtend-gen/org/yakindu/sct/model/stext/types/STextDefaultTypeInferrer.java

+ 0 - 102
plugins/org.yakindu.sct.generator.genmodel.ui/xtend-gen/org/yakindu/sct/generator/genmodel/ui/templates/SGenProposalCreator.java

@@ -1,102 +0,0 @@
-package org.yakindu.sct.generator.genmodel.ui.templates;
-
-import com.google.common.base.Objects;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.yakindu.sct.generator.core.features.IDefaultFeatureValueProvider;
-import org.yakindu.sct.model.sgen.FeatureConfiguration;
-import org.yakindu.sct.model.sgen.FeatureParameter;
-import org.yakindu.sct.model.sgen.FeatureParameterValue;
-import org.yakindu.sct.model.sgen.FeatureType;
-import org.yakindu.sct.model.sgen.Literal;
-import org.yakindu.sct.model.sgen.ParameterTypes;
-
-/**
- * @author andreas muelder - Initial contribution and API
- */
-@SuppressWarnings("all")
-public class SGenProposalCreator {
-  public String createProposal(final FeatureType featureType, final IDefaultFeatureValueProvider defaultProvider, final EObject context) {
-    String _xblockexpression = null;
-    {
-      FeatureConfiguration defaultConfiguration = defaultProvider.createDefaultFeatureConfiguration(featureType, context);
-      StringConcatenation _builder = new StringConcatenation();
-      _builder.append("feature ");
-      String _name = featureType.getName();
-      _builder.append(_name, "");
-      _builder.append(" {");
-      _builder.newLineIfNotEmpty();
-      {
-        EList<FeatureParameter> _parameters = featureType.getParameters();
-        for(final FeatureParameter param : _parameters) {
-          _builder.append("\t");
-          String _name_1 = param.getName();
-          _builder.append(_name_1, "	");
-          _builder.append(" = ");
-          Object _value = this.value(defaultConfiguration, param);
-          _builder.append(_value, "	");
-          _builder.newLineIfNotEmpty();
-        }
-      }
-      _builder.append("}");
-      _builder.newLine();
-      String _string = _builder.toString();
-      _xblockexpression = (_string);
-    }
-    return _xblockexpression;
-  }
-  
-  public Object value(final FeatureConfiguration value, final FeatureParameter param) {
-    Object _xblockexpression = null;
-    {
-      String _name = param.getName();
-      FeatureParameterValue defaultValue = value.getParameterValue(_name);
-      boolean _notEquals = (!Objects.equal(defaultValue, null));
-      if (_notEquals) {
-        ParameterTypes _parameterType = param.getParameterType();
-        boolean _equals = _parameterType.equals(ParameterTypes.STRING);
-        if (_equals) {
-          StringConcatenation _builder = new StringConcatenation();
-          _builder.append(" ");
-          _builder.append("\"");
-          Literal _expression = defaultValue.getExpression();
-          _builder.append(_expression, " ");
-          _builder.append("\" ");
-          return _builder.toString();
-        } else {
-          return defaultValue.getExpression();
-        }
-      }
-      ParameterTypes _parameterType_1 = param.getParameterType();
-      final ParameterTypes _switchValue = _parameterType_1;
-      boolean _matched = false;
-      if (!_matched) {
-        if (Objects.equal(_switchValue,ParameterTypes.STRING)) {
-          _matched=true;
-          return "\"\"";
-        }
-      }
-      if (!_matched) {
-        if (Objects.equal(_switchValue,ParameterTypes.BOOLEAN)) {
-          _matched=true;
-          return "false";
-        }
-      }
-      if (!_matched) {
-        if (Objects.equal(_switchValue,ParameterTypes.FLOAT)) {
-          _matched=true;
-          return "0.0";
-        }
-      }
-      if (!_matched) {
-        if (Objects.equal(_switchValue,ParameterTypes.INTEGER)) {
-          _matched=true;
-          return "0";
-        }
-      }
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-}

Разница между файлами не показана из-за своего большого размера
+ 0 - 1273
plugins/org.yakindu.sct.generator.genmodel.ui/xtend-gen/org/yakindu/sct/generator/genmodel/ui/wizard/GeneratorProjectTemplate.java


+ 0 - 769
plugins/org.yakindu.sct.model.sexec.interpreter/xtend-gen/org/yakindu/sct/model/sexec/interpreter/impl/ExecutionFlowInterpreter.java

@@ -1,769 +0,0 @@
-package org.yakindu.sct.model.sexec.interpreter.impl;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.xtext.naming.QualifiedName;
-import org.eclipse.xtext.xbase.lib.Conversions;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.InputOutput;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-import org.yakindu.base.types.ITypeSystem.InferenceResult;
-import org.yakindu.base.types.ITypeSystem.InferredType;
-import org.yakindu.base.types.Type;
-import org.yakindu.sct.model.sexec.Call;
-import org.yakindu.sct.model.sexec.Check;
-import org.yakindu.sct.model.sexec.EnterState;
-import org.yakindu.sct.model.sexec.Execution;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.ExitState;
-import org.yakindu.sct.model.sexec.HistoryEntry;
-import org.yakindu.sct.model.sexec.If;
-import org.yakindu.sct.model.sexec.SaveHistory;
-import org.yakindu.sct.model.sexec.ScheduleTimeEvent;
-import org.yakindu.sct.model.sexec.Sequence;
-import org.yakindu.sct.model.sexec.SexecFactory;
-import org.yakindu.sct.model.sexec.StateCase;
-import org.yakindu.sct.model.sexec.StateSwitch;
-import org.yakindu.sct.model.sexec.StateVector;
-import org.yakindu.sct.model.sexec.Step;
-import org.yakindu.sct.model.sexec.TimeEvent;
-import org.yakindu.sct.model.sexec.Trace;
-import org.yakindu.sct.model.sexec.TraceBeginRunCycle;
-import org.yakindu.sct.model.sexec.TraceEndRunCycle;
-import org.yakindu.sct.model.sexec.UnscheduleTimeEvent;
-import org.yakindu.sct.model.sexec.interpreter.IExecutionFlowInterpreter;
-import org.yakindu.sct.model.sexec.interpreter.IStatementInterpreter;
-import org.yakindu.sct.model.sexec.interpreter.ITimingService;
-import org.yakindu.sct.model.sgraph.Declaration;
-import org.yakindu.sct.model.sgraph.Event;
-import org.yakindu.sct.model.sgraph.Scope;
-import org.yakindu.sct.model.sgraph.Statement;
-import org.yakindu.sct.model.stext.naming.StextNameProvider;
-import org.yakindu.sct.model.stext.stext.Direction;
-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.OperationDefinition;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-import org.yakindu.sct.model.stext.types.ISTextTypeInferrer;
-import org.yakindu.sct.model.stext.types.ISTextTypeSystem;
-import org.yakindu.sct.simulation.core.runtime.AbstractExecutionFacade;
-import org.yakindu.sct.simulation.core.runtime.IEventSlot;
-import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
-import org.yakindu.sct.simulation.core.runtime.ISlot;
-import org.yakindu.sct.simulation.core.runtime.impl.ExecutionEvent;
-import org.yakindu.sct.simulation.core.runtime.impl.ExecutionVariable;
-
-/**
- * @author andreas muelder - Initial contribution and API
- */
-@SuppressWarnings("all")
-public class ExecutionFlowInterpreter extends AbstractExecutionFacade implements IExecutionFlowInterpreter {
-  @Inject
-  private IStatementInterpreter interpreter;
-  
-  @Inject
-  private IExecutionContext executionContext;
-  
-  @Inject
-  private StextNameProvider provider;
-  
-  @Inject
-  private ITimingService timingService;
-  
-  @Inject
-  private ISTextTypeSystem _iSTextTypeSystem;
-  
-  @Inject
-  private ISTextTypeInferrer _iSTextTypeInferrer;
-  
-  @Inject
-  @Named(value = "InterpreterName")
-  private String interpreterName;
-  
-  private ExecutionFlow flow;
-  
-  private List<EventDefinition> inEvents;
-  
-  private List<EventDefinition> outEvents;
-  
-  private List<EventDefinition> localEvents;
-  
-  private List<TimeEvent> timeEvents;
-  
-  private Map<Declaration,ISlot> slotMap;
-  
-  private int nextSVIdx;
-  
-  private TraceBeginRunCycle brc;
-  
-  private TraceEndRunCycle erc;
-  
-  public void initialize(final ExecutionFlow flow) {
-    this.flow = flow;
-    HashMap<Declaration,ISlot> _hashMap = new HashMap<Declaration,ISlot>();
-    this.slotMap = _hashMap;
-    EList<Scope> _scopes = flow.getScopes();
-    for (final Scope scope : _scopes) {
-      this.declareContents(scope);
-    }
-    StateVector _stateVector = flow.getStateVector();
-    int _size = _stateVector.getSize();
-    this.executionContext.initStateConfigurationVector(_size);
-    List<Object> _callbacks = super.getCallbacks();
-    this.interpreter.setOperationCallbacks(_callbacks);
-    TraceBeginRunCycle _createTraceBeginRunCycle = SexecFactory.eINSTANCE.createTraceBeginRunCycle();
-    this.brc = _createTraceBeginRunCycle;
-    TraceEndRunCycle _createTraceEndRunCycle = SexecFactory.eINSTANCE.createTraceEndRunCycle();
-    this.erc = _createTraceEndRunCycle;
-    EList<Scope> _scopes_1 = flow.getScopes();
-    final Function1<Scope,Iterable<EventDefinition>> _function = new Function1<Scope,Iterable<EventDefinition>>() {
-        public Iterable<EventDefinition> apply(final Scope s) {
-          EList<Declaration> _declarations = s.getDeclarations();
-          Iterable<EventDefinition> _filter = Iterables.<EventDefinition>filter(_declarations, EventDefinition.class);
-          final Function1<EventDefinition,Boolean> _function = new Function1<EventDefinition,Boolean>() {
-              public Boolean apply(final EventDefinition e) {
-                Direction _direction = e.getDirection();
-                boolean _equals = Objects.equal(_direction, Direction.IN);
-                return Boolean.valueOf(_equals);
-              }
-            };
-          Iterable<EventDefinition> _filter_1 = IterableExtensions.<EventDefinition>filter(_filter, _function);
-          return _filter_1;
-        }
-      };
-    List<Iterable<EventDefinition>> _map = ListExtensions.<Scope, Iterable<EventDefinition>>map(_scopes_1, _function);
-    Iterable<EventDefinition> _flatten = Iterables.<EventDefinition>concat(_map);
-    List<EventDefinition> _list = IterableExtensions.<EventDefinition>toList(_flatten);
-    this.inEvents = _list;
-    EList<Scope> _scopes_2 = flow.getScopes();
-    final Function1<Scope,Iterable<EventDefinition>> _function_1 = new Function1<Scope,Iterable<EventDefinition>>() {
-        public Iterable<EventDefinition> apply(final Scope s) {
-          EList<Declaration> _declarations = s.getDeclarations();
-          Iterable<EventDefinition> _filter = Iterables.<EventDefinition>filter(_declarations, EventDefinition.class);
-          final Function1<EventDefinition,Boolean> _function = new Function1<EventDefinition,Boolean>() {
-              public Boolean apply(final EventDefinition e) {
-                Direction _direction = e.getDirection();
-                boolean _equals = Objects.equal(_direction, Direction.OUT);
-                return Boolean.valueOf(_equals);
-              }
-            };
-          Iterable<EventDefinition> _filter_1 = IterableExtensions.<EventDefinition>filter(_filter, _function);
-          return _filter_1;
-        }
-      };
-    List<Iterable<EventDefinition>> _map_1 = ListExtensions.<Scope, Iterable<EventDefinition>>map(_scopes_2, _function_1);
-    Iterable<EventDefinition> _flatten_1 = Iterables.<EventDefinition>concat(_map_1);
-    List<EventDefinition> _list_1 = IterableExtensions.<EventDefinition>toList(_flatten_1);
-    this.outEvents = _list_1;
-    EList<Scope> _scopes_3 = flow.getScopes();
-    final Function1<Scope,Iterable<EventDefinition>> _function_2 = new Function1<Scope,Iterable<EventDefinition>>() {
-        public Iterable<EventDefinition> apply(final Scope s) {
-          EList<Declaration> _declarations = s.getDeclarations();
-          Iterable<EventDefinition> _filter = Iterables.<EventDefinition>filter(_declarations, EventDefinition.class);
-          final Function1<EventDefinition,Boolean> _function = new Function1<EventDefinition,Boolean>() {
-              public Boolean apply(final EventDefinition e) {
-                Direction _direction = e.getDirection();
-                boolean _equals = Objects.equal(_direction, Direction.LOCAL);
-                return Boolean.valueOf(_equals);
-              }
-            };
-          Iterable<EventDefinition> _filter_1 = IterableExtensions.<EventDefinition>filter(_filter, _function);
-          return _filter_1;
-        }
-      };
-    List<Iterable<EventDefinition>> _map_2 = ListExtensions.<Scope, Iterable<EventDefinition>>map(_scopes_3, _function_2);
-    Iterable<EventDefinition> _flatten_2 = Iterables.<EventDefinition>concat(_map_2);
-    List<EventDefinition> _list_2 = IterableExtensions.<EventDefinition>toList(_flatten_2);
-    this.localEvents = _list_2;
-    EList<Scope> _scopes_4 = flow.getScopes();
-    final Function1<Scope,Iterable<TimeEvent>> _function_3 = new Function1<Scope,Iterable<TimeEvent>>() {
-        public Iterable<TimeEvent> apply(final Scope s) {
-          EList<Declaration> _declarations = s.getDeclarations();
-          Iterable<TimeEvent> _filter = Iterables.<TimeEvent>filter(_declarations, TimeEvent.class);
-          return _filter;
-        }
-      };
-    List<Iterable<TimeEvent>> _map_3 = ListExtensions.<Scope, Iterable<TimeEvent>>map(_scopes_4, _function_3);
-    Iterable<TimeEvent> _flatten_3 = Iterables.<TimeEvent>concat(_map_3);
-    List<TimeEvent> _list_3 = IterableExtensions.<TimeEvent>toList(_flatten_3);
-    this.timeEvents = _list_3;
-    Sequence _initSequence = flow.getInitSequence();
-    this.execute(_initSequence);
-  }
-  
-  public void tearDown() {
-    this.timingService.stop();
-  }
-  
-  public String getName() {
-    return this.interpreterName;
-  }
-  
-  protected void _declareContents(final InternalScope scope) {
-    EList<Declaration> _declarations = scope.getDeclarations();
-    for (final Declaration declaration : _declarations) {
-      this.addToScope(declaration);
-    }
-  }
-  
-  protected void _declareContents(final Scope scope) {
-    EList<Declaration> _declarations = scope.getDeclarations();
-    for (final Declaration declaration : _declarations) {
-      this.addToScope(declaration);
-    }
-  }
-  
-  protected void _declareContents(final InterfaceScope scope) {
-    EList<Declaration> _declarations = scope.getDeclarations();
-    for (final Declaration declaration : _declarations) {
-      this.addToScope(declaration);
-    }
-  }
-  
-  public void runCycle() {
-    this.executionContext.flush();
-    this.nextSVIdx = 0;
-    this.execute(this.brc);
-    this.clearOutEvents();
-    ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
-    int _size = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).size();
-    boolean _lessThan = (this.nextSVIdx < _size);
-    boolean _while = _lessThan;
-    while (_while) {
-      {
-        ExecutionState[] _stateConfiguration_1 = this.executionContext.getStateConfiguration();
-        ExecutionState state = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration_1)).get(this.nextSVIdx);
-        boolean _notEquals = (!Objects.equal(state, null));
-        if (_notEquals) {
-          Sequence _reactSequence = state.getReactSequence();
-          this.execute(_reactSequence);
-        }
-        int _plus = (this.nextSVIdx + 1);
-        this.nextSVIdx = _plus;
-      }
-      ExecutionState[] _stateConfiguration_1 = this.executionContext.getStateConfiguration();
-      int _size_1 = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration_1)).size();
-      boolean _lessThan_1 = (this.nextSVIdx < _size_1);
-      _while = _lessThan_1;
-    }
-    this.clearEvents();
-    this.execute(this.erc);
-  }
-  
-  public void clearOutEvents() {
-    final Procedure1<EventDefinition> _function = new Procedure1<EventDefinition>() {
-        public void apply(final EventDefinition e) {
-          ExecutionFlowInterpreter.this.unraise(e);
-        }
-      };
-    IterableExtensions.<EventDefinition>forEach(this.outEvents, _function);
-  }
-  
-  public void clearEvents() {
-    final Procedure1<EventDefinition> _function = new Procedure1<EventDefinition>() {
-        public void apply(final EventDefinition e) {
-          ExecutionFlowInterpreter.this.unraise(e);
-        }
-      };
-    IterableExtensions.<EventDefinition>forEach(this.inEvents, _function);
-    final Procedure1<EventDefinition> _function_1 = new Procedure1<EventDefinition>() {
-        public void apply(final EventDefinition e) {
-          ExecutionFlowInterpreter.this.unraise(e);
-        }
-      };
-    IterableExtensions.<EventDefinition>forEach(this.localEvents, _function_1);
-    final Procedure1<TimeEvent> _function_2 = new Procedure1<TimeEvent>() {
-        public void apply(final TimeEvent e) {
-          ExecutionFlowInterpreter.this.unraise(e);
-        }
-      };
-    IterableExtensions.<TimeEvent>forEach(this.timeEvents, _function_2);
-  }
-  
-  public void unraise(final Event it) {
-    ISlot _get = this.slotMap.get(it);
-    ((IEventSlot) _get).unraise();
-  }
-  
-  protected void _addToScope(final VariableDefinition variable) {
-    QualifiedName _qualifiedName = this.provider.qualifiedName(variable);
-    String fqName = _qualifiedName.toString();
-    ExecutionVariable varSlot = null;
-    InferenceResult _inferType = this._iSTextTypeInferrer.inferType(variable);
-    InferredType _type = _inferType.getType();
-    boolean _isBooleanType = this._iSTextTypeSystem.isBooleanType(_type);
-    if (_isBooleanType) {
-      ExecutionVariable _executionVariable = new ExecutionVariable(fqName, Boolean.class, Boolean.valueOf(false));
-      varSlot = _executionVariable;
-    } else {
-      InferenceResult _inferType_1 = this._iSTextTypeInferrer.inferType(variable);
-      InferredType _type_1 = _inferType_1.getType();
-      boolean _isIntegerType = this._iSTextTypeSystem.isIntegerType(_type_1);
-      if (_isIntegerType) {
-        ExecutionVariable _executionVariable_1 = new ExecutionVariable(fqName, Integer.class, Integer.valueOf(0));
-        varSlot = _executionVariable_1;
-      } else {
-        InferenceResult _inferType_2 = this._iSTextTypeInferrer.inferType(variable);
-        InferredType _type_2 = _inferType_2.getType();
-        boolean _isRealType = this._iSTextTypeSystem.isRealType(_type_2);
-        if (_isRealType) {
-          ExecutionVariable _executionVariable_2 = new ExecutionVariable(fqName, Float.class, Float.valueOf(0.0f));
-          varSlot = _executionVariable_2;
-        } else {
-          InferenceResult _inferType_3 = this._iSTextTypeInferrer.inferType(variable);
-          InferredType _type_3 = _inferType_3.getType();
-          boolean _isStringType = this._iSTextTypeSystem.isStringType(_type_3);
-          if (_isStringType) {
-            ExecutionVariable _executionVariable_3 = new ExecutionVariable(fqName, String.class, "");
-            varSlot = _executionVariable_3;
-          }
-        }
-      }
-    }
-    this.executionContext.declareVariable(varSlot);
-    this.slotMap.put(variable, varSlot);
-  }
-  
-  protected void _addToScope(final EventDefinition event) {
-    QualifiedName _qualifiedName = this.provider.qualifiedName(event);
-    String fqName = _qualifiedName.toString();
-    ExecutionEvent eventSlot = null;
-    InferenceResult _inferType = this._iSTextTypeInferrer.inferType(event);
-    InferredType _type = _inferType.getType();
-    boolean _isBooleanType = this._iSTextTypeSystem.isBooleanType(_type);
-    if (_isBooleanType) {
-      ExecutionEvent _executionEvent = new ExecutionEvent(fqName, Boolean.class, Boolean.valueOf(false));
-      eventSlot = _executionEvent;
-    } else {
-      InferenceResult _inferType_1 = this._iSTextTypeInferrer.inferType(event);
-      InferredType _type_1 = _inferType_1.getType();
-      boolean _isIntegerType = this._iSTextTypeSystem.isIntegerType(_type_1);
-      if (_isIntegerType) {
-        ExecutionEvent _executionEvent_1 = new ExecutionEvent(fqName, Integer.class, Integer.valueOf(0));
-        eventSlot = _executionEvent_1;
-      } else {
-        InferenceResult _inferType_2 = this._iSTextTypeInferrer.inferType(event);
-        InferredType _type_2 = _inferType_2.getType();
-        boolean _isRealType = this._iSTextTypeSystem.isRealType(_type_2);
-        if (_isRealType) {
-          ExecutionEvent _executionEvent_2 = new ExecutionEvent(fqName, Float.class, Float.valueOf(0.0f));
-          eventSlot = _executionEvent_2;
-        } else {
-          InferenceResult _inferType_3 = this._iSTextTypeInferrer.inferType(event);
-          InferredType _type_3 = _inferType_3.getType();
-          boolean _isVoidType = this._iSTextTypeSystem.isVoidType(_type_3);
-          if (_isVoidType) {
-            ExecutionEvent _executionEvent_3 = new ExecutionEvent(fqName, Void.class);
-            eventSlot = _executionEvent_3;
-          } else {
-            InferenceResult _inferType_4 = this._iSTextTypeInferrer.inferType(event);
-            InferredType _type_4 = _inferType_4.getType();
-            boolean _isStringType = this._iSTextTypeSystem.isStringType(_type_4);
-            if (_isStringType) {
-              ExecutionEvent _executionEvent_4 = new ExecutionEvent(fqName, String.class, "");
-              eventSlot = _executionEvent_4;
-            }
-          }
-        }
-      }
-    }
-    this.executionContext.declareEvent(eventSlot);
-    this.slotMap.put(event, eventSlot);
-  }
-  
-  protected void _addToScope(final OperationDefinition op) {
-    QualifiedName _qualifiedName = this.provider.qualifiedName(op);
-    String fqName = _qualifiedName.toString();
-    Type _type = op.getType();
-    Class<? extends Object> type = this.mappedType(_type);
-    Object _defaultValue = this.defaultValue(type);
-    ExecutionVariable _executionVariable = new ExecutionVariable(fqName, type, _defaultValue);
-    final ExecutionVariable opSlot = _executionVariable;
-    this.executionContext.declareVariable(opSlot);
-    this.slotMap.put(op, opSlot);
-  }
-  
-  public Class<? extends Object> mappedType(final Type it) {
-    Class<? extends Object> _xifexpression = null;
-    boolean _isBooleanType = this._iSTextTypeSystem.isBooleanType(it);
-    if (_isBooleanType) {
-      _xifexpression = Boolean.class;
-    } else {
-      Class<? extends Object> _xifexpression_1 = null;
-      boolean _isIntegerType = this._iSTextTypeSystem.isIntegerType(it);
-      if (_isIntegerType) {
-        _xifexpression_1 = Integer.class;
-      } else {
-        Class<? extends Object> _xifexpression_2 = null;
-        boolean _isRealType = this._iSTextTypeSystem.isRealType(it);
-        if (_isRealType) {
-          _xifexpression_2 = Float.class;
-        } else {
-          Class<? extends Object> _xifexpression_3 = null;
-          boolean _isVoidType = this._iSTextTypeSystem.isVoidType(it);
-          if (_isVoidType) {
-            _xifexpression_3 = Void.class;
-          } else {
-            Class<String> _xifexpression_4 = null;
-            boolean _isStringType = this._iSTextTypeSystem.isStringType(it);
-            if (_isStringType) {
-              _xifexpression_4 = String.class;
-            } else {
-              _xifexpression_4 = null;
-            }
-            _xifexpression_3 = _xifexpression_4;
-          }
-          _xifexpression_2 = _xifexpression_3;
-        }
-        _xifexpression_1 = _xifexpression_2;
-      }
-      _xifexpression = _xifexpression_1;
-    }
-    return _xifexpression;
-  }
-  
-  public Object defaultValue(final Class<? extends Object> type) {
-    Object _switchResult = null;
-    boolean _matched = false;
-    if (!_matched) {
-      if (Objects.equal(type,Boolean.class)) {
-        _matched=true;
-        _switchResult = true;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(type,Integer.class)) {
-        _matched=true;
-        _switchResult = 0;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(type,Float.class)) {
-        _matched=true;
-        _switchResult = 0.0;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(type,Void.class)) {
-        _matched=true;
-        _switchResult = null;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(type,String.class)) {
-        _matched=true;
-        _switchResult = "";
-      }
-    }
-    return ((Comparable<Object>)_switchResult);
-  }
-  
-  protected void _addToScope(final TimeEvent event) {
-    String _name = event.getName();
-    ExecutionEvent _executionEvent = new ExecutionEvent(_name, Long.class);
-    final ExecutionEvent eventSlot = _executionEvent;
-    this.executionContext.declareEvent(eventSlot);
-    this.slotMap.put(event, eventSlot);
-  }
-  
-  public void enter() {
-    Sequence _enterSequence = this.flow.getEnterSequence();
-    EList<Step> _steps = _enterSequence.getSteps();
-    for (final Step step : _steps) {
-      this.execute(step);
-    }
-  }
-  
-  public void exit() {
-    Sequence _exitSequence = this.flow.getExitSequence();
-    EList<Step> _steps = _exitSequence.getSteps();
-    for (final Step step : _steps) {
-      this.execute(step);
-    }
-  }
-  
-  protected Object _execute(final Step step) {
-    String _plus = ("Missing dispatch function for " + step);
-    String _println = InputOutput.<String>println(_plus);
-    return _println;
-  }
-  
-  protected Object _execute(final Call call) {
-    Object _xblockexpression = null;
-    {
-      Step _step = call.getStep();
-      this.execute(_step);
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final Trace trace) {
-    Object _xblockexpression = null;
-    {
-      this.notifyTraceStepEntered(trace);
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final Check check) {
-    Statement _condition = check.getCondition();
-    boolean _equals = Objects.equal(_condition, null);
-    if (_equals) {
-      return Boolean.valueOf(true);
-    }
-    Statement _condition_1 = check.getCondition();
-    Object interpreterResult = this.interpreter.evaluateStatement(_condition_1, this.executionContext);
-    return interpreterResult;
-  }
-  
-  protected Object _execute(final EnterState enterState) {
-    Object _xblockexpression = null;
-    {
-      ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
-      ExecutionState _state = enterState.getState();
-      StateVector _stateVector = _state.getStateVector();
-      int _offset = _stateVector.getOffset();
-      ExecutionState _state_1 = enterState.getState();
-      ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).set(_offset, _state_1);
-      ExecutionState _state_2 = enterState.getState();
-      StateVector _stateVector_1 = _state_2.getStateVector();
-      int _offset_1 = _stateVector_1.getOffset();
-      this.nextSVIdx = _offset_1;
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final HistoryEntry entry) {
-    Object _xblockexpression = null;
-    {
-      ExecutionRegion _region = entry.getRegion();
-      ExecutionState _historyStateConfiguration = this.executionContext.getHistoryStateConfiguration(_region);
-      boolean _notEquals = (!Objects.equal(_historyStateConfiguration, null));
-      if (_notEquals) {
-        Step _historyStep = entry.getHistoryStep();
-        this.execute(_historyStep);
-      } else {
-        Step _initialStep = entry.getInitialStep();
-        boolean _equals = Objects.equal(_initialStep, null);
-        if (_equals) {
-          String _plus = ("Missing initial transition " + entry);
-          InputOutput.<String>println(_plus);
-        } else {
-          Step _initialStep_1 = entry.getInitialStep();
-          this.execute(_initialStep_1);
-        }
-      }
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final Execution execution) {
-    Statement _statement = execution.getStatement();
-    Object _evaluateStatement = this.interpreter.evaluateStatement(_statement, this.executionContext);
-    return _evaluateStatement;
-  }
-  
-  protected Object _execute(final ExitState exitState) {
-    Object _xblockexpression = null;
-    {
-      ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
-      ExecutionState _state = exitState.getState();
-      StateVector _stateVector = _state.getStateVector();
-      int _offset = _stateVector.getOffset();
-      ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).set(_offset, null);
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final If ifStep) {
-    Object _xblockexpression = null;
-    {
-      Check _check = ifStep.getCheck();
-      Object check = this.execute(_check);
-      if ((((Boolean) check)).booleanValue()) {
-        Step _thenStep = ifStep.getThenStep();
-        this.execute(_thenStep);
-      } else {
-        Step _elseStep = ifStep.getElseStep();
-        boolean _notEquals = (!Objects.equal(_elseStep, null));
-        if (_notEquals) {
-          Step _elseStep_1 = ifStep.getElseStep();
-          this.execute(_elseStep_1);
-        }
-      }
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final Sequence sequence) {
-    Object _xblockexpression = null;
-    {
-      EList<Step> _steps = sequence.getSteps();
-      for (final Step step : _steps) {
-        this.execute(step);
-      }
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final SaveHistory action) {
-    Object _xblockexpression = null;
-    {
-      ExecutionRegion _region = action.getRegion();
-      this.executionContext.saveHistoryStateConfiguration(_region);
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final StateSwitch stateSwitch) {
-    Object _xblockexpression = null;
-    {
-      final ExecutionRegion historyRegion = stateSwitch.getHistoryRegion();
-      boolean _notEquals = (!Objects.equal(historyRegion, null));
-      if (_notEquals) {
-        final ExecutionState historyState = this.executionContext.getHistoryStateConfiguration(historyRegion);
-        EList<StateCase> _cases = stateSwitch.getCases();
-        for (final StateCase stateCase : _cases) {
-          ExecutionState _state = stateCase.getState();
-          boolean _equals = Objects.equal(historyState, _state);
-          if (_equals) {
-            Step _step = stateCase.getStep();
-            this.execute(_step);
-          }
-        }
-      } else {
-        EList<StateCase> _cases_1 = stateSwitch.getCases();
-        for (final StateCase stateCase_1 : _cases_1) {
-          ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
-          ExecutionState _state_1 = stateCase_1.getState();
-          boolean _contains = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).contains(_state_1);
-          if (_contains) {
-            Step _step_1 = stateCase_1.getStep();
-            this.execute(_step_1);
-          }
-        }
-      }
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final ScheduleTimeEvent scheduleTimeEvent) {
-    Object _xblockexpression = null;
-    {
-      TimeEvent timeEvent = scheduleTimeEvent.getTimeEvent();
-      Statement _timeValue = scheduleTimeEvent.getTimeValue();
-      Object duration = this.interpreter.evaluateStatement(_timeValue, this.executionContext);
-      String _name = timeEvent.getName();
-      boolean _isPeriodic = timeEvent.isPeriodic();
-      this.timingService.scheduleTimeEvent(this.executionContext, _name, _isPeriodic, (((Integer) duration)).intValue());
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final UnscheduleTimeEvent timeEvent) {
-    Object _xblockexpression = null;
-    {
-      TimeEvent _timeEvent = timeEvent.getTimeEvent();
-      String _name = _timeEvent.getName();
-      this.timingService.unscheduleTimeEvent(_name);
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  public IExecutionContext getExecutionContext() {
-    return this.executionContext;
-  }
-  
-  public void declareContents(final Scope scope) {
-    if (scope instanceof InterfaceScope) {
-      _declareContents((InterfaceScope)scope);
-      return;
-    } else if (scope instanceof InternalScope) {
-      _declareContents((InternalScope)scope);
-      return;
-    } else if (scope != null) {
-      _declareContents(scope);
-      return;
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(scope).toString());
-    }
-  }
-  
-  public void addToScope(final Declaration event) {
-    if (event instanceof TimeEvent) {
-      _addToScope((TimeEvent)event);
-      return;
-    } else if (event instanceof EventDefinition) {
-      _addToScope((EventDefinition)event);
-      return;
-    } else if (event instanceof OperationDefinition) {
-      _addToScope((OperationDefinition)event);
-      return;
-    } else if (event instanceof VariableDefinition) {
-      _addToScope((VariableDefinition)event);
-      return;
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(event).toString());
-    }
-  }
-  
-  public Object execute(final Step call) {
-    if (call instanceof Call) {
-      return _execute((Call)call);
-    } else if (call instanceof Check) {
-      return _execute((Check)call);
-    } else if (call instanceof EnterState) {
-      return _execute((EnterState)call);
-    } else if (call instanceof Execution) {
-      return _execute((Execution)call);
-    } else if (call instanceof ExitState) {
-      return _execute((ExitState)call);
-    } else if (call instanceof HistoryEntry) {
-      return _execute((HistoryEntry)call);
-    } else if (call instanceof If) {
-      return _execute((If)call);
-    } else if (call instanceof SaveHistory) {
-      return _execute((SaveHistory)call);
-    } else if (call instanceof ScheduleTimeEvent) {
-      return _execute((ScheduleTimeEvent)call);
-    } else if (call instanceof Sequence) {
-      return _execute((Sequence)call);
-    } else if (call instanceof StateSwitch) {
-      return _execute((StateSwitch)call);
-    } else if (call instanceof Trace) {
-      return _execute((Trace)call);
-    } else if (call instanceof UnscheduleTimeEvent) {
-      return _execute((UnscheduleTimeEvent)call);
-    } else if (call != null) {
-      return _execute(call);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(call).toString());
-    }
-  }
-}

+ 0 - 580
plugins/org.yakindu.sct.model.sexec.interpreter/xtend-gen/org/yakindu/sct/model/sexec/interpreter/stext/StextStatementInterpreter.java

@@ -1,580 +0,0 @@
-package org.yakindu.sct.model.sexec.interpreter.stext;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.naming.QualifiedName;
-import org.eclipse.xtext.util.SimpleAttributeResolver;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.yakindu.sct.model.sexec.interpreter.stext.AbstractStatementInterpreter;
-import org.yakindu.sct.model.sexec.interpreter.stext.CoreFunction;
-import org.yakindu.sct.model.sgraph.RegularState;
-import org.yakindu.sct.model.sgraph.State;
-import org.yakindu.sct.model.sgraph.Statement;
-import org.yakindu.sct.model.stext.naming.StextNameProvider;
-import org.yakindu.sct.model.stext.stext.ActiveStateReferenceExpression;
-import org.yakindu.sct.model.stext.stext.AdditiveOperator;
-import org.yakindu.sct.model.stext.stext.AssignmentExpression;
-import org.yakindu.sct.model.stext.stext.AssignmentOperator;
-import org.yakindu.sct.model.stext.stext.BitwiseAndExpression;
-import org.yakindu.sct.model.stext.stext.BitwiseOrExpression;
-import org.yakindu.sct.model.stext.stext.BitwiseXorExpression;
-import org.yakindu.sct.model.stext.stext.BoolLiteral;
-import org.yakindu.sct.model.stext.stext.ConditionalExpression;
-import org.yakindu.sct.model.stext.stext.ElementReferenceExpression;
-import org.yakindu.sct.model.stext.stext.EventDefinition;
-import org.yakindu.sct.model.stext.stext.EventRaisingExpression;
-import org.yakindu.sct.model.stext.stext.EventValueReferenceExpression;
-import org.yakindu.sct.model.stext.stext.Expression;
-import org.yakindu.sct.model.stext.stext.FeatureCall;
-import org.yakindu.sct.model.stext.stext.HexLiteral;
-import org.yakindu.sct.model.stext.stext.IntLiteral;
-import org.yakindu.sct.model.stext.stext.Literal;
-import org.yakindu.sct.model.stext.stext.LogicalAndExpression;
-import org.yakindu.sct.model.stext.stext.LogicalNotExpression;
-import org.yakindu.sct.model.stext.stext.LogicalOrExpression;
-import org.yakindu.sct.model.stext.stext.LogicalRelationExpression;
-import org.yakindu.sct.model.stext.stext.MultiplicativeOperator;
-import org.yakindu.sct.model.stext.stext.NumericalAddSubtractExpression;
-import org.yakindu.sct.model.stext.stext.NumericalMultiplyDivideExpression;
-import org.yakindu.sct.model.stext.stext.NumericalUnaryExpression;
-import org.yakindu.sct.model.stext.stext.OperationDefinition;
-import org.yakindu.sct.model.stext.stext.ParenthesizedExpression;
-import org.yakindu.sct.model.stext.stext.PrimitiveValueExpression;
-import org.yakindu.sct.model.stext.stext.RealLiteral;
-import org.yakindu.sct.model.stext.stext.RelationalOperator;
-import org.yakindu.sct.model.stext.stext.ShiftExpression;
-import org.yakindu.sct.model.stext.stext.ShiftOperator;
-import org.yakindu.sct.model.stext.stext.StringLiteral;
-import org.yakindu.sct.model.stext.stext.UnaryOperator;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
-import org.yakindu.sct.simulation.core.runtime.impl.ExecutionEvent;
-import org.yakindu.sct.simulation.core.runtime.impl.ExecutionVariable;
-
-/**
- * @author andreas muelder - Initial contribution and API
- * @authos axel terfloth - additions
- */
-@SuppressWarnings("all")
-public class StextStatementInterpreter extends AbstractStatementInterpreter {
-  @Inject
-  private StextNameProvider provider;
-  
-  protected IExecutionContext context;
-  
-  public Object evaluateStatement(final Statement statement, final IExecutionContext context) {
-    Object _xblockexpression = null;
-    {
-      this.context = context;
-      Object _execute = this.execute(statement);
-      _xblockexpression = (_execute);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final Statement statement) {
-    return null;
-  }
-  
-  protected Object _execute(final AssignmentExpression assignment) {
-    Object _xblockexpression = null;
-    {
-      Expression _varRef = assignment.getVarRef();
-      EObject _variable = this.variable(_varRef);
-      QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_variable);
-      String _string = _fullyQualifiedName.toString();
-      ExecutionVariable scopeVariable = this.context.getVariable(_string);
-      Expression _expression = assignment.getExpression();
-      Object result = this.execute(_expression);
-      AssignmentOperator _operator = assignment.getOperator();
-      boolean _equals = Objects.equal(_operator, AssignmentOperator.ASSIGN);
-      if (_equals) {
-        String _name = scopeVariable.getName();
-        this.context.setSlotValue(_name, result);
-      } else {
-        AssignmentOperator _operator_1 = assignment.getOperator();
-        String _name_1 = _operator_1.getName();
-        String operator = AbstractStatementInterpreter.assignFunctionMap.get(_name_1);
-        String _name_2 = scopeVariable.getName();
-        Object _value = scopeVariable.getValue();
-        Object _evaluate = this.evaluate(operator, _value, result);
-        this.context.setSlotValue(_name_2, _evaluate);
-      }
-      String _name_3 = scopeVariable.getName();
-      ExecutionVariable _variable_1 = this.context.getVariable(_name_3);
-      Object _value_1 = _variable_1.getValue();
-      _xblockexpression = (_value_1);
-    }
-    return _xblockexpression;
-  }
-  
-  protected EObject _variable(final ElementReferenceExpression e) {
-    EObject _xifexpression = null;
-    EObject _reference = e.getReference();
-    if ((_reference instanceof VariableDefinition)) {
-      EObject _reference_1 = e.getReference();
-      _xifexpression = _reference_1;
-    } else {
-      _xifexpression = null;
-    }
-    return _xifexpression;
-  }
-  
-  protected EObject _variable(final FeatureCall e) {
-    EObject _xifexpression = null;
-    EObject _feature = e.getFeature();
-    if ((_feature instanceof VariableDefinition)) {
-      EObject _feature_1 = e.getFeature();
-      _xifexpression = _feature_1;
-    } else {
-      _xifexpression = null;
-    }
-    return _xifexpression;
-  }
-  
-  protected EObject _variable(final AssignmentExpression e) {
-    Expression _varRef = e.getVarRef();
-    EObject _variable = this.variable(_varRef);
-    return ((EObject) _variable);
-  }
-  
-  protected EObject _event(final ElementReferenceExpression e) {
-    EObject _xifexpression = null;
-    EObject _reference = e.getReference();
-    if ((_reference instanceof EventDefinition)) {
-      EObject _reference_1 = e.getReference();
-      _xifexpression = _reference_1;
-    } else {
-      _xifexpression = null;
-    }
-    return _xifexpression;
-  }
-  
-  protected EObject _event(final FeatureCall e) {
-    EObject _xifexpression = null;
-    EObject _feature = e.getFeature();
-    if ((_feature instanceof EventDefinition)) {
-      EObject _feature_1 = e.getFeature();
-      _xifexpression = _feature_1;
-    } else {
-      _xifexpression = null;
-    }
-    return _xifexpression;
-  }
-  
-  protected Object _execute(final EventRaisingExpression eventRaising) {
-    Object _xblockexpression = null;
-    {
-      Expression _value = eventRaising.getValue();
-      boolean _notEquals = (!Objects.equal(_value, null));
-      if (_notEquals) {
-        Expression _event = eventRaising.getEvent();
-        EObject _event_1 = this.event(_event);
-        QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_event_1);
-        String _string = _fullyQualifiedName.toString();
-        Expression _value_1 = eventRaising.getValue();
-        Object _execute = this.execute(_value_1);
-        this.context.raiseEvent(_string, _execute);
-      } else {
-        Expression _event_2 = eventRaising.getEvent();
-        EObject _event_3 = this.event(_event_2);
-        QualifiedName _fullyQualifiedName_1 = this.provider.getFullyQualifiedName(_event_3);
-        String _string_1 = _fullyQualifiedName_1.toString();
-        this.context.raiseEvent(_string_1, null);
-      }
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Object _execute(final ConditionalExpression expression) {
-    Expression _condition = expression.getCondition();
-    Object _execute = this.execute(_condition);
-    if ((((Boolean) _execute)).booleanValue()) {
-      Expression _trueCase = expression.getTrueCase();
-      return this.execute(_trueCase);
-    } else {
-      Expression _falseCase = expression.getFalseCase();
-      return this.execute(_falseCase);
-    }
-  }
-  
-  protected Object _execute(final ElementReferenceExpression expression) {
-    boolean _and = false;
-    boolean _isOperationCall = expression.isOperationCall();
-    if (!_isOperationCall) {
-      _and = false;
-    } else {
-      int _size = super.operationCallback.size();
-      boolean _greaterThan = (_size > 0);
-      _and = (_isOperationCall && _greaterThan);
-    }
-    if (_and) {
-      EList<Expression> _args = expression.getArgs();
-      final Function1<Expression,Object> _function = new Function1<Expression,Object>() {
-          public Object apply(final Expression it) {
-            Object _execute = StextStatementInterpreter.this.execute(it);
-            return _execute;
-          }
-        };
-      List<Object> parameter = ListExtensions.<Expression, Object>map(_args, _function);
-      EObject _reference = expression.getReference();
-      Object[] _array = parameter.toArray();
-      return super.executeOperationCallback(((OperationDefinition) _reference), _array);
-    }
-    EObject _reference_1 = expression.getReference();
-    QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_reference_1);
-    String _string = _fullyQualifiedName.toString();
-    ExecutionVariable variableRef = this.context.getVariable(_string);
-    boolean _notEquals = (!Objects.equal(variableRef, null));
-    if (_notEquals) {
-      return variableRef.getValue();
-    }
-    EObject _reference_2 = expression.getReference();
-    QualifiedName _fullyQualifiedName_1 = this.provider.getFullyQualifiedName(_reference_2);
-    String _string_1 = _fullyQualifiedName_1.toString();
-    return Boolean.valueOf(this.context.isEventRaised(_string_1));
-  }
-  
-  protected Object _execute(final EventValueReferenceExpression expression) {
-    Object _xblockexpression = null;
-    {
-      List<ExecutionEvent> _raisedEvents = this.context.getRaisedEvents();
-      for (final ExecutionEvent event : _raisedEvents) {
-        String _name = event.getName();
-        Expression _value = expression.getValue();
-        String _qname = this.qname(_value);
-        Boolean _equals = this.equals(_name, _qname);
-        if ((_equals).booleanValue()) {
-          return event.getValue();
-        }
-      }
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  public String name(final EObject e) {
-    return SimpleAttributeResolver.NAME_RESOLVER.apply(e);
-  }
-  
-  protected String _qname(final FeatureCall e) {
-    EObject _feature = e.getFeature();
-    QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_feature);
-    return _fullyQualifiedName.toString();
-  }
-  
-  protected String _qname(final ElementReferenceExpression e) {
-    EObject _reference = e.getReference();
-    QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_reference);
-    String _string = _fullyQualifiedName.toString();
-    return _string;
-  }
-  
-  protected Object _execute(final ActiveStateReferenceExpression expression) {
-    Set<RegularState> _allActiveStates = this.context.getAllActiveStates();
-    for (final RegularState activeState : _allActiveStates) {
-      State _value = expression.getValue();
-      boolean _equals = Objects.equal(activeState, _value);
-      if (_equals) {
-        return Boolean.valueOf(true);
-      }
-    }
-    return Boolean.valueOf(false);
-  }
-  
-  protected Object _execute(final LogicalAndExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Object leftResult = this.execute(_leftOperand);
-    boolean _not = (!((Boolean) leftResult));
-    if (_not) {
-      return Boolean.valueOf(false);
-    }
-    Expression _rightOperand = expression.getRightOperand();
-    Object rightResult = this.execute(_rightOperand);
-    boolean _and = false;
-    if (!(((Boolean) leftResult)).booleanValue()) {
-      _and = false;
-    } else {
-      _and = ((((Boolean) leftResult)).booleanValue() && (((Boolean) rightResult)).booleanValue());
-    }
-    return Boolean.valueOf(_and);
-  }
-  
-  protected Object _execute(final LogicalOrExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Object leftResult = this.execute(_leftOperand);
-    if ((((Boolean) leftResult)).booleanValue()) {
-      return Boolean.valueOf(true);
-    }
-    Expression _rightOperand = expression.getRightOperand();
-    Object rightResult = this.execute(_rightOperand);
-    boolean _or = false;
-    if ((((Boolean) leftResult)).booleanValue()) {
-      _or = true;
-    } else {
-      _or = ((((Boolean) leftResult)).booleanValue() || (((Boolean) rightResult)).booleanValue());
-    }
-    return Boolean.valueOf(_or);
-  }
-  
-  protected Object _execute(final LogicalNotExpression expression) {
-    Expression _operand = expression.getOperand();
-    Object _execute = this.execute(_operand);
-    return Boolean.valueOf((!((Boolean) _execute)));
-  }
-  
-  protected Object _execute(final BitwiseAndExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Expression _rightOperand = expression.getRightOperand();
-    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, CoreFunction.BIT_AND);
-    return _executeBinaryCoreFunction;
-  }
-  
-  protected Object _execute(final BitwiseOrExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Expression _rightOperand = expression.getRightOperand();
-    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, CoreFunction.BIT_OR);
-    return _executeBinaryCoreFunction;
-  }
-  
-  protected Object _execute(final BitwiseXorExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Expression _rightOperand = expression.getRightOperand();
-    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, CoreFunction.BIT_XOR);
-    return _executeBinaryCoreFunction;
-  }
-  
-  protected Object _execute(final LogicalRelationExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Expression _rightOperand = expression.getRightOperand();
-    RelationalOperator _operator = expression.getOperator();
-    String _name = _operator.getName();
-    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, _name);
-    return _executeBinaryCoreFunction;
-  }
-  
-  protected Object _execute(final NumericalAddSubtractExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Expression _rightOperand = expression.getRightOperand();
-    AdditiveOperator _operator = expression.getOperator();
-    String _literal = _operator.getLiteral();
-    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, _literal);
-    return _executeBinaryCoreFunction;
-  }
-  
-  protected Object _execute(final NumericalMultiplyDivideExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Expression _rightOperand = expression.getRightOperand();
-    MultiplicativeOperator _operator = expression.getOperator();
-    String _name = _operator.getName();
-    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, _name);
-    return _executeBinaryCoreFunction;
-  }
-  
-  protected Object _execute(final ShiftExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Expression _rightOperand = expression.getRightOperand();
-    ShiftOperator _operator = expression.getOperator();
-    String _name = _operator.getName();
-    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, _name);
-    return _executeBinaryCoreFunction;
-  }
-  
-  protected Object _execute(final NumericalUnaryExpression expression) {
-    Expression _operand = expression.getOperand();
-    UnaryOperator _operator = expression.getOperator();
-    String _name = _operator.getName();
-    Object _executeUnaryCoreFunction = this.executeUnaryCoreFunction(_operand, _name);
-    return _executeUnaryCoreFunction;
-  }
-  
-  public Object executeBinaryCoreFunction(final Statement leftStatement, final Statement rightStatement, final String operator) {
-    Object leftResult = this.execute(leftStatement);
-    Object rightResult = this.execute(rightStatement);
-    return this.evaluate(operator, leftResult, rightResult);
-  }
-  
-  public Object executeUnaryCoreFunction(final Statement statement, final String operator) {
-    Object result = this.execute(statement);
-    return this.evaluate(operator, result);
-  }
-  
-  protected Object _execute(final FeatureCall call) {
-    boolean _and = false;
-    boolean _isOperationCall = call.isOperationCall();
-    if (!_isOperationCall) {
-      _and = false;
-    } else {
-      int _size = super.operationCallback.size();
-      boolean _greaterThan = (_size > 0);
-      _and = (_isOperationCall && _greaterThan);
-    }
-    if (_and) {
-      EList<Expression> _args = call.getArgs();
-      final Function1<Expression,Object> _function = new Function1<Expression,Object>() {
-          public Object apply(final Expression it) {
-            Object _execute = StextStatementInterpreter.this.execute(it);
-            return _execute;
-          }
-        };
-      List<Object> parameter = ListExtensions.<Expression, Object>map(_args, _function);
-      EObject _feature = call.getFeature();
-      Object[] _array = parameter.toArray();
-      return super.executeOperationCallback(((OperationDefinition) _feature), _array);
-    } else {
-      EObject _feature_1 = call.getFeature();
-      String fqn = this.fqn(_feature_1);
-      ExecutionVariable variableRef = this.context.getVariable(fqn);
-      boolean _notEquals = (!Objects.equal(variableRef, null));
-      if (_notEquals) {
-        return variableRef.getValue();
-      }
-      return Boolean.valueOf(this.context.isEventRaised(fqn));
-    }
-  }
-  
-  public String fqn(final EObject obj) {
-    QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(obj);
-    String _string = _fullyQualifiedName.toString();
-    return _string;
-  }
-  
-  protected Object _execute(final ParenthesizedExpression e) {
-    Expression _expression = e.getExpression();
-    Object _execute = this.execute(_expression);
-    return _execute;
-  }
-  
-  protected Object _execute(final PrimitiveValueExpression expression) {
-    Literal _value = expression.getValue();
-    return ((Comparable<Object>)this.valueLiteral(_value));
-  }
-  
-  protected Object _valueLiteral(final IntLiteral literal) {
-    return Integer.valueOf(literal.getValue());
-  }
-  
-  protected Object _valueLiteral(final HexLiteral literal) {
-    return Integer.valueOf(literal.getValue());
-  }
-  
-  protected Object _valueLiteral(final BoolLiteral bool) {
-    return Boolean.valueOf(bool.isValue());
-  }
-  
-  protected Object _valueLiteral(final RealLiteral literal) {
-    return Float.valueOf(literal.getValue());
-  }
-  
-  protected Object _valueLiteral(final StringLiteral literal) {
-    return literal.getValue();
-  }
-  
-  public Object execute(final Statement expression) {
-    if (expression instanceof ActiveStateReferenceExpression) {
-      return _execute((ActiveStateReferenceExpression)expression);
-    } else if (expression instanceof AssignmentExpression) {
-      return _execute((AssignmentExpression)expression);
-    } else if (expression instanceof BitwiseAndExpression) {
-      return _execute((BitwiseAndExpression)expression);
-    } else if (expression instanceof BitwiseOrExpression) {
-      return _execute((BitwiseOrExpression)expression);
-    } else if (expression instanceof BitwiseXorExpression) {
-      return _execute((BitwiseXorExpression)expression);
-    } else if (expression instanceof ConditionalExpression) {
-      return _execute((ConditionalExpression)expression);
-    } else if (expression instanceof ElementReferenceExpression) {
-      return _execute((ElementReferenceExpression)expression);
-    } else if (expression instanceof EventRaisingExpression) {
-      return _execute((EventRaisingExpression)expression);
-    } else if (expression instanceof EventValueReferenceExpression) {
-      return _execute((EventValueReferenceExpression)expression);
-    } else if (expression instanceof FeatureCall) {
-      return _execute((FeatureCall)expression);
-    } else if (expression instanceof LogicalAndExpression) {
-      return _execute((LogicalAndExpression)expression);
-    } else if (expression instanceof LogicalNotExpression) {
-      return _execute((LogicalNotExpression)expression);
-    } else if (expression instanceof LogicalOrExpression) {
-      return _execute((LogicalOrExpression)expression);
-    } else if (expression instanceof LogicalRelationExpression) {
-      return _execute((LogicalRelationExpression)expression);
-    } else if (expression instanceof NumericalAddSubtractExpression) {
-      return _execute((NumericalAddSubtractExpression)expression);
-    } else if (expression instanceof NumericalMultiplyDivideExpression) {
-      return _execute((NumericalMultiplyDivideExpression)expression);
-    } else if (expression instanceof NumericalUnaryExpression) {
-      return _execute((NumericalUnaryExpression)expression);
-    } else if (expression instanceof ParenthesizedExpression) {
-      return _execute((ParenthesizedExpression)expression);
-    } else if (expression instanceof PrimitiveValueExpression) {
-      return _execute((PrimitiveValueExpression)expression);
-    } else if (expression instanceof ShiftExpression) {
-      return _execute((ShiftExpression)expression);
-    } else if (expression != null) {
-      return _execute(expression);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(expression).toString());
-    }
-  }
-  
-  public EObject variable(final Expression e) {
-    if (e instanceof AssignmentExpression) {
-      return _variable((AssignmentExpression)e);
-    } else if (e instanceof ElementReferenceExpression) {
-      return _variable((ElementReferenceExpression)e);
-    } else if (e instanceof FeatureCall) {
-      return _variable((FeatureCall)e);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(e).toString());
-    }
-  }
-  
-  public EObject event(final Expression e) {
-    if (e instanceof ElementReferenceExpression) {
-      return _event((ElementReferenceExpression)e);
-    } else if (e instanceof FeatureCall) {
-      return _event((FeatureCall)e);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(e).toString());
-    }
-  }
-  
-  public String qname(final Expression e) {
-    if (e instanceof ElementReferenceExpression) {
-      return _qname((ElementReferenceExpression)e);
-    } else if (e instanceof FeatureCall) {
-      return _qname((FeatureCall)e);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(e).toString());
-    }
-  }
-  
-  public Object valueLiteral(final Literal bool) {
-    if (bool instanceof BoolLiteral) {
-      return _valueLiteral((BoolLiteral)bool);
-    } else if (bool instanceof HexLiteral) {
-      return _valueLiteral((HexLiteral)bool);
-    } else if (bool instanceof IntLiteral) {
-      return _valueLiteral((IntLiteral)bool);
-    } else if (bool instanceof RealLiteral) {
-      return _valueLiteral((RealLiteral)bool);
-    } else if (bool instanceof StringLiteral) {
-      return _valueLiteral((StringLiteral)bool);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(bool).toString());
-    }
-  }
-}

+ 0 - 809
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/extensions/SExecExtensions.java

@@ -1,809 +0,0 @@
-package org.yakindu.sct.model.sexec.extensions;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.Functions.Function2;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-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.ExecutionNode;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionScope;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.Reaction;
-import org.yakindu.sct.model.sexec.Sequence;
-import org.yakindu.sct.model.sexec.StateVector;
-import org.yakindu.sct.model.sexec.Step;
-import org.yakindu.sct.model.sexec.TimeEvent;
-import org.yakindu.sct.model.sgraph.Declaration;
-import org.yakindu.sct.model.sgraph.Event;
-import org.yakindu.sct.model.sgraph.Scope;
-import org.yakindu.sct.model.stext.stext.Direction;
-import org.yakindu.sct.model.stext.stext.ElementReferenceExpression;
-import org.yakindu.sct.model.stext.stext.EventDefinition;
-import org.yakindu.sct.model.stext.stext.Expression;
-import org.yakindu.sct.model.stext.stext.FeatureCall;
-import org.yakindu.sct.model.stext.stext.InterfaceScope;
-import org.yakindu.sct.model.stext.stext.InternalScope;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-
-@SuppressWarnings("all")
-public class SExecExtensions {
-  public boolean isTimed(final ExecutionFlow it) {
-    EList<Scope> _scopes = it.getScopes();
-    final Function1<Scope,Boolean> _function = new Function1<Scope,Boolean>() {
-        public Boolean apply(final Scope it) {
-          EList<Declaration> _declarations = it.getDeclarations();
-          Iterable<TimeEvent> _filter = Iterables.<TimeEvent>filter(_declarations, TimeEvent.class);
-          int _size = IterableExtensions.size(_filter);
-          boolean _greaterThan = (_size > 0);
-          return Boolean.valueOf(_greaterThan);
-        }
-      };
-    Iterable<Scope> _filter = IterableExtensions.<Scope>filter(_scopes, _function);
-    int _size = IterableExtensions.size(_filter);
-    boolean _greaterThan = (_size > 0);
-    return _greaterThan;
-  }
-  
-  public boolean hasHistory(final ExecutionFlow it) {
-    boolean _and = false;
-    StateVector _historyVector = it.getHistoryVector();
-    boolean _notEquals = (!Objects.equal(_historyVector, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      StateVector _historyVector_1 = it.getHistoryVector();
-      int _size = _historyVector_1.getSize();
-      boolean _greaterThan = (_size > 0);
-      _and = (_notEquals && _greaterThan);
-    }
-    return _and;
-  }
-  
-  public boolean hasOutgoingEvents(final Scope it) {
-    List<EventDefinition> _outgoingEvents = this.getOutgoingEvents(it);
-    boolean _isEmpty = _outgoingEvents.isEmpty();
-    boolean _not = (!_isEmpty);
-    return _not;
-  }
-  
-  public List<EventDefinition> getOutgoingEvents(final Scope it) {
-    ArrayList<EventDefinition> _xblockexpression = null;
-    {
-      ArrayList<EventDefinition> _arrayList = new ArrayList<EventDefinition>();
-      final ArrayList<EventDefinition> events = _arrayList;
-      EList<Declaration> _declarations = it.getDeclarations();
-      Iterable<EventDefinition> _filter = Iterables.<EventDefinition>filter(_declarations, EventDefinition.class);
-      final Procedure1<EventDefinition> _function = new Procedure1<EventDefinition>() {
-          public void apply(final EventDefinition ev) {
-            Direction _direction = ev.getDirection();
-            boolean _equals = Objects.equal(_direction, Direction.OUT);
-            if (_equals) {
-              events.add(ev);
-            }
-          }
-        };
-      IterableExtensions.<EventDefinition>forEach(_filter, _function);
-      _xblockexpression = (events);
-    }
-    return _xblockexpression;
-  }
-  
-  public boolean hasIncomingEvents(final Scope it) {
-    List<EventDefinition> _incomingEvents = this.getIncomingEvents(it);
-    boolean _isEmpty = _incomingEvents.isEmpty();
-    boolean _not = (!_isEmpty);
-    return _not;
-  }
-  
-  public List<EventDefinition> getIncomingEvents(final Scope it) {
-    ArrayList<EventDefinition> _xblockexpression = null;
-    {
-      ArrayList<EventDefinition> _arrayList = new ArrayList<EventDefinition>();
-      final ArrayList<EventDefinition> events = _arrayList;
-      EList<Declaration> _declarations = it.getDeclarations();
-      Iterable<EventDefinition> _filter = Iterables.<EventDefinition>filter(_declarations, EventDefinition.class);
-      final Procedure1<EventDefinition> _function = new Procedure1<EventDefinition>() {
-          public void apply(final EventDefinition ev) {
-            Direction _direction = ev.getDirection();
-            boolean _equals = Objects.equal(_direction, Direction.IN);
-            if (_equals) {
-              events.add(ev);
-            }
-          }
-        };
-      IterableExtensions.<EventDefinition>forEach(_filter, _function);
-      _xblockexpression = (events);
-    }
-    return _xblockexpression;
-  }
-  
-  public Iterable<InterfaceScope> getInterfaceScopes(final ExecutionFlow it) {
-    EList<Scope> _scopes = it.getScopes();
-    Iterable<InterfaceScope> _filter = Iterables.<InterfaceScope>filter(_scopes, InterfaceScope.class);
-    return _filter;
-  }
-  
-  public Iterable<VariableDefinition> getVariableDefinitions(final Scope it) {
-    EList<Declaration> _declarations = it.getDeclarations();
-    Iterable<VariableDefinition> _filter = Iterables.<VariableDefinition>filter(_declarations, VariableDefinition.class);
-    return _filter;
-  }
-  
-  public InternalScope getInternalScope(final ExecutionFlow it) {
-    EList<Scope> _scopes = it.getScopes();
-    Iterable<InternalScope> _filter = Iterables.<InternalScope>filter(_scopes, InternalScope.class);
-    InternalScope _head = IterableExtensions.<InternalScope>head(_filter);
-    return _head;
-  }
-  
-  protected Declaration _definition(final ElementReferenceExpression it) {
-    Declaration _xifexpression = null;
-    EObject _reference = it.getReference();
-    if ((_reference instanceof Declaration)) {
-      EObject _reference_1 = it.getReference();
-      _xifexpression = ((Declaration) _reference_1);
-    }
-    return _xifexpression;
-  }
-  
-  protected Declaration _definition(final FeatureCall it) {
-    Declaration _xifexpression = null;
-    EObject _feature = it.getFeature();
-    if ((_feature instanceof Declaration)) {
-      EObject _feature_1 = it.getFeature();
-      _xifexpression = ((Declaration) _feature_1);
-    }
-    return _xifexpression;
-  }
-  
-  protected Declaration _definition(final Expression it) {
-    return null;
-  }
-  
-  public Event event(final Declaration it) {
-    Event _xifexpression = null;
-    if ((it instanceof Event)) {
-      _xifexpression = ((Event) it);
-    } else {
-      _xifexpression = null;
-    }
-    return _xifexpression;
-  }
-  
-  protected List<ExecutionState> _subStates(final ExecutionState it) {
-    EList<ExecutionScope> _subScopes = it.getSubScopes();
-    ArrayList<ExecutionState> _arrayList = new ArrayList<ExecutionState>();
-    final Function2<ArrayList<ExecutionState>,ExecutionScope,ArrayList<ExecutionState>> _function = new Function2<ArrayList<ExecutionState>,ExecutionScope,ArrayList<ExecutionState>>() {
-        public ArrayList<ExecutionState> apply(final ArrayList<ExecutionState> a, final ExecutionScope s) {
-          ArrayList<ExecutionState> _xblockexpression = null;
-          {
-            List<ExecutionState> _subStates = SExecExtensions.this.subStates(s);
-            a.addAll(_subStates);
-            _xblockexpression = (a);
-          }
-          return _xblockexpression;
-        }
-      };
-    ArrayList<ExecutionState> _fold = IterableExtensions.<ExecutionScope, ArrayList<ExecutionState>>fold(_subScopes, _arrayList, _function);
-    return _fold;
-  }
-  
-  protected List<ExecutionState> _subStates(final ExecutionRegion it) {
-    EList<ExecutionScope> _subScopes = it.getSubScopes();
-    ArrayList<ExecutionState> _arrayList = new ArrayList<ExecutionState>();
-    final Function2<ArrayList<ExecutionState>,ExecutionScope,ArrayList<ExecutionState>> _function = new Function2<ArrayList<ExecutionState>,ExecutionScope,ArrayList<ExecutionState>>() {
-        public ArrayList<ExecutionState> apply(final ArrayList<ExecutionState> a, final ExecutionScope s) {
-          ArrayList<ExecutionState> _xblockexpression = null;
-          {
-            a.add(((ExecutionState) s));
-            List<ExecutionState> _subStates = SExecExtensions.this.subStates(s);
-            a.addAll(_subStates);
-            _xblockexpression = (a);
-          }
-          return _xblockexpression;
-        }
-      };
-    ArrayList<ExecutionState> _fold = IterableExtensions.<ExecutionScope, ArrayList<ExecutionState>>fold(_subScopes, _arrayList, _function);
-    return _fold;
-  }
-  
-  protected List<ExecutionState> _subStates(final ExecutionScope it) {
-    ArrayList<ExecutionState> _arrayList = new ArrayList<ExecutionState>();
-    return _arrayList;
-  }
-  
-  public Iterable<Check> referencedChecks(final ExecutionNode it) {
-    EList<Reaction> _reactions = it.getReactions();
-    final Function1<Reaction,Boolean> _function = new Function1<Reaction,Boolean>() {
-        public Boolean apply(final Reaction r) {
-          boolean _and = false;
-          Check _check = r.getCheck();
-          boolean _notEquals = (!Objects.equal(_check, null));
-          if (!_notEquals) {
-            _and = false;
-          } else {
-            Check _check_1 = r.getCheck();
-            EList<CheckRef> _refs = _check_1.getRefs();
-            int _size = _refs.size();
-            boolean _greaterThan = (_size > 0);
-            _and = (_notEquals && _greaterThan);
-          }
-          return Boolean.valueOf(_and);
-        }
-      };
-    Iterable<Reaction> _filter = IterableExtensions.<Reaction>filter(_reactions, _function);
-    final Function1<Reaction,Check> _function_1 = new Function1<Reaction,Check>() {
-        public Check apply(final Reaction it) {
-          Check _check = it.getCheck();
-          return _check;
-        }
-      };
-    Iterable<Check> _map = IterableExtensions.<Reaction, Check>map(_filter, _function_1);
-    return _map;
-  }
-  
-  public Iterable<Step> referencedEffects(final ExecutionNode it) {
-    EList<Reaction> _reactions = it.getReactions();
-    final Function1<Reaction,Boolean> _function = new Function1<Reaction,Boolean>() {
-        public Boolean apply(final Reaction r) {
-          boolean _and = false;
-          Step _effect = r.getEffect();
-          boolean _notEquals = (!Objects.equal(_effect, null));
-          if (!_notEquals) {
-            _and = false;
-          } else {
-            Step _effect_1 = r.getEffect();
-            EList<Call> _caller = _effect_1.getCaller();
-            int _size = _caller.size();
-            boolean _greaterThan = (_size > 0);
-            _and = (_notEquals && _greaterThan);
-          }
-          return Boolean.valueOf(_and);
-        }
-      };
-    Iterable<Reaction> _filter = IterableExtensions.<Reaction>filter(_reactions, _function);
-    final Function1<Reaction,Step> _function_1 = new Function1<Reaction,Step>() {
-        public Step apply(final Reaction r) {
-          Step _effect = r.getEffect();
-          return _effect;
-        }
-      };
-    Iterable<Step> _map = IterableExtensions.<Reaction, Step>map(_filter, _function_1);
-    return _map;
-  }
-  
-  public List<Step> checkFunctions(final ExecutionFlow it) {
-    ArrayList<Step> _xblockexpression = null;
-    {
-      ArrayList<Step> _arrayList = new ArrayList<Step>();
-      final ArrayList<Step> funcs = _arrayList;
-      Iterable<Check> _referencedChecks = this.referencedChecks(it);
-      Iterables.<Step>addAll(funcs, _referencedChecks);
-      EList<ExecutionState> _states = it.getStates();
-      final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-          public void apply(final ExecutionState s) {
-            Iterable<Check> _referencedChecks = SExecExtensions.this.referencedChecks(s);
-            Iterables.<Step>addAll(funcs, _referencedChecks);
-          }
-        };
-      IterableExtensions.<ExecutionState>forEach(_states, _function);
-      EList<ExecutionNode> _nodes = it.getNodes();
-      final Procedure1<ExecutionNode> _function_1 = new Procedure1<ExecutionNode>() {
-          public void apply(final ExecutionNode n) {
-            Iterable<Check> _referencedChecks = SExecExtensions.this.referencedChecks(n);
-            Iterables.<Step>addAll(funcs, _referencedChecks);
-          }
-        };
-      IterableExtensions.<ExecutionNode>forEach(_nodes, _function_1);
-      _xblockexpression = (funcs);
-    }
-    return _xblockexpression;
-  }
-  
-  public List<Step> effectFunctions(final ExecutionFlow it) {
-    ArrayList<Step> _arrayList = new ArrayList<Step>();
-    final ArrayList<Step> funcs = _arrayList;
-    Iterable<Step> _referencedEffects = this.referencedEffects(it);
-    Iterables.<Step>addAll(funcs, _referencedEffects);
-    EList<ExecutionState> _states = it.getStates();
-    final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState s) {
-          Iterable<Step> _referencedEffects = SExecExtensions.this.referencedEffects(s);
-          Iterables.<Step>addAll(funcs, _referencedEffects);
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states, _function);
-    EList<ExecutionNode> _nodes = it.getNodes();
-    final Procedure1<ExecutionNode> _function_1 = new Procedure1<ExecutionNode>() {
-        public void apply(final ExecutionNode n) {
-          Iterable<Step> _referencedEffects = SExecExtensions.this.referencedEffects(n);
-          Iterables.<Step>addAll(funcs, _referencedEffects);
-        }
-      };
-    IterableExtensions.<ExecutionNode>forEach(_nodes, _function_1);
-    return funcs;
-  }
-  
-  public List<Step> entryActionFunctions(final ExecutionFlow it) {
-    ArrayList<Step> _arrayList = new ArrayList<Step>();
-    final ArrayList<Step> funcs = _arrayList;
-    Step _entryAction = it.getEntryAction();
-    boolean _isCalled = this.isCalled(_entryAction);
-    if (_isCalled) {
-      Step _entryAction_1 = it.getEntryAction();
-      funcs.add(_entryAction_1);
-    }
-    EList<ExecutionState> _states = it.getStates();
-    final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState s) {
-          Step _entryAction = s.getEntryAction();
-          boolean _isCalled = SExecExtensions.this.isCalled(_entryAction);
-          if (_isCalled) {
-            Step _entryAction_1 = s.getEntryAction();
-            funcs.add(_entryAction_1);
-          }
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states, _function);
-    return funcs;
-  }
-  
-  public List<Step> exitActionFunctions(final ExecutionFlow it) {
-    ArrayList<Step> _arrayList = new ArrayList<Step>();
-    final ArrayList<Step> funcs = _arrayList;
-    Step _exitAction = it.getExitAction();
-    boolean _isCalled = this.isCalled(_exitAction);
-    if (_isCalled) {
-      Step _exitAction_1 = it.getExitAction();
-      funcs.add(_exitAction_1);
-    }
-    EList<ExecutionState> _states = it.getStates();
-    final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState s) {
-          Step _exitAction = s.getExitAction();
-          boolean _isCalled = SExecExtensions.this.isCalled(_exitAction);
-          if (_isCalled) {
-            Step _exitAction_1 = s.getExitAction();
-            funcs.add(_exitAction_1);
-          }
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states, _function);
-    return funcs;
-  }
-  
-  public boolean isCalled(final Step it) {
-    boolean _and = false;
-    boolean _notEquals = (!Objects.equal(it, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      EList<Call> _caller = it.getCaller();
-      int _size = _caller.size();
-      boolean _greaterThan = (_size > 0);
-      _and = (_notEquals && _greaterThan);
-    }
-    return _and;
-  }
-  
-  public List<Step> enterSequenceFunctions(final ExecutionFlow it) {
-    ArrayList<Step> _arrayList = new ArrayList<Step>();
-    final ArrayList<Step> funcs = _arrayList;
-    Sequence _enterSequence = it.getEnterSequence();
-    boolean _isCalled = this.isCalled(_enterSequence);
-    if (_isCalled) {
-      Sequence _enterSequence_1 = it.getEnterSequence();
-      funcs.add(_enterSequence_1);
-    }
-    EList<ExecutionState> _states = it.getStates();
-    final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState s) {
-          Sequence _enterSequence = s.getEnterSequence();
-          boolean _isCalled = SExecExtensions.this.isCalled(_enterSequence);
-          if (_isCalled) {
-            Sequence _enterSequence_1 = s.getEnterSequence();
-            funcs.add(_enterSequence_1);
-          }
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states, _function);
-    EList<ExecutionRegion> _regions = it.getRegions();
-    final Procedure1<ExecutionRegion> _function_1 = new Procedure1<ExecutionRegion>() {
-        public void apply(final ExecutionRegion s) {
-          Sequence _enterSequence = s.getEnterSequence();
-          boolean _isCalled = SExecExtensions.this.isCalled(_enterSequence);
-          if (_isCalled) {
-            Sequence _enterSequence_1 = s.getEnterSequence();
-            funcs.add(_enterSequence_1);
-          }
-          Sequence _deepEnterSequence = s.getDeepEnterSequence();
-          boolean _isCalled_1 = SExecExtensions.this.isCalled(_deepEnterSequence);
-          if (_isCalled_1) {
-            Sequence _deepEnterSequence_1 = s.getDeepEnterSequence();
-            funcs.add(_deepEnterSequence_1);
-          }
-          Sequence _shallowEnterSequence = s.getShallowEnterSequence();
-          boolean _isCalled_2 = SExecExtensions.this.isCalled(_shallowEnterSequence);
-          if (_isCalled_2) {
-            Sequence _shallowEnterSequence_1 = s.getShallowEnterSequence();
-            funcs.add(_shallowEnterSequence_1);
-          }
-        }
-      };
-    IterableExtensions.<ExecutionRegion>forEach(_regions, _function_1);
-    return funcs;
-  }
-  
-  public List<Step> exitSequenceFunctions(final ExecutionFlow it) {
-    ArrayList<Step> _arrayList = new ArrayList<Step>();
-    final ArrayList<Step> funcs = _arrayList;
-    Sequence _exitSequence = it.getExitSequence();
-    boolean _isCalled = this.isCalled(_exitSequence);
-    if (_isCalled) {
-      Sequence _exitSequence_1 = it.getExitSequence();
-      funcs.add(_exitSequence_1);
-    }
-    EList<ExecutionState> _states = it.getStates();
-    final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState s) {
-          Sequence _exitSequence = s.getExitSequence();
-          boolean _isCalled = SExecExtensions.this.isCalled(_exitSequence);
-          if (_isCalled) {
-            Sequence _exitSequence_1 = s.getExitSequence();
-            funcs.add(_exitSequence_1);
-          }
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states, _function);
-    EList<ExecutionRegion> _regions = it.getRegions();
-    final Procedure1<ExecutionRegion> _function_1 = new Procedure1<ExecutionRegion>() {
-        public void apply(final ExecutionRegion s) {
-          Sequence _exitSequence = s.getExitSequence();
-          boolean _isCalled = SExecExtensions.this.isCalled(_exitSequence);
-          if (_isCalled) {
-            Sequence _exitSequence_1 = s.getExitSequence();
-            funcs.add(_exitSequence_1);
-          }
-        }
-      };
-    IterableExtensions.<ExecutionRegion>forEach(_regions, _function_1);
-    return funcs;
-  }
-  
-  public List<Step> reactFunctions(final ExecutionFlow it) {
-    ArrayList<Step> _arrayList = new ArrayList<Step>();
-    final ArrayList<Step> funcs = _arrayList;
-    Sequence _reactSequence = it.getReactSequence();
-    boolean _isCalled = this.isCalled(_reactSequence);
-    if (_isCalled) {
-      Sequence _reactSequence_1 = it.getReactSequence();
-      funcs.add(_reactSequence_1);
-    }
-    EList<ExecutionState> _states = it.getStates();
-    final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState s) {
-          Sequence _reactSequence = s.getReactSequence();
-          boolean _isCalled = SExecExtensions.this.isCalled(_reactSequence);
-          if (_isCalled) {
-            Sequence _reactSequence_1 = s.getReactSequence();
-            funcs.add(_reactSequence_1);
-          }
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states, _function);
-    EList<ExecutionNode> _nodes = it.getNodes();
-    final Procedure1<ExecutionNode> _function_1 = new Procedure1<ExecutionNode>() {
-        public void apply(final ExecutionNode s) {
-          Sequence _reactSequence = s.getReactSequence();
-          boolean _isCalled = SExecExtensions.this.isCalled(_reactSequence);
-          if (_isCalled) {
-            Sequence _reactSequence_1 = s.getReactSequence();
-            funcs.add(_reactSequence_1);
-          }
-        }
-      };
-    IterableExtensions.<ExecutionNode>forEach(_nodes, _function_1);
-    return funcs;
-  }
-  
-  protected Reaction _reaction(final Check it) {
-    EObject _eContainer = it.eContainer();
-    return ((Reaction) _eContainer);
-  }
-  
-  protected Reaction _reaction(final EObject it) {
-    EObject _eContainer = it.eContainer();
-    Reaction _reaction = _eContainer==null?(Reaction)null:this.reaction(_eContainer);
-    return _reaction;
-  }
-  
-  protected Reaction _reaction(final Reaction it) {
-    return it;
-  }
-  
-  public boolean isEntryAction(final Step it) {
-    EObject _eContainer = it.eContainer();
-    boolean _isEntryAction = this.isEntryAction(_eContainer, it);
-    return _isEntryAction;
-  }
-  
-  protected boolean _isEntryAction(final ExecutionFlow it, final Step s) {
-    Step _entryAction = it.getEntryAction();
-    boolean _equals = Objects.equal(_entryAction, s);
-    return _equals;
-  }
-  
-  protected boolean _isEntryAction(final ExecutionState it, final Step s) {
-    Step _entryAction = it.getEntryAction();
-    boolean _equals = Objects.equal(_entryAction, s);
-    return _equals;
-  }
-  
-  protected boolean _isEntryAction(final EObject it, final Step s) {
-    return false;
-  }
-  
-  public boolean isExitAction(final Step it) {
-    EObject _eContainer = it.eContainer();
-    boolean _isExitAction = this.isExitAction(_eContainer, it);
-    return _isExitAction;
-  }
-  
-  protected boolean _isExitAction(final ExecutionFlow it, final Step s) {
-    Step _exitAction = it.getExitAction();
-    boolean _equals = Objects.equal(_exitAction, s);
-    return _equals;
-  }
-  
-  protected boolean _isExitAction(final ExecutionState it, final Step s) {
-    Step _exitAction = it.getExitAction();
-    boolean _equals = Objects.equal(_exitAction, s);
-    return _equals;
-  }
-  
-  protected boolean _isExitAction(final EObject it, final Step s) {
-    return false;
-  }
-  
-  public boolean isEffect(final Step it) {
-    EObject _eContainer = it.eContainer();
-    boolean _isEffect = this.isEffect(_eContainer, it);
-    return _isEffect;
-  }
-  
-  protected boolean _isEffect(final Reaction it, final Step s) {
-    Step _effect = it.getEffect();
-    boolean _equals = Objects.equal(_effect, s);
-    return _equals;
-  }
-  
-  protected boolean _isEffect(final EObject it, final Step s) {
-    return false;
-  }
-  
-  public boolean isEnterSequence(final Step it) {
-    EObject _eContainer = it.eContainer();
-    boolean _isEnterSequence = this.isEnterSequence(_eContainer, it);
-    return _isEnterSequence;
-  }
-  
-  protected boolean _isEnterSequence(final ExecutionScope it, final Step s) {
-    Sequence _enterSequence = it.getEnterSequence();
-    boolean _equals = Objects.equal(_enterSequence, s);
-    return _equals;
-  }
-  
-  protected boolean _isEnterSequence(final EObject it, final Step s) {
-    return false;
-  }
-  
-  public boolean isDeepEnterSequence(final Step it) {
-    EObject _eContainer = it.eContainer();
-    boolean _isDeepEnterSequence = this.isDeepEnterSequence(_eContainer, it);
-    return _isDeepEnterSequence;
-  }
-  
-  protected boolean _isDeepEnterSequence(final ExecutionRegion it, final Step s) {
-    Sequence _deepEnterSequence = it.getDeepEnterSequence();
-    boolean _equals = Objects.equal(_deepEnterSequence, s);
-    return _equals;
-  }
-  
-  protected boolean _isDeepEnterSequence(final EObject it, final Step s) {
-    return false;
-  }
-  
-  public boolean isShallowEnterSequence(final Step it) {
-    EObject _eContainer = it.eContainer();
-    boolean _isShallowEnterSequence = this.isShallowEnterSequence(_eContainer, it);
-    return _isShallowEnterSequence;
-  }
-  
-  protected boolean _isShallowEnterSequence(final ExecutionRegion it, final Step s) {
-    Sequence _shallowEnterSequence = it.getShallowEnterSequence();
-    boolean _equals = Objects.equal(_shallowEnterSequence, s);
-    return _equals;
-  }
-  
-  protected boolean _isShallowEnterSequence(final EObject it, final Step s) {
-    return false;
-  }
-  
-  public boolean isExitSequence(final Step it) {
-    EObject _eContainer = it.eContainer();
-    boolean _isExitSequence = this.isExitSequence(_eContainer, it);
-    return _isExitSequence;
-  }
-  
-  protected boolean _isExitSequence(final ExecutionScope it, final Step s) {
-    Sequence _exitSequence = it.getExitSequence();
-    boolean _equals = Objects.equal(_exitSequence, s);
-    return _equals;
-  }
-  
-  protected boolean _isExitSequence(final EObject it, final Step s) {
-    return false;
-  }
-  
-  public boolean isReactSequence(final Step it) {
-    EObject _eContainer = it.eContainer();
-    boolean _isReactSequence = this.isReactSequence(_eContainer, it);
-    return _isReactSequence;
-  }
-  
-  protected boolean _isReactSequence(final ExecutionNode it, final Step s) {
-    Sequence _reactSequence = it.getReactSequence();
-    boolean _equals = Objects.equal(_reactSequence, s);
-    return _equals;
-  }
-  
-  protected boolean _isReactSequence(final EObject it, final Step s) {
-    return false;
-  }
-  
-  public boolean isCheckFunction(final Step it) {
-    return (it instanceof Check);
-  }
-  
-  public Declaration definition(final Expression it) {
-    if (it instanceof ElementReferenceExpression) {
-      return _definition((ElementReferenceExpression)it);
-    } else if (it instanceof FeatureCall) {
-      return _definition((FeatureCall)it);
-    } else if (it != null) {
-      return _definition(it);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it).toString());
-    }
-  }
-  
-  public List<ExecutionState> subStates(final ExecutionScope it) {
-    if (it instanceof ExecutionRegion) {
-      return _subStates((ExecutionRegion)it);
-    } else if (it instanceof ExecutionState) {
-      return _subStates((ExecutionState)it);
-    } else if (it != null) {
-      return _subStates(it);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it).toString());
-    }
-  }
-  
-  public Reaction reaction(final EObject it) {
-    if (it instanceof Check) {
-      return _reaction((Check)it);
-    } else if (it instanceof Reaction) {
-      return _reaction((Reaction)it);
-    } else if (it != null) {
-      return _reaction(it);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it).toString());
-    }
-  }
-  
-  public boolean isEntryAction(final EObject it, final Step s) {
-    if (it instanceof ExecutionFlow) {
-      return _isEntryAction((ExecutionFlow)it, s);
-    } else if (it instanceof ExecutionState) {
-      return _isEntryAction((ExecutionState)it, s);
-    } else if (it != null) {
-      return _isEntryAction(it, s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it, s).toString());
-    }
-  }
-  
-  public boolean isExitAction(final EObject it, final Step s) {
-    if (it instanceof ExecutionFlow) {
-      return _isExitAction((ExecutionFlow)it, s);
-    } else if (it instanceof ExecutionState) {
-      return _isExitAction((ExecutionState)it, s);
-    } else if (it != null) {
-      return _isExitAction(it, s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it, s).toString());
-    }
-  }
-  
-  public boolean isEffect(final EObject it, final Step s) {
-    if (it instanceof Reaction) {
-      return _isEffect((Reaction)it, s);
-    } else if (it != null) {
-      return _isEffect(it, s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it, s).toString());
-    }
-  }
-  
-  public boolean isEnterSequence(final EObject it, final Step s) {
-    if (it instanceof ExecutionScope) {
-      return _isEnterSequence((ExecutionScope)it, s);
-    } else if (it != null) {
-      return _isEnterSequence(it, s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it, s).toString());
-    }
-  }
-  
-  public boolean isDeepEnterSequence(final EObject it, final Step s) {
-    if (it instanceof ExecutionRegion) {
-      return _isDeepEnterSequence((ExecutionRegion)it, s);
-    } else if (it != null) {
-      return _isDeepEnterSequence(it, s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it, s).toString());
-    }
-  }
-  
-  public boolean isShallowEnterSequence(final EObject it, final Step s) {
-    if (it instanceof ExecutionRegion) {
-      return _isShallowEnterSequence((ExecutionRegion)it, s);
-    } else if (it != null) {
-      return _isShallowEnterSequence(it, s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it, s).toString());
-    }
-  }
-  
-  public boolean isExitSequence(final EObject it, final Step s) {
-    if (it instanceof ExecutionScope) {
-      return _isExitSequence((ExecutionScope)it, s);
-    } else if (it != null) {
-      return _isExitSequence(it, s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it, s).toString());
-    }
-  }
-  
-  public boolean isReactSequence(final EObject it, final Step s) {
-    if (it instanceof ExecutionNode) {
-      return _isReactSequence((ExecutionNode)it, s);
-    } else if (it != null) {
-      return _isReactSequence(it, s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(it, s).toString());
-    }
-  }
-}

BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.BehaviorMapping.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.FlowOptimizer.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.ModelSequencer.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.ReactionBuilder.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.SequenceBuilder.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.SexecElementMapping.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.SexecExtensions.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.SgraphExtensions.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.StateVectorBuilder.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.StatechartExtensions.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.StextExtensions.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.StructureMapping.java._trace


BIN
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/.TraceExtensions.java._trace


Разница между файлами не показана из-за своего большого размера
+ 0 - 1380
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/BehaviorMapping.java


+ 0 - 808
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/FlowOptimizer.java

@@ -1,808 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-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.ExecutionChoice;
-import org.yakindu.sct.model.sexec.ExecutionEntry;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.ExecutionNode;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.HistoryEntry;
-import org.yakindu.sct.model.sexec.If;
-import org.yakindu.sct.model.sexec.Reaction;
-import org.yakindu.sct.model.sexec.Sequence;
-import org.yakindu.sct.model.sexec.SexecFactory;
-import org.yakindu.sct.model.sexec.StateCase;
-import org.yakindu.sct.model.sexec.StateSwitch;
-import org.yakindu.sct.model.sexec.Step;
-import org.yakindu.sct.model.sgraph.SGraphFactory;
-import org.yakindu.sct.model.sgraph.Statement;
-import org.yakindu.sct.model.stext.stext.BoolLiteral;
-import org.yakindu.sct.model.stext.stext.Literal;
-import org.yakindu.sct.model.stext.stext.PrimitiveValueExpression;
-import org.yakindu.sct.model.stext.stext.StextFactory;
-
-@SuppressWarnings("all")
-public class FlowOptimizer {
-  private boolean _inlineReactions;
-  
-  public boolean inlineReactions(final boolean b) {
-    boolean __inlineReactions = this._inlineReactions = b;
-    return __inlineReactions;
-  }
-  
-  private boolean _inlineEntryActions;
-  
-  public boolean inlineEntryActions(final boolean b) {
-    boolean __inlineEntryActions = this._inlineEntryActions = b;
-    return __inlineEntryActions;
-  }
-  
-  private boolean _inlineExitActions;
-  
-  public boolean inlineExitActions(final boolean b) {
-    boolean __inlineExitActions = this._inlineExitActions = b;
-    return __inlineExitActions;
-  }
-  
-  private boolean _inlineEnterSequences;
-  
-  public boolean inlineEnterSequences(final boolean b) {
-    boolean __inlineEnterSequences = this._inlineEnterSequences = b;
-    return __inlineEnterSequences;
-  }
-  
-  private boolean _inlineEnterRegion;
-  
-  public boolean inlineEnterRegion(final boolean b) {
-    boolean __inlineEnterRegion = this._inlineEnterRegion = b;
-    return __inlineEnterRegion;
-  }
-  
-  private boolean _inlineExitRegion;
-  
-  public boolean inlineExitRegion(final boolean b) {
-    boolean __inlineExitRegion = this._inlineExitRegion = b;
-    return __inlineExitRegion;
-  }
-  
-  private boolean _inlineExitSequences;
-  
-  public boolean inlineExitSequences(final boolean b) {
-    boolean __inlineExitSequences = this._inlineExitSequences = b;
-    return __inlineExitSequences;
-  }
-  
-  private boolean _inlineChoices;
-  
-  public boolean inlineChoices(final boolean b) {
-    boolean __inlineChoices = this._inlineChoices = b;
-    return __inlineChoices;
-  }
-  
-  private boolean _inlineEntries;
-  
-  public boolean inlineEntries(final boolean b) {
-    boolean __inlineEntries = this._inlineEntries = b;
-    return __inlineEntries;
-  }
-  
-  public ExecutionFlow transform(final ExecutionFlow flow) {
-    ExecutionFlow _xblockexpression = null;
-    {
-      this.replaceTrueIfs(flow);
-      if (this._inlineReactions) {
-        this.inlineReactionChecks(flow);
-        this.inlineReactionEffects(flow);
-      }
-      if (this._inlineEntryActions) {
-        EList<ExecutionState> _states = flow.getStates();
-        final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-            public void apply(final ExecutionState state) {
-              Step _entryAction = state.getEntryAction();
-              FlowOptimizer.this.inline(_entryAction);
-            }
-          };
-        IterableExtensions.<ExecutionState>forEach(_states, _function);
-      }
-      if (this._inlineExitActions) {
-        EList<ExecutionState> _states_1 = flow.getStates();
-        final Procedure1<ExecutionState> _function_1 = new Procedure1<ExecutionState>() {
-            public void apply(final ExecutionState state) {
-              Step _exitAction = state.getExitAction();
-              FlowOptimizer.this.inline(_exitAction);
-            }
-          };
-        IterableExtensions.<ExecutionState>forEach(_states_1, _function_1);
-      }
-      if (this._inlineEnterSequences) {
-        EList<ExecutionState> _states_2 = flow.getStates();
-        final Procedure1<ExecutionState> _function_2 = new Procedure1<ExecutionState>() {
-            public void apply(final ExecutionState state) {
-              Sequence _enterSequence = state.getEnterSequence();
-              FlowOptimizer.this.inline(_enterSequence);
-            }
-          };
-        IterableExtensions.<ExecutionState>forEach(_states_2, _function_2);
-      }
-      if (this._inlineExitSequences) {
-        EList<ExecutionState> _states_3 = flow.getStates();
-        final Procedure1<ExecutionState> _function_3 = new Procedure1<ExecutionState>() {
-            public void apply(final ExecutionState state) {
-              Sequence _exitSequence = state.getExitSequence();
-              FlowOptimizer.this.inline(_exitSequence);
-            }
-          };
-        IterableExtensions.<ExecutionState>forEach(_states_3, _function_3);
-      }
-      if (this._inlineExitRegion) {
-        TreeIterator<EObject> _eAllContents = flow.eAllContents();
-        Iterator<ExecutionRegion> _filter = Iterators.<ExecutionRegion>filter(_eAllContents, ExecutionRegion.class);
-        final Procedure1<ExecutionRegion> _function_4 = new Procedure1<ExecutionRegion>() {
-            public void apply(final ExecutionRegion region) {
-              Sequence _exitSequence = region.getExitSequence();
-              FlowOptimizer.this.inline(_exitSequence);
-            }
-          };
-        IteratorExtensions.<ExecutionRegion>forEach(_filter, _function_4);
-      }
-      if (this._inlineEnterRegion) {
-        TreeIterator<EObject> _eAllContents_1 = flow.eAllContents();
-        Iterator<ExecutionRegion> _filter_1 = Iterators.<ExecutionRegion>filter(_eAllContents_1, ExecutionRegion.class);
-        final Procedure1<ExecutionRegion> _function_5 = new Procedure1<ExecutionRegion>() {
-            public void apply(final ExecutionRegion region) {
-              Sequence _enterSequence = region.getEnterSequence();
-              FlowOptimizer.this.inline(_enterSequence);
-            }
-          };
-        IteratorExtensions.<ExecutionRegion>forEach(_filter_1, _function_5);
-      }
-      if (this._inlineChoices) {
-        EList<ExecutionNode> _nodes = flow.getNodes();
-        Iterable<ExecutionChoice> _filter_2 = Iterables.<ExecutionChoice>filter(_nodes, ExecutionChoice.class);
-        final Procedure1<ExecutionChoice> _function_6 = new Procedure1<ExecutionChoice>() {
-            public void apply(final ExecutionChoice node) {
-              EList<Reaction> _reactions = node.getReactions();
-              final Procedure1<Reaction> _function = new Procedure1<Reaction>() {
-                  public void apply(final Reaction r) {
-                    Check _check = r.getCheck();
-                    FlowOptimizer.this.inline(_check);
-                    Step _effect = r.getEffect();
-                    FlowOptimizer.this.inline(_effect);
-                  }
-                };
-              IterableExtensions.<Reaction>forEach(_reactions, _function);
-            }
-          };
-        IterableExtensions.<ExecutionChoice>forEach(_filter_2, _function_6);
-        EList<ExecutionNode> _nodes_1 = flow.getNodes();
-        Iterable<ExecutionChoice> _filter_3 = Iterables.<ExecutionChoice>filter(_nodes_1, ExecutionChoice.class);
-        final Procedure1<ExecutionChoice> _function_7 = new Procedure1<ExecutionChoice>() {
-            public void apply(final ExecutionChoice node) {
-              Sequence _reactSequence = node.getReactSequence();
-              FlowOptimizer.this.inline(_reactSequence);
-            }
-          };
-        IterableExtensions.<ExecutionChoice>forEach(_filter_3, _function_7);
-      }
-      if (this._inlineEntries) {
-        EList<ExecutionNode> _nodes_2 = flow.getNodes();
-        Iterable<ExecutionEntry> _filter_4 = Iterables.<ExecutionEntry>filter(_nodes_2, ExecutionEntry.class);
-        final Procedure1<ExecutionEntry> _function_8 = new Procedure1<ExecutionEntry>() {
-            public void apply(final ExecutionEntry node) {
-              EList<Reaction> _reactions = node.getReactions();
-              final Procedure1<Reaction> _function = new Procedure1<Reaction>() {
-                  public void apply(final Reaction r) {
-                    Check _check = r.getCheck();
-                    FlowOptimizer.this.inline(_check);
-                    Step _effect = r.getEffect();
-                    FlowOptimizer.this.inline(_effect);
-                  }
-                };
-              IterableExtensions.<Reaction>forEach(_reactions, _function);
-            }
-          };
-        IterableExtensions.<ExecutionEntry>forEach(_filter_4, _function_8);
-        EList<ExecutionNode> _nodes_3 = flow.getNodes();
-        Iterable<ExecutionEntry> _filter_5 = Iterables.<ExecutionEntry>filter(_nodes_3, ExecutionEntry.class);
-        final Procedure1<ExecutionEntry> _function_9 = new Procedure1<ExecutionEntry>() {
-            public void apply(final ExecutionEntry node) {
-              Sequence _reactSequence = node.getReactSequence();
-              FlowOptimizer.this.inline(_reactSequence);
-            }
-          };
-        IterableExtensions.<ExecutionEntry>forEach(_filter_5, _function_9);
-      }
-      _xblockexpression = (flow);
-    }
-    return _xblockexpression;
-  }
-  
-  public void replaceTrueIfs(final ExecutionFlow flow) {
-    TreeIterator<EObject> _eAllContents = flow.eAllContents();
-    Iterator<If> _filter = Iterators.<If>filter(_eAllContents, If.class);
-    final Function1<If,Boolean> _function = new Function1<If,Boolean>() {
-        public Boolean apply(final If i) {
-          Check _check = i.getCheck();
-          boolean _alwaysTrue = FlowOptimizer.this.alwaysTrue(_check);
-          return Boolean.valueOf(_alwaysTrue);
-        }
-      };
-    Iterator<If> _filter_1 = IteratorExtensions.<If>filter(_filter, _function);
-    final Procedure1<If> _function_1 = new Procedure1<If>() {
-        public void apply(final If i) {
-          Step _thenStep = i.getThenStep();
-          FlowOptimizer.this.substituteBy(i, _thenStep);
-        }
-      };
-    IteratorExtensions.<If>forEach(_filter_1, _function_1);
-  }
-  
-  public Step substituteBy(final Step orig, final Step substitute) {
-    EObject _eContainer = orig.eContainer();
-    Step _substitute = this.substitute(_eContainer, orig, substitute);
-    return _substitute;
-  }
-  
-  protected Step _substitute(final Object parent, final Step orig, final Step subst) {
-    return null;
-  }
-  
-  protected Step _substitute(final Sequence parent, final Step orig, final Step subst) {
-    Step _xifexpression = null;
-    EList<Step> _steps = parent.getSteps();
-    boolean _contains = _steps.contains(orig);
-    if (_contains) {
-      EList<Step> _steps_1 = parent.getSteps();
-      EList<Step> _steps_2 = parent.getSteps();
-      int _indexOf = _steps_2.indexOf(orig);
-      Step _set = _steps_1.set(_indexOf, subst);
-      _xifexpression = _set;
-    }
-    return _xifexpression;
-  }
-  
-  protected Step _substitute(final If parent, final Step orig, final Step subst) {
-    Step _xblockexpression = null;
-    {
-      Step _thenStep = parent.getThenStep();
-      boolean _equals = Objects.equal(_thenStep, orig);
-      if (_equals) {
-        parent.setThenStep(subst);
-      } else {
-        Step _elseStep = parent.getElseStep();
-        boolean _equals_1 = Objects.equal(_elseStep, orig);
-        if (_equals_1) {
-          parent.setElseStep(subst);
-        }
-      }
-      _xblockexpression = (subst);
-    }
-    return _xblockexpression;
-  }
-  
-  public boolean alwaysTrue(final Check check) {
-    boolean _and = false;
-    boolean _notEquals = (!Objects.equal(check, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      Statement _condition = check.getCondition();
-      _and = (_notEquals && (_condition instanceof PrimitiveValueExpression));
-    }
-    if (_and) {
-      Statement _condition_1 = check.getCondition();
-      final PrimitiveValueExpression pve = ((PrimitiveValueExpression) _condition_1);
-      boolean _and_1 = false;
-      Literal _value = pve.getValue();
-      if (!(_value instanceof BoolLiteral)) {
-        _and_1 = false;
-      } else {
-        Literal _value_1 = pve.getValue();
-        boolean _isValue = ((BoolLiteral) _value_1).isValue();
-        _and_1 = ((_value instanceof BoolLiteral) && _isValue);
-      }
-      return _and_1;
-    }
-    return false;
-  }
-  
-  protected boolean _empty(final Step step) {
-    return false;
-  }
-  
-  protected boolean _empty(final Sequence seq) {
-    EList<Step> _steps = seq.getSteps();
-    int _size = _steps.size();
-    boolean _equals = (_size == 0);
-    return _equals;
-  }
-  
-  public void inlineReactionChecks(final ExecutionFlow flow) {
-    EList<ExecutionState> _states = flow.getStates();
-    final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState state) {
-          FlowOptimizer.this.inlineReactionChecks(state);
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states, _function);
-  }
-  
-  public ExecutionState inlineReactionChecks(final ExecutionState state) {
-    ExecutionState _xblockexpression = null;
-    {
-      EList<Reaction> _reactions = state.getReactions();
-      final Function1<Reaction,Check> _function = new Function1<Reaction,Check>() {
-          public Check apply(final Reaction r) {
-            Check _check = r.getCheck();
-            return _check;
-          }
-        };
-      List<Check> _map = ListExtensions.<Reaction, Check>map(_reactions, _function);
-      final List<Check> checks = IterableExtensions.<Check>toList(_map);
-      final Procedure1<Check> _function_1 = new Procedure1<Check>() {
-          public void apply(final Check c) {
-            FlowOptimizer.this.inline(c);
-          }
-        };
-      IterableExtensions.<Check>forEach(checks, _function_1);
-      _xblockexpression = (state);
-    }
-    return _xblockexpression;
-  }
-  
-  public Check inline(final Check c) {
-    Check _xblockexpression = null;
-    {
-      boolean _notEquals = (!Objects.equal(c, null));
-      if (_notEquals) {
-        ArrayList<CheckRef> _arrayList = new ArrayList<CheckRef>();
-        final List<CheckRef> cRefs = _arrayList;
-        EList<CheckRef> _refs = c.getRefs();
-        cRefs.addAll(_refs);
-        for (final CheckRef ref : cRefs) {
-          {
-            final Check clone = EcoreUtil.<Check>copy(c);
-            EObject _eContainer = ref.eContainer();
-            this.substitute(_eContainer, ref, clone);
-            ref.setCheck(null);
-          }
-        }
-      }
-      _xblockexpression = (c);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Step _substitute(final EObject owner, final Check pre, final Check post) {
-    return null;
-  }
-  
-  protected Step _substitute(final If owner, final Check pre, final Check post) {
-    Check _xblockexpression = null;
-    {
-      Check _check = owner.getCheck();
-      boolean _equals = Objects.equal(_check, pre);
-      if (_equals) {
-        owner.setCheck(post);
-      }
-      _xblockexpression = (post);
-    }
-    return _xblockexpression;
-  }
-  
-  public void inlineReactionEffects(final ExecutionFlow flow) {
-    EList<ExecutionState> _states = flow.getStates();
-    final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState state) {
-          FlowOptimizer.this.inlineReactionEffects(state);
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states, _function);
-  }
-  
-  public ExecutionState inlineReactionEffects(final ExecutionState state) {
-    ExecutionState _xblockexpression = null;
-    {
-      EList<Reaction> _reactions = state.getReactions();
-      final Function1<Reaction,Step> _function = new Function1<Reaction,Step>() {
-          public Step apply(final Reaction r) {
-            Step _effect = r.getEffect();
-            return _effect;
-          }
-        };
-      List<Step> _map = ListExtensions.<Reaction, Step>map(_reactions, _function);
-      final List<Step> effects = IterableExtensions.<Step>toList(_map);
-      final Procedure1<Step> _function_1 = new Procedure1<Step>() {
-          public void apply(final Step e) {
-            FlowOptimizer.this.inline(e);
-          }
-        };
-      IterableExtensions.<Step>forEach(effects, _function_1);
-      _xblockexpression = (state);
-    }
-    return _xblockexpression;
-  }
-  
-  public void inlineEntryAndExitActions(final ExecutionFlow flow) {
-    EList<ExecutionState> _states = flow.getStates();
-    final Procedure1<ExecutionState> _function = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState state) {
-          Step _entryAction = state.getEntryAction();
-          FlowOptimizer.this.inline(_entryAction);
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states, _function);
-    EList<ExecutionState> _states_1 = flow.getStates();
-    final Procedure1<ExecutionState> _function_1 = new Procedure1<ExecutionState>() {
-        public void apply(final ExecutionState state) {
-          Step _exitAction = state.getExitAction();
-          FlowOptimizer.this.inline(_exitAction);
-        }
-      };
-    IterableExtensions.<ExecutionState>forEach(_states_1, _function_1);
-  }
-  
-  public Step inline(final Step step) {
-    Step _xblockexpression = null;
-    {
-      boolean _notEquals = (!Objects.equal(step, null));
-      if (_notEquals) {
-        ArrayList<Call> _arrayList = new ArrayList<Call>();
-        final List<Call> calls = _arrayList;
-        EList<Call> _caller = step.getCaller();
-        calls.addAll(_caller);
-        for (final Call caller : calls) {
-          {
-            final Step clone = this.stepCopy(step);
-            EObject _eContainer = caller.eContainer();
-            boolean _substituteCall = this.substituteCall(_eContainer, caller, clone);
-            if (_substituteCall) {
-              caller.setStep(null);
-            } else {
-              String _plus = ("Did not substitute \'" + step);
-              String _plus_1 = (_plus + "\' call from \'");
-              EObject _eContainer_1 = caller.eContainer();
-              String _plus_2 = (_plus_1 + _eContainer_1);
-              String _plus_3 = (_plus_2 + "\'.");
-              System.out.println(_plus_3);
-            }
-          }
-        }
-      }
-      _xblockexpression = (step);
-    }
-    return _xblockexpression;
-  }
-  
-  protected boolean _substituteCall(final EObject owner, final Call pre, final Step post) {
-    return false;
-  }
-  
-  protected boolean _substituteCall(final StateCase owner, final Call pre, final Step post) {
-    Step _step = owner.getStep();
-    boolean _equals = Objects.equal(_step, pre);
-    if (_equals) {
-      owner.setStep(post);
-      return true;
-    }
-    return false;
-  }
-  
-  protected boolean _substituteCall(final HistoryEntry owner, final Call pre, final Step post) {
-    Step _initialStep = owner.getInitialStep();
-    boolean _equals = Objects.equal(_initialStep, pre);
-    if (_equals) {
-      owner.setInitialStep(post);
-      return true;
-    }
-    Step _historyStep = owner.getHistoryStep();
-    boolean _equals_1 = Objects.equal(_historyStep, pre);
-    if (_equals_1) {
-      owner.setHistoryStep(post);
-      return true;
-    }
-    return false;
-  }
-  
-  protected boolean _substituteCall(final Sequence owner, final Call call, final Step step) {
-    EList<Step> _steps = owner.getSteps();
-    boolean _contains = _steps.contains(call);
-    if (_contains) {
-      EList<Step> _steps_1 = owner.getSteps();
-      EList<Step> _steps_2 = owner.getSteps();
-      int _indexOf = _steps_2.indexOf(call);
-      _steps_1.set(_indexOf, step);
-      return true;
-    }
-    return false;
-  }
-  
-  protected boolean _substituteCall(final If owner, final Call call, final Step step) {
-    Step _thenStep = owner.getThenStep();
-    boolean _equals = Objects.equal(_thenStep, call);
-    if (_equals) {
-      owner.setThenStep(step);
-      return true;
-    } else {
-      Step _elseStep = owner.getElseStep();
-      boolean _equals_1 = Objects.equal(_elseStep, call);
-      if (_equals_1) {
-        owner.setElseStep(step);
-        return true;
-      }
-    }
-    return false;
-  }
-  
-  protected Step _stepCopy(final Step step) {
-    Step _copy = EcoreUtil.<Step>copy(step);
-    return _copy;
-  }
-  
-  protected Step _stepCopy(final Sequence seq) {
-    Sequence _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final Sequence _copy = _sexecFactory.createSequence();
-      String _name = seq.getName();
-      _copy.setName(_name);
-      String _comment = seq.getComment();
-      _copy.setComment(_comment);
-      EList<Step> _steps = _copy.getSteps();
-      EList<Step> _steps_1 = seq.getSteps();
-      final Function1<Step,Step> _function = new Function1<Step,Step>() {
-          public Step apply(final Step s) {
-            Step _stepCopy = FlowOptimizer.this.stepCopy(s);
-            return _stepCopy;
-          }
-        };
-      List<Step> _map = ListExtensions.<Step, Step>map(_steps_1, _function);
-      _steps.addAll(_map);
-      _xblockexpression = (_copy);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Step _stepCopy(final If _if) {
-    If _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final If _copy = _sexecFactory.createIf();
-      String _name = _if.getName();
-      _copy.setName(_name);
-      String _comment = _if.getComment();
-      _copy.setComment(_comment);
-      Check _check = _if.getCheck();
-      Step _stepCopy = this.stepCopy(_check);
-      _copy.setCheck(((Check) _stepCopy));
-      Step _xifexpression = null;
-      Step _thenStep = _if.getThenStep();
-      boolean _notEquals = (!Objects.equal(_thenStep, null));
-      if (_notEquals) {
-        Step _thenStep_1 = _if.getThenStep();
-        Step _stepCopy_1 = this.stepCopy(_thenStep_1);
-        _xifexpression = _stepCopy_1;
-      } else {
-        _xifexpression = null;
-      }
-      _copy.setThenStep(_xifexpression);
-      Step _xifexpression_1 = null;
-      Step _elseStep = _if.getElseStep();
-      boolean _notEquals_1 = (!Objects.equal(_elseStep, null));
-      if (_notEquals_1) {
-        Step _elseStep_1 = _if.getElseStep();
-        Step _stepCopy_2 = this.stepCopy(_elseStep_1);
-        _xifexpression_1 = _stepCopy_2;
-      } else {
-        _xifexpression_1 = null;
-      }
-      _copy.setElseStep(_xifexpression_1);
-      _xblockexpression = (_copy);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Step _stepCopy(final Call call) {
-    Call _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final Call _copy = _sexecFactory.createCall();
-      String _name = call.getName();
-      _copy.setName(_name);
-      String _comment = call.getComment();
-      _copy.setComment(_comment);
-      Step _step = call.getStep();
-      _copy.setStep(_step);
-      _xblockexpression = (_copy);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Step _stepCopy(final CheckRef cref) {
-    CheckRef _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final CheckRef _copy = _sexecFactory.createCheckRef();
-      String _name = cref.getName();
-      _copy.setName(_name);
-      String _comment = cref.getComment();
-      _copy.setComment(_comment);
-      Check _check = cref.getCheck();
-      _copy.setCheck(_check);
-      _xblockexpression = (_copy);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Step _stepCopy(final HistoryEntry cref) {
-    HistoryEntry _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final HistoryEntry _copy = _sexecFactory.createHistoryEntry();
-      String _name = cref.getName();
-      _copy.setName(_name);
-      String _comment = cref.getComment();
-      _copy.setComment(_comment);
-      boolean _isDeep = cref.isDeep();
-      _copy.setDeep(_isDeep);
-      ExecutionRegion _region = cref.getRegion();
-      _copy.setRegion(_region);
-      Step _initialStep = cref.getInitialStep();
-      Step _stepCopy = _initialStep==null?(Step)null:this.stepCopy(_initialStep);
-      _copy.setInitialStep(_stepCopy);
-      Step _historyStep = cref.getHistoryStep();
-      Step _stepCopy_1 = this.stepCopy(_historyStep);
-      _copy.setHistoryStep(_stepCopy_1);
-      _xblockexpression = (_copy);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Step _stepCopy(final StateSwitch _switch) {
-    StateSwitch _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final StateSwitch _copy = _sexecFactory.createStateSwitch();
-      String _name = _switch.getName();
-      _copy.setName(_name);
-      String _comment = _switch.getComment();
-      _copy.setComment(_comment);
-      int _stateConfigurationIdx = _switch.getStateConfigurationIdx();
-      _copy.setStateConfigurationIdx(_stateConfigurationIdx);
-      EList<StateCase> _cases = _copy.getCases();
-      EList<StateCase> _cases_1 = _switch.getCases();
-      final Function1<StateCase,StateCase> _function = new Function1<StateCase,StateCase>() {
-          public StateCase apply(final StateCase c) {
-            StateCase _caseCopy = FlowOptimizer.this.caseCopy(c);
-            return _caseCopy;
-          }
-        };
-      List<StateCase> _map = ListExtensions.<StateCase, StateCase>map(_cases_1, _function);
-      _cases.addAll(_map);
-      _xblockexpression = (_copy);
-    }
-    return _xblockexpression;
-  }
-  
-  public StateCase caseCopy(final StateCase _case) {
-    StateCase _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final StateCase _copy = _sexecFactory.createStateCase();
-      ExecutionState _state = _case.getState();
-      _copy.setState(_state);
-      Step _step = _case.getStep();
-      Step _stepCopy = this.stepCopy(_step);
-      _copy.setStep(_stepCopy);
-      _xblockexpression = (_copy);
-    }
-    return _xblockexpression;
-  }
-  
-  public SexecFactory sexecFactory() {
-    return SexecFactory.eINSTANCE;
-  }
-  
-  public SGraphFactory sgraphFactory() {
-    return SGraphFactory.eINSTANCE;
-  }
-  
-  public StextFactory stextFactory() {
-    return StextFactory.eINSTANCE;
-  }
-  
-  public Step substitute(final Object owner, final Step pre, final Step post) {
-    if (owner instanceof If
-         && pre instanceof Check
-         && post instanceof Check) {
-      return _substitute((If)owner, (Check)pre, (Check)post);
-    } else if (owner instanceof If
-         && pre != null
-         && post != null) {
-      return _substitute((If)owner, pre, post);
-    } else if (owner instanceof Sequence
-         && pre != null
-         && post != null) {
-      return _substitute((Sequence)owner, pre, post);
-    } else if (owner instanceof EObject
-         && pre instanceof Check
-         && post instanceof Check) {
-      return _substitute((EObject)owner, (Check)pre, (Check)post);
-    } else if (owner != null
-         && pre != null
-         && post != null) {
-      return _substitute(owner, pre, post);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(owner, pre, post).toString());
-    }
-  }
-  
-  public boolean empty(final Step seq) {
-    if (seq instanceof Sequence) {
-      return _empty((Sequence)seq);
-    } else if (seq != null) {
-      return _empty(seq);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(seq).toString());
-    }
-  }
-  
-  public boolean substituteCall(final EObject owner, final Call pre, final Step post) {
-    if (owner instanceof HistoryEntry) {
-      return _substituteCall((HistoryEntry)owner, pre, post);
-    } else if (owner instanceof If) {
-      return _substituteCall((If)owner, pre, post);
-    } else if (owner instanceof Sequence) {
-      return _substituteCall((Sequence)owner, pre, post);
-    } else if (owner instanceof StateCase) {
-      return _substituteCall((StateCase)owner, pre, post);
-    } else if (owner != null) {
-      return _substituteCall(owner, pre, post);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(owner, pre, post).toString());
-    }
-  }
-  
-  public Step stepCopy(final Step cref) {
-    if (cref instanceof CheckRef) {
-      return _stepCopy((CheckRef)cref);
-    } else if (cref instanceof Call) {
-      return _stepCopy((Call)cref);
-    } else if (cref instanceof HistoryEntry) {
-      return _stepCopy((HistoryEntry)cref);
-    } else if (cref instanceof If) {
-      return _stepCopy((If)cref);
-    } else if (cref instanceof Sequence) {
-      return _stepCopy((Sequence)cref);
-    } else if (cref instanceof StateSwitch) {
-      return _stepCopy((StateSwitch)cref);
-    } else if (cref != null) {
-      return _stepCopy(cref);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(cref).toString());
-    }
-  }
-}

+ 0 - 265
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java

@@ -1,265 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.inject.Inject;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogConfigurationException;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.EcoreUtil2;
-import org.eclipse.xtext.naming.IQualifiedNameProvider;
-import org.eclipse.xtext.naming.QualifiedName;
-import org.eclipse.xtext.xbase.lib.Exceptions;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.InputOutput;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-import org.yakindu.base.types.Feature;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.TimeEvent;
-import org.yakindu.sct.model.sexec.transformation.BehaviorMapping;
-import org.yakindu.sct.model.sexec.transformation.ReactionBuilder;
-import org.yakindu.sct.model.sexec.transformation.SequenceBuilder;
-import org.yakindu.sct.model.sexec.transformation.SexecElementMapping;
-import org.yakindu.sct.model.sexec.transformation.StateVectorBuilder;
-import org.yakindu.sct.model.sexec.transformation.StructureMapping;
-import org.yakindu.sct.model.sgraph.Declaration;
-import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.stext.stext.ElementReferenceExpression;
-import org.yakindu.sct.model.stext.stext.EventDefinition;
-import org.yakindu.sct.model.stext.stext.FeatureCall;
-import org.yakindu.sct.model.stext.stext.OperationDefinition;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-
-@SuppressWarnings("all")
-public class ModelSequencer {
-  @Inject
-  private IQualifiedNameProvider qfnProvider;
-  
-  @Inject
-  private SexecElementMapping mapping;
-  
-  @Inject
-  private StructureMapping structureMapping;
-  
-  @Inject
-  private BehaviorMapping behaviorMapping;
-  
-  @Inject
-  private ReactionBuilder reactBuilder;
-  
-  @Inject
-  private SequenceBuilder seqBuilder;
-  
-  @Inject
-  private StateVectorBuilder svBuilder;
-  
-  /**
-   * ==========================================================================
-   * TRANSFORMATION ROOT
-   */
-  public ExecutionFlow transform(final Statechart sc) {
-    final ExecutionFlow ef = this.mapping.create(sc);
-    this.structureMapping.mapScopes(sc, ef);
-    this.structureMapping.mapRegularStates(sc, ef);
-    this.structureMapping.mapPseudoStates(sc, ef);
-    this.structureMapping.mapRegions(sc, ef);
-    this.structureMapping.mapTimeEvents(sc, ef);
-    this.svBuilder.defineStateVector(ef, sc);
-    this.svBuilder.defineHistoryVector(ef, sc);
-    this.behaviorMapping.mapEntryActions(sc, ef);
-    this.behaviorMapping.mapExitActions(sc, ef);
-    this.seqBuilder.defineStateEnterSequences(ef, sc);
-    this.seqBuilder.defineStateExitSequences(ef, sc);
-    this.seqBuilder.defineDeepEnterSequences(ef, sc);
-    this.seqBuilder.defineShallowEnterSequences(ef, sc);
-    this.seqBuilder.defineStatechartEnterSequence(ef, sc);
-    this.seqBuilder.defineStatechartExitSequence(ef, sc);
-    this.seqBuilder.defineStatechartInitSequence(ef, sc);
-    this.behaviorMapping.mapTransitions(sc, ef);
-    this.behaviorMapping.mapEntries(sc, ef);
-    this.behaviorMapping.mapLocalReactions(sc, ef);
-    this.behaviorMapping.mapChoiceTransitions(sc, ef);
-    this.behaviorMapping.mapSyncTransitions(sc, ef);
-    this.reactBuilder.defineEntryReactions(sc, ef);
-    this.reactBuilder.defineRegularStateReactions(ef, sc);
-    this.reactBuilder.definePseudoStateReactions(ef, sc);
-    this.reactBuilder.defineStatechartReaction(ef, sc);
-    this.retargetDeclRefs(ef);
-    this.mapping.cleanup();
-    return ef;
-  }
-  
-  /**
-   * retarget declaration refs
-   */
-  public void retargetDeclRefs(final ExecutionFlow flow) {
-    final List<EObject> allContent = EcoreUtil2.eAllContentsAsList(flow);
-    final Function1<EObject,Boolean> _function = new Function1<EObject,Boolean>() {
-        public Boolean apply(final EObject e) {
-          boolean _or = false;
-          boolean _or_1 = false;
-          if ((e instanceof EventDefinition)) {
-            _or_1 = true;
-          } else {
-            _or_1 = ((e instanceof EventDefinition) || (e instanceof VariableDefinition));
-          }
-          if (_or_1) {
-            _or = true;
-          } else {
-            _or = (_or_1 || (e instanceof OperationDefinition));
-          }
-          return Boolean.valueOf(_or);
-        }
-      };
-    Iterable<EObject> _filter = IterableExtensions.<EObject>filter(allContent, _function);
-    final Set<EObject> declared = IterableExtensions.<EObject>toSet(_filter);
-    Iterable<ElementReferenceExpression> _filter_1 = Iterables.<ElementReferenceExpression>filter(allContent, ElementReferenceExpression.class);
-    final Procedure1<ElementReferenceExpression> _function_1 = new Procedure1<ElementReferenceExpression>() {
-        public void apply(final ElementReferenceExpression ere) {
-          ModelSequencer.this.retarget(ere, declared);
-        }
-      };
-    IterableExtensions.<ElementReferenceExpression>forEach(_filter_1, _function_1);
-    Iterable<FeatureCall> _filter_2 = Iterables.<FeatureCall>filter(allContent, FeatureCall.class);
-    final Procedure1<FeatureCall> _function_2 = new Procedure1<FeatureCall>() {
-        public void apply(final FeatureCall call) {
-          ModelSequencer.this.retarget(call, declared);
-        }
-      };
-    IterableExtensions.<FeatureCall>forEach(_filter_2, _function_2);
-  }
-  
-  public void retarget(final ElementReferenceExpression ere, final Collection<EObject> declared) {
-    boolean _and = false;
-    EObject _reference = ere.getReference();
-    boolean _notEquals = (!Objects.equal(_reference, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      EObject _reference_1 = ere.getReference();
-      boolean _contains = declared.contains(_reference_1);
-      boolean _not = (!_contains);
-      _and = (_notEquals && _not);
-    }
-    if (_and) {
-      EObject _reference_2 = ere.getReference();
-      final Declaration r = this.replaced(_reference_2);
-      boolean _notEquals_1 = (!Objects.equal(r, null));
-      if (_notEquals_1) {
-        ere.setReference(r);
-      }
-    }
-  }
-  
-  public void retarget(final FeatureCall call, final Collection<EObject> declared) {
-    boolean _and = false;
-    EObject _feature = call.getFeature();
-    boolean _notEquals = (!Objects.equal(_feature, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      EObject _feature_1 = call.getFeature();
-      boolean _contains = declared.contains(_feature_1);
-      boolean _not = (!_contains);
-      _and = (_notEquals && _not);
-    }
-    if (_and) {
-      EObject _feature_2 = call.getFeature();
-      final Declaration r = this.replaced(_feature_2);
-      boolean _notEquals_1 = (!Objects.equal(r, null));
-      if (_notEquals_1) {
-        call.setFeature(((Feature) r));
-      }
-    }
-  }
-  
-  protected Declaration _replaced(final EObject ne) {
-    Declaration _xblockexpression = null;
-    {
-      try {
-        Comparable<? extends Object> _xifexpression = null;
-        boolean _equals = Objects.equal(ne, null);
-        if (_equals) {
-          _xifexpression = "null";
-        } else {
-          QualifiedName _fullyQualifiedName = this.qfnProvider.getFullyQualifiedName(ne);
-          _xifexpression = _fullyQualifiedName;
-        }
-        String _plus = ("Replace with unknown eObject called: " + _xifexpression);
-        InputOutput.<String>println(_plus);
-        Log _log = LogFactory.getLog(ModelSequencer.class);
-        Comparable<? extends Object> _xifexpression_1 = null;
-        boolean _equals_1 = Objects.equal(ne, null);
-        if (_equals_1) {
-          _xifexpression_1 = "null";
-        } else {
-          QualifiedName _fullyQualifiedName_1 = this.qfnProvider.getFullyQualifiedName(ne);
-          _xifexpression_1 = _fullyQualifiedName_1;
-        }
-        String _plus_1 = ("Replace with unknown NamedElement called: " + _xifexpression_1);
-        _log.error(_plus_1);
-      } catch (final Throwable _t) {
-        if (_t instanceof LogConfigurationException) {
-          final LogConfigurationException e = (LogConfigurationException)_t;
-          e.printStackTrace();
-          Comparable<? extends Object> _xifexpression_2 = null;
-          boolean _equals_2 = Objects.equal(ne, null);
-          if (_equals_2) {
-            _xifexpression_2 = "null";
-          } else {
-            QualifiedName _fullyQualifiedName_2 = this.qfnProvider.getFullyQualifiedName(ne);
-            _xifexpression_2 = _fullyQualifiedName_2;
-          }
-          String _plus_2 = ("Replace with unknown NamedElement called: " + _xifexpression_2);
-          InputOutput.<String>println(_plus_2);
-        } else {
-          throw Exceptions.sneakyThrow(_t);
-        }
-      }
-      _xblockexpression = (null);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Declaration _replaced(final VariableDefinition vd) {
-    VariableDefinition _create = this.mapping.create(vd);
-    return _create;
-  }
-  
-  protected Declaration _replaced(final OperationDefinition vd) {
-    OperationDefinition _create = this.mapping.create(vd);
-    return _create;
-  }
-  
-  protected Declaration _replaced(final EventDefinition ed) {
-    EventDefinition _create = this.mapping.create(ed);
-    return _create;
-  }
-  
-  protected Declaration _replaced(final TimeEvent ed) {
-    return ed;
-  }
-  
-  public Declaration replaced(final EObject ed) {
-    if (ed instanceof TimeEvent) {
-      return _replaced((TimeEvent)ed);
-    } else if (ed instanceof EventDefinition) {
-      return _replaced((EventDefinition)ed);
-    } else if (ed instanceof OperationDefinition) {
-      return _replaced((OperationDefinition)ed);
-    } else if (ed instanceof VariableDefinition) {
-      return _replaced((VariableDefinition)ed);
-    } else if (ed != null) {
-      return _replaced(ed);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(ed).toString());
-    }
-  }
-}

+ 0 - 580
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ReactionBuilder.java

@@ -1,580 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.inject.Inject;
-import java.util.HashSet;
-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.CollectionExtensions;
-import org.eclipse.xtext.xbase.lib.CollectionLiterals;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.Functions.Function2;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-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.ExecutionChoice;
-import org.yakindu.sct.model.sexec.ExecutionEntry;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.ExecutionNode;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.ExecutionSynchronization;
-import org.yakindu.sct.model.sexec.HistoryEntry;
-import org.yakindu.sct.model.sexec.If;
-import org.yakindu.sct.model.sexec.Reaction;
-import org.yakindu.sct.model.sexec.ReactionFired;
-import org.yakindu.sct.model.sexec.Sequence;
-import org.yakindu.sct.model.sexec.SexecFactory;
-import org.yakindu.sct.model.sexec.StateCase;
-import org.yakindu.sct.model.sexec.StateSwitch;
-import org.yakindu.sct.model.sexec.StateVector;
-import org.yakindu.sct.model.sexec.Step;
-import org.yakindu.sct.model.sexec.TraceNodeExecuted;
-import org.yakindu.sct.model.sexec.transformation.SexecElementMapping;
-import org.yakindu.sct.model.sexec.transformation.SexecExtensions;
-import org.yakindu.sct.model.sexec.transformation.SgraphExtensions;
-import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
-import org.yakindu.sct.model.sexec.transformation.TraceExtensions;
-import org.yakindu.sct.model.sgraph.Choice;
-import org.yakindu.sct.model.sgraph.Entry;
-import org.yakindu.sct.model.sgraph.EntryKind;
-import org.yakindu.sct.model.sgraph.FinalState;
-import org.yakindu.sct.model.sgraph.Region;
-import org.yakindu.sct.model.sgraph.RegularState;
-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.Synchronization;
-import org.yakindu.sct.model.sgraph.Transition;
-import org.yakindu.sct.model.stext.stext.BoolLiteral;
-import org.yakindu.sct.model.stext.stext.Literal;
-import org.yakindu.sct.model.stext.stext.PrimitiveValueExpression;
-
-@SuppressWarnings("all")
-public class ReactionBuilder {
-  @Inject
-  private SexecElementMapping mapping;
-  
-  @Inject
-  private SexecExtensions sexec;
-  
-  @Inject
-  private SgraphExtensions sgraph;
-  
-  @Inject
-  private StatechartExtensions sct;
-  
-  @Inject
-  private TraceExtensions trace;
-  
-  public ExecutionFlow defineStatechartReaction(final ExecutionFlow flow, final Statechart sc) {
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence sequence = _factory.createSequence();
-    sequence.setName("react");
-    String _name = sc.getName();
-    String _plus = ("The reactions of statechart " + _name);
-    sequence.setComment(_plus);
-    List<RegularState> _allRegularStates = this.sct.allRegularStates(sc);
-    final Function1<RegularState,Boolean> _function = new Function1<RegularState,Boolean>() {
-        public Boolean apply(final RegularState s) {
-          boolean _isLeaf = ReactionBuilder.this.sgraph.isLeaf(s);
-          return Boolean.valueOf(_isLeaf);
-        }
-      };
-    final Iterable<RegularState> leafStates = IterableExtensions.<RegularState>filter(_allRegularStates, _function);
-    SexecFactory _factory_1 = this.sexec.factory();
-    final StateSwitch sSwitch = _factory_1.createStateSwitch();
-    EList<Step> _steps = sequence.getSteps();
-    _steps.add(sSwitch);
-    final Function1<RegularState,ExecutionState> _function_1 = new Function1<RegularState,ExecutionState>() {
-        public ExecutionState apply(final RegularState s) {
-          ExecutionState _create = ReactionBuilder.this.mapping.create(s);
-          return _create;
-        }
-      };
-    Iterable<ExecutionState> _map = IterableExtensions.<RegularState, ExecutionState>map(leafStates, _function_1);
-    for (final ExecutionState leaf : _map) {
-      {
-        SexecFactory _factory_2 = this.sexec.factory();
-        final StateCase sCase = _factory_2.createStateCase();
-        sCase.setState(leaf);
-        Sequence _reactSequence = leaf.getReactSequence();
-        Call _newCall = this.mapping.newCall(_reactSequence);
-        sCase.setStep(_newCall);
-        EList<StateCase> _cases = sSwitch.getCases();
-        _cases.add(sCase);
-      }
-    }
-    flow.setReactSequence(sequence);
-    return flow;
-  }
-  
-  public ExecutionFlow defineRegularStateReactions(final ExecutionFlow flow, final Statechart sc) {
-    final List<RegularState> states = this.sct.allRegularStates(sc);
-    Iterable<State> _filter = Iterables.<State>filter(states, State.class);
-    final Function1<State,Boolean> _function = new Function1<State,Boolean>() {
-        public Boolean apply(final State s) {
-          boolean _isSimple = s.isSimple();
-          return Boolean.valueOf(_isSimple);
-        }
-      };
-    Iterable<State> _filter_1 = IterableExtensions.<State>filter(_filter, _function);
-    final Procedure1<State> _function_1 = new Procedure1<State>() {
-        public void apply(final State s) {
-          ReactionBuilder.this.defineCycle(s);
-        }
-      };
-    IterableExtensions.<State>forEach(_filter_1, _function_1);
-    Iterable<FinalState> _filter_2 = Iterables.<FinalState>filter(states, FinalState.class);
-    final Procedure1<FinalState> _function_2 = new Procedure1<FinalState>() {
-        public void apply(final FinalState s) {
-          ReactionBuilder.this.defineCycle(s);
-        }
-      };
-    IterableExtensions.<FinalState>forEach(_filter_2, _function_2);
-    return flow;
-  }
-  
-  public void definePseudoStateReactions(final ExecutionFlow flow, final Statechart sc) {
-    Iterable<Choice> _allChoices = this.sct.allChoices(sc);
-    final Procedure1<Choice> _function = new Procedure1<Choice>() {
-        public void apply(final Choice choice) {
-          ReactionBuilder.this.defineReaction(choice);
-        }
-      };
-    IterableExtensions.<Choice>forEach(_allChoices, _function);
-    Iterable<Synchronization> _allSynchronizations = this.sct.allSynchronizations(sc);
-    final Procedure1<Synchronization> _function_1 = new Procedure1<Synchronization>() {
-        public void apply(final Synchronization sync) {
-          ReactionBuilder.this.defineReaction(sync);
-        }
-      };
-    IterableExtensions.<Synchronization>forEach(_allSynchronizations, _function_1);
-  }
-  
-  public Sequence defineReaction(final Choice choice) {
-    final ExecutionChoice execChoice = this.mapping.create(choice);
-    EList<Reaction> _reactions = execChoice.getReactions();
-    final Function1<Reaction,Boolean> _function = new Function1<Reaction,Boolean>() {
-        public Boolean apply(final Reaction r) {
-          Check _check = r.getCheck();
-          boolean _alwaysTrue = ReactionBuilder.this.alwaysTrue(_check);
-          return Boolean.valueOf(_alwaysTrue);
-        }
-      };
-    Iterable<Reaction> _filter = IterableExtensions.<Reaction>filter(_reactions, _function);
-    List<Reaction> _list = IterableExtensions.<Reaction>toList(_filter);
-    final Reaction _default_ = IterableExtensions.<Reaction>head(_list);
-    boolean _notEquals = (!Objects.equal(_default_, null));
-    if (_notEquals) {
-      EList<Reaction> _reactions_1 = execChoice.getReactions();
-      EList<Reaction> _reactions_2 = execChoice.getReactions();
-      int _size = _reactions_2.size();
-      int _minus = (_size - 1);
-      _reactions_1.move(_minus, _default_);
-    }
-    final Sequence stateReaction = this.createReactionSequence(execChoice, null);
-    Sequence _reactSequence = execChoice.getReactSequence();
-    EList<Step> _steps = _reactSequence.getSteps();
-    EList<Step> _steps_1 = stateReaction.getSteps();
-    _steps.addAll(_steps_1);
-    Sequence _reactSequence_1 = execChoice.getReactSequence();
-    _reactSequence_1.setName("react");
-    Sequence _reactSequence_2 = execChoice.getReactSequence();
-    String _name = choice.getName();
-    String _plus = ("The reactions of state " + _name);
-    String _plus_1 = (_plus + ".");
-    _reactSequence_2.setComment(_plus_1);
-    boolean _isAddTraceSteps = this.trace.isAddTraceSteps();
-    if (_isAddTraceSteps) {
-      Sequence _reactSequence_3 = execChoice.getReactSequence();
-      EList<Step> _steps_2 = _reactSequence_3.getSteps();
-      ExecutionChoice _create = this.mapping.create(choice);
-      TraceNodeExecuted _newTraceNodeExecuted = this.trace.newTraceNodeExecuted(_create);
-      _steps_2.add(0, _newTraceNodeExecuted);
-    }
-    return execChoice.getReactSequence();
-  }
-  
-  /**
-   * TODO : support fork...
-   */
-  public Sequence defineReaction(final Synchronization sync) {
-    final ExecutionSynchronization execSync = this.mapping.create(sync);
-    EList<Reaction> _reactions = execSync.getReactions();
-    final Reaction _default_ = IterableExtensions.<Reaction>head(_reactions);
-    Sequence _reactSequence = execSync.getReactSequence();
-    EList<Step> _steps = _reactSequence.getSteps();
-    Step _effect = _default_.getEffect();
-    CollectionExtensions.<Step>addAll(_steps, _effect);
-    Sequence _reactSequence_1 = execSync.getReactSequence();
-    _reactSequence_1.setName("react");
-    Sequence _reactSequence_2 = execSync.getReactSequence();
-    String _name = sync.getName();
-    String _plus = ("The reactions of state " + _name);
-    String _plus_1 = (_plus + ".");
-    _reactSequence_2.setComment(_plus_1);
-    boolean _isAddTraceSteps = this.trace.isAddTraceSteps();
-    if (_isAddTraceSteps) {
-      Sequence _reactSequence_3 = execSync.getReactSequence();
-      EList<Step> _steps_1 = _reactSequence_3.getSteps();
-      ExecutionSynchronization _create = this.mapping.create(sync);
-      TraceNodeExecuted _newTraceNodeExecuted = this.trace.newTraceNodeExecuted(_create);
-      _steps_1.add(0, _newTraceNodeExecuted);
-    }
-    return execSync.getReactSequence();
-  }
-  
-  public boolean alwaysTrue(final Check check) {
-    boolean _and = false;
-    boolean _notEquals = (!Objects.equal(check, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      Statement _condition = check.getCondition();
-      _and = (_notEquals && (_condition instanceof PrimitiveValueExpression));
-    }
-    if (_and) {
-      Statement _condition_1 = check.getCondition();
-      final PrimitiveValueExpression pve = ((PrimitiveValueExpression) _condition_1);
-      boolean _and_1 = false;
-      Literal _value = pve.getValue();
-      if (!(_value instanceof BoolLiteral)) {
-        _and_1 = false;
-      } else {
-        Literal _value_1 = pve.getValue();
-        boolean _isValue = ((BoolLiteral) _value_1).isValue();
-        _and_1 = ((_value instanceof BoolLiteral) && _isValue);
-      }
-      return _and_1;
-    }
-    return false;
-  }
-  
-  public Sequence defineCycle(final RegularState state) {
-    final ExecutionState execState = this.mapping.create(state);
-    List<RegularState> _parentStates = this.sgraph.parentStates(state);
-    final Function1<RegularState,ExecutionState> _function = new Function1<RegularState,ExecutionState>() {
-        public ExecutionState apply(final RegularState p) {
-          ExecutionState _create = ReactionBuilder.this.mapping.create(p);
-          return ((ExecutionState) _create);
-        }
-      };
-    List<ExecutionState> _map = ListExtensions.<RegularState, ExecutionState>map(_parentStates, _function);
-    final Function1<ExecutionState,Boolean> _function_1 = new Function1<ExecutionState,Boolean>() {
-        public Boolean apply(final ExecutionState p) {
-          StateVector _stateVector = p.getStateVector();
-          int _offset = _stateVector.getOffset();
-          StateVector _stateVector_1 = execState.getStateVector();
-          int _offset_1 = _stateVector_1.getOffset();
-          boolean _equals = (_offset == _offset_1);
-          return Boolean.valueOf(_equals);
-        }
-      };
-    final Iterable<ExecutionState> parents = IterableExtensions.<ExecutionState>filter(_map, _function_1);
-    Iterable<ExecutionNode> _xifexpression = null;
-    EObject _rootContainer = EcoreUtil2.getRootContainer(execState);
-    StateVector _stateVector = ((ExecutionFlow) _rootContainer).getStateVector();
-    int _offset = _stateVector.getOffset();
-    StateVector _stateVector_1 = execState.getStateVector();
-    int _offset_1 = _stateVector_1.getOffset();
-    boolean _equals = (_offset == _offset_1);
-    if (_equals) {
-      final Function1<ExecutionState,ExecutionNode> _function_2 = new Function1<ExecutionState,ExecutionNode>() {
-          public ExecutionNode apply(final ExecutionState p) {
-            return ((ExecutionNode) p);
-          }
-        };
-      Iterable<ExecutionNode> _map_1 = IterableExtensions.<ExecutionState, ExecutionNode>map(parents, _function_2);
-      EObject _rootContainer_1 = EcoreUtil2.getRootContainer(execState);
-      HashSet<ExecutionNode> _newHashSet = CollectionLiterals.<ExecutionNode>newHashSet(((ExecutionNode) _rootContainer_1));
-      Iterable<ExecutionNode> _concat = Iterables.<ExecutionNode>concat(_map_1, _newHashSet);
-      _xifexpression = _concat;
-    } else {
-      final Function1<ExecutionState,ExecutionNode> _function_3 = new Function1<ExecutionState,ExecutionNode>() {
-          public ExecutionNode apply(final ExecutionState p) {
-            return ((ExecutionNode) p);
-          }
-        };
-      Iterable<ExecutionNode> _map_2 = IterableExtensions.<ExecutionState, ExecutionNode>map(parents, _function_3);
-      _xifexpression = _map_2;
-    }
-    final Iterable<ExecutionNode> parentNodes = _xifexpression;
-    final Function2<Sequence,ExecutionNode,Sequence> _function_4 = new Function2<Sequence,ExecutionNode,Sequence>() {
-        public Sequence apply(final Sequence r, final ExecutionNode s) {
-          Sequence _createReactionSequence = ReactionBuilder.this.createReactionSequence(s, r);
-          return _createReactionSequence;
-        }
-      };
-    Sequence _fold = IterableExtensions.<ExecutionNode, Sequence>fold(parentNodes, null, _function_4);
-    execState.setReactSequence(_fold);
-    Sequence _reactSequence = execState.getReactSequence();
-    _reactSequence.setName("react");
-    Sequence _reactSequence_1 = execState.getReactSequence();
-    String _name = state.getName();
-    String _plus = ("The reactions of state " + _name);
-    String _plus_1 = (_plus + ".");
-    _reactSequence_1.setComment(_plus_1);
-    return execState.getReactSequence();
-  }
-  
-  public Sequence createReactionSequence(final ExecutionNode state, final Step localStep) {
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence cycle = _factory.createSequence();
-    cycle.setName("react");
-    EList<Reaction> _reactions = state.getReactions();
-    final Function1<Reaction,Boolean> _function = new Function1<Reaction,Boolean>() {
-        public Boolean apply(final Reaction r) {
-          boolean _isTransition = r.isTransition();
-          boolean _not = (!_isTransition);
-          return Boolean.valueOf(_not);
-        }
-      };
-    Iterable<Reaction> _filter = IterableExtensions.<Reaction>filter(_reactions, _function);
-    final List<Reaction> localReactions = IterableExtensions.<Reaction>toList(_filter);
-    SexecFactory _factory_1 = this.sexec.factory();
-    Sequence localSteps = _factory_1.createSequence();
-    EList<Step> _steps = localSteps.getSteps();
-    final Function1<Reaction,If> _function_1 = new Function1<Reaction,If>() {
-        public If apply(final Reaction lr) {
-          If _xblockexpression = null;
-          {
-            SexecFactory _factory = ReactionBuilder.this.sexec.factory();
-            If ifStep = _factory.createIf();
-            Check _check = lr.getCheck();
-            CheckRef _newRef = ReactionBuilder.this.mapping.newRef(_check);
-            ifStep.setCheck(_newRef);
-            Step _effect = lr.getEffect();
-            Call _newCall = ReactionBuilder.this.mapping.newCall(_effect);
-            ifStep.setThenStep(_newCall);
-            _xblockexpression = (ifStep);
-          }
-          return _xblockexpression;
-        }
-      };
-    List<If> _map = ListExtensions.<Reaction, If>map(localReactions, _function_1);
-    _steps.addAll(_map);
-    boolean _notEquals = (!Objects.equal(localStep, null));
-    if (_notEquals) {
-      EList<Step> _steps_1 = localSteps.getSteps();
-      _steps_1.add(localStep);
-    }
-    EList<Step> _steps_2 = localSteps.getSteps();
-    boolean _isEmpty = _steps_2.isEmpty();
-    if (_isEmpty) {
-      localSteps = null;
-    }
-    EList<Reaction> _reactions_1 = state.getReactions();
-    final Function1<Reaction,Boolean> _function_2 = new Function1<Reaction,Boolean>() {
-        public Boolean apply(final Reaction r) {
-          boolean _isTransition = r.isTransition();
-          return Boolean.valueOf(_isTransition);
-        }
-      };
-    Iterable<Reaction> _filter_1 = IterableExtensions.<Reaction>filter(_reactions_1, _function_2);
-    final List<Reaction> transitionReactions = IterableExtensions.<Reaction>toList(_filter_1);
-    List<Reaction> _reverseView = ListExtensions.<Reaction>reverseView(transitionReactions);
-    final Function2<Step,Reaction,Step> _function_3 = new Function2<Step,Reaction,Step>() {
-        public Step apply(final Step s, final Reaction reaction) {
-          Step _xblockexpression = null;
-          {
-            SexecFactory _factory = ReactionBuilder.this.sexec.factory();
-            If ifStep = _factory.createIf();
-            Check _check = reaction.getCheck();
-            CheckRef _newRef = ReactionBuilder.this.mapping.newRef(_check);
-            ifStep.setCheck(_newRef);
-            Step _effect = reaction.getEffect();
-            Call _newCall = ReactionBuilder.this.mapping.newCall(_effect);
-            ifStep.setThenStep(_newCall);
-            ifStep.setElseStep(s);
-            _xblockexpression = (((Step) ifStep));
-          }
-          return _xblockexpression;
-        }
-      };
-    final Step transitionStep = IterableExtensions.<Reaction, Step>fold(_reverseView, ((Step) localSteps), _function_3);
-    boolean _notEquals_1 = (!Objects.equal(transitionStep, null));
-    if (_notEquals_1) {
-      EList<Step> _steps_3 = cycle.getSteps();
-      _steps_3.add(transitionStep);
-    } else {
-      boolean _notEquals_2 = (!Objects.equal(localSteps, null));
-      if (_notEquals_2) {
-        EList<Step> _steps_4 = cycle.getSteps();
-        _steps_4.add(localSteps);
-      }
-    }
-    return cycle;
-  }
-  
-  public ExecutionFlow defineEntryReactions(final Statechart statechart, final ExecutionFlow r) {
-    Iterable<Entry> _allEntries = this.sct.allEntries(statechart);
-    final Procedure1<Entry> _function = new Procedure1<Entry>() {
-        public void apply(final Entry e) {
-          ReactionBuilder.this.defineReaction(e);
-        }
-      };
-    IterableExtensions.<Entry>forEach(_allEntries, _function);
-    return r;
-  }
-  
-  public boolean defineReaction(final Entry e) {
-    boolean _xblockexpression = false;
-    {
-      final ExecutionEntry execEntry = this.mapping.create(e);
-      final Sequence seq = execEntry.getReactSequence();
-      State _target = this.sgraph.target(e);
-      final ExecutionState target = this.mapping.create(_target);
-      boolean _isAddTraceSteps = this.trace.isAddTraceSteps();
-      if (_isAddTraceSteps) {
-        EList<Step> _steps = seq.getSteps();
-        TraceNodeExecuted _newTraceNodeExecuted = this.trace.newTraceNodeExecuted(execEntry);
-        _steps.add(0, _newTraceNodeExecuted);
-      }
-      boolean _xifexpression = false;
-      EntryKind _kind = e.getKind();
-      boolean _equals = Objects.equal(_kind, EntryKind.INITIAL);
-      if (_equals) {
-        boolean _xifexpression_1 = false;
-        boolean _and = false;
-        boolean _notEquals = (!Objects.equal(target, null));
-        if (!_notEquals) {
-          _and = false;
-        } else {
-          Sequence _enterSequence = target.getEnterSequence();
-          boolean _notEquals_1 = (!Objects.equal(_enterSequence, null));
-          _and = (_notEquals && _notEquals_1);
-        }
-        if (_and) {
-          boolean _xblockexpression_1 = false;
-          {
-            boolean _isAddTraceSteps_1 = this.trace.isAddTraceSteps();
-            if (_isAddTraceSteps_1) {
-              EList<Step> _steps_1 = seq.getSteps();
-              EList<Transition> _outgoingTransitions = e.getOutgoingTransitions();
-              Transition _get = _outgoingTransitions.get(0);
-              Reaction _create = this.mapping.create(_get);
-              ReactionFired _newTraceReactionFired = this.trace.newTraceReactionFired(_create);
-              _steps_1.add(_newTraceReactionFired);
-            }
-            EList<Step> _steps_2 = seq.getSteps();
-            Sequence _enterSequence_1 = target.getEnterSequence();
-            Call _newCall = this.mapping.newCall(_enterSequence_1);
-            boolean _add = _steps_2.add(_newCall);
-            _xblockexpression_1 = (_add);
-          }
-          _xifexpression_1 = _xblockexpression_1;
-        }
-        _xifexpression = _xifexpression_1;
-      } else {
-        boolean _xifexpression_2 = false;
-        EntryKind _kind_1 = e.getKind();
-        boolean _equals_1 = Objects.equal(_kind_1, EntryKind.SHALLOW_HISTORY);
-        if (_equals_1) {
-          boolean _xblockexpression_2 = false;
-          {
-            SexecFactory _factory = this.sexec.factory();
-            final HistoryEntry entryStep = _factory.createHistoryEntry();
-            entryStep.setName("HistoryEntry");
-            entryStep.setComment("Enter the region with shallow history");
-            entryStep.setDeep(false);
-            EObject _eContainer = e.eContainer();
-            ExecutionRegion _create = this.mapping.create(((Region) _eContainer));
-            entryStep.setRegion(_create);
-            boolean _and_1 = false;
-            boolean _notEquals_2 = (!Objects.equal(target, null));
-            if (!_notEquals_2) {
-              _and_1 = false;
-            } else {
-              Sequence _enterSequence_1 = target.getEnterSequence();
-              boolean _notEquals_3 = (!Objects.equal(_enterSequence_1, null));
-              _and_1 = (_notEquals_2 && _notEquals_3);
-            }
-            if (_and_1) {
-              boolean _isAddTraceSteps_1 = this.trace.isAddTraceSteps();
-              if (_isAddTraceSteps_1) {
-                EList<Step> _steps_1 = seq.getSteps();
-                EList<Transition> _outgoingTransitions = e.getOutgoingTransitions();
-                Transition _get = _outgoingTransitions.get(0);
-                Reaction _create_1 = this.mapping.create(_get);
-                ReactionFired _newTraceReactionFired = this.trace.newTraceReactionFired(_create_1);
-                _steps_1.add(_newTraceReactionFired);
-              }
-              Sequence _enterSequence_2 = target.getEnterSequence();
-              Call _newCall = this.mapping.newCall(_enterSequence_2);
-              entryStep.setInitialStep(_newCall);
-            }
-            EObject _eContainer_1 = e.eContainer();
-            ExecutionRegion _create_2 = this.mapping.create(((Region) _eContainer_1));
-            Sequence _shallowEnterSequence = _create_2.getShallowEnterSequence();
-            Call _newCall_1 = this.mapping.newCall(_shallowEnterSequence);
-            entryStep.setHistoryStep(_newCall_1);
-            EList<Step> _steps_2 = seq.getSteps();
-            boolean _add = _steps_2.add(entryStep);
-            _xblockexpression_2 = (_add);
-          }
-          _xifexpression_2 = _xblockexpression_2;
-        } else {
-          boolean _xifexpression_3 = false;
-          EntryKind _kind_2 = e.getKind();
-          boolean _equals_2 = Objects.equal(_kind_2, EntryKind.DEEP_HISTORY);
-          if (_equals_2) {
-            boolean _xblockexpression_3 = false;
-            {
-              SexecFactory _factory = this.sexec.factory();
-              final HistoryEntry entryStep = _factory.createHistoryEntry();
-              entryStep.setName("HistoryEntry");
-              entryStep.setComment("Enter the region with deep history");
-              EObject _eContainer = e.eContainer();
-              ExecutionRegion _create = this.mapping.create(((Region) _eContainer));
-              entryStep.setRegion(_create);
-              entryStep.setDeep(true);
-              boolean _and_1 = false;
-              boolean _notEquals_2 = (!Objects.equal(target, null));
-              if (!_notEquals_2) {
-                _and_1 = false;
-              } else {
-                Sequence _enterSequence_1 = target.getEnterSequence();
-                boolean _notEquals_3 = (!Objects.equal(_enterSequence_1, null));
-                _and_1 = (_notEquals_2 && _notEquals_3);
-              }
-              if (_and_1) {
-                boolean _isAddTraceSteps_1 = this.trace.isAddTraceSteps();
-                if (_isAddTraceSteps_1) {
-                  EList<Step> _steps_1 = seq.getSteps();
-                  EList<Transition> _outgoingTransitions = e.getOutgoingTransitions();
-                  Transition _get = _outgoingTransitions.get(0);
-                  Reaction _create_1 = this.mapping.create(_get);
-                  ReactionFired _newTraceReactionFired = this.trace.newTraceReactionFired(_create_1);
-                  _steps_1.add(_newTraceReactionFired);
-                }
-                Sequence _enterSequence_2 = target.getEnterSequence();
-                Call _newCall = this.mapping.newCall(_enterSequence_2);
-                entryStep.setInitialStep(_newCall);
-              }
-              EObject _eContainer_1 = e.eContainer();
-              ExecutionRegion _create_2 = this.mapping.create(((Region) _eContainer_1));
-              Sequence _deepEnterSequence = _create_2.getDeepEnterSequence();
-              Call _newCall_1 = this.mapping.newCall(_deepEnterSequence);
-              entryStep.setHistoryStep(_newCall_1);
-              EList<Step> _steps_2 = seq.getSteps();
-              boolean _add = _steps_2.add(entryStep);
-              _xblockexpression_3 = (_add);
-            }
-            _xifexpression_3 = _xblockexpression_3;
-          }
-          _xifexpression_2 = _xifexpression_3;
-        }
-        _xifexpression = _xifexpression_2;
-      }
-      _xblockexpression = (_xifexpression);
-    }
-    return _xblockexpression;
-  }
-}

Разница между файлами не показана из-за своего большого размера
+ 0 - 1006
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.java


+ 0 - 874
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.java

@@ -1,874 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.xtext.naming.IQualifiedNameProvider;
-import org.eclipse.xtext.naming.QualifiedName;
-import org.eclipse.xtext.util.Strings;
-import org.eclipse.xtext.xbase.lib.CollectionLiterals;
-import org.eclipse.xtext.xbase.lib.Functions.Function0;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-import org.eclipse.xtext.xbase.lib.StringExtensions;
-import org.yakindu.base.base.NamedElement;
-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.ExecutionChoice;
-import org.yakindu.sct.model.sexec.ExecutionEntry;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.ExecutionNode;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.ExecutionSynchronization;
-import org.yakindu.sct.model.sexec.Reaction;
-import org.yakindu.sct.model.sexec.ScheduleTimeEvent;
-import org.yakindu.sct.model.sexec.Sequence;
-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.SexecExtensions;
-import org.yakindu.sct.model.sexec.transformation.SgraphExtensions;
-import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
-import org.yakindu.sct.model.sexec.transformation.StextExtensions;
-import org.yakindu.sct.model.sgraph.Choice;
-import org.yakindu.sct.model.sgraph.CompositeElement;
-import org.yakindu.sct.model.sgraph.Entry;
-import org.yakindu.sct.model.sgraph.EntryKind;
-import org.yakindu.sct.model.sgraph.FinalState;
-import org.yakindu.sct.model.sgraph.Region;
-import org.yakindu.sct.model.sgraph.RegularState;
-import org.yakindu.sct.model.sgraph.SGraphFactory;
-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.Synchronization;
-import org.yakindu.sct.model.sgraph.Transition;
-import org.yakindu.sct.model.sgraph.Vertex;
-import org.yakindu.sct.model.stext.stext.AlwaysEvent;
-import org.yakindu.sct.model.stext.stext.BoolLiteral;
-import org.yakindu.sct.model.stext.stext.ElementReferenceExpression;
-import org.yakindu.sct.model.stext.stext.EventDefinition;
-import org.yakindu.sct.model.stext.stext.EventSpec;
-import org.yakindu.sct.model.stext.stext.Expression;
-import org.yakindu.sct.model.stext.stext.FeatureCall;
-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.OperationDefinition;
-import org.yakindu.sct.model.stext.stext.PrimitiveValueExpression;
-import org.yakindu.sct.model.stext.stext.ReactionTrigger;
-import org.yakindu.sct.model.stext.stext.RegularEventSpec;
-import org.yakindu.sct.model.stext.stext.StextFactory;
-import org.yakindu.sct.model.stext.stext.TimeEventSpec;
-import org.yakindu.sct.model.stext.stext.TimeEventType;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-
-@Singleton
-@SuppressWarnings("all")
-public class SexecElementMapping {
-  @Inject
-  private IQualifiedNameProvider qfnProvider;
-  
-  @Inject
-  private StatechartExtensions sce;
-  
-  @Inject
-  private SgraphExtensions sgraph;
-  
-  @Inject
-  private StextExtensions stext;
-  
-  @Inject
-  private SexecExtensions sexec;
-  
-  public ExecutionFlow create(final Statechart statechart) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(statechart);
-    final ExecutionFlow _result;
-    synchronized (_createCache_create) {
-      if (_createCache_create.containsKey(_cacheKey)) {
-        return _createCache_create.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionFlow _createExecutionFlow = _sexecFactory.createExecutionFlow();
-      _result = _createExecutionFlow;
-      _createCache_create.put(_cacheKey, _result);
-    }
-    _init_create(_result, statechart);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionFlow> _createCache_create = CollectionLiterals.newHashMap();
-  
-  private void _init_create(final ExecutionFlow r, final Statechart statechart) {
-    String _name = statechart.getName();
-    r.setName(_name);
-    r.setSourceElement(statechart);
-  }
-  
-  protected Scope _createScope(final InterfaceScope scope) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(scope);
-    final InterfaceScope _result;
-    synchronized (_createCache_createScope) {
-      if (_createCache_createScope.containsKey(_cacheKey)) {
-        return _createCache_createScope.get(_cacheKey);
-      }
-      StextFactory _stextFactory = this.stextFactory();
-      InterfaceScope _createInterfaceScope = _stextFactory.createInterfaceScope();
-      _result = _createInterfaceScope;
-      _createCache_createScope.put(_cacheKey, _result);
-    }
-    _init_createScope(_result, scope);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,Scope> _createCache_createScope = CollectionLiterals.newHashMap();
-  
-  private void _init_createScope(final InterfaceScope r, final InterfaceScope scope) {
-    String _name = scope.getName();
-    r.setName(_name);
-  }
-  
-  protected Scope _createScope(final Scope scope) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(scope);
-    final InternalScope _result;
-    synchronized (_createCache_createScope_1) {
-      if (_createCache_createScope_1.containsKey(_cacheKey)) {
-        return _createCache_createScope_1.get(_cacheKey);
-      }
-      StextFactory _stextFactory = this.stextFactory();
-      InternalScope _createInternalScope = _stextFactory.createInternalScope();
-      _result = _createInternalScope;
-      _createCache_createScope_1.put(_cacheKey, _result);
-    }
-    _init_createScope_1(_result, scope);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,Scope> _createCache_createScope_1 = CollectionLiterals.newHashMap();
-  
-  private void _init_createScope_1(final InternalScope r, final Scope scope) {
-  }
-  
-  public Scope timeEventScope(final ExecutionFlow flow) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(flow);
-    final Scope _result;
-    synchronized (_createCache_timeEventScope) {
-      if (_createCache_timeEventScope.containsKey(_cacheKey)) {
-        return _createCache_timeEventScope.get(_cacheKey);
-      }
-      SGraphFactory _factory = this.sgraph.factory();
-      Scope _createScope = _factory.createScope();
-      _result = _createScope;
-      _createCache_timeEventScope.put(_cacheKey, _result);
-    }
-    _init_timeEventScope(_result, flow);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,Scope> _createCache_timeEventScope = CollectionLiterals.newHashMap();
-  
-  private void _init_timeEventScope(final Scope r, final ExecutionFlow flow) {
-    EList<Scope> _scopes = flow.getScopes();
-    _scopes.add(r);
-  }
-  
-  public void cleanup() {
-    this._createCache_create.clear();
-    this._createCache_createCheck.clear();
-    this._createCache_createDerivedEvent.clear();
-    this._createCache_create_1.clear();
-    this._createCache_create_10.clear();
-    this._createCache_createScope.clear();
-    this._createCache_createScope_1.clear();
-    this._createCache_create_2.clear();
-    this._createCache_create_3.clear();
-    this._createCache_create_4.clear();
-    this._createCache_create_5.clear();
-    this._createCache_create_6.clear();
-    this._createCache_create_7.clear();
-    this._createCache_create_8.clear();
-    this._createCache_create_9.clear();
-    this._createCache_timeEventScope.clear();
-  }
-  
-  public EventDefinition create(final EventDefinition event) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(event);
-    final EventDefinition _result;
-    synchronized (_createCache_create_1) {
-      if (_createCache_create_1.containsKey(_cacheKey)) {
-        return _createCache_create_1.get(_cacheKey);
-      }
-      EventDefinition _copy = EcoreUtil.<EventDefinition>copy(event);
-      _result = _copy;
-      _createCache_create_1.put(_cacheKey, _result);
-    }
-    _init_create_1(_result, event);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,EventDefinition> _createCache_create_1 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_1(final EventDefinition r, final EventDefinition event) {
-  }
-  
-  public VariableDefinition create(final VariableDefinition v) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(v);
-    final VariableDefinition _result;
-    synchronized (_createCache_create_2) {
-      if (_createCache_create_2.containsKey(_cacheKey)) {
-        return _createCache_create_2.get(_cacheKey);
-      }
-      VariableDefinition _copy = EcoreUtil.<VariableDefinition>copy(v);
-      _result = _copy;
-      _createCache_create_2.put(_cacheKey, _result);
-    }
-    _init_create_2(_result, v);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,VariableDefinition> _createCache_create_2 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_2(final VariableDefinition r, final VariableDefinition v) {
-  }
-  
-  public OperationDefinition create(final OperationDefinition v) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(v);
-    final OperationDefinition _result;
-    synchronized (_createCache_create_3) {
-      if (_createCache_create_3.containsKey(_cacheKey)) {
-        return _createCache_create_3.get(_cacheKey);
-      }
-      OperationDefinition _copy = EcoreUtil.<OperationDefinition>copy(v);
-      _result = _copy;
-      _createCache_create_3.put(_cacheKey, _result);
-    }
-    _init_create_3(_result, v);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,OperationDefinition> _createCache_create_3 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_3(final OperationDefinition r, final OperationDefinition v) {
-  }
-  
-  public ExecutionState create(final RegularState state) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(state);
-    final ExecutionState _result;
-    synchronized (_createCache_create_4) {
-      if (_createCache_create_4.containsKey(_cacheKey)) {
-        return _createCache_create_4.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionState _createExecutionState = _sexecFactory.createExecutionState();
-      _result = _createExecutionState;
-      _createCache_create_4.put(_cacheKey, _result);
-    }
-    _init_create_4(_result, state);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionState> _createCache_create_4 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_4(final ExecutionState r, final RegularState state) {
-    boolean _notEquals = (!Objects.equal(state, null));
-    if (_notEquals) {
-      Region _parentRegion = state.getParentRegion();
-      EList<Vertex> _vertices = _parentRegion.getVertices();
-      Iterable<FinalState> _filter = Iterables.<FinalState>filter(_vertices, FinalState.class);
-      List<FinalState> _list = IterableExtensions.<FinalState>toList(_filter);
-      final int n = _list.indexOf(state);
-      String _xifexpression = null;
-      if ((state instanceof FinalState)) {
-        String _plus = ("_final_" + Integer.valueOf(n));
-        _xifexpression = _plus;
-      } else {
-        String _name = state.getName();
-        _xifexpression = _name;
-      }
-      r.setSimpleName(_xifexpression);
-      QualifiedName _fullyQualifiedName = this.qfnProvider.getFullyQualifiedName(state);
-      String _string = _fullyQualifiedName.toString();
-      String _replaceAll = _string.replaceAll(" ", "");
-      r.setName(_replaceAll);
-      r.setSourceElement(state);
-    }
-  }
-  
-  public ExecutionChoice create(final Choice choice) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(choice);
-    final ExecutionChoice _result;
-    synchronized (_createCache_create_5) {
-      if (_createCache_create_5.containsKey(_cacheKey)) {
-        return _createCache_create_5.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionChoice _createExecutionChoice = _sexecFactory.createExecutionChoice();
-      _result = _createExecutionChoice;
-      _createCache_create_5.put(_cacheKey, _result);
-    }
-    _init_create_5(_result, choice);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionChoice> _createCache_create_5 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_5(final ExecutionChoice r, final Choice choice) {
-    boolean _notEquals = (!Objects.equal(choice, null));
-    if (_notEquals) {
-      Region _parentRegion = choice.getParentRegion();
-      EList<Vertex> _vertices = _parentRegion.getVertices();
-      Iterable<Choice> _filter = Iterables.<Choice>filter(_vertices, Choice.class);
-      List<Choice> _list = IterableExtensions.<Choice>toList(_filter);
-      final int n = _list.indexOf(choice);
-      String _plus = ("_choice" + Integer.valueOf(n));
-      String _plus_1 = (_plus + "_");
-      r.setSimpleName(_plus_1);
-      QualifiedName _fullyQualifiedName = this.qfnProvider.getFullyQualifiedName(choice);
-      String _string = _fullyQualifiedName.toString();
-      String _replaceAll = _string.replaceAll(" ", "");
-      r.setName(_replaceAll);
-      r.setSourceElement(choice);
-      SexecFactory _sexecFactory = this.sexecFactory();
-      Sequence _createSequence = _sexecFactory.createSequence();
-      r.setReactSequence(_createSequence);
-    }
-  }
-  
-  public ExecutionEntry create(final Entry entry) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(entry);
-    final ExecutionEntry _result;
-    synchronized (_createCache_create_6) {
-      if (_createCache_create_6.containsKey(_cacheKey)) {
-        return _createCache_create_6.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionEntry _createExecutionEntry = _sexecFactory.createExecutionEntry();
-      _result = _createExecutionEntry;
-      _createCache_create_6.put(_cacheKey, _result);
-    }
-    _init_create_6(_result, entry);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionEntry> _createCache_create_6 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_6(final ExecutionEntry r, final Entry entry) {
-    boolean _notEquals = (!Objects.equal(entry, null));
-    if (_notEquals) {
-      EObject _eContainer = entry.eContainer();
-      final Region region = ((Region) _eContainer);
-      String _name = region.getName();
-      final String regionName = StringExtensions.toFirstUpper(_name);
-      String _xifexpression = null;
-      EObject _eContainer_1 = region.eContainer();
-      if ((_eContainer_1 instanceof State)) {
-        EObject _eContainer_2 = region.eContainer();
-        String _name_1 = ((State) _eContainer_2).getName();
-        String _firstUpper = StringExtensions.toFirstUpper(_name_1);
-        _xifexpression = _firstUpper;
-      }
-      final String stateName = _xifexpression;
-      String _xifexpression_1 = null;
-      String _name_2 = entry.getName();
-      boolean _isEmpty = _name_2==null?false:_name_2.isEmpty();
-      boolean _not = (!_isEmpty);
-      if (_not) {
-        String _name_3 = entry.getName();
-        _xifexpression_1 = _name_3;
-      } else {
-        _xifexpression_1 = "_entry_Default";
-      }
-      final String entryName = _xifexpression_1;
-      String _xifexpression_2 = null;
-      boolean _notEquals_1 = (!Objects.equal(regionName, null));
-      if (_notEquals_1) {
-        _xifexpression_2 = regionName;
-      } else {
-        _xifexpression_2 = "";
-      }
-      String _plus = (new Function0<Object>() {
-        public Object apply() {
-          String _xifexpression = null;
-          boolean _notEquals = (!Objects.equal(regionName, null));
-          if (_notEquals) {
-            _xifexpression = regionName;
-          } else {
-            _xifexpression = "";
-          }
-          return _xifexpression;
-        }
-      }.apply() + "_");
-      String _xifexpression_3 = null;
-      boolean _notEquals_2 = (!Objects.equal(stateName, null));
-      if (_notEquals_2) {
-        _xifexpression_3 = stateName;
-      } else {
-        _xifexpression_3 = "";
-      }
-      String _plus_1 = (_plus + new Function0<String>() {
-        public String apply() {
-          String _xifexpression = null;
-          boolean _notEquals = (!Objects.equal(stateName, null));
-          if (_notEquals) {
-            _xifexpression = stateName;
-          } else {
-            _xifexpression = "";
-          }
-          return _xifexpression;
-        }
-      }.apply());
-      String _plus_2 = (_plus_1 + "_");
-      String _plus_3 = (_plus_2 + entryName);
-      r.setSimpleName(_plus_3);
-      QualifiedName _fullyQualifiedName = this.qfnProvider.getFullyQualifiedName(entry);
-      String _string = _fullyQualifiedName.toString();
-      String _replaceAll = _string.replaceAll(" ", "");
-      r.setName(_replaceAll);
-      r.setSourceElement(entry);
-      SexecFactory _factory = this.sexec.factory();
-      final Sequence seq = _factory.createSequence();
-      seq.setName("react");
-      String _switchResult = null;
-      EntryKind _kind = entry.getKind();
-      final EntryKind _switchValue = _kind;
-      boolean _matched = false;
-      if (!_matched) {
-        if (Objects.equal(_switchValue,EntryKind.INITIAL)) {
-          _matched=true;
-          _switchResult = "initial ";
-        }
-      }
-      if (!_matched) {
-        if (Objects.equal(_switchValue,EntryKind.DEEP_HISTORY)) {
-          _matched=true;
-          _switchResult = "deep history ";
-        }
-      }
-      if (!_matched) {
-        if (Objects.equal(_switchValue,EntryKind.SHALLOW_HISTORY)) {
-          _matched=true;
-          _switchResult = "shallow history ";
-        }
-      }
-      if (!_matched) {
-        _switchResult = "";
-      }
-      String _plus_4 = ("Default react sequence for " + _switchResult);
-      String _plus_5 = (_plus_4 + "entry ");
-      String _name_4 = entry.getName();
-      String _plus_6 = (_plus_5 + _name_4);
-      seq.setComment(_plus_6);
-      r.setReactSequence(seq);
-      EList<Transition> _outgoingTransitions = entry.getOutgoingTransitions();
-      final Procedure1<Transition> _function = new Procedure1<Transition>() {
-          public void apply(final Transition t) {
-            EList<Reaction> _reactions = r.getReactions();
-            Reaction _create = SexecElementMapping.this.create(t);
-            _reactions.add(_create);
-          }
-        };
-      IterableExtensions.<Transition>forEach(_outgoingTransitions, _function);
-    }
-  }
-  
-  public ExecutionSynchronization create(final Synchronization sync) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(sync);
-    final ExecutionSynchronization _result;
-    synchronized (_createCache_create_7) {
-      if (_createCache_create_7.containsKey(_cacheKey)) {
-        return _createCache_create_7.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionSynchronization _createExecutionSynchronization = _sexecFactory.createExecutionSynchronization();
-      _result = _createExecutionSynchronization;
-      _createCache_create_7.put(_cacheKey, _result);
-    }
-    _init_create_7(_result, sync);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionSynchronization> _createCache_create_7 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_7(final ExecutionSynchronization r, final Synchronization sync) {
-    boolean _notEquals = (!Objects.equal(sync, null));
-    if (_notEquals) {
-      Region _parentRegion = sync.getParentRegion();
-      EList<Vertex> _vertices = _parentRegion.getVertices();
-      Iterable<Synchronization> _filter = Iterables.<Synchronization>filter(_vertices, Synchronization.class);
-      List<Synchronization> _list = IterableExtensions.<Synchronization>toList(_filter);
-      final int n = _list.indexOf(sync);
-      String _plus = ("_sync" + Integer.valueOf(n));
-      String _plus_1 = (_plus + "_");
-      r.setSimpleName(_plus_1);
-      QualifiedName _fullyQualifiedName = this.qfnProvider.getFullyQualifiedName(sync);
-      String _string = _fullyQualifiedName.toString();
-      String _replaceAll = _string.replaceAll(" ", "");
-      r.setName(_replaceAll);
-      r.setSourceElement(sync);
-      SexecFactory _sexecFactory = this.sexecFactory();
-      Sequence _createSequence = _sexecFactory.createSequence();
-      r.setReactSequence(_createSequence);
-    }
-  }
-  
-  public ExecutionRegion create(final Region region) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(region);
-    final ExecutionRegion _result;
-    synchronized (_createCache_create_8) {
-      if (_createCache_create_8.containsKey(_cacheKey)) {
-        return _createCache_create_8.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionRegion _createExecutionRegion = _sexecFactory.createExecutionRegion();
-      _result = _createExecutionRegion;
-      _createCache_create_8.put(_cacheKey, _result);
-    }
-    _init_create_8(_result, region);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionRegion> _createCache_create_8 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_8(final ExecutionRegion r, final Region region) {
-    boolean _notEquals = (!Objects.equal(region, null));
-    if (_notEquals) {
-      String _name = region.getName();
-      boolean _isEmpty = Strings.isEmpty(_name);
-      if (_isEmpty) {
-        EObject _eContainer = region.eContainer();
-        final CompositeElement container = ((CompositeElement) _eContainer);
-        EList<Region> _regions = container.getRegions();
-        final int index = _regions.indexOf(region);
-        String _plus = ("region" + Integer.valueOf(index));
-        r.setName(_plus);
-      } else {
-        String _name_1 = region.getName();
-        r.setName(_name_1);
-      }
-      r.setSourceElement(region);
-    }
-  }
-  
-  public Check createCheck(final ReactionTrigger tr) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(tr);
-    final Check _result;
-    synchronized (_createCache_createCheck) {
-      if (_createCache_createCheck.containsKey(_cacheKey)) {
-        return _createCache_createCheck.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      Check _createCheck = _sexecFactory.createCheck();
-      _result = _createCheck;
-      _createCache_createCheck.put(_cacheKey, _result);
-    }
-    _init_createCheck(_result, tr);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,Check> _createCache_createCheck = CollectionLiterals.newHashMap();
-  
-  private void _init_createCheck(final Check r, final ReactionTrigger tr) {
-    org.yakindu.sct.model.sgraph.Reaction _reaction = this.sce.reaction(tr);
-    String _id = this.sce.id(_reaction);
-    r.setName(_id);
-  }
-  
-  public Reaction create(final Transition tr) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(tr);
-    final Reaction _result;
-    synchronized (_createCache_create_9) {
-      if (_createCache_create_9.containsKey(_cacheKey)) {
-        return _createCache_create_9.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      Reaction _createReaction = _sexecFactory.createReaction();
-      _result = _createReaction;
-      _createCache_create_9.put(_cacheKey, _result);
-    }
-    _init_create_9(_result, tr);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,Reaction> _createCache_create_9 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_9(final Reaction r, final Transition tr) {
-    String _id = this.sce.id(tr);
-    r.setName(_id);
-    r.setTransition(true);
-    r.setSourceElement(tr);
-  }
-  
-  public Reaction create(final LocalReaction lr) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(lr);
-    final Reaction _result;
-    synchronized (_createCache_create_10) {
-      if (_createCache_create_10.containsKey(_cacheKey)) {
-        return _createCache_create_10.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      Reaction _createReaction = _sexecFactory.createReaction();
-      _result = _createReaction;
-      _createCache_create_10.put(_cacheKey, _result);
-    }
-    _init_create_10(_result, lr);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,Reaction> _createCache_create_10 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_10(final Reaction r, final LocalReaction lr) {
-    String _id = this.sce.id(lr);
-    r.setName(_id);
-    r.setTransition(false);
-  }
-  
-  public CheckRef newRef(final Check check) {
-    CheckRef _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final CheckRef r = _sexecFactory.createCheckRef();
-      r.setCheck(check);
-      _xblockexpression = (r);
-    }
-    return _xblockexpression;
-  }
-  
-  public Call newCall(final Step step) {
-    Call _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final Call r = _sexecFactory.createCall();
-      r.setStep(step);
-      _xblockexpression = (r);
-    }
-    return _xblockexpression;
-  }
-  
-  public ScheduleTimeEvent newScheduleTimeEvent(final TimeEvent te, final Statement timeValue) {
-    ScheduleTimeEvent _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final ScheduleTimeEvent r = _sexecFactory.createScheduleTimeEvent();
-      r.setTimeEvent(te);
-      r.setTimeValue(timeValue);
-      _xblockexpression = (r);
-    }
-    return _xblockexpression;
-  }
-  
-  public UnscheduleTimeEvent newUnscheduleTimeEvent(final TimeEvent te) {
-    UnscheduleTimeEvent _xblockexpression = null;
-    {
-      SexecFactory _sexecFactory = this.sexecFactory();
-      final UnscheduleTimeEvent r = _sexecFactory.createUnscheduleTimeEvent();
-      r.setTimeEvent(te);
-      _xblockexpression = (r);
-    }
-    return _xblockexpression;
-  }
-  
-  public TimeEvent createDerivedEvent(final TimeEventSpec tes) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(tes);
-    final TimeEvent _result;
-    synchronized (_createCache_createDerivedEvent) {
-      if (_createCache_createDerivedEvent.containsKey(_cacheKey)) {
-        return _createCache_createDerivedEvent.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      TimeEvent _createTimeEvent = _sexecFactory.createTimeEvent();
-      _result = _createTimeEvent;
-      _createCache_createDerivedEvent.put(_cacheKey, _result);
-    }
-    _init_createDerivedEvent(_result, tes);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,TimeEvent> _createCache_createDerivedEvent = CollectionLiterals.newHashMap();
-  
-  private void _init_createDerivedEvent(final TimeEvent r, final TimeEventSpec tes) {
-    TimeEventType _type = tes.getType();
-    boolean _equals = Objects.equal(_type, TimeEventType.EVERY);
-    r.setPeriodic(_equals);
-  }
-  
-  protected Expression _raised(final EventSpec e) {
-    return null;
-  }
-  
-  protected Expression _raised(final RegularEventSpec e) {
-    StextFactory _factory = this.stext.factory();
-    final ElementReferenceExpression r = _factory.createElementReferenceExpression();
-    EObject _eContainer = e.eContainer();
-    NamedElement _resolveRegularEventSpec = this.resolveRegularEventSpec(e, _eContainer);
-    r.setReference(_resolveRegularEventSpec);
-    return r;
-  }
-  
-  protected NamedElement _resolveRegularEventSpec(final Object o, final Object context) {
-    return null;
-  }
-  
-  protected NamedElement _resolveRegularEventSpec(final RegularEventSpec re, final Object context) {
-    NamedElement _xifexpression = null;
-    Expression _event = re.getEvent();
-    boolean _notEquals = (!Objects.equal(_event, null));
-    if (_notEquals) {
-      Expression _event_1 = re.getEvent();
-      NamedElement _resolveRegularEventSpec = this.resolveRegularEventSpec(_event_1, re);
-      _xifexpression = _resolveRegularEventSpec;
-    }
-    return _xifexpression;
-  }
-  
-  protected NamedElement _resolveRegularEventSpec(final FeatureCall fc, final Object context) {
-    NamedElement _xifexpression = null;
-    EObject _feature = fc.getFeature();
-    boolean _notEquals = (!Objects.equal(_feature, null));
-    if (_notEquals) {
-      EObject _feature_1 = fc.getFeature();
-      NamedElement _resolveRegularEventSpec = this.resolveRegularEventSpec(_feature_1, fc);
-      _xifexpression = _resolveRegularEventSpec;
-    }
-    return _xifexpression;
-  }
-  
-  protected NamedElement _resolveRegularEventSpec(final ElementReferenceExpression ter, final Object context) {
-    NamedElement _xifexpression = null;
-    EObject _reference = ter.getReference();
-    boolean _notEquals = (!Objects.equal(_reference, null));
-    if (_notEquals) {
-      EObject _reference_1 = ter.getReference();
-      NamedElement _resolveRegularEventSpec = this.resolveRegularEventSpec(_reference_1, ter);
-      _xifexpression = _resolveRegularEventSpec;
-    }
-    return _xifexpression;
-  }
-  
-  protected NamedElement _resolveRegularEventSpec(final EventDefinition ed, final Object context) {
-    EventDefinition _create = this.create(ed);
-    return _create;
-  }
-  
-  protected Expression _raised(final TimeEventSpec e) {
-    StextFactory _factory = this.stext.factory();
-    final ElementReferenceExpression r = _factory.createElementReferenceExpression();
-    TimeEvent _createDerivedEvent = this.createDerivedEvent(e);
-    r.setReference(_createDerivedEvent);
-    return r;
-  }
-  
-  protected Expression _raised(final AlwaysEvent e) {
-    StextFactory _factory = this.stext.factory();
-    final PrimitiveValueExpression r = _factory.createPrimitiveValueExpression();
-    StextFactory _factory_1 = this.stext.factory();
-    final BoolLiteral boolLit = _factory_1.createBoolLiteral();
-    boolLit.setValue(true);
-    r.setValue(boolLit);
-    return r;
-  }
-  
-  protected ExecutionNode _mapped(final State s) {
-    ExecutionState _create = this.create(s);
-    return _create;
-  }
-  
-  protected ExecutionNode _mapped(final FinalState s) {
-    ExecutionState _create = this.create(s);
-    return _create;
-  }
-  
-  protected ExecutionNode _mapped(final Choice s) {
-    ExecutionChoice _create = this.create(s);
-    return _create;
-  }
-  
-  protected ExecutionNode _mapped(final Entry s) {
-    ExecutionEntry _create = this.create(s);
-    return _create;
-  }
-  
-  protected ExecutionNode _mapped(final Synchronization s) {
-    ExecutionSynchronization _create = this.create(s);
-    return _create;
-  }
-  
-  public SexecFactory sexecFactory() {
-    return SexecFactory.eINSTANCE;
-  }
-  
-  public StextFactory stextFactory() {
-    return StextFactory.eINSTANCE;
-  }
-  
-  public Scope createScope(final Scope scope) {
-    if (scope instanceof InterfaceScope) {
-      return _createScope((InterfaceScope)scope);
-    } else if (scope != null) {
-      return _createScope(scope);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(scope).toString());
-    }
-  }
-  
-  public Expression raised(final EventSpec e) {
-    if (e instanceof AlwaysEvent) {
-      return _raised((AlwaysEvent)e);
-    } else if (e instanceof RegularEventSpec) {
-      return _raised((RegularEventSpec)e);
-    } else if (e instanceof TimeEventSpec) {
-      return _raised((TimeEventSpec)e);
-    } else if (e != null) {
-      return _raised(e);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(e).toString());
-    }
-  }
-  
-  public NamedElement resolveRegularEventSpec(final Object ed, final Object context) {
-    if (ed instanceof EventDefinition) {
-      return _resolveRegularEventSpec((EventDefinition)ed, context);
-    } else if (ed instanceof ElementReferenceExpression) {
-      return _resolveRegularEventSpec((ElementReferenceExpression)ed, context);
-    } else if (ed instanceof FeatureCall) {
-      return _resolveRegularEventSpec((FeatureCall)ed, context);
-    } else if (ed instanceof RegularEventSpec) {
-      return _resolveRegularEventSpec((RegularEventSpec)ed, context);
-    } else if (ed != null) {
-      return _resolveRegularEventSpec(ed, context);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(ed, context).toString());
-    }
-  }
-  
-  public ExecutionNode mapped(final Vertex s) {
-    if (s instanceof Choice) {
-      return _mapped((Choice)s);
-    } else if (s instanceof Entry) {
-      return _mapped((Entry)s);
-    } else if (s instanceof FinalState) {
-      return _mapped((FinalState)s);
-    } else if (s instanceof State) {
-      return _mapped((State)s);
-    } else if (s instanceof Synchronization) {
-      return _mapped((Synchronization)s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(s).toString());
-    }
-  }
-}

+ 0 - 145
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecExtensions.java

@@ -1,145 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.base.Objects;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.xtext.xbase.lib.CollectionLiterals;
-import org.yakindu.sct.model.sexec.EnterState;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionScope;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.ExitState;
-import org.yakindu.sct.model.sexec.SaveHistory;
-import org.yakindu.sct.model.sexec.SexecFactory;
-import org.yakindu.sct.model.sexec.StateCase;
-import org.yakindu.sct.model.sexec.StateVector;
-import org.yakindu.sct.model.sexec.Step;
-
-@SuppressWarnings("all")
-public class SexecExtensions {
-  public SexecFactory factory() {
-    return SexecFactory.eINSTANCE;
-  }
-  
-  public EnterState newEnterStateStep(final ExecutionState s) {
-    EnterState ess = null;
-    boolean _notEquals = (!Objects.equal(s, null));
-    if (_notEquals) {
-      SexecFactory _factory = this.factory();
-      EnterState _createEnterState = _factory.createEnterState();
-      ess = _createEnterState;
-      ess.setState(s);
-    }
-    return ess;
-  }
-  
-  public ExitState newExitStateStep(final ExecutionState s) {
-    ExitState ess = null;
-    boolean _notEquals = (!Objects.equal(s, null));
-    if (_notEquals) {
-      SexecFactory _factory = this.factory();
-      ExitState _createExitState = _factory.createExitState();
-      ess = _createExitState;
-      ess.setState(s);
-    }
-    return ess;
-  }
-  
-  public StateCase newCase(final ExecutionState it, final Step step) {
-    SexecFactory _factory = this.factory();
-    final StateCase sCase = _factory.createStateCase();
-    sCase.setState(it);
-    sCase.setStep(step);
-    return sCase;
-  }
-  
-  public SaveHistory newSaveHistory(final ExecutionRegion r) {
-    SexecFactory _factory = this.factory();
-    final SaveHistory save = _factory.createSaveHistory();
-    save.setRegion(r);
-    return save;
-  }
-  
-  protected List<ExecutionState> _collectLeafStates(final ExecutionState state, final List<ExecutionState> leafStates) {
-    boolean _isLeaf = state.isLeaf();
-    if (_isLeaf) {
-      leafStates.add(state);
-    } else {
-      EList<ExecutionScope> _subScopes = state.getSubScopes();
-      for (final ExecutionScope r : _subScopes) {
-        this.collectLeafStates(r, leafStates);
-      }
-    }
-    return leafStates;
-  }
-  
-  protected List<ExecutionState> _collectLeafStates(final ExecutionRegion region, final List<ExecutionState> leafStates) {
-    EList<ExecutionScope> _subScopes = region.getSubScopes();
-    for (final ExecutionScope r : _subScopes) {
-      this.collectLeafStates(r, leafStates);
-    }
-    return leafStates;
-  }
-  
-  public int last(final StateVector sv) {
-    int _offset = sv.getOffset();
-    int _size = sv.getSize();
-    int _plus = (_offset + _size);
-    int _minus = (_plus - 1);
-    return _minus;
-  }
-  
-  public int first(final StateVector sv) {
-    int _offset = sv.getOffset();
-    return _offset;
-  }
-  
-  public ArrayList<ExecutionScope> parentScopes(final ExecutionScope scope) {
-    final ArrayList<ExecutionScope> parents = CollectionLiterals.<ExecutionScope>newArrayList();
-    ExecutionScope s = scope;
-    boolean _notEquals = (!Objects.equal(s, null));
-    boolean _while = _notEquals;
-    while (_while) {
-      {
-        parents.add(s);
-        ExecutionScope _superScope = s.getSuperScope();
-        s = _superScope;
-      }
-      boolean _notEquals_1 = (!Objects.equal(s, null));
-      _while = _notEquals_1;
-    }
-    return parents;
-  }
-  
-  /**
-   * Collect all scopes beneath this scope which does not contain subscopes and are instances of ExecutionState.
-   */
-  public List<ExecutionState> collectLeafScopes(final ExecutionScope scope, final List<ExecutionState> leafs) {
-    EList<ExecutionScope> _subScopes = scope.getSubScopes();
-    boolean _isEmpty = _subScopes.isEmpty();
-    if (_isEmpty) {
-      if ((scope instanceof ExecutionState)) {
-        leafs.add(((ExecutionState) scope));
-      }
-    } else {
-      EList<ExecutionScope> _subScopes_1 = scope.getSubScopes();
-      for (final ExecutionScope s : _subScopes_1) {
-        this.collectLeafScopes(s, leafs);
-      }
-    }
-    return leafs;
-  }
-  
-  public List<ExecutionState> collectLeafStates(final ExecutionScope region, final List<ExecutionState> leafStates) {
-    if (region instanceof ExecutionRegion) {
-      return _collectLeafStates((ExecutionRegion)region, leafStates);
-    } else if (region instanceof ExecutionState) {
-      return _collectLeafStates((ExecutionState)region, leafStates);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(region, leafStates).toString());
-    }
-  }
-}

+ 0 - 236
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SgraphExtensions.java

@@ -1,236 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.yakindu.sct.model.sgraph.Entry;
-import org.yakindu.sct.model.sgraph.EntryKind;
-import org.yakindu.sct.model.sgraph.FinalState;
-import org.yakindu.sct.model.sgraph.Region;
-import org.yakindu.sct.model.sgraph.RegularState;
-import org.yakindu.sct.model.sgraph.SGraphFactory;
-import org.yakindu.sct.model.sgraph.State;
-import org.yakindu.sct.model.sgraph.Transition;
-import org.yakindu.sct.model.sgraph.Vertex;
-
-@SuppressWarnings("all")
-public class SgraphExtensions {
-  public SGraphFactory factory() {
-    return SGraphFactory.eINSTANCE;
-  }
-  
-  protected boolean _isLeaf(final RegularState s) {
-    return false;
-  }
-  
-  protected boolean _isLeaf(final FinalState s) {
-    return true;
-  }
-  
-  protected boolean _isLeaf(final State s) {
-    boolean _isSimple = s.isSimple();
-    return _isSimple;
-  }
-  
-  public List<RegularState> parentStates(final RegularState s) {
-    List<EObject> _containers = this.containers(s);
-    Iterable<RegularState> _filter = Iterables.<RegularState>filter(_containers, RegularState.class);
-    List<RegularState> _list = IterableExtensions.<RegularState>toList(_filter);
-    return _list;
-  }
-  
-  public List<RegularState> parentStates(final Region s) {
-    List<EObject> _containers = this.containers(s);
-    Iterable<RegularState> _filter = Iterables.<RegularState>filter(_containers, RegularState.class);
-    List<RegularState> _list = IterableExtensions.<RegularState>toList(_filter);
-    return _list;
-  }
-  
-  public List<EObject> containers(final EObject obj) {
-    ArrayList<EObject> _arrayList = new ArrayList<EObject>();
-    final ArrayList<EObject> containerList = _arrayList;
-    this.collectContainers(obj, containerList);
-    return containerList;
-  }
-  
-  public void collectContainers(final EObject obj, final List<EObject> containerList) {
-    containerList.add(obj);
-    EObject _eContainer = obj==null?(EObject)null:obj.eContainer();
-    boolean _notEquals = (!Objects.equal(_eContainer, null));
-    if (_notEquals) {
-      EObject _eContainer_1 = obj.eContainer();
-      this.collectContainers(_eContainer_1, containerList);
-    }
-  }
-  
-  public Iterable<Entry> collectEntries(final Region r) {
-    EList<Vertex> _vertices = r.getVertices();
-    Iterable<Entry> _filter = Iterables.<Entry>filter(_vertices, Entry.class);
-    return _filter;
-  }
-  
-  public Entry entry(final Region r) {
-    EList<Vertex> _vertices = r.getVertices();
-    final Function1<Vertex,Boolean> _function = new Function1<Vertex,Boolean>() {
-        public Boolean apply(final Vertex v) {
-          boolean _and = false;
-          if (!(v instanceof Entry)) {
-            _and = false;
-          } else {
-            boolean _or = false;
-            boolean _or_1 = false;
-            String _name = v.getName();
-            boolean _equals = Objects.equal(_name, null);
-            if (_equals) {
-              _or_1 = true;
-            } else {
-              String _name_1 = v.getName();
-              boolean _equals_1 = "".equals(_name_1);
-              _or_1 = (_equals || _equals_1);
-            }
-            if (_or_1) {
-              _or = true;
-            } else {
-              String _name_2 = v.getName();
-              boolean _equals_2 = Objects.equal(_name_2, "default");
-              _or = (_or_1 || _equals_2);
-            }
-            _and = ((v instanceof Entry) && _or);
-          }
-          return Boolean.valueOf(_and);
-        }
-      };
-    Vertex _findFirst = IterableExtensions.<Vertex>findFirst(_vertices, _function);
-    return ((Entry) _findFirst);
-  }
-  
-  /**
-   * Retrieves the target from an entry.
-   * TODO: validation of preconditions for entry targets e.g every region needs an entry with appropriate target
-   */
-  public State target(final Entry entry) {
-    State _xifexpression = null;
-    EList<Transition> _outgoingTransitions = entry==null?(EList<Transition>)null:entry.getOutgoingTransitions();
-    boolean _notEquals = (!Objects.equal(_outgoingTransitions, null));
-    if (_notEquals) {
-      State _xifexpression_1 = null;
-      EList<Transition> _outgoingTransitions_1 = entry.getOutgoingTransitions();
-      int _size = _outgoingTransitions_1.size();
-      boolean _greaterThan = (_size > 0);
-      if (_greaterThan) {
-        State _xblockexpression = null;
-        {
-          EList<Transition> _outgoingTransitions_2 = entry.getOutgoingTransitions();
-          Transition _get = _outgoingTransitions_2.get(0);
-          final Vertex target = _get.getTarget();
-          State _xifexpression_2 = null;
-          if ((target instanceof State)) {
-            _xifexpression_2 = ((State) target);
-          }
-          _xblockexpression = (_xifexpression_2);
-        }
-        _xifexpression_1 = _xblockexpression;
-      }
-      _xifexpression = _xifexpression_1;
-    }
-    return _xifexpression;
-  }
-  
-  public List<RegularState> collectLeafStates(final RegularState state, final List<RegularState> leafStates) {
-    boolean _isLeaf = this.isLeaf(state);
-    if (_isLeaf) {
-      leafStates.add(state);
-    } else {
-      if ((state instanceof State)) {
-        final State s = ((State) state);
-        EList<Region> _regions = s.getRegions();
-        for (final Region r : _regions) {
-          EList<Vertex> _vertices = r.getVertices();
-          for (final Vertex v : _vertices) {
-            if ((v instanceof RegularState)) {
-              this.collectLeafStates(((RegularState) v), leafStates);
-            }
-          }
-        }
-      }
-    }
-    return leafStates;
-  }
-  
-  public List<RegularState> collectLeafStates(final Region region, final List<RegularState> leafStates) {
-    EList<Vertex> _vertices = region.getVertices();
-    for (final Vertex v : _vertices) {
-      if ((v instanceof RegularState)) {
-        this.collectLeafStates(((RegularState) v), leafStates);
-      }
-    }
-    return leafStates;
-  }
-  
-  public boolean requireDeepHistory(final Region r) {
-    List<EObject> _containers = this.containers(r);
-    Iterable<Region> _filter = Iterables.<Region>filter(_containers, Region.class);
-    final Function1<Region,Boolean> _function = new Function1<Region,Boolean>() {
-        public Boolean apply(final Region p) {
-          EList<Vertex> _vertices = p.getVertices();
-          Iterable<Entry> _filter = Iterables.<Entry>filter(_vertices, Entry.class);
-          final Function1<Entry,Boolean> _function = new Function1<Entry,Boolean>() {
-              public Boolean apply(final Entry v) {
-                EntryKind _kind = v.getKind();
-                boolean _equals = Objects.equal(_kind, EntryKind.DEEP_HISTORY);
-                return Boolean.valueOf(_equals);
-              }
-            };
-          boolean _exists = IterableExtensions.<Entry>exists(_filter, _function);
-          return Boolean.valueOf(_exists);
-        }
-      };
-    boolean _exists = IterableExtensions.<Region>exists(_filter, _function);
-    return _exists;
-  }
-  
-  public boolean requireShallowHistory(final Region r) {
-    EList<Vertex> _vertices = r.getVertices();
-    Iterable<Entry> _filter = Iterables.<Entry>filter(_vertices, Entry.class);
-    final Function1<Entry,Boolean> _function = new Function1<Entry,Boolean>() {
-        public Boolean apply(final Entry v) {
-          EntryKind _kind = v.getKind();
-          boolean _equals = Objects.equal(_kind, EntryKind.SHALLOW_HISTORY);
-          return Boolean.valueOf(_equals);
-        }
-      };
-    boolean _exists = IterableExtensions.<Entry>exists(_filter, _function);
-    return _exists;
-  }
-  
-  public boolean requireHistory(final Region r) {
-    boolean _or = false;
-    boolean _requireDeepHistory = this.requireDeepHistory(r);
-    if (_requireDeepHistory) {
-      _or = true;
-    } else {
-      boolean _requireShallowHistory = this.requireShallowHistory(r);
-      _or = (_requireDeepHistory || _requireShallowHistory);
-    }
-    return _or;
-  }
-  
-  public boolean isLeaf(final RegularState s) {
-    if (s instanceof FinalState) {
-      return _isLeaf((FinalState)s);
-    } else if (s instanceof State) {
-      return _isLeaf((State)s);
-    } else if (s != null) {
-      return _isLeaf(s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(s).toString());
-    }
-  }
-}

+ 0 - 257
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StateVectorBuilder.java

@@ -1,257 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.Functions.Function2;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.SexecFactory;
-import org.yakindu.sct.model.sexec.StateVector;
-import org.yakindu.sct.model.sexec.transformation.SexecElementMapping;
-import org.yakindu.sct.model.sexec.transformation.SexecExtensions;
-import org.yakindu.sct.model.sexec.transformation.SgraphExtensions;
-import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
-import org.yakindu.sct.model.sgraph.Choice;
-import org.yakindu.sct.model.sgraph.FinalState;
-import org.yakindu.sct.model.sgraph.Region;
-import org.yakindu.sct.model.sgraph.RegularState;
-import org.yakindu.sct.model.sgraph.State;
-import org.yakindu.sct.model.sgraph.Statechart;
-import org.yakindu.sct.model.sgraph.Vertex;
-
-@SuppressWarnings("all")
-public class StateVectorBuilder {
-  @Inject
-  private SexecExtensions sexec;
-  
-  @Inject
-  private SexecElementMapping mapping;
-  
-  @Inject
-  private StatechartExtensions sc;
-  
-  @Inject
-  private SgraphExtensions sgraph;
-  
-  public void defineHistoryVector(final ExecutionFlow flow, final Statechart sc) {
-    int offset = (-1);
-    TreeIterator<EObject> _eAllContents = sc.eAllContents();
-    Iterator<Region> _filter = Iterators.<Region>filter(_eAllContents, Region.class);
-    Iterable<Region> _iterable = IteratorExtensions.<Region>toIterable(_filter);
-    for (final Region r : _iterable) {
-      boolean _requireHistory = this.sgraph.requireHistory(r);
-      if (_requireHistory) {
-        int _plus = (offset + 1);
-        offset = _plus;
-        final ExecutionRegion er = this.mapping.create(r);
-        SexecFactory _factory = this.sexec.factory();
-        StateVector _createStateVector = _factory.createStateVector();
-        er.setHistoryVector(_createStateVector);
-        StateVector _historyVector = er.getHistoryVector();
-        _historyVector.setOffset(offset);
-        StateVector _historyVector_1 = er.getHistoryVector();
-        _historyVector_1.setSize(1);
-      }
-    }
-    int _minus = (-1);
-    boolean _notEquals = (offset != _minus);
-    if (_notEquals) {
-      SexecFactory _factory_1 = this.sexec.factory();
-      StateVector _createStateVector_1 = _factory_1.createStateVector();
-      flow.setHistoryVector(_createStateVector_1);
-      StateVector _historyVector_2 = flow.getHistoryVector();
-      _historyVector_2.setOffset(0);
-      StateVector _historyVector_3 = flow.getHistoryVector();
-      int _plus_1 = (offset + 1);
-      _historyVector_3.setSize(_plus_1);
-    }
-  }
-  
-  public void defineStateVector(final ExecutionFlow flow, final Statechart sc) {
-    int offset = 0;
-    EList<Region> _regions = sc.getRegions();
-    for (final Region r : _regions) {
-      int _defineStateVectors = this.defineStateVectors(r, offset);
-      int _plus = (offset + _defineStateVectors);
-      offset = _plus;
-    }
-    SexecFactory _factory = this.sexec.factory();
-    StateVector _createStateVector = _factory.createStateVector();
-    flow.setStateVector(_createStateVector);
-    StateVector _stateVector = flow.getStateVector();
-    _stateVector.setOffset(0);
-    StateVector _stateVector_1 = flow.getStateVector();
-    _stateVector_1.setSize(offset);
-  }
-  
-  /**
-   * calculates the maximum orthogonality (maximum number of possible active leaf states) of the statechart
-   */
-  public int defineStateVectors(final Statechart sc, final int offset) {
-    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 = StateVectorBuilder.this.sc.maxOrthogonality(r);
-          int _plus = (_maxOrthogonality + (o).intValue());
-          return Integer.valueOf(_plus);
-        }
-      };
-    Integer _fold = IterableExtensions.<Region, Integer>fold(_regions, Integer.valueOf(0), _function);
-    return (_fold).intValue();
-  }
-  
-  /**
-   * calculates the maximum orthogonality (maximum number of possible active leaf states) of a region
-   */
-  public int defineStateVectors(final Region r, final int offset) {
-    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;
-          {
-            final int mo = StateVectorBuilder.this.defineStateVectors(v, offset);
-            int _xifexpression = (int) 0;
-            boolean _greaterThan = (mo > (s).intValue());
-            if (_greaterThan) {
-              _xifexpression = mo;
-            } else {
-              _xifexpression = s;
-            }
-            _xblockexpression = (_xifexpression);
-          }
-          return Integer.valueOf(_xblockexpression);
-        }
-      };
-    final Integer maxOrthogonality = IterableExtensions.<Vertex, Integer>fold(_vertices, Integer.valueOf(0), _function);
-    final ExecutionRegion er = this.mapping.create(r);
-    SexecFactory _factory = this.sexec.factory();
-    StateVector _createStateVector = _factory.createStateVector();
-    er.setStateVector(_createStateVector);
-    StateVector _stateVector = er.getStateVector();
-    _stateVector.setOffset(offset);
-    StateVector _stateVector_1 = er.getStateVector();
-    _stateVector_1.setSize((maxOrthogonality).intValue());
-    return (maxOrthogonality).intValue();
-  }
-  
-  /**
-   * the maximum orthogonality of all  pseudo states is 0
-   */
-  protected int _defineStateVectors(final Vertex v, final int offset) {
-    return 0;
-  }
-  
-  /**
-   * calculates the maximum orthogonality (maximum number of possible active leaf states) of a state
-   */
-  protected int _defineStateVectors(final State s, final int offset) {
-    int maxOrthogonality = 0;
-    EList<Region> _regions = s.getRegions();
-    boolean _containsStates = this.containsStates(_regions);
-    if (_containsStates) {
-      EList<Region> _regions_1 = s.getRegions();
-      for (final Region r : _regions_1) {
-        int _plus = (offset + maxOrthogonality);
-        int _defineStateVectors = this.defineStateVectors(r, _plus);
-        int _plus_1 = (maxOrthogonality + _defineStateVectors);
-        maxOrthogonality = _plus_1;
-      }
-    } else {
-      maxOrthogonality = 1;
-    }
-    final ExecutionState es = this.mapping.create(s);
-    SexecFactory _factory = this.sexec.factory();
-    StateVector _createStateVector = _factory.createStateVector();
-    es.setStateVector(_createStateVector);
-    StateVector _stateVector = es.getStateVector();
-    _stateVector.setOffset(offset);
-    StateVector _stateVector_1 = es.getStateVector();
-    _stateVector_1.setSize(maxOrthogonality);
-    return maxOrthogonality;
-  }
-  
-  public boolean containsStates(final List<Region> regions) {
-    final Function1<Region,Boolean> _function = new Function1<Region,Boolean>() {
-        public Boolean apply(final Region r) {
-          EList<Vertex> _vertices = r.getVertices();
-          Iterable<RegularState> _filter = Iterables.<RegularState>filter(_vertices, RegularState.class);
-          int _size = IterableExtensions.size(_filter);
-          boolean _greaterThan = (_size > 0);
-          return Boolean.valueOf(_greaterThan);
-        }
-      };
-    Iterable<Region> _filter = IterableExtensions.<Region>filter(regions, _function);
-    int _size = IterableExtensions.size(_filter);
-    boolean _greaterThan = (_size > 0);
-    return _greaterThan;
-  }
-  
-  /**
-   * calculates the maximum orthogonality (maximum number of possible active leaf states) of a state
-   */
-  protected int _defineStateVectors(final FinalState s, final int offset) {
-    final ExecutionState es = this.mapping.create(s);
-    SexecFactory _factory = this.sexec.factory();
-    StateVector _createStateVector = _factory.createStateVector();
-    es.setStateVector(_createStateVector);
-    StateVector _stateVector = es.getStateVector();
-    _stateVector.setOffset(offset);
-    StateVector _stateVector_1 = es.getStateVector();
-    _stateVector_1.setSize(1);
-    return 1;
-  }
-  
-  protected StateVector _stateVector(final Vertex v) {
-    return null;
-  }
-  
-  protected StateVector _stateVector(final RegularState s) {
-    ExecutionState _create = this.mapping.create(s);
-    StateVector _stateVector = _create.getStateVector();
-    return _stateVector;
-  }
-  
-  protected StateVector _stateVector(final Choice choice) {
-    Region _parentRegion = choice.getParentRegion();
-    ExecutionRegion _create = this.mapping.create(_parentRegion);
-    StateVector _stateVector = _create.getStateVector();
-    return _stateVector;
-  }
-  
-  public int defineStateVectors(final Vertex s, final int offset) {
-    if (s instanceof FinalState) {
-      return _defineStateVectors((FinalState)s, offset);
-    } else if (s instanceof State) {
-      return _defineStateVectors((State)s, offset);
-    } else if (s != null) {
-      return _defineStateVectors(s, offset);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(s, offset).toString());
-    }
-  }
-  
-  public StateVector stateVector(final Vertex choice) {
-    if (choice instanceof Choice) {
-      return _stateVector((Choice)choice);
-    } else if (choice instanceof RegularState) {
-      return _stateVector((RegularState)choice);
-    } else if (choice != null) {
-      return _stateVector(choice);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(choice).toString());
-    }
-  }
-}

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

@@ -1,459 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.EcoreUtil2;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.Functions.Function2;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-import org.yakindu.base.base.NamedElement;
-import org.yakindu.sct.model.sgraph.Choice;
-import org.yakindu.sct.model.sgraph.Entry;
-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.RegularState;
-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.Synchronization;
-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.EntryEvent;
-import org.yakindu.sct.model.stext.stext.EventSpec;
-import org.yakindu.sct.model.stext.stext.ExitEvent;
-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.TimeEventSpec;
-
-@SuppressWarnings("all")
-public class StatechartExtensions {
-  /**
-   * calculates the maximum orthogonality (maximum number of possible active leaf states) of the statechart
-   */
-  protected 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 _plus = (_maxOrthogonality + (o).intValue());
-          return Integer.valueOf(_plus);
-        }
-      };
-    Integer _fold = IterableExtensions.<Region, Integer>fold(_regions, Integer.valueOf(0), _function);
-    return (_fold).intValue();
-  }
-  
-  /**
-   * calculates the maximum orthogonality (maximum number of possible active leaf states) of a region
-   */
-  protected 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;
-          {
-            final int mo = StatechartExtensions.this.maxOrthogonality(v);
-            int _xifexpression = (int) 0;
-            boolean _greaterThan = (mo > (s).intValue());
-            if (_greaterThan) {
-              _xifexpression = mo;
-            } else {
-              _xifexpression = s;
-            }
-            _xblockexpression = (_xifexpression);
-          }
-          return Integer.valueOf(_xblockexpression);
-        }
-      };
-    Integer _fold = IterableExtensions.<Vertex, Integer>fold(_vertices, Integer.valueOf(0), _function);
-    return (_fold).intValue();
-  }
-  
-  /**
-   * the maximum orthogonality of all  pseudo states is 0
-   */
-  protected int _maxOrthogonality(final Vertex v) {
-    return 0;
-  }
-  
-  /**
-   * calculates the maximum orthogonality (maximum number of possible active leaf states) of a state
-   */
-  protected int _maxOrthogonality(final State s) {
-    Integer _xifexpression = null;
-    EList<Region> _regions = s.getRegions();
-    int _size = _regions.size();
-    boolean _greaterThan = (_size > 0);
-    if (_greaterThan) {
-      EList<Region> _regions_1 = s.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 _plus = (_maxOrthogonality + (o).intValue());
-            return Integer.valueOf(_plus);
-          }
-        };
-      Integer _fold = IterableExtensions.<Region, Integer>fold(_regions_1, Integer.valueOf(0), _function);
-      _xifexpression = _fold;
-    } else {
-      _xifexpression = 1;
-    }
-    return (_xifexpression).intValue();
-  }
-  
-  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 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;
-  }
-  
-  /**
-   * Provides a list of all TimeEventSpecs that are defined in the context of 'statechart'.
-   */
-  public List<TimeEventSpec> timeEventSpecs(final Statechart state) {
-    ArrayList<TimeEventSpec> _arrayList = new ArrayList<TimeEventSpec>();
-    ArrayList<TimeEventSpec> tesList = _arrayList;
-    EList<Reaction> _localReactions = state.getLocalReactions();
-    final Function2<ArrayList<TimeEventSpec>,Reaction,ArrayList<TimeEventSpec>> _function = new Function2<ArrayList<TimeEventSpec>,Reaction,ArrayList<TimeEventSpec>>() {
-        public ArrayList<TimeEventSpec> apply(final ArrayList<TimeEventSpec> s, final Reaction r) {
-          ArrayList<TimeEventSpec> _xblockexpression = null;
-          {
-            List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(r);
-            Iterable<TimeEventSpec> _filter = Iterables.<TimeEventSpec>filter(_eAllContentsAsList, TimeEventSpec.class);
-            final Procedure1<TimeEventSpec> _function = new Procedure1<TimeEventSpec>() {
-                public void apply(final TimeEventSpec tes) {
-                  s.add(tes);
-                }
-              };
-            IterableExtensions.<TimeEventSpec>forEach(_filter, _function);
-            _xblockexpression = (s);
-          }
-          return _xblockexpression;
-        }
-      };
-    IterableExtensions.<Reaction, ArrayList<TimeEventSpec>>fold(_localReactions, tesList, _function);
-    return tesList;
-  }
-  
-  /**
-   * Provides a list of all TimeEventSpecs that are defined in the context of 'state'.
-   */
-  protected 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 = Iterables.<TimeEventSpec>filter(_eAllContentsAsList, TimeEventSpec.class);
-            final Procedure1<TimeEventSpec> _function = new Procedure1<TimeEventSpec>() {
-                public void apply(final TimeEventSpec tes) {
-                  s.add(tes);
-                }
-              };
-            IterableExtensions.<TimeEventSpec>forEach(_filter, _function);
-            _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_1 = new Function2<ArrayList<TimeEventSpec>,Reaction,ArrayList<TimeEventSpec>>() {
-        public ArrayList<TimeEventSpec> apply(final ArrayList<TimeEventSpec> s, final Reaction r) {
-          ArrayList<TimeEventSpec> _xblockexpression = null;
-          {
-            List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(r);
-            Iterable<TimeEventSpec> _filter = Iterables.<TimeEventSpec>filter(_eAllContentsAsList, TimeEventSpec.class);
-            final Procedure1<TimeEventSpec> _function = new Procedure1<TimeEventSpec>() {
-                public void apply(final TimeEventSpec tes) {
-                  s.add(tes);
-                }
-              };
-            IterableExtensions.<TimeEventSpec>forEach(_filter, _function);
-            _xblockexpression = (s);
-          }
-          return _xblockexpression;
-        }
-      };
-    IterableExtensions.<Reaction, ArrayList<TimeEventSpec>>fold(_localReactions, tesList, _function_1);
-    return tesList;
-  }
-  
-  /**
-   * Provides a list of all TimeEventSpecs that are defined in the context of 'state'.
-   */
-  protected List<TimeEventSpec> _timeEventSpecs(final Statechart state) {
-    ArrayList<TimeEventSpec> _arrayList = new ArrayList<TimeEventSpec>();
-    ArrayList<TimeEventSpec> tesList = _arrayList;
-    EList<Reaction> _localReactions = state.getLocalReactions();
-    final Function2<ArrayList<TimeEventSpec>,Reaction,ArrayList<TimeEventSpec>> _function = new Function2<ArrayList<TimeEventSpec>,Reaction,ArrayList<TimeEventSpec>>() {
-        public ArrayList<TimeEventSpec> apply(final ArrayList<TimeEventSpec> s, final Reaction r) {
-          ArrayList<TimeEventSpec> _xblockexpression = null;
-          {
-            List<EObject> _eAllContentsAsList = EcoreUtil2.eAllContentsAsList(r);
-            Iterable<TimeEventSpec> _filter = Iterables.<TimeEventSpec>filter(_eAllContentsAsList, TimeEventSpec.class);
-            final Procedure1<TimeEventSpec> _function = new Procedure1<TimeEventSpec>() {
-                public void apply(final TimeEventSpec tes) {
-                  s.add(tes);
-                }
-              };
-            IterableExtensions.<TimeEventSpec>forEach(_filter, _function);
-            _xblockexpression = (s);
-          }
-          return _xblockexpression;
-        }
-      };
-    IterableExtensions.<Reaction, ArrayList<TimeEventSpec>>fold(_localReactions, tesList, _function);
-    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 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 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 ReactiveElement)) {
-      EObject _eContainer_1 = s.eContainer();
-      _xifexpression = ((ReactiveElement) _eContainer_1);
-    }
-    return _xifexpression;
-  }
-  
-  public List<RegularState> allRegularStates(final Statechart sc) {
-    List<EObject> content = EcoreUtil2.eAllContentsAsList(sc);
-    final Iterable<RegularState> allStates = Iterables.<RegularState>filter(content, RegularState.class);
-    return IterableExtensions.<RegularState>toList(allStates);
-  }
-  
-  public List<Region> allRegions(final Statechart sc) {
-    List<EObject> content = EcoreUtil2.eAllContentsAsList(sc);
-    final Iterable<Region> allRegions = Iterables.<Region>filter(content, Region.class);
-    return IterableExtensions.<Region>toList(allRegions);
-  }
-  
-  public Iterable<Choice> allChoices(final Statechart sc) {
-    List<EObject> content = EcoreUtil2.eAllContentsAsList(sc);
-    final Iterable<Choice> allChoices = Iterables.<Choice>filter(content, Choice.class);
-    return allChoices;
-  }
-  
-  public Iterable<Entry> allEntries(final Statechart sc) {
-    TreeIterator<EObject> _eAllContents = sc.eAllContents();
-    Iterator<Entry> _filter = Iterators.<Entry>filter(_eAllContents, Entry.class);
-    return IteratorExtensions.<Entry>toIterable(_filter);
-  }
-  
-  public Iterable<Synchronization> allSynchronizations(final Statechart sc) {
-    TreeIterator<EObject> _eAllContents = sc.eAllContents();
-    Iterator<Synchronization> _filter = Iterators.<Synchronization>filter(_eAllContents, Synchronization.class);
-    return IteratorExtensions.<Synchronization>toIterable(_filter);
-  }
-  
-  public List<LocalReaction> entryReactions(final ReactiveElement state) {
-    EList<Reaction> _localReactions = state.getLocalReactions();
-    final Function1<Reaction,Boolean> _function = new Function1<Reaction,Boolean>() {
-        public Boolean apply(final Reaction r) {
-          Trigger _trigger = ((LocalReaction) r).getTrigger();
-          EList<EventSpec> _triggers = ((ReactionTrigger) _trigger).getTriggers();
-          final Function1<EventSpec,Boolean> _function = new Function1<EventSpec,Boolean>() {
-              public Boolean apply(final EventSpec t) {
-                return Boolean.valueOf((t instanceof EntryEvent));
-              }
-            };
-          boolean _exists = IterableExtensions.<EventSpec>exists(_triggers, _function);
-          return Boolean.valueOf(_exists);
-        }
-      };
-    Iterable<Reaction> _filter = IterableExtensions.<Reaction>filter(_localReactions, _function);
-    final Function1<Reaction,LocalReaction> _function_1 = new Function1<Reaction,LocalReaction>() {
-        public LocalReaction apply(final Reaction lr) {
-          return ((LocalReaction) lr);
-        }
-      };
-    Iterable<LocalReaction> _map = IterableExtensions.<Reaction, LocalReaction>map(_filter, _function_1);
-    List<LocalReaction> _list = IterableExtensions.<LocalReaction>toList(_map);
-    return _list;
-  }
-  
-  public List<LocalReaction> exitReactions(final ReactiveElement state) {
-    EList<Reaction> _localReactions = state.getLocalReactions();
-    final Function1<Reaction,Boolean> _function = new Function1<Reaction,Boolean>() {
-        public Boolean apply(final Reaction r) {
-          Trigger _trigger = ((LocalReaction) r).getTrigger();
-          EList<EventSpec> _triggers = ((ReactionTrigger) _trigger).getTriggers();
-          final Function1<EventSpec,Boolean> _function = new Function1<EventSpec,Boolean>() {
-              public Boolean apply(final EventSpec t) {
-                return Boolean.valueOf((t instanceof ExitEvent));
-              }
-            };
-          boolean _exists = IterableExtensions.<EventSpec>exists(_triggers, _function);
-          return Boolean.valueOf(_exists);
-        }
-      };
-    Iterable<Reaction> _filter = IterableExtensions.<Reaction>filter(_localReactions, _function);
-    final Function1<Reaction,LocalReaction> _function_1 = new Function1<Reaction,LocalReaction>() {
-        public LocalReaction apply(final Reaction lr) {
-          return ((LocalReaction) lr);
-        }
-      };
-    Iterable<LocalReaction> _map = IterableExtensions.<Reaction, LocalReaction>map(_filter, _function_1);
-    List<LocalReaction> _list = IterableExtensions.<LocalReaction>toList(_map);
-    return _list;
-  }
-  
-  protected String _id(final Object obj) {
-    return null;
-  }
-  
-  /**
-   * The id of a transition is unique within the context of its source vertex.
-   */
-  protected String _id(final Transition t) {
-    Object _xifexpression = null;
-    Vertex _source = t.getSource();
-    boolean _notEquals = (!Objects.equal(_source, null));
-    if (_notEquals) {
-      Vertex _source_1 = t.getSource();
-      EList<Transition> _outgoingTransitions = _source_1.getOutgoingTransitions();
-      int _indexOf = _outgoingTransitions.indexOf(t);
-      _xifexpression = _indexOf;
-    } else {
-      _xifexpression = "";
-    }
-    String _plus = ("tr" + ((Comparable<Object>)_xifexpression));
-    return _plus;
-  }
-  
-  /**
-   * The id of a local reaction is unique within the context of its source vertex.
-   */
-  protected String _id(final LocalReaction t) {
-    Object _xifexpression = null;
-    ReactiveElement _reactiveElement = this.reactiveElement(t);
-    boolean _notEquals = (!Objects.equal(_reactiveElement, null));
-    if (_notEquals) {
-      ReactiveElement _reactiveElement_1 = this.reactiveElement(t);
-      EList<Reaction> _localReactions = _reactiveElement_1.getLocalReactions();
-      int _indexOf = _localReactions.indexOf(t);
-      _xifexpression = _indexOf;
-    } else {
-      _xifexpression = "";
-    }
-    String _plus = ("lr" + ((Comparable<Object>)_xifexpression));
-    return _plus;
-  }
-  
-  public StextFactory stextFactory() {
-    return StextFactory.eINSTANCE;
-  }
-  
-  public int maxOrthogonality(final NamedElement s) {
-    if (s instanceof State) {
-      return _maxOrthogonality((State)s);
-    } else if (s instanceof Region) {
-      return _maxOrthogonality((Region)s);
-    } else if (s instanceof Statechart) {
-      return _maxOrthogonality((Statechart)s);
-    } else if (s instanceof Vertex) {
-      return _maxOrthogonality((Vertex)s);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(s).toString());
-    }
-  }
-  
-  public List<TimeEventSpec> timeEventSpecs(final EObject state) {
-    if (state instanceof State) {
-      return _timeEventSpecs((State)state);
-    } else if (state instanceof Statechart) {
-      return _timeEventSpecs((Statechart)state);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(state).toString());
-    }
-  }
-  
-  public ReactiveElement reactiveElement(final Reaction tr) {
-    if (tr instanceof Transition) {
-      return _reactiveElement((Transition)tr);
-    } else if (tr != null) {
-      return _reactiveElement(tr);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        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 != null) {
-      return _id(t);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(t).toString());
-    }
-  }
-}

+ 0 - 53
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StextExtensions.java

@@ -1,53 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import org.yakindu.sct.model.sgraph.State;
-import org.yakindu.sct.model.stext.stext.ActiveStateReferenceExpression;
-import org.yakindu.sct.model.stext.stext.Expression;
-import org.yakindu.sct.model.stext.stext.LogicalAndExpression;
-import org.yakindu.sct.model.stext.stext.LogicalOrExpression;
-import org.yakindu.sct.model.stext.stext.StextFactory;
-
-/**
- * @author Axel Terfloth added 'active' extension
- */
-@SuppressWarnings("all")
-public class StextExtensions {
-  public StextFactory factory() {
-    return StextFactory.eINSTANCE;
-  }
-  
-  public Expression or(final Expression left, final Expression right) {
-    LogicalOrExpression _xblockexpression = null;
-    {
-      StextFactory _factory = this.factory();
-      final LogicalOrExpression or = _factory.createLogicalOrExpression();
-      or.setLeftOperand(left);
-      or.setRightOperand(right);
-      _xblockexpression = (or);
-    }
-    return _xblockexpression;
-  }
-  
-  public Expression and(final Expression left, final Expression right) {
-    LogicalAndExpression _xblockexpression = null;
-    {
-      StextFactory _factory = this.factory();
-      final LogicalAndExpression and = _factory.createLogicalAndExpression();
-      and.setLeftOperand(left);
-      and.setRightOperand(right);
-      _xblockexpression = (and);
-    }
-    return _xblockexpression;
-  }
-  
-  public Expression active(final State state) {
-    ActiveStateReferenceExpression _xblockexpression = null;
-    {
-      StextFactory _factory = this.factory();
-      final ActiveStateReferenceExpression active = _factory.createActiveStateReferenceExpression();
-      active.setValue(state);
-      _xblockexpression = (active);
-    }
-    return _xblockexpression;
-  }
-}

+ 0 - 334
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StructureMapping.java

@@ -1,334 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.inject.Inject;
-import java.util.ArrayList;
-import java.util.Arrays;
-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.naming.IQualifiedNameProvider;
-import org.eclipse.xtext.naming.QualifiedName;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
-import org.yakindu.sct.model.sexec.ExecutionChoice;
-import org.yakindu.sct.model.sexec.ExecutionEntry;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-import org.yakindu.sct.model.sexec.ExecutionNode;
-import org.yakindu.sct.model.sexec.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionScope;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.ExecutionSynchronization;
-import org.yakindu.sct.model.sexec.TimeEvent;
-import org.yakindu.sct.model.sexec.transformation.SexecElementMapping;
-import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
-import org.yakindu.sct.model.sgraph.Choice;
-import org.yakindu.sct.model.sgraph.CompositeElement;
-import org.yakindu.sct.model.sgraph.Declaration;
-import org.yakindu.sct.model.sgraph.Entry;
-import org.yakindu.sct.model.sgraph.FinalState;
-import org.yakindu.sct.model.sgraph.Region;
-import org.yakindu.sct.model.sgraph.RegularState;
-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.Synchronization;
-import org.yakindu.sct.model.sgraph.Vertex;
-import org.yakindu.sct.model.stext.stext.EventDefinition;
-import org.yakindu.sct.model.stext.stext.OperationDefinition;
-import org.yakindu.sct.model.stext.stext.TimeEventSpec;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-
-@SuppressWarnings("all")
-public class StructureMapping {
-  @Inject
-  private SexecElementMapping mapping;
-  
-  @Inject
-  private StatechartExtensions sct;
-  
-  @Inject
-  private IQualifiedNameProvider _iQualifiedNameProvider;
-  
-  /**
-   * maps all required scope defined in the statechart to the execution flow.
-   * This includes creating the scopes and adding all relevant declarations. Empty scopes wont be mapped.
-   */
-  public ExecutionFlow mapScopes(final Statechart sc, final ExecutionFlow flow) {
-    ExecutionFlow _xblockexpression = null;
-    {
-      EList<Scope> _scopes = flow.getScopes();
-      EList<Scope> _scopes_1 = sc.getScopes();
-      final Function1<Scope,Scope> _function = new Function1<Scope,Scope>() {
-          public Scope apply(final Scope scope) {
-            Scope _map = StructureMapping.this.map(scope);
-            return _map;
-          }
-        };
-      List<Scope> _map = ListExtensions.<Scope, Scope>map(_scopes_1, _function);
-      _scopes.addAll(_map);
-      _xblockexpression = (flow);
-    }
-    return _xblockexpression;
-  }
-  
-  public Scope map(final Scope scope) {
-    final Scope _scope = this.mapping.createScope(scope);
-    EList<Declaration> _declarations = _scope.getDeclarations();
-    EList<Declaration> _declarations_1 = scope.getDeclarations();
-    final Function1<Declaration,Declaration> _function = new Function1<Declaration,Declaration>() {
-        public Declaration apply(final Declaration decl) {
-          Declaration _map = StructureMapping.this.map(decl);
-          return _map;
-        }
-      };
-    List<Declaration> _map = ListExtensions.<Declaration, Declaration>map(_declarations_1, _function);
-    final Function1<Declaration,Boolean> _function_1 = new Function1<Declaration,Boolean>() {
-        public Boolean apply(final Declaration e) {
-          boolean _notEquals = (!Objects.equal(e, null));
-          return Boolean.valueOf(_notEquals);
-        }
-      };
-    Iterable<Declaration> _filter = IterableExtensions.<Declaration>filter(_map, _function_1);
-    Iterables.<Declaration>addAll(_declarations, _filter);
-    return _scope;
-  }
-  
-  protected Declaration _map(final Declaration decl) {
-    return null;
-  }
-  
-  protected Declaration _map(final EventDefinition e) {
-    final EventDefinition _e = this.mapping.create(e);
-    return _e;
-  }
-  
-  protected Declaration _map(final VariableDefinition v) {
-    final VariableDefinition _v = this.mapping.create(v);
-    return _v;
-  }
-  
-  protected Declaration _map(final OperationDefinition v) {
-    final OperationDefinition _v = this.mapping.create(v);
-    return _v;
-  }
-  
-  public ExecutionFlow mapRegularStates(final Statechart statechart, final ExecutionFlow r) {
-    final List<RegularState> allStates = this.sct.allRegularStates(statechart);
-    EList<ExecutionState> _states = r.getStates();
-    final Function1<RegularState,ExecutionState> _function = new Function1<RegularState,ExecutionState>() {
-        public ExecutionState apply(final RegularState s) {
-          ExecutionState _mapState = StructureMapping.this.mapState(s);
-          return _mapState;
-        }
-      };
-    List<ExecutionState> _map = ListExtensions.<RegularState, ExecutionState>map(allStates, _function);
-    _states.addAll(_map);
-    return r;
-  }
-  
-  protected ExecutionState _mapState(final FinalState state) {
-    final ExecutionState _state = this.mapping.create(state);
-    _state.setLeaf(true);
-    _state.setEntryAction(null);
-    _state.setExitAction(null);
-    return _state;
-  }
-  
-  protected ExecutionState _mapState(final State state) {
-    final ExecutionState _state = this.mapping.create(state);
-    boolean _isSimple = state.isSimple();
-    _state.setLeaf(_isSimple);
-    return _state;
-  }
-  
-  protected ExecutionState _mapState(final RegularState state) {
-    return null;
-  }
-  
-  public ExecutionFlow mapRegions(final Statechart statechart, final ExecutionFlow flow) {
-    final List<Region> allRegions = this.sct.allRegions(statechart);
-    EList<ExecutionRegion> _regions = flow.getRegions();
-    final Function1<Region,ExecutionRegion> _function = new Function1<Region,ExecutionRegion>() {
-        public ExecutionRegion apply(final Region r) {
-          ExecutionRegion _mapRegion = StructureMapping.this.mapRegion(r);
-          return _mapRegion;
-        }
-      };
-    List<ExecutionRegion> _map = ListExtensions.<Region, ExecutionRegion>map(allRegions, _function);
-    _regions.addAll(_map);
-    return flow;
-  }
-  
-  public ExecutionRegion mapRegion(final Region region) {
-    final ExecutionRegion _region = this.mapping.create(region);
-    CompositeElement _composite = region.getComposite();
-    if ((_composite instanceof Statechart)) {
-      CompositeElement _composite_1 = region.getComposite();
-      ExecutionFlow _create = this.mapping.create(((Statechart) _composite_1));
-      _region.setSuperScope(_create);
-    } else {
-      CompositeElement _composite_2 = region.getComposite();
-      ExecutionState _create_1 = this.mapping.create(((State) _composite_2));
-      _region.setSuperScope(_create_1);
-    }
-    EList<ExecutionScope> _subScopes = _region.getSubScopes();
-    EList<Vertex> _vertices = region.getVertices();
-    Iterable<RegularState> _filter = Iterables.<RegularState>filter(_vertices, RegularState.class);
-    final Function1<RegularState,ExecutionScope> _function = new Function1<RegularState,ExecutionScope>() {
-        public ExecutionScope apply(final RegularState v) {
-          ExecutionState _create = StructureMapping.this.mapping.create(v);
-          return ((ExecutionScope) _create);
-        }
-      };
-    Iterable<ExecutionScope> _map = IterableExtensions.<RegularState, ExecutionScope>map(_filter, _function);
-    Iterables.<ExecutionScope>addAll(_subScopes, _map);
-    EList<ExecutionNode> _nodes = _region.getNodes();
-    EList<Vertex> _vertices_1 = region.getVertices();
-    Iterable<Vertex> _filter_1 = Iterables.<Vertex>filter(_vertices_1, Vertex.class);
-    final Function1<Vertex,ExecutionNode> _function_1 = new Function1<Vertex,ExecutionNode>() {
-        public ExecutionNode apply(final Vertex v) {
-          ExecutionNode _mapped = StructureMapping.this.mapping.mapped(v);
-          return _mapped;
-        }
-      };
-    Iterable<ExecutionNode> _map_1 = IterableExtensions.<Vertex, ExecutionNode>map(_filter_1, _function_1);
-    Iterables.<ExecutionNode>addAll(_nodes, _map_1);
-    return _region;
-  }
-  
-  public ExecutionFlow mapPseudoStates(final Statechart statechart, final ExecutionFlow r) {
-    EList<ExecutionNode> _nodes = r.getNodes();
-    Iterable<Choice> _allChoices = this.sct.allChoices(statechart);
-    final Function1<Choice,ExecutionChoice> _function = new Function1<Choice,ExecutionChoice>() {
-        public ExecutionChoice apply(final Choice choice) {
-          ExecutionChoice _create = StructureMapping.this.mapping.create(choice);
-          return _create;
-        }
-      };
-    Iterable<ExecutionChoice> _map = IterableExtensions.<Choice, ExecutionChoice>map(_allChoices, _function);
-    Iterables.<ExecutionNode>addAll(_nodes, _map);
-    EList<ExecutionNode> _nodes_1 = r.getNodes();
-    Iterable<Entry> _allEntries = this.sct.allEntries(statechart);
-    final Function1<Entry,ExecutionEntry> _function_1 = new Function1<Entry,ExecutionEntry>() {
-        public ExecutionEntry apply(final Entry entry) {
-          ExecutionEntry _create = StructureMapping.this.mapping.create(entry);
-          return _create;
-        }
-      };
-    Iterable<ExecutionEntry> _map_1 = IterableExtensions.<Entry, ExecutionEntry>map(_allEntries, _function_1);
-    Iterables.<ExecutionNode>addAll(_nodes_1, _map_1);
-    EList<ExecutionNode> _nodes_2 = r.getNodes();
-    Iterable<Synchronization> _allSynchronizations = this.sct.allSynchronizations(statechart);
-    final Function1<Synchronization,ExecutionSynchronization> _function_2 = new Function1<Synchronization,ExecutionSynchronization>() {
-        public ExecutionSynchronization apply(final Synchronization sync) {
-          ExecutionSynchronization _create = StructureMapping.this.mapping.create(sync);
-          return _create;
-        }
-      };
-    Iterable<ExecutionSynchronization> _map_2 = IterableExtensions.<Synchronization, ExecutionSynchronization>map(_allSynchronizations, _function_2);
-    Iterables.<ExecutionNode>addAll(_nodes_2, _map_2);
-    return r;
-  }
-  
-  /**
-   * Time trigger will be mapped to execution model time events for each real state.
-   */
-  public ExecutionFlow mapTimeEvents(final Statechart statechart, final ExecutionFlow r) {
-    List<EObject> content = EcoreUtil2.eAllContentsAsList(statechart);
-    final Iterable<State> allStates = Iterables.<State>filter(content, State.class);
-    final Procedure1<State> _function = new Procedure1<State>() {
-        public void apply(final State s) {
-          StructureMapping.this.mapTimeEventSpecs(s);
-        }
-      };
-    IterableExtensions.<State>forEach(allStates, _function);
-    this.mapTimeEventSpecs(statechart);
-    return r;
-  }
-  
-  public ArrayList<TimeEvent> mapTimeEventSpecs(final State state) {
-    ArrayList<TimeEvent> _xblockexpression = null;
-    {
-      final List<TimeEventSpec> timeEventSpecs = this.sct.timeEventSpecs(state);
-      ArrayList<TimeEvent> _arrayList = new ArrayList<TimeEvent>();
-      final ArrayList<TimeEvent> result = _arrayList;
-      for (final TimeEventSpec tes : timeEventSpecs) {
-        {
-          final TimeEvent timeEvent = this.mapping.createDerivedEvent(tes);
-          QualifiedName _fullyQualifiedName = this._iQualifiedNameProvider.getFullyQualifiedName(state);
-          String _plus = (_fullyQualifiedName + "_time_event_");
-          int _indexOf = timeEventSpecs.indexOf(tes);
-          String _plus_1 = (_plus + Integer.valueOf(_indexOf));
-          timeEvent.setName(_plus_1);
-          Statechart _statechart = this.sct.statechart(state);
-          ExecutionFlow _create = this.mapping.create(_statechart);
-          Scope _timeEventScope = this.mapping.timeEventScope(_create);
-          EList<Declaration> _declarations = _timeEventScope.getDeclarations();
-          _declarations.add(timeEvent);
-          result.add(timeEvent);
-        }
-      }
-      _xblockexpression = (result);
-    }
-    return _xblockexpression;
-  }
-  
-  public ArrayList<TimeEvent> mapTimeEventSpecs(final Statechart statechart) {
-    ArrayList<TimeEvent> _xblockexpression = null;
-    {
-      final List<TimeEventSpec> timeEventSpecs = this.sct.timeEventSpecs(statechart);
-      ArrayList<TimeEvent> _arrayList = new ArrayList<TimeEvent>();
-      final ArrayList<TimeEvent> result = _arrayList;
-      for (final TimeEventSpec tes : timeEventSpecs) {
-        {
-          final TimeEvent timeEvent = this.mapping.createDerivedEvent(tes);
-          String _name = statechart.getName();
-          String _plus = (_name + "_time_event_");
-          int _indexOf = timeEventSpecs.indexOf(tes);
-          String _plus_1 = (_plus + Integer.valueOf(_indexOf));
-          timeEvent.setName(_plus_1);
-          ExecutionFlow _create = this.mapping.create(statechart);
-          Scope _timeEventScope = this.mapping.timeEventScope(_create);
-          EList<Declaration> _declarations = _timeEventScope.getDeclarations();
-          _declarations.add(timeEvent);
-          result.add(timeEvent);
-        }
-      }
-      _xblockexpression = (result);
-    }
-    return _xblockexpression;
-  }
-  
-  public Declaration map(final Declaration e) {
-    if (e instanceof EventDefinition) {
-      return _map((EventDefinition)e);
-    } else if (e instanceof OperationDefinition) {
-      return _map((OperationDefinition)e);
-    } else if (e instanceof VariableDefinition) {
-      return _map((VariableDefinition)e);
-    } else if (e != null) {
-      return _map(e);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(e).toString());
-    }
-  }
-  
-  public ExecutionState mapState(final RegularState state) {
-    if (state instanceof FinalState) {
-      return _mapState((FinalState)state);
-    } else if (state instanceof State) {
-      return _mapState((State)state);
-    } else if (state != null) {
-      return _mapState(state);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(state).toString());
-    }
-  }
-}

+ 0 - 102
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/TraceExtensions.java

@@ -1,102 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import org.eclipse.emf.common.util.EList;
-import org.yakindu.sct.model.sexec.ExecutionNode;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.Reaction;
-import org.yakindu.sct.model.sexec.ReactionFired;
-import org.yakindu.sct.model.sexec.Sequence;
-import org.yakindu.sct.model.sexec.SexecFactory;
-import org.yakindu.sct.model.sexec.Step;
-import org.yakindu.sct.model.sexec.TraceNodeExecuted;
-import org.yakindu.sct.model.sexec.TraceStateEntered;
-import org.yakindu.sct.model.sexec.TraceStateExited;
-import org.yakindu.sct.model.sexec.transformation.SexecElementMapping;
-import org.yakindu.sct.model.sexec.transformation.SexecExtensions;
-import org.yakindu.sct.model.sgraph.RegularState;
-
-@SuppressWarnings("all")
-public class TraceExtensions {
-  @Inject
-  private SexecExtensions sexec;
-  
-  @Inject
-  private SexecElementMapping mapping;
-  
-  @Inject
-  @Named(value = "ADD_TRACES")
-  private boolean _addTraceSteps;
-  
-  public boolean isAddTraceSteps() {
-    return this._addTraceSteps;
-  }
-  
-  public ReactionFired newTraceReactionFired(final Reaction r) {
-    ReactionFired _xblockexpression = null;
-    {
-      SexecFactory _factory = this.sexec.factory();
-      final ReactionFired rf = _factory.createReactionFired();
-      rf.setReaction(r);
-      _xblockexpression = (rf);
-    }
-    return _xblockexpression;
-  }
-  
-  public TraceNodeExecuted newTraceNodeExecuted(final ExecutionNode node) {
-    TraceNodeExecuted _xblockexpression = null;
-    {
-      SexecFactory _factory = this.sexec.factory();
-      final TraceNodeExecuted t = _factory.createTraceNodeExecuted();
-      t.setNode(node);
-      _xblockexpression = (t);
-    }
-    return _xblockexpression;
-  }
-  
-  public TraceStateEntered newTraceStateEntered(final ExecutionState state) {
-    TraceStateEntered _xblockexpression = null;
-    {
-      SexecFactory _factory = this.sexec.factory();
-      final TraceStateEntered t = _factory.createTraceStateEntered();
-      t.setState(state);
-      _xblockexpression = (t);
-    }
-    return _xblockexpression;
-  }
-  
-  public TraceStateExited newTraceStateExited(final ExecutionState state) {
-    TraceStateExited _xblockexpression = null;
-    {
-      SexecFactory _factory = this.sexec.factory();
-      final TraceStateExited t = _factory.createTraceStateExited();
-      t.setState(state);
-      _xblockexpression = (t);
-    }
-    return _xblockexpression;
-  }
-  
-  public boolean traceStateExited(final Sequence seq, final ExecutionState state) {
-    boolean _xifexpression = false;
-    boolean _isAddTraceSteps = this.isAddTraceSteps();
-    if (_isAddTraceSteps) {
-      EList<Step> _steps = seq.getSteps();
-      TraceStateExited _newTraceStateExited = this.newTraceStateExited(state);
-      boolean _add = _steps.add(_newTraceStateExited);
-      _xifexpression = _add;
-    }
-    return _xifexpression;
-  }
-  
-  public boolean traceStateExited(final Sequence seq, final RegularState state) {
-    boolean _xifexpression = false;
-    boolean _isAddTraceSteps = this.isAddTraceSteps();
-    if (_isAddTraceSteps) {
-      ExecutionState _create = this.mapping.create(state);
-      boolean _traceStateExited = this.traceStateExited(seq, _create);
-      _xifexpression = _traceStateExited;
-    }
-    return _xifexpression;
-  }
-}

BIN
plugins/org.yakindu.sct.model.stext/xtend-gen/org/yakindu/sct/model/stext/types/.DefaultSTextTypeInferrer.java._trace


BIN
plugins/org.yakindu.sct.model.stext/xtend-gen/org/yakindu/sct/model/stext/types/.STextDefaultTypeInferrer.java._trace


+ 0 - 901
plugins/org.yakindu.sct.model.stext/xtend-gen/org/yakindu/sct/model/stext/types/STextDefaultTypeInferrer.java

@@ -1,901 +0,0 @@
-package org.yakindu.sct.model.stext.types;
-
-import com.google.common.base.Objects;
-import com.google.common.collect.Iterables;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.yakindu.base.types.EnumerationType;
-import org.yakindu.base.types.Enumerator;
-import org.yakindu.base.types.Event;
-import org.yakindu.base.types.Feature;
-import org.yakindu.base.types.ITypeSystem.ITypeSystemOperator;
-import org.yakindu.base.types.ITypeSystem.InferenceIssue;
-import org.yakindu.base.types.ITypeSystem.InferenceResult;
-import org.yakindu.base.types.ITypeSystem.InferredType;
-import org.yakindu.base.types.Type;
-import org.yakindu.base.types.TypedElement;
-import org.yakindu.sct.model.stext.stext.ActiveStateReferenceExpression;
-import org.yakindu.sct.model.stext.stext.AdditiveOperator;
-import org.yakindu.sct.model.stext.stext.AssignmentExpression;
-import org.yakindu.sct.model.stext.stext.AssignmentOperator;
-import org.yakindu.sct.model.stext.stext.BitwiseAndExpression;
-import org.yakindu.sct.model.stext.stext.BitwiseOrExpression;
-import org.yakindu.sct.model.stext.stext.BitwiseXorExpression;
-import org.yakindu.sct.model.stext.stext.ConditionalExpression;
-import org.yakindu.sct.model.stext.stext.ElementReferenceExpression;
-import org.yakindu.sct.model.stext.stext.EventDefinition;
-import org.yakindu.sct.model.stext.stext.EventRaisingExpression;
-import org.yakindu.sct.model.stext.stext.EventValueReferenceExpression;
-import org.yakindu.sct.model.stext.stext.Expression;
-import org.yakindu.sct.model.stext.stext.FeatureCall;
-import org.yakindu.sct.model.stext.stext.Literal;
-import org.yakindu.sct.model.stext.stext.LogicalAndExpression;
-import org.yakindu.sct.model.stext.stext.LogicalNotExpression;
-import org.yakindu.sct.model.stext.stext.LogicalOrExpression;
-import org.yakindu.sct.model.stext.stext.LogicalRelationExpression;
-import org.yakindu.sct.model.stext.stext.MultiplicativeOperator;
-import org.yakindu.sct.model.stext.stext.NumericalAddSubtractExpression;
-import org.yakindu.sct.model.stext.stext.NumericalMultiplyDivideExpression;
-import org.yakindu.sct.model.stext.stext.NumericalUnaryExpression;
-import org.yakindu.sct.model.stext.stext.OperationDefinition;
-import org.yakindu.sct.model.stext.stext.ParenthesizedExpression;
-import org.yakindu.sct.model.stext.stext.PrimitiveValueExpression;
-import org.yakindu.sct.model.stext.stext.RelationalOperator;
-import org.yakindu.sct.model.stext.stext.ShiftExpression;
-import org.yakindu.sct.model.stext.stext.ShiftOperator;
-import org.yakindu.sct.model.stext.stext.UnaryOperator;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-import org.yakindu.sct.model.stext.types.ISTextTypeInferrer;
-import org.yakindu.sct.model.stext.types.ISTextTypeSystem;
-import org.yakindu.sct.model.stext.types.ISTextTypeSystem.BinaryOperators;
-import org.yakindu.sct.model.stext.types.ISTextTypeSystem.TernaryOperators;
-import org.yakindu.sct.model.stext.types.ISTextTypeSystem.UnaryOperators;
-
-/**
- * The TypeInferrer checks an expression AST for type conformance
- * 
- * @author andreas muelder - Initial contribution and API
- * @author Alexander Nyßen - Complete revision of API
- */
-@Singleton
-@SuppressWarnings("all")
-public class STextDefaultTypeInferrer implements ISTextTypeInferrer {
-  @Inject
-  protected ISTextTypeSystem ts;
-  
-  public InferenceResult inferType(final Expression e) {
-    boolean _equals = Objects.equal(e, null);
-    if (_equals) {
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException("Expression may not be null");
-      throw _illegalArgumentException;
-    } else {
-      return this.doInferType(e);
-    }
-  }
-  
-  public InferenceResult inferType(final VariableDefinition definition) {
-    InferenceResult _xifexpression = null;
-    boolean _equals = Objects.equal(definition, null);
-    if (_equals) {
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException("Definition may not be null");
-      throw _illegalArgumentException;
-    } else {
-      InferenceResult _doInferType = this.doInferType(definition);
-      _xifexpression = _doInferType;
-    }
-    return _xifexpression;
-  }
-  
-  public InferenceResult inferType(final EventDefinition definition) {
-    InferenceResult _xifexpression = null;
-    boolean _equals = Objects.equal(definition, null);
-    if (_equals) {
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException("Definition may not be null");
-      throw _illegalArgumentException;
-    } else {
-      InferenceResult _doInferType = this.doInferType(definition);
-      _xifexpression = _doInferType;
-    }
-    return _xifexpression;
-  }
-  
-  protected InferenceResult _doInferType(final VariableDefinition definition) {
-    Type _type = definition.getType();
-    boolean _equals = Objects.equal(_type, null);
-    if (_equals) {
-      String _name = definition.getName();
-      String _plus = ("Could not infer type of variable: " + _name);
-      InferenceIssue _inferenceIssue = new InferenceIssue(_plus, IStatus.ERROR);
-      InferenceResult _inferenceResult = new InferenceResult(null, _inferenceIssue);
-      return _inferenceResult;
-    } else {
-      Type _type_1 = definition.getType();
-      InferredType _inferredType = new InferredType(_type_1);
-      InferenceResult _inferenceResult_1 = new InferenceResult(_inferredType);
-      InferenceResult varType = _inferenceResult_1;
-      Expression _initialValue = definition.getInitialValue();
-      boolean _notEquals = (!Objects.equal(_initialValue, null));
-      if (_notEquals) {
-        Expression _initialValue_1 = definition.getInitialValue();
-        final InferenceResult valueType = this.doInferType(_initialValue_1);
-        InferredType _type_2 = valueType.getType();
-        boolean _equals_1 = Objects.equal(_type_2, null);
-        if (_equals_1) {
-          Expression _initialValue_2 = definition.getInitialValue();
-          String _plus_1 = ("Could not infer type of initial value expression: " + _initialValue_2);
-          InferenceIssue _inferenceIssue_1 = new InferenceIssue(_plus_1, IStatus.ERROR);
-          InferenceResult _inferenceResult_2 = new InferenceResult(null, _inferenceIssue_1);
-          return _inferenceResult_2;
-        }
-        final InferenceResult result = this.inferResult(varType, valueType, BinaryOperators.ASSIGN);
-        InferredType _type_3 = result.getType();
-        boolean _equals_2 = Objects.equal(_type_3, null);
-        if (_equals_2) {
-          InferredType _type_4 = valueType.getType();
-          Type _type_5 = _type_4.getType();
-          String _name_1 = _type_5.getName();
-          String _plus_2 = ("Cannot assign a value of type " + _name_1);
-          String _plus_3 = (_plus_2 + " to a variable of type ");
-          InferredType _type_6 = varType.getType();
-          Type _type_7 = _type_6.getType();
-          String _name_2 = _type_7.getName();
-          String _plus_4 = (_plus_3 + _name_2);
-          String _plus_5 = (_plus_4 + ".");
-          InferenceIssue _inferenceIssue_2 = new InferenceIssue(_plus_5, IStatus.ERROR);
-          InferenceResult _inferenceResult_3 = new InferenceResult(null, _inferenceIssue_2);
-          return _inferenceResult_3;
-        }
-      }
-      return varType;
-    }
-  }
-  
-  protected InferenceResult _doInferType(final EventDefinition definition) {
-    boolean _equals = Objects.equal(definition, null);
-    if (_equals) {
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException("EventDefinition may not be null");
-      throw _illegalArgumentException;
-    }
-    Type _type = definition.getType();
-    boolean _equals_1 = Objects.equal(_type, null);
-    if (_equals_1) {
-      Type _voidType = this.ts.getVoidType();
-      InferredType _inferredType = new InferredType(_voidType);
-      InferenceResult _inferenceResult = new InferenceResult(_inferredType);
-      return _inferenceResult;
-    }
-    Type _type_1 = definition.getType();
-    InferredType _inferredType_1 = new InferredType(_type_1);
-    InferenceResult _inferenceResult_1 = new InferenceResult(_inferredType_1);
-    return _inferenceResult_1;
-  }
-  
-  protected InferenceResult _doInferType(final OperationDefinition definition) {
-    boolean _equals = Objects.equal(definition, null);
-    if (_equals) {
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException("EventDefinition may not be null");
-      throw _illegalArgumentException;
-    }
-    Type _type = definition.getType();
-    boolean _equals_1 = Objects.equal(_type, null);
-    if (_equals_1) {
-      Type _voidType = this.ts.getVoidType();
-      InferredType _inferredType = new InferredType(_voidType);
-      InferenceResult _inferenceResult = new InferenceResult(_inferredType);
-      return _inferenceResult;
-    }
-    Type _type_1 = definition.getType();
-    InferredType _inferredType_1 = new InferredType(_type_1);
-    InferenceResult _inferenceResult_1 = new InferenceResult(_inferredType_1);
-    return _inferenceResult_1;
-  }
-  
-  protected InferenceResult _doInferType(final Type type) {
-    InferredType _inferredType = new InferredType(type);
-    InferenceResult _inferenceResult = new InferenceResult(_inferredType);
-    return _inferenceResult;
-  }
-  
-  protected InferenceResult _doInferType(final TypedElement typedElement) {
-    Type _type = typedElement.getType();
-    InferredType _inferredType = new InferredType(_type);
-    InferenceResult _inferenceResult = new InferenceResult(_inferredType);
-    return _inferenceResult;
-  }
-  
-  protected InferenceResult _doInferType(final Enumerator enumerator) {
-    EnumerationType _owningEnumeration = enumerator.getOwningEnumeration();
-    InferredType _inferredType = new InferredType(_owningEnumeration);
-    InferenceResult _inferenceResult = new InferenceResult(_inferredType);
-    return _inferenceResult;
-  }
-  
-  protected InferenceResult _doInferType(final EObject e) {
-    Type _voidType = this.ts.getVoidType();
-    InferredType _inferredType = new InferredType(_voidType);
-    InferenceResult _inferenceResult = new InferenceResult(_inferredType);
-    return _inferenceResult;
-  }
-  
-  protected InferenceResult _doInferType(final Expression e) {
-    String _plus = ("Unsupported expression type " + e);
-    UnsupportedOperationException _unsupportedOperationException = new UnsupportedOperationException(_plus);
-    throw _unsupportedOperationException;
-  }
-  
-  public InferenceResult inferResult(final InferenceResult operand, final ITypeSystemOperator unaryOperator) {
-    InferredType _type = operand.getType();
-    boolean _notEquals = (!Objects.equal(_type, null));
-    if (_notEquals) {
-      InferredType _type_1 = operand.getType();
-      return this.ts.inferType(_type_1, unaryOperator);
-    }
-    Collection<InferenceIssue> _issues = operand.getIssues();
-    InferenceResult _inferenceResult = new InferenceResult(null, _issues);
-    return _inferenceResult;
-  }
-  
-  public InferenceResult inferResult(final InferenceResult firstOperand, final InferenceResult secondOperand, final ITypeSystemOperator binaryOperator) {
-    boolean _and = false;
-    InferredType _type = firstOperand.getType();
-    boolean _notEquals = (!Objects.equal(_type, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      InferredType _type_1 = secondOperand.getType();
-      boolean _notEquals_1 = (!Objects.equal(_type_1, null));
-      _and = (_notEquals && _notEquals_1);
-    }
-    if (_and) {
-      InferredType _type_2 = firstOperand.getType();
-      InferredType _type_3 = secondOperand.getType();
-      final InferenceResult result = this.ts.inferType(_type_2, _type_3, binaryOperator);
-      Collection<InferenceIssue> _issues = result.getIssues();
-      Collection<InferenceIssue> _issues_1 = firstOperand.getIssues();
-      _issues.addAll(_issues_1);
-      Collection<InferenceIssue> _issues_2 = result.getIssues();
-      Collection<InferenceIssue> _issues_3 = secondOperand.getIssues();
-      _issues_2.addAll(_issues_3);
-      return result;
-    }
-    Collection<InferenceIssue> _issues_4 = firstOperand.getIssues();
-    Collection<InferenceIssue> _issues_5 = secondOperand.getIssues();
-    Iterable<InferenceIssue> _concat = Iterables.<InferenceIssue>concat(_issues_4, _issues_5);
-    List<InferenceIssue> _list = IterableExtensions.<InferenceIssue>toList(_concat);
-    InferenceResult _inferenceResult = new InferenceResult(null, _list);
-    return _inferenceResult;
-  }
-  
-  public InferenceResult inferResult(final InferenceResult firstOperand, final InferenceResult secondOperand, final InferenceResult thirdOperand, final ITypeSystemOperator ternaryOperator) {
-    boolean _and = false;
-    boolean _and_1 = false;
-    InferredType _type = firstOperand.getType();
-    boolean _notEquals = (!Objects.equal(_type, null));
-    if (!_notEquals) {
-      _and_1 = false;
-    } else {
-      InferredType _type_1 = secondOperand.getType();
-      boolean _notEquals_1 = (!Objects.equal(_type_1, null));
-      _and_1 = (_notEquals && _notEquals_1);
-    }
-    if (!_and_1) {
-      _and = false;
-    } else {
-      InferredType _type_2 = thirdOperand.getType();
-      boolean _notEquals_2 = (!Objects.equal(_type_2, null));
-      _and = (_and_1 && _notEquals_2);
-    }
-    if (_and) {
-      InferredType _type_3 = firstOperand.getType();
-      InferredType _type_4 = secondOperand.getType();
-      InferredType _type_5 = thirdOperand.getType();
-      final InferenceResult result = this.ts.inferType(_type_3, _type_4, _type_5, ternaryOperator);
-      Collection<InferenceIssue> _issues = result.getIssues();
-      Collection<InferenceIssue> _issues_1 = firstOperand.getIssues();
-      _issues.addAll(_issues_1);
-      Collection<InferenceIssue> _issues_2 = result.getIssues();
-      Collection<InferenceIssue> _issues_3 = secondOperand.getIssues();
-      _issues_2.addAll(_issues_3);
-      Collection<InferenceIssue> _issues_4 = result.getIssues();
-      Collection<InferenceIssue> _issues_5 = thirdOperand.getIssues();
-      _issues_4.addAll(_issues_5);
-      return result;
-    }
-    Collection<InferenceIssue> _issues_6 = firstOperand.getIssues();
-    Collection<InferenceIssue> _issues_7 = secondOperand.getIssues();
-    Iterable<InferenceIssue> _concat = Iterables.<InferenceIssue>concat(_issues_6, _issues_7);
-    List<InferenceIssue> _list = IterableExtensions.<InferenceIssue>toList(_concat);
-    InferenceResult _inferenceResult = new InferenceResult(null, _list);
-    return _inferenceResult;
-  }
-  
-  protected InferenceResult _doInferType(final AssignmentExpression expression) {
-    Expression _varRef = expression.getVarRef();
-    InferenceResult _doInferType = this.doInferType(_varRef);
-    Expression _expression = expression.getExpression();
-    InferenceResult _doInferType_1 = this.doInferType(_expression);
-    AssignmentOperator _operator = expression.getOperator();
-    ITypeSystemOperator _typeSystemOperator = this.getTypeSystemOperator(_operator);
-    return this.inferResult(_doInferType, _doInferType_1, _typeSystemOperator);
-  }
-  
-  protected InferenceResult _doInferType(final LogicalAndExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    InferenceResult _doInferType = this.doInferType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    InferenceResult _doInferType_1 = this.doInferType(_rightOperand);
-    return this.inferResult(_doInferType, _doInferType_1, BinaryOperators.LOGICAL_AND);
-  }
-  
-  protected InferenceResult _doInferType(final LogicalOrExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    InferenceResult _doInferType = this.doInferType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    InferenceResult _doInferType_1 = this.doInferType(_rightOperand);
-    return this.inferResult(_doInferType, _doInferType_1, BinaryOperators.LOGICAL_OR);
-  }
-  
-  protected InferenceResult _doInferType(final LogicalNotExpression expression) {
-    Expression _operand = expression.getOperand();
-    InferenceResult _doInferType = this.doInferType(_operand);
-    return this.inferResult(_doInferType, UnaryOperators.LOGICAL_NOT);
-  }
-  
-  protected InferenceResult _doInferType(final BitwiseAndExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    InferenceResult _doInferType = this.doInferType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    InferenceResult _doInferType_1 = this.doInferType(_rightOperand);
-    return this.inferResult(_doInferType, _doInferType_1, BinaryOperators.BITWISE_AND);
-  }
-  
-  protected InferenceResult _doInferType(final BitwiseOrExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    InferenceResult _doInferType = this.doInferType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    InferenceResult _doInferType_1 = this.doInferType(_rightOperand);
-    return this.inferResult(_doInferType, _doInferType_1, BinaryOperators.BITWISE_OR);
-  }
-  
-  protected InferenceResult _doInferType(final BitwiseXorExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    InferenceResult _doInferType = this.doInferType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    InferenceResult _doInferType_1 = this.doInferType(_rightOperand);
-    return this.inferResult(_doInferType, _doInferType_1, BinaryOperators.BITWISE_XOR);
-  }
-  
-  protected InferenceResult _doInferType(final LogicalRelationExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    InferenceResult _doInferType = this.doInferType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    InferenceResult _doInferType_1 = this.doInferType(_rightOperand);
-    RelationalOperator _operator = expression.getOperator();
-    ITypeSystemOperator _typeSystemOperator = this.getTypeSystemOperator(_operator);
-    return this.inferResult(_doInferType, _doInferType_1, _typeSystemOperator);
-  }
-  
-  protected InferenceResult _doInferType(final NumericalAddSubtractExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    InferenceResult _doInferType = this.doInferType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    InferenceResult _doInferType_1 = this.doInferType(_rightOperand);
-    AdditiveOperator _operator = expression.getOperator();
-    ITypeSystemOperator _typeSystemOperator = this.getTypeSystemOperator(_operator);
-    return this.inferResult(_doInferType, _doInferType_1, _typeSystemOperator);
-  }
-  
-  protected InferenceResult _doInferType(final NumericalMultiplyDivideExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    InferenceResult _doInferType = this.doInferType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    InferenceResult _doInferType_1 = this.doInferType(_rightOperand);
-    MultiplicativeOperator _operator = expression.getOperator();
-    ITypeSystemOperator _typeSystemOperator = this.getTypeSystemOperator(_operator);
-    return this.inferResult(_doInferType, _doInferType_1, _typeSystemOperator);
-  }
-  
-  protected InferenceResult _doInferType(final NumericalUnaryExpression expression) {
-    Expression _operand = expression.getOperand();
-    InferenceResult _doInferType = this.doInferType(_operand);
-    UnaryOperator _operator = expression.getOperator();
-    ITypeSystemOperator _typeSystemOperator = this.getTypeSystemOperator(_operator);
-    return this.inferResult(_doInferType, _typeSystemOperator);
-  }
-  
-  protected InferenceResult _doInferType(final PrimitiveValueExpression expression) {
-    Literal _value = expression.getValue();
-    return this.doInferType(_value);
-  }
-  
-  protected InferenceResult _doInferType(final ShiftExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    InferenceResult _doInferType = this.doInferType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    InferenceResult _doInferType_1 = this.doInferType(_rightOperand);
-    ShiftOperator _operator = expression.getOperator();
-    ITypeSystemOperator _typeSystemOperator = this.getTypeSystemOperator(_operator);
-    return this.inferResult(_doInferType, _doInferType_1, _typeSystemOperator);
-  }
-  
-  protected InferenceResult _doInferType(final ConditionalExpression expression) {
-    Expression _condition = expression.getCondition();
-    InferenceResult _doInferType = this.doInferType(_condition);
-    Expression _trueCase = expression.getTrueCase();
-    InferenceResult _doInferType_1 = this.doInferType(_trueCase);
-    Expression _falseCase = expression.getFalseCase();
-    InferenceResult _doInferType_2 = this.doInferType(_falseCase);
-    return this.inferResult(_doInferType, _doInferType_1, _doInferType_2, TernaryOperators.CONDITIONAL);
-  }
-  
-  protected InferenceResult _doInferType(final EventRaisingExpression eventRaising) {
-    Expression _event = eventRaising.getEvent();
-    final InferenceResult eventType = this.doInferType(_event);
-    InferredType _type = eventType.getType();
-    boolean _equals = Objects.equal(_type, null);
-    if (_equals) {
-      Expression _event_1 = eventRaising.getEvent();
-      String _plus = ("Could not infer type of event expression: " + _event_1);
-      InferenceIssue _inferenceIssue = new InferenceIssue(_plus, IStatus.ERROR);
-      InferenceResult _inferenceResult = new InferenceResult(null, _inferenceIssue);
-      return _inferenceResult;
-    } else {
-      Expression _value = eventRaising.getValue();
-      boolean _equals_1 = Objects.equal(_value, null);
-      if (_equals_1) {
-        InferredType _type_1 = eventType.getType();
-        boolean _isVoidType = this.ts.isVoidType(_type_1);
-        boolean _not = (!_isVoidType);
-        if (_not) {
-          InferredType _type_2 = eventType.getType();
-          Type _type_3 = _type_2.getType();
-          String _name = _type_3.getName();
-          String _plus_1 = ("Need to assign a value to an event of type " + _name);
-          String _plus_2 = (_plus_1 + ".");
-          InferenceIssue _inferenceIssue_1 = new InferenceIssue(_plus_2, IStatus.ERROR);
-          InferenceResult _inferenceResult_1 = new InferenceResult(null, _inferenceIssue_1);
-          return _inferenceResult_1;
-        }
-        return eventType;
-      } else {
-        Expression _value_1 = eventRaising.getValue();
-        final InferenceResult valueType = this.doInferType(_value_1);
-        InferredType _type_4 = valueType.getType();
-        boolean _equals_2 = Objects.equal(_type_4, null);
-        if (_equals_2) {
-          Expression _value_2 = eventRaising.getValue();
-          String _plus_3 = ("Could not infer type of value expression: " + _value_2);
-          InferenceIssue _inferenceIssue_2 = new InferenceIssue(_plus_3, IStatus.ERROR);
-          InferenceResult _inferenceResult_2 = new InferenceResult(null, _inferenceIssue_2);
-          return _inferenceResult_2;
-        }
-        final InferenceResult result = this.inferResult(eventType, valueType, BinaryOperators.ASSIGN);
-        InferredType _type_5 = result.getType();
-        boolean _equals_3 = Objects.equal(_type_5, null);
-        if (_equals_3) {
-          InferredType _type_6 = valueType.getType();
-          Type _type_7 = _type_6.getType();
-          String _name_1 = _type_7.getName();
-          String _plus_4 = ("Cannot assign a value of type " + _name_1);
-          String _plus_5 = (_plus_4 + " to an event of type ");
-          InferredType _type_8 = eventType.getType();
-          Type _type_9 = _type_8.getType();
-          String _name_2 = _type_9.getName();
-          String _plus_6 = (_plus_5 + _name_2);
-          String _plus_7 = (_plus_6 + ".");
-          InferenceIssue _inferenceIssue_3 = new InferenceIssue(_plus_7, IStatus.ERROR);
-          InferenceResult _inferenceResult_3 = new InferenceResult(null, _inferenceIssue_3);
-          return _inferenceResult_3;
-        } else {
-          return result;
-        }
-      }
-    }
-  }
-  
-  protected InferenceResult _doInferType(final FeatureCall featureCall) {
-    boolean _and = false;
-    boolean _and_1 = false;
-    EObject _feature = featureCall.getFeature();
-    if (!(_feature instanceof Event)) {
-      _and_1 = false;
-    } else {
-      EObject _eContainer = featureCall.eContainer();
-      boolean _not = (!(_eContainer instanceof EventRaisingExpression));
-      _and_1 = ((_feature instanceof Event) && _not);
-    }
-    if (!_and_1) {
-      _and = false;
-    } else {
-      EObject _eContainer_1 = featureCall.eContainer();
-      boolean _not_1 = (!(_eContainer_1 instanceof EventValueReferenceExpression));
-      _and = (_and_1 && _not_1);
-    }
-    if (_and) {
-      Type _booleanType = this.ts.getBooleanType();
-      InferenceResult _inferenceResult = new InferenceResult(_booleanType);
-      return _inferenceResult;
-    }
-    EObject _feature_1 = featureCall.getFeature();
-    if ((_feature_1 instanceof Feature)) {
-      EObject _feature_2 = featureCall.getFeature();
-      final Type type = ((Feature) _feature_2).getType();
-      boolean _notEquals = (!Objects.equal(type, null));
-      if (_notEquals) {
-        InferredType _inferredType = new InferredType(type);
-        InferenceResult _inferenceResult_1 = new InferenceResult(_inferredType);
-        return _inferenceResult_1;
-      }
-      Type _voidType = this.ts.getVoidType();
-      InferenceResult _inferenceResult_2 = new InferenceResult(_voidType);
-      return _inferenceResult_2;
-    }
-    EObject _feature_3 = featureCall.getFeature();
-    return this.doInferType(_feature_3);
-  }
-  
-  protected InferenceResult _doInferType(final ActiveStateReferenceExpression expression) {
-    Type _booleanType = this.ts.getBooleanType();
-    InferenceResult _inferenceResult = new InferenceResult(_booleanType);
-    return _inferenceResult;
-  }
-  
-  protected InferenceResult _doInferType(final ElementReferenceExpression expression) {
-    boolean _and = false;
-    EObject _reference = expression.getReference();
-    if (!(_reference instanceof EventDefinition)) {
-      _and = false;
-    } else {
-      boolean _or = false;
-      EObject _eContainer = expression.eContainer();
-      if ((_eContainer instanceof EventRaisingExpression)) {
-        _or = true;
-      } else {
-        EObject _eContainer_1 = expression.eContainer();
-        _or = ((_eContainer instanceof EventRaisingExpression) || (_eContainer_1 instanceof EventValueReferenceExpression));
-      }
-      boolean _not = (!_or);
-      _and = ((_reference instanceof EventDefinition) && _not);
-    }
-    if (_and) {
-      Type _booleanType = this.ts.getBooleanType();
-      InferenceResult _inferenceResult = new InferenceResult(_booleanType);
-      return _inferenceResult;
-    } else {
-      EObject _reference_1 = expression.getReference();
-      return this.doInferType(_reference_1);
-    }
-  }
-  
-  protected InferenceResult _doInferType(final EventValueReferenceExpression expression) {
-    Expression _value = expression.getValue();
-    return this.doInferType(_value);
-  }
-  
-  protected InferenceResult _doInferType(final ParenthesizedExpression expression) {
-    Expression _expression = expression.getExpression();
-    return this.doInferType(_expression);
-  }
-  
-  protected InferenceResult _doInferType(final Literal literal) {
-    return this.ts.inferType(literal);
-  }
-  
-  protected ITypeSystemOperator _getTypeSystemOperator(final UnaryOperator operator) {
-    UnaryOperators _switchResult = null;
-    boolean _matched = false;
-    if (!_matched) {
-      if (Objects.equal(operator,UnaryOperator.COMPLEMENT)) {
-        _matched=true;
-        _switchResult = UnaryOperators.COMPLEMENT;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,UnaryOperator.NEGATIVE)) {
-        _matched=true;
-        _switchResult = UnaryOperators.NEGATIVE;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,UnaryOperator.POSITIVE)) {
-        _matched=true;
-        _switchResult = UnaryOperators.POSITIVE;
-      }
-    }
-    if (!_matched) {
-      String _plus = ("Unsupported operator" + operator);
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException(_plus);
-      throw _illegalArgumentException;
-    }
-    return _switchResult;
-  }
-  
-  protected ITypeSystemOperator _getTypeSystemOperator(final AssignmentOperator operator) {
-    BinaryOperators _switchResult = null;
-    boolean _matched = false;
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.ADD_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_ADD;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.AND_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_BITWISE_AND;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.DIV_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_DIV;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.LEFT_SHIFT_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_LEFT_SHIFT;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.MOD_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_MOD;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.MULT_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_MULTIPLY;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.OR_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_BITWISE_OR;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.RIGHT_SHIFT_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_RIGHT_SHIFT;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.SUB_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_SUBTRACT;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AssignmentOperator.XOR_ASSIGN)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ASSIGN_BITWISE_XOR;
-      }
-    }
-    if (!_matched) {
-      String _plus = ("Unsupported operator" + operator);
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException(_plus);
-      throw _illegalArgumentException;
-    }
-    return _switchResult;
-  }
-  
-  protected ITypeSystemOperator _getTypeSystemOperator(final ShiftOperator operator) {
-    BinaryOperators _switchResult = null;
-    boolean _matched = false;
-    if (!_matched) {
-      if (Objects.equal(operator,ShiftOperator.LEFT)) {
-        _matched=true;
-        _switchResult = BinaryOperators.LEFT_SHIFT;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,ShiftOperator.RIGHT)) {
-        _matched=true;
-        _switchResult = BinaryOperators.RIGHT_SHIFT;
-      }
-    }
-    if (!_matched) {
-      String _plus = ("Unsupported operator" + operator);
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException(_plus);
-      throw _illegalArgumentException;
-    }
-    return _switchResult;
-  }
-  
-  protected ITypeSystemOperator _getTypeSystemOperator(final AdditiveOperator operator) {
-    BinaryOperators _switchResult = null;
-    boolean _matched = false;
-    if (!_matched) {
-      if (Objects.equal(operator,AdditiveOperator.PLUS)) {
-        _matched=true;
-        _switchResult = BinaryOperators.ADD;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,AdditiveOperator.MINUS)) {
-        _matched=true;
-        _switchResult = BinaryOperators.SUBTRACT;
-      }
-    }
-    if (!_matched) {
-      String _plus = ("Unsupported operator" + operator);
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException(_plus);
-      throw _illegalArgumentException;
-    }
-    return _switchResult;
-  }
-  
-  protected ITypeSystemOperator _getTypeSystemOperator(final MultiplicativeOperator operator) {
-    BinaryOperators _switchResult = null;
-    boolean _matched = false;
-    if (!_matched) {
-      if (Objects.equal(operator,MultiplicativeOperator.DIV)) {
-        _matched=true;
-        _switchResult = BinaryOperators.DIV;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,MultiplicativeOperator.MOD)) {
-        _matched=true;
-        _switchResult = BinaryOperators.MOD;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,MultiplicativeOperator.MUL)) {
-        _matched=true;
-        _switchResult = BinaryOperators.MULTIPLY;
-      }
-    }
-    if (!_matched) {
-      String _plus = ("Unsupported operator" + operator);
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException(_plus);
-      throw _illegalArgumentException;
-    }
-    return _switchResult;
-  }
-  
-  protected ITypeSystemOperator _getTypeSystemOperator(final RelationalOperator operator) {
-    BinaryOperators _switchResult = null;
-    boolean _matched = false;
-    if (!_matched) {
-      if (Objects.equal(operator,RelationalOperator.EQUALS)) {
-        _matched=true;
-        _switchResult = BinaryOperators.EQUAL;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,RelationalOperator.NOT_EQUALS)) {
-        _matched=true;
-        _switchResult = BinaryOperators.NOT_EQUAL;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,RelationalOperator.GREATER)) {
-        _matched=true;
-        _switchResult = BinaryOperators.GREATER;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,RelationalOperator.GREATER_EQUAL)) {
-        _matched=true;
-        _switchResult = BinaryOperators.GREATER_EQUAL;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,RelationalOperator.SMALLER)) {
-        _matched=true;
-        _switchResult = BinaryOperators.SMALLER;
-      }
-    }
-    if (!_matched) {
-      if (Objects.equal(operator,RelationalOperator.SMALLER_EQUAL)) {
-        _matched=true;
-        _switchResult = BinaryOperators.SMALLER_EQUAL;
-      }
-    }
-    if (!_matched) {
-      String _plus = ("Unsupported operator" + operator);
-      IllegalArgumentException _illegalArgumentException = new IllegalArgumentException(_plus);
-      throw _illegalArgumentException;
-    }
-    return _switchResult;
-  }
-  
-  public InferenceResult doInferType(final EObject definition) {
-    if (definition instanceof EventDefinition) {
-      return _doInferType((EventDefinition)definition);
-    } else if (definition instanceof OperationDefinition) {
-      return _doInferType((OperationDefinition)definition);
-    } else if (definition instanceof VariableDefinition) {
-      return _doInferType((VariableDefinition)definition);
-    } else if (definition instanceof ActiveStateReferenceExpression) {
-      return _doInferType((ActiveStateReferenceExpression)definition);
-    } else if (definition instanceof AssignmentExpression) {
-      return _doInferType((AssignmentExpression)definition);
-    } else if (definition instanceof BitwiseAndExpression) {
-      return _doInferType((BitwiseAndExpression)definition);
-    } else if (definition instanceof BitwiseOrExpression) {
-      return _doInferType((BitwiseOrExpression)definition);
-    } else if (definition instanceof BitwiseXorExpression) {
-      return _doInferType((BitwiseXorExpression)definition);
-    } else if (definition instanceof ConditionalExpression) {
-      return _doInferType((ConditionalExpression)definition);
-    } else if (definition instanceof ElementReferenceExpression) {
-      return _doInferType((ElementReferenceExpression)definition);
-    } else if (definition instanceof EventRaisingExpression) {
-      return _doInferType((EventRaisingExpression)definition);
-    } else if (definition instanceof EventValueReferenceExpression) {
-      return _doInferType((EventValueReferenceExpression)definition);
-    } else if (definition instanceof FeatureCall) {
-      return _doInferType((FeatureCall)definition);
-    } else if (definition instanceof LogicalAndExpression) {
-      return _doInferType((LogicalAndExpression)definition);
-    } else if (definition instanceof LogicalNotExpression) {
-      return _doInferType((LogicalNotExpression)definition);
-    } else if (definition instanceof LogicalOrExpression) {
-      return _doInferType((LogicalOrExpression)definition);
-    } else if (definition instanceof LogicalRelationExpression) {
-      return _doInferType((LogicalRelationExpression)definition);
-    } else if (definition instanceof NumericalAddSubtractExpression) {
-      return _doInferType((NumericalAddSubtractExpression)definition);
-    } else if (definition instanceof NumericalMultiplyDivideExpression) {
-      return _doInferType((NumericalMultiplyDivideExpression)definition);
-    } else if (definition instanceof NumericalUnaryExpression) {
-      return _doInferType((NumericalUnaryExpression)definition);
-    } else if (definition instanceof ParenthesizedExpression) {
-      return _doInferType((ParenthesizedExpression)definition);
-    } else if (definition instanceof PrimitiveValueExpression) {
-      return _doInferType((PrimitiveValueExpression)definition);
-    } else if (definition instanceof ShiftExpression) {
-      return _doInferType((ShiftExpression)definition);
-    } else if (definition instanceof Enumerator) {
-      return _doInferType((Enumerator)definition);
-    } else if (definition instanceof Type) {
-      return _doInferType((Type)definition);
-    } else if (definition instanceof Expression) {
-      return _doInferType((Expression)definition);
-    } else if (definition instanceof TypedElement) {
-      return _doInferType((TypedElement)definition);
-    } else if (definition instanceof Literal) {
-      return _doInferType((Literal)definition);
-    } else if (definition != null) {
-      return _doInferType(definition);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(definition).toString());
-    }
-  }
-  
-  public ITypeSystemOperator getTypeSystemOperator(final Object operator) {
-    if (operator instanceof AdditiveOperator) {
-      return _getTypeSystemOperator((AdditiveOperator)operator);
-    } else if (operator instanceof AssignmentOperator) {
-      return _getTypeSystemOperator((AssignmentOperator)operator);
-    } else if (operator instanceof MultiplicativeOperator) {
-      return _getTypeSystemOperator((MultiplicativeOperator)operator);
-    } else if (operator instanceof RelationalOperator) {
-      return _getTypeSystemOperator((RelationalOperator)operator);
-    } else if (operator instanceof ShiftOperator) {
-      return _getTypeSystemOperator((ShiftOperator)operator);
-    } else if (operator instanceof UnaryOperator) {
-      return _getTypeSystemOperator((UnaryOperator)operator);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(operator).toString());
-    }
-  }
-}