소스 검색

Removed generated content of xtend-gen folders

benjamin.schwertfeger@gmail.com 13 년 전
부모
커밋
8bfc91e865
16개의 변경된 파일0개의 추가작업 그리고 6979개의 파일을 삭제
  1. 0 1112
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/BehaviorMapping.java
  2. 0 808
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/FlowOptimizer.java
  3. 0 262
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java
  4. 0 580
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ReactionBuilder.java
  5. 0 875
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.java
  6. 0 263
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.smap
  7. 0 828
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.java
  8. 0 146
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.smap
  9. 0 145
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecExtensions.java
  10. 0 236
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SgraphExtensions.java
  11. 0 239
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StateVectorBuilder.java
  12. 0 459
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StatechartExtensions.java
  13. 0 53
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StextExtensions.java
  14. 0 318
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StructureMapping.java
  15. 0 102
      plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/TraceExtensions.java
  16. 0 553
      plugins/org.yakindu.sct.model.stext/xtend-gen/org/yakindu/sct/model/stext/validation/TypeInferrer.java

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 1112
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 = 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 _stepCopy = FlowOptimizer.this.stepCopy(c);
-            return _stepCopy;
-          }
-        };
-      List<StateCase> _map = ListExtensions.<StateCase, StateCase>map(_cases_1, _function);
-      _cases.addAll(_map);
-      _xblockexpression = (_copy);
-    }
-    return _xblockexpression;
-  }
-  
-  public StateCase stepCopy(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 - 262
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/ModelSequencer.java

@@ -1,262 +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.mapRegions(sc, ef);
-    this.structureMapping.mapPseudoStates(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.behaviorMapping.mapTransitions(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);
-    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 - 875
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.java

@@ -1,875 +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 com.google.inject.Inject;
-import com.google.inject.name.Named;
-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.CollectionLiterals;
-import org.eclipse.xtext.xbase.lib.Functions.Function1;
-import org.eclipse.xtext.xbase.lib.Functions.Function2;
-import org.eclipse.xtext.xbase.lib.IntegerRange;
-import org.eclipse.xtext.xbase.lib.IterableExtensions;
-import org.eclipse.xtext.xbase.lib.IteratorExtensions;
-import org.eclipse.xtext.xbase.lib.ListExtensions;
-import org.yakindu.base.base.NamedElement;
-import org.yakindu.sct.model.sexec.Call;
-import org.yakindu.sct.model.sexec.EnterState;
-import org.yakindu.sct.model.sexec.Execution;
-import org.yakindu.sct.model.sexec.ExecutionEntry;
-import org.yakindu.sct.model.sexec.ExecutionFlow;
-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.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.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.sexec.transformation.SgraphExtensions;
-import org.yakindu.sct.model.sexec.transformation.StatechartExtensions;
-import org.yakindu.sct.model.sexec.transformation.StextExtensions;
-import org.yakindu.sct.model.sexec.transformation.TraceExtensions;
-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.Statement;
-import org.yakindu.sct.model.sgraph.Variable;
-import org.yakindu.sct.model.sgraph.Vertex;
-import org.yakindu.sct.model.stext.stext.AssignmentExpression;
-import org.yakindu.sct.model.stext.stext.AssignmentOperator;
-import org.yakindu.sct.model.stext.stext.ElementReferenceExpression;
-import org.yakindu.sct.model.stext.stext.Expression;
-import org.yakindu.sct.model.stext.stext.IntLiteral;
-import org.yakindu.sct.model.stext.stext.MultiplicativeOperator;
-import org.yakindu.sct.model.stext.stext.NumericalMultiplyDivideExpression;
-import org.yakindu.sct.model.stext.stext.PrimitiveValueExpression;
-import org.yakindu.sct.model.stext.stext.StextFactory;
-import org.yakindu.sct.model.stext.stext.TimeEventSpec;
-import org.yakindu.sct.model.stext.stext.TimeUnit;
-import org.yakindu.sct.model.stext.stext.VariableDefinition;
-
-@SuppressWarnings("all")
-public class SequenceBuilder {
-  @Inject
-  private StatechartExtensions sc;
-  
-  @Inject
-  private SgraphExtensions sgraph;
-  
-  @Inject
-  private StextExtensions stext;
-  
-  @Inject
-  private SexecExtensions sexec;
-  
-  @Inject
-  private SexecElementMapping mapping;
-  
-  @Inject
-  private TraceExtensions trace;
-  
-  @Inject
-  @Named(value = "ADD_TRACES")
-  private boolean _addTraceSteps;
-  
-  public void defineDeepEnterSequences(final ExecutionFlow flow, final Statechart sc) {
-    EList<Region> _regions = sc.getRegions();
-    for (final Region r : _regions) {
-      this.defineDeepEnterSequence(r);
-    }
-  }
-  
-  public void defineDeepEnterSequence(final State s) {
-    EList<Region> _regions = s.getRegions();
-    for (final Region r : _regions) {
-      this.defineDeepEnterSequence(r);
-    }
-  }
-  
-  public void defineDeepEnterSequence(final Region r) {
-    EList<Vertex> _vertices = r.getVertices();
-    Iterable<State> _filter = Iterables.<State>filter(_vertices, State.class);
-    for (final State s : _filter) {
-      this.defineDeepEnterSequence(s);
-    }
-    boolean _requireDeepHistory = this.sgraph.requireDeepHistory(r);
-    boolean _not = (!_requireDeepHistory);
-    if (_not) {
-      return;
-    }
-    final ExecutionRegion execRegion = this.mapping.create(r);
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence seq = _factory.createSequence();
-    seq.setName("deepEnterSequence");
-    String _name = r.getName();
-    String _plus = ("deep enterSequence with history in child " + _name);
-    seq.setComment(_plus);
-    EList<Step> _steps = seq.getSteps();
-    StateSwitch _defineDeepHistorySwitch = this.defineDeepHistorySwitch(r);
-    _steps.add(_defineDeepHistorySwitch);
-    execRegion.setDeepEnterSequence(seq);
-  }
-  
-  public StateSwitch defineDeepHistorySwitch(final Region r) {
-    final ExecutionRegion execRegion = this.mapping.create(r);
-    SexecFactory _factory = this.sexec.factory();
-    final StateSwitch sSwitch = _factory.createStateSwitch();
-    StateVector _stateVector = execRegion.getStateVector();
-    int _offset = _stateVector.getOffset();
-    sSwitch.setStateConfigurationIdx(_offset);
-    String _name = r.getName();
-    String _plus = ("Handle deep history entry of " + _name);
-    sSwitch.setComment(_plus);
-    sSwitch.setHistoryRegion(execRegion);
-    EList<Vertex> _vertices = r.getVertices();
-    Iterable<State> _filter = Iterables.<State>filter(_vertices, State.class);
-    for (final State child : _filter) {
-      ArrayList<RegularState> _newArrayList = CollectionLiterals.<RegularState>newArrayList();
-      List<RegularState> _collectLeafStates = this.sgraph.collectLeafStates(child, _newArrayList);
-      final Function1<RegularState,Boolean> _function = new Function1<RegularState,Boolean>() {
-          public Boolean apply(final RegularState c) {
-            ExecutionState _create = SequenceBuilder.this.mapping.create(c);
-            StateVector _stateVector = _create.getStateVector();
-            int _offset = _stateVector.getOffset();
-            int _stateConfigurationIdx = sSwitch.getStateConfigurationIdx();
-            boolean _equals = (_offset == _stateConfigurationIdx);
-            return Boolean.valueOf(_equals);
-          }
-        };
-      Iterable<RegularState> _filter_1 = IterableExtensions.<RegularState>filter(_collectLeafStates, _function);
-      for (final RegularState childLeaf : _filter_1) {
-        {
-          final ExecutionState execChild = this.mapping.create(child);
-          SexecFactory _factory_1 = this.sexec.factory();
-          final Sequence seq = _factory_1.createSequence();
-          seq.setName("enterSequence");
-          String _name_1 = child.getName();
-          String _plus_1 = ("enterSequence with history in child " + _name_1);
-          String _plus_2 = (_plus_1 + " for leaf ");
-          String _name_2 = childLeaf.getName();
-          String _plus_3 = (_plus_2 + _name_2);
-          seq.setComment(_plus_3);
-          boolean _isLeaf = execChild.isLeaf();
-          if (_isLeaf) {
-            EList<Step> _steps = seq.getSteps();
-            Sequence _enterSequence = execChild.getEnterSequence();
-            Call _newCall = this.mapping.newCall(_enterSequence);
-            _steps.add(_newCall);
-          } else {
-            Step _entryAction = execChild.getEntryAction();
-            boolean _notEquals = (!Objects.equal(_entryAction, null));
-            if (_notEquals) {
-              EList<Step> _steps_1 = seq.getSteps();
-              Step _entryAction_1 = execChild.getEntryAction();
-              Call _newCall_1 = this.mapping.newCall(_entryAction_1);
-              _steps_1.add(_newCall_1);
-            }
-            boolean _isAddTraceSteps = this.trace.isAddTraceSteps();
-            if (_isAddTraceSteps) {
-              EList<Step> _steps_2 = seq.getSteps();
-              TraceStateEntered _newTraceStateEntered = this.trace.newTraceStateEntered(execChild);
-              _steps_2.add(_newTraceStateEntered);
-            }
-            EList<Region> _regions = child.getRegions();
-            for (final Region childRegion : _regions) {
-              EList<Step> _steps_3 = seq.getSteps();
-              ExecutionRegion _create = this.mapping.create(childRegion);
-              Sequence _deepEnterSequence = _create.getDeepEnterSequence();
-              Call _newCall_2 = this.mapping.newCall(_deepEnterSequence);
-              _steps_3.add(_newCall_2);
-            }
-          }
-          EList<StateCase> _cases = sSwitch.getCases();
-          ExecutionState _create_1 = this.mapping.create(childLeaf);
-          StateCase _newCase = this.sexec.newCase(_create_1, seq);
-          _cases.add(_newCase);
-        }
-      }
-    }
-    return sSwitch;
-  }
-  
-  public void defineShallowEnterSequences(final ExecutionFlow flow, final Statechart sc) {
-    final TreeIterator<EObject> contents = sc.eAllContents();
-    Iterator<Region> _filter = Iterators.<Region>filter(contents, Region.class);
-    Iterable<Region> _iterable = IteratorExtensions.<Region>toIterable(_filter);
-    for (final Region r : _iterable) {
-      boolean _requireShallowHistory = this.sgraph.requireShallowHistory(r);
-      if (_requireShallowHistory) {
-        final ExecutionRegion execRegion = this.mapping.create(r);
-        SexecFactory _factory = this.sexec.factory();
-        final Sequence seq = _factory.createSequence();
-        seq.setName("shallowEnterSequence");
-        String _name = r.getName();
-        String _plus = ("shallow enterSequence with history in child " + _name);
-        seq.setComment(_plus);
-        EList<Step> _steps = seq.getSteps();
-        StateSwitch _defineShallowHistorySwitch = this.defineShallowHistorySwitch(r);
-        _steps.add(_defineShallowHistorySwitch);
-        execRegion.setShallowEnterSequence(seq);
-      }
-    }
-  }
-  
-  public StateSwitch defineShallowHistorySwitch(final Region r) {
-    final ExecutionRegion execRegion = this.mapping.create(r);
-    SexecFactory _factory = this.sexec.factory();
-    final StateSwitch sSwitch = _factory.createStateSwitch();
-    StateVector _stateVector = execRegion.getStateVector();
-    int _offset = _stateVector.getOffset();
-    sSwitch.setStateConfigurationIdx(_offset);
-    String _name = r.getName();
-    String _plus = ("Handle shallow history entry of " + _name);
-    sSwitch.setComment(_plus);
-    ExecutionRegion _create = this.mapping.create(r);
-    sSwitch.setHistoryRegion(_create);
-    EList<Vertex> _vertices = r.getVertices();
-    Iterable<State> _filter = Iterables.<State>filter(_vertices, State.class);
-    for (final State child : _filter) {
-      {
-        final ExecutionState execChild = this.mapping.create(child);
-        ArrayList<RegularState> _newArrayList = CollectionLiterals.<RegularState>newArrayList();
-        List<RegularState> _collectLeafStates = this.sgraph.collectLeafStates(child, _newArrayList);
-        final Function1<RegularState,Boolean> _function = new Function1<RegularState,Boolean>() {
-            public Boolean apply(final RegularState c) {
-              ExecutionState _create = SequenceBuilder.this.mapping.create(c);
-              StateVector _stateVector = _create.getStateVector();
-              int _offset = _stateVector.getOffset();
-              int _stateConfigurationIdx = sSwitch.getStateConfigurationIdx();
-              boolean _equals = (_offset == _stateConfigurationIdx);
-              return Boolean.valueOf(_equals);
-            }
-          };
-        Iterable<RegularState> _filter_1 = IterableExtensions.<RegularState>filter(_collectLeafStates, _function);
-        for (final RegularState childLeaf : _filter_1) {
-          EList<StateCase> _cases = sSwitch.getCases();
-          ExecutionState _create_1 = this.mapping.create(childLeaf);
-          Sequence _enterSequence = execChild.getEnterSequence();
-          Call _newCall = this.mapping.newCall(_enterSequence);
-          StateCase _newCase = this.sexec.newCase(_create_1, _newCall);
-          _cases.add(_newCase);
-        }
-      }
-    }
-    return sSwitch;
-  }
-  
-  /**
-   * Defines the enter sequences of all states
-   */
-  public void defineStateEnterSequences(final ExecutionFlow flow, final Statechart sc) {
-    EList<Region> _regions = sc.getRegions();
-    for (final Region r : _regions) {
-      this.defineStateEnterSequence(r);
-    }
-  }
-  
-  protected void _defineStateEnterSequence(final Region r) {
-    final ExecutionRegion execState = this.mapping.create(r);
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence seq = _factory.createSequence();
-    seq.setName("enterSequence");
-    String _name = r.getName();
-    String _plus = ("Default enter sequence for region " + _name);
-    seq.setComment(_plus);
-    EList<Vertex> _vertices = r.getVertices();
-    for (final Vertex s : _vertices) {
-      this.defineStateEnterSequence(s);
-    }
-    Entry _entry = this.sgraph.entry(r);
-    final ExecutionEntry entryNode = _entry==null?(ExecutionEntry)null:this.mapping.create(_entry);
-    boolean _and = false;
-    boolean _notEquals = (!Objects.equal(entryNode, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      Sequence _reactSequence = entryNode.getReactSequence();
-      boolean _notEquals_1 = (!Objects.equal(_reactSequence, null));
-      _and = (_notEquals && _notEquals_1);
-    }
-    if (_and) {
-      EList<Step> _steps = seq.getSteps();
-      Sequence _reactSequence_1 = entryNode.getReactSequence();
-      Call _newCall = this.mapping.newCall(_reactSequence_1);
-      _steps.add(_newCall);
-    }
-    execState.setEnterSequence(seq);
-  }
-  
-  protected void _defineStateEnterSequence(final Vertex v) {
-  }
-  
-  protected void _defineStateEnterSequence(final FinalState state) {
-    final ExecutionState execState = this.mapping.create(state);
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence seq = _factory.createSequence();
-    seq.setName("enterSequence");
-    String _name = state.getName();
-    String _plus = ("Default enter sequence for state " + _name);
-    seq.setComment(_plus);
-    Step _entryAction = execState.getEntryAction();
-    boolean _notEquals = (!Objects.equal(_entryAction, null));
-    if (_notEquals) {
-      EList<Step> _steps = seq.getSteps();
-      Step _entryAction_1 = execState.getEntryAction();
-      Call _newCall = this.mapping.newCall(_entryAction_1);
-      _steps.add(_newCall);
-    }
-    if (this._addTraceSteps) {
-      EList<Step> _steps_1 = seq.getSteps();
-      TraceStateEntered _newTraceStateEntered = this.trace.newTraceStateEntered(execState);
-      _steps_1.add(_newTraceStateEntered);
-    }
-    EList<Step> _steps_2 = seq.getSteps();
-    EnterState _newEnterStateStep = this.sexec.newEnterStateStep(execState);
-    _steps_2.add(_newEnterStateStep);
-    execState.setEnterSequence(seq);
-  }
-  
-  protected void _defineStateEnterSequence(final State state) {
-    final ExecutionState execState = this.mapping.create(state);
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence seq = _factory.createSequence();
-    seq.setName("enterSequence");
-    String _name = state.getName();
-    String _plus = ("Default enter sequence for state " + _name);
-    seq.setComment(_plus);
-    Step _entryAction = execState.getEntryAction();
-    boolean _notEquals = (!Objects.equal(_entryAction, null));
-    if (_notEquals) {
-      EList<Step> _steps = seq.getSteps();
-      Step _entryAction_1 = execState.getEntryAction();
-      Call _newCall = this.mapping.newCall(_entryAction_1);
-      _steps.add(_newCall);
-    }
-    if (this._addTraceSteps) {
-      EList<Step> _steps_1 = seq.getSteps();
-      TraceStateEntered _newTraceStateEntered = this.trace.newTraceStateEntered(execState);
-      _steps_1.add(_newTraceStateEntered);
-    }
-    boolean _isLeaf = execState.isLeaf();
-    if (_isLeaf) {
-      EList<Step> _steps_2 = seq.getSteps();
-      EnterState _newEnterStateStep = this.sexec.newEnterStateStep(execState);
-      _steps_2.add(_newEnterStateStep);
-    } else {
-      EList<Region> _regions = state.getRegions();
-      for (final Region r : _regions) {
-        {
-          this.defineStateEnterSequence(r);
-          final ExecutionRegion execRegion = this.mapping.create(r);
-          Sequence _enterSequence = execRegion.getEnterSequence();
-          boolean _notEquals_1 = (!Objects.equal(_enterSequence, null));
-          if (_notEquals_1) {
-            EList<Step> _steps_3 = seq.getSteps();
-            Sequence _enterSequence_1 = execRegion.getEnterSequence();
-            Call _newCall_1 = this.mapping.newCall(_enterSequence_1);
-            _steps_3.add(_newCall_1);
-          }
-        }
-      }
-    }
-    execState.setEnterSequence(seq);
-  }
-  
-  /**
-   * Defines the exit sequences of all states
-   */
-  public void defineStateExitSequences(final ExecutionFlow flow, final Statechart sc) {
-    EList<Region> _regions = sc.getRegions();
-    for (final Region r : _regions) {
-      this.defineStateExitSequence(r);
-    }
-  }
-  
-  protected void _defineStateExitSequence(final Region r) {
-    final ExecutionRegion execRegion = this.mapping.create(r);
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence seq = _factory.createSequence();
-    seq.setName("exitSequence");
-    String _name = r.getName();
-    String _plus = ("Default exit sequence for region " + _name);
-    seq.setComment(_plus);
-    EList<Vertex> _vertices = r.getVertices();
-    for (final Vertex s : _vertices) {
-      this.defineStateExitSequence(s);
-    }
-    StateVector _historyVector = execRegion.getHistoryVector();
-    boolean _notEquals = (!Objects.equal(_historyVector, null));
-    if (_notEquals) {
-      EList<Step> _steps = seq.getSteps();
-      SaveHistory _newSaveHistory = this.sexec.newSaveHistory(execRegion);
-      _steps.add(_newSaveHistory);
-    }
-    ArrayList<RegularState> _arrayList = new ArrayList<RegularState>();
-    List<RegularState> _collectLeafStates = this.sgraph.collectLeafStates(r, _arrayList);
-    final Function1<RegularState,ExecutionState> _function = new Function1<RegularState,ExecutionState>() {
-        public ExecutionState apply(final RegularState rs) {
-          ExecutionState _create = SequenceBuilder.this.mapping.create(rs);
-          return _create;
-        }
-      };
-    final Iterable<ExecutionState> leafStates = ListExtensions.<RegularState, ExecutionState>map(_collectLeafStates, _function);
-    final StateVector sVector = execRegion.getStateVector();
-    int _offset = sVector.getOffset();
-    int _offset_1 = sVector.getOffset();
-    int _size = sVector.getSize();
-    int _plus_1 = (_offset_1 + _size);
-    int _minus = (_plus_1 - 1);
-    IntegerRange _upTo = new IntegerRange(_offset, _minus);
-    for (final Integer i : _upTo) {
-      {
-        final StateSwitch sSwitch = this.defineExitSwitch(execRegion, leafStates, (i).intValue());
-        EList<Step> _steps_1 = seq.getSteps();
-        _steps_1.add(sSwitch);
-      }
-    }
-    execRegion.setExitSequence(seq);
-  }
-  
-  protected void _defineStateExitSequence(final Vertex v) {
-  }
-  
-  protected void _defineStateExitSequence(final FinalState s) {
-    final ExecutionState execState = this.mapping.create(s);
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence seq = _factory.createSequence();
-    seq.setName("exitSequence");
-    seq.setComment("Default exit sequence for final state.");
-    EList<Step> _steps = seq.getSteps();
-    ExitState _newExitStateStep = this.sexec.newExitStateStep(execState);
-    _steps.add(_newExitStateStep);
-    if (this._addTraceSteps) {
-      EList<Step> _steps_1 = seq.getSteps();
-      TraceStateExited _newTraceStateExited = this.trace.newTraceStateExited(execState);
-      _steps_1.add(_newTraceStateExited);
-    }
-    execState.setExitSequence(seq);
-  }
-  
-  protected void _defineStateExitSequence(final State state) {
-    final ExecutionState execState = this.mapping.create(state);
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence seq = _factory.createSequence();
-    seq.setName("exitSequence");
-    String _name = state.getName();
-    String _plus = ("Default exit sequence for state " + _name);
-    seq.setComment(_plus);
-    boolean _isLeaf = execState.isLeaf();
-    if (_isLeaf) {
-      EList<Step> _steps = seq.getSteps();
-      ExitState _newExitStateStep = this.sexec.newExitStateStep(execState);
-      _steps.add(_newExitStateStep);
-    } else {
-      EList<Region> _regions = state.getRegions();
-      for (final Region r : _regions) {
-        {
-          this.defineStateExitSequence(r);
-          final ExecutionRegion execRegion = this.mapping.create(r);
-          Sequence _exitSequence = execRegion.getExitSequence();
-          boolean _notEquals = (!Objects.equal(_exitSequence, null));
-          if (_notEquals) {
-            EList<Step> _steps_1 = seq.getSteps();
-            Sequence _exitSequence_1 = execRegion.getExitSequence();
-            Call _newCall = this.mapping.newCall(_exitSequence_1);
-            _steps_1.add(_newCall);
-          }
-        }
-      }
-    }
-    Step _exitAction = execState.getExitAction();
-    boolean _notEquals = (!Objects.equal(_exitAction, null));
-    if (_notEquals) {
-      EList<Step> _steps_1 = seq.getSteps();
-      Step _exitAction_1 = execState.getExitAction();
-      Call _newCall = this.mapping.newCall(_exitAction_1);
-      _steps_1.add(_newCall);
-    }
-    if (this._addTraceSteps) {
-      EList<Step> _steps_2 = seq.getSteps();
-      TraceStateExited _newTraceStateExited = this.trace.newTraceStateExited(execState);
-      _steps_2.add(_newTraceStateExited);
-    }
-    execState.setExitSequence(seq);
-  }
-  
-  public StateSwitch defineExitSwitch(final ExecutionRegion region, final Iterable<ExecutionState> leafStates, final int pos) {
-    SexecFactory _factory = this.sexec.factory();
-    StateSwitch sSwitch = _factory.createStateSwitch();
-    sSwitch.setStateConfigurationIdx(pos);
-    String _name = region.getName();
-    String _plus = ("Handle exit of all possible states (of " + _name);
-    String _plus_1 = (_plus + ") at position ");
-    int _stateConfigurationIdx = sSwitch.getStateConfigurationIdx();
-    String _plus_2 = (_plus_1 + Integer.valueOf(_stateConfigurationIdx));
-    String _plus_3 = (_plus_2 + "...");
-    sSwitch.setComment(_plus_3);
-    final Function1<ExecutionState,Boolean> _function = new Function1<ExecutionState,Boolean>() {
-        public Boolean apply(final ExecutionState rs) {
-          boolean _and = false;
-          StateVector _stateVector = rs.getStateVector();
-          int _size = _stateVector.getSize();
-          boolean _equals = (_size == 1);
-          if (!_equals) {
-            _and = false;
-          } else {
-            StateVector _stateVector_1 = rs.getStateVector();
-            int _offset = _stateVector_1.getOffset();
-            boolean _equals_1 = (_offset == pos);
-            _and = (_equals && _equals_1);
-          }
-          return Boolean.valueOf(_and);
-        }
-      };
-    final Iterable<ExecutionState> posStates = IterableExtensions.<ExecutionState>filter(leafStates, _function);
-    for (final ExecutionState s : posStates) {
-      {
-        SexecFactory _factory_1 = this.sexec.factory();
-        final Sequence caseSeq = _factory_1.createSequence();
-        final ArrayList<ExecutionScope> exitScopes = this.sexec.parentScopes(s);
-        ArrayList<ExecutionScope> _parentScopes = this.sexec.parentScopes(region);
-        exitScopes.removeAll(_parentScopes);
-        exitScopes.remove(s);
-        final Function2<Sequence,ExecutionScope,Sequence> _function_1 = new Function2<Sequence,ExecutionScope,Sequence>() {
-            public Sequence apply(final Sequence cs, final ExecutionScope exitScope) {
-              Sequence _xblockexpression = null;
-              {
-                boolean _and = false;
-                if (!(exitScope instanceof ExecutionRegion)) {
-                  _and = false;
-                } else {
-                  StateVector _historyVector = ((ExecutionRegion) exitScope).getHistoryVector();
-                  boolean _notEquals = (!Objects.equal(_historyVector, null));
-                  _and = ((exitScope instanceof ExecutionRegion) && _notEquals);
-                }
-                if (_and) {
-                  final ExecutionRegion execRegion = ((ExecutionRegion) exitScope);
-                  EList<Step> _steps = cs.getSteps();
-                  SaveHistory _newSaveHistory = SequenceBuilder.this.sexec.newSaveHistory(execRegion);
-                  _steps.add(_newSaveHistory);
-                }
-                _xblockexpression = (cs);
-              }
-              return _xblockexpression;
-            }
-          };
-        IterableExtensions.<ExecutionScope, Sequence>fold(exitScopes, caseSeq, _function_1);
-        Sequence _exitSequence = s.getExitSequence();
-        boolean _notEquals = (!Objects.equal(_exitSequence, null));
-        if (_notEquals) {
-          EList<Step> _steps = caseSeq.getSteps();
-          Sequence _exitSequence_1 = s.getExitSequence();
-          Call _newCall = this.mapping.newCall(_exitSequence_1);
-          _steps.add(_newCall);
-        }
-        final Function2<Sequence,ExecutionScope,Sequence> _function_2 = new Function2<Sequence,ExecutionScope,Sequence>() {
-            public Sequence apply(final Sequence cs, final ExecutionScope exitScope) {
-              Sequence _xblockexpression = null;
-              {
-                boolean _and = false;
-                if (!(exitScope instanceof ExecutionState)) {
-                  _and = false;
-                } else {
-                  StateVector _stateVector = s.getStateVector();
-                  int _last = SequenceBuilder.this.sexec.last(_stateVector);
-                  StateVector _stateVector_1 = exitScope.getStateVector();
-                  int _last_1 = SequenceBuilder.this.sexec.last(_stateVector_1);
-                  boolean _equals = (_last == _last_1);
-                  _and = ((exitScope instanceof ExecutionState) && _equals);
-                }
-                if (_and) {
-                  final ExecutionState execState = ((ExecutionState) exitScope);
-                  Step _exitAction = execState.getExitAction();
-                  boolean _notEquals = (!Objects.equal(_exitAction, null));
-                  if (_notEquals) {
-                    EList<Step> _steps = cs.getSteps();
-                    Step _exitAction_1 = execState.getExitAction();
-                    Call _newCall = SequenceBuilder.this.mapping.newCall(_exitAction_1);
-                    _steps.add(_newCall);
-                  }
-                  if (SequenceBuilder.this._addTraceSteps) {
-                    EList<Step> _steps_1 = cs.getSteps();
-                    TraceStateExited _newTraceStateExited = SequenceBuilder.this.trace.newTraceStateExited(execState);
-                    _steps_1.add(_newTraceStateExited);
-                  }
-                }
-                _xblockexpression = (cs);
-              }
-              return _xblockexpression;
-            }
-          };
-        IterableExtensions.<ExecutionScope, Sequence>fold(exitScopes, caseSeq, _function_2);
-        EList<Step> _steps_1 = caseSeq.getSteps();
-        boolean _isEmpty = _steps_1.isEmpty();
-        boolean _not = (!_isEmpty);
-        if (_not) {
-          EList<StateCase> _cases = sSwitch.getCases();
-          StateCase _newCase = this.sexec.newCase(s, caseSeq);
-          _cases.add(_newCase);
-        }
-      }
-    }
-    return sSwitch;
-  }
-  
-  public Sequence defineStatechartExitSequence(final ExecutionFlow flow, final Statechart sc) {
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence exitSequence = _factory.createSequence();
-    exitSequence.setName("exit");
-    String _name = sc.getName();
-    String _plus = ("Default exit sequence for statechart " + _name);
-    exitSequence.setComment(_plus);
-    EList<Region> _regions = sc.getRegions();
-    for (final Region r : _regions) {
-      {
-        final ExecutionRegion execRegion = this.mapping.create(r);
-        Sequence _exitSequence = execRegion.getExitSequence();
-        boolean _notEquals = (!Objects.equal(_exitSequence, null));
-        if (_notEquals) {
-          EList<Step> _steps = exitSequence.getSteps();
-          Sequence _exitSequence_1 = execRegion.getExitSequence();
-          Call _newCall = this.mapping.newCall(_exitSequence_1);
-          _steps.add(_newCall);
-        }
-      }
-    }
-    Step _exitAction = flow.getExitAction();
-    boolean _notEquals = (!Objects.equal(_exitAction, null));
-    if (_notEquals) {
-      EList<Step> _steps = exitSequence.getSteps();
-      Step _exitAction_1 = flow.getExitAction();
-      Call _newCall = this.mapping.newCall(_exitAction_1);
-      _steps.add(_newCall);
-    }
-    flow.setExitSequence(exitSequence);
-    return exitSequence;
-  }
-  
-  public Sequence defineStatechartEnterSequence(final ExecutionFlow flow, final Statechart sc) {
-    SexecFactory _factory = this.sexec.factory();
-    final Sequence enterSequence = _factory.createSequence();
-    enterSequence.setName("enter");
-    String _name = sc.getName();
-    String _plus = ("Default enter sequence for statechart " + _name);
-    enterSequence.setComment(_plus);
-    EList<Scope> _scopes = sc.getScopes();
-    final Function1<Scope,EList<Variable>> _function = new Function1<Scope,EList<Variable>>() {
-        public EList<Variable> apply(final Scope s) {
-          EList<Variable> _variables = s.getVariables();
-          return _variables;
-        }
-      };
-    List<EList<Variable>> _map = ListExtensions.<Scope, EList<Variable>>map(_scopes, _function);
-    Iterable<Variable> _flatten = Iterables.<Variable>concat(_map);
-    Iterable<VariableDefinition> _filter = Iterables.<VariableDefinition>filter(_flatten, VariableDefinition.class);
-    for (final VariableDefinition vd : _filter) {
-      Expression _initialValue = vd.getInitialValue();
-      boolean _notEquals = (!Objects.equal(_initialValue, null));
-      if (_notEquals) {
-        EList<Step> _steps = enterSequence.getSteps();
-        Execution _createInitialization = this.createInitialization(vd);
-        _steps.add(_createInitialization);
-      }
-    }
-    List<TimeEventSpec> _timeEventSpecs = this.sc.timeEventSpecs(sc);
-    for (final TimeEventSpec tes : _timeEventSpecs) {
-      {
-        final TimeEvent timeEvent = this.mapping.createDerivedEvent(tes);
-        Statement _buildValueExpression = this.buildValueExpression(tes);
-        final ScheduleTimeEvent scheduleStep = this.mapping.newScheduleTimeEvent(timeEvent, _buildValueExpression);
-        EList<Step> _steps_1 = enterSequence.getSteps();
-        _steps_1.add(scheduleStep);
-      }
-    }
-    Step _entryAction = flow.getEntryAction();
-    boolean _notEquals_1 = (!Objects.equal(_entryAction, null));
-    if (_notEquals_1) {
-      EList<Step> _steps_1 = enterSequence.getSteps();
-      Step _entryAction_1 = flow.getEntryAction();
-      Call _newCall = this.mapping.newCall(_entryAction_1);
-      _steps_1.add(_newCall);
-    }
-    EList<Region> _regions = sc.getRegions();
-    for (final Region r : _regions) {
-      {
-        final ExecutionRegion execRegion = this.mapping.create(r);
-        Sequence _enterSequence = execRegion.getEnterSequence();
-        boolean _notEquals_2 = (!Objects.equal(_enterSequence, null));
-        if (_notEquals_2) {
-          EList<Step> _steps_2 = enterSequence.getSteps();
-          Sequence _enterSequence_1 = execRegion.getEnterSequence();
-          Call _newCall_1 = this.mapping.newCall(_enterSequence_1);
-          _steps_2.add(_newCall_1);
-        }
-      }
-    }
-    flow.setEnterSequence(enterSequence);
-    return enterSequence;
-  }
-  
-  public Execution createInitialization(final VariableDefinition vd) {
-    SexecFactory _factory = this.sexec.factory();
-    final Execution execution = _factory.createExecution();
-    StextFactory _factory_1 = this.stext.factory();
-    final AssignmentExpression assignment = _factory_1.createAssignmentExpression();
-    StextFactory _factory_2 = this.stext.factory();
-    final ElementReferenceExpression reference = _factory_2.createElementReferenceExpression();
-    reference.setReference(vd);
-    assignment.setVarRef(reference);
-    assignment.setOperator(AssignmentOperator.ASSIGN);
-    Expression _initialValue = vd.getInitialValue();
-    Expression _copy = EcoreUtil.<Expression>copy(_initialValue);
-    assignment.setExpression(_copy);
-    execution.setStatement(assignment);
-    return execution;
-  }
-  
-  public Statement buildValueExpression(final TimeEventSpec tes) {
-    Statement _xblockexpression = null;
-    {
-      StextFactory _factory = this.stext.factory();
-      final PrimitiveValueExpression pve = _factory.createPrimitiveValueExpression();
-      StextFactory _factory_1 = this.stext.factory();
-      final IntLiteral intLit = _factory_1.createIntLiteral();
-      int _value = tes.getValue();
-      intLit.setValue(_value);
-      pve.setValue(intLit);
-      Statement _switchResult = null;
-      TimeUnit _unit = tes.getUnit();
-      final TimeUnit _switchValue = _unit;
-      boolean _matched = false;
-      if (!_matched) {
-        if (Objects.equal(_switchValue,TimeUnit.MILLISECOND)) {
-          _matched=true;
-          _switchResult = pve;
-        }
-      }
-      if (!_matched) {
-        if (Objects.equal(_switchValue,TimeUnit.MICROSECOND)) {
-          _matched=true;
-          Statement _divide = this.divide(pve, 1000);
-          _switchResult = _divide;
-        }
-      }
-      if (!_matched) {
-        if (Objects.equal(_switchValue,TimeUnit.NANOSECOND)) {
-          _matched=true;
-          Statement _divide_1 = this.divide(pve, 1000000);
-          _switchResult = _divide_1;
-        }
-      }
-      if (!_matched) {
-        if (Objects.equal(_switchValue,TimeUnit.SECOND)) {
-          _matched=true;
-          Statement _multiply = this.multiply(pve, 1000);
-          _switchResult = _multiply;
-        }
-      }
-      if (!_matched) {
-        _switchResult = pve;
-      }
-      _xblockexpression = (_switchResult);
-    }
-    return _xblockexpression;
-  }
-  
-  public Statement divide(final Expression stmnt, final long divisor) {
-    NumericalMultiplyDivideExpression _xblockexpression = null;
-    {
-      StextFactory _factory = this.stext.factory();
-      final NumericalMultiplyDivideExpression div = _factory.createNumericalMultiplyDivideExpression();
-      StextFactory _factory_1 = this.stext.factory();
-      final PrimitiveValueExpression pve = _factory_1.createPrimitiveValueExpression();
-      StextFactory _factory_2 = this.stext.factory();
-      final IntLiteral intLit = _factory_2.createIntLiteral();
-      int _intValue = Long.valueOf(divisor).intValue();
-      intLit.setValue(_intValue);
-      pve.setValue(intLit);
-      div.setOperator(MultiplicativeOperator.DIV);
-      div.setLeftOperand(stmnt);
-      div.setRightOperand(pve);
-      _xblockexpression = (div);
-    }
-    return _xblockexpression;
-  }
-  
-  public Statement multiply(final Expression stmnt, final long factor) {
-    NumericalMultiplyDivideExpression _xblockexpression = null;
-    {
-      StextFactory _factory = this.stext.factory();
-      final NumericalMultiplyDivideExpression div = _factory.createNumericalMultiplyDivideExpression();
-      StextFactory _factory_1 = this.stext.factory();
-      final PrimitiveValueExpression pve = _factory_1.createPrimitiveValueExpression();
-      StextFactory _factory_2 = this.stext.factory();
-      final IntLiteral intLit = _factory_2.createIntLiteral();
-      int _intValue = Long.valueOf(factor).intValue();
-      intLit.setValue(_intValue);
-      pve.setValue(intLit);
-      div.setOperator(MultiplicativeOperator.MUL);
-      div.setLeftOperand(stmnt);
-      div.setRightOperand(pve);
-      _xblockexpression = (div);
-    }
-    return _xblockexpression;
-  }
-  
-  public void defineStateEnterSequence(final NamedElement state) {
-    if (state instanceof FinalState) {
-      _defineStateEnterSequence((FinalState)state);
-      return;
-    } else if (state instanceof State) {
-      _defineStateEnterSequence((State)state);
-      return;
-    } else if (state instanceof Region) {
-      _defineStateEnterSequence((Region)state);
-      return;
-    } else if (state instanceof Vertex) {
-      _defineStateEnterSequence((Vertex)state);
-      return;
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(state).toString());
-    }
-  }
-  
-  public void defineStateExitSequence(final NamedElement s) {
-    if (s instanceof FinalState) {
-      _defineStateExitSequence((FinalState)s);
-      return;
-    } else if (s instanceof State) {
-      _defineStateExitSequence((State)s);
-      return;
-    } else if (s instanceof Region) {
-      _defineStateExitSequence((Region)s);
-      return;
-    } else if (s instanceof Vertex) {
-      _defineStateExitSequence((Vertex)s);
-      return;
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(s).toString());
-    }
-  }
-}

+ 0 - 263
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.smap

@@ -1,263 +0,0 @@
-SMAP
-SequenceBuilder.java
-Xtend
-*S Xtend
-*F
-+ 0 SequenceBuilder.xtend
-src/org/yakindu/sct/model/sexec/transformation/SequenceBuilder.xtend
-*L
-44:98,2
-45:100
-44:101
-49:105,2
-50:107
-49:108
-55:112,3
-56:115
-55:116
-58:117,3
-59:120
-58:121
-61:122
-62:123,2
-63:125
-64:126,3
-66:129,3
-67:132
-71:136
-73:137,2
-74:139,3
-75:142,3
-76:145
-78:146,3
-80:149,15
-81:164
-82:165,2
-83:167
-84:168,6
-85:174,2
-86:176,4
-85:180
-88:181,8
-89:189,6
-90:195,2
-91:197,5
-90:202
-85:203
-94:204,4
-80:208,2
-78:210
-98:211
-102:215
-103:216,3
-104:219,2
-105:221
-106:222,2
-107:224
-108:225,3
-110:228,3
-111:231
-104:232
-103:233
-117:237
-119:238,2
-120:240,3
-121:243,3
-122:246,2
-124:248,4
-125:252
-127:253,14
-128:267,6
-127:273
-124:274,2
-132:276
-141:283,4
-146:290
-147:291,2
-148:293
-149:294,3
-152:297,4
-154:301,2
-155:303,10
-156:313,4
-155:317
-162:318
-169:325
-170:326,2
-171:328
-172:329,3
-173:332,8
-175:340,5
-177:345,3
-178:348
-185:352
-186:353,2
-187:355
-188:356,3
-189:359,8
-191:367,5
-193:372,2
-195:374,3
-193:377
-199:378,3
-200:381
-202:382
-203:383,3
-204:386,4
-203:390
-199:391,2
-193:393
-209:394
-218:401,4
-223:408
-224:409,2
-225:411
-226:412,3
-229:415,4
-231:419,3
-232:422,3
-231:425
-236:426,9
-237:435
-239:436,8
-242:444
-243:445,2
-239:447,2
-246:449
-253:456
-254:457,2
-255:459
-256:460
-257:461,3
-259:464,5
-261:469
-267:473
-268:474,2
-269:476
-270:477,3
-272:480,2
-274:482,3
-272:485
-278:486,3
-280:489
-282:490
-283:491,3
-284:494,4
-283:498
-278:499,2
-272:501
-289:502,8
-291:510,5
-293:515
-299:519,2
-300:521
-301:522,7
-303:529,18
-306:547,2
-308:549,2
-311:551
-312:552,2
-313:554
-314:555,4
-315:559,9
-316:568
-317:569,3
-315:572
-314:573,6
-323:579,3
-324:582,4
-323:586
-328:587,4
-329:591,12
-330:603
-331:604,8
-332:612,5
-329:617
-328:618,6
-337:624,8
-306:632,2
-341:634
-347:638,2
-348:640
-349:641,3
-351:644,3
-352:647
-353:648,3
-354:651,4
-353:655
-351:656,2
-358:658,8
-360:666
-361:667
-368:671,2
-369:673
-370:674,3
-372:677,11
-373:688,3
-374:691,3
-373:694
-372:695
-378:696,3
-379:699
-380:700,2
-381:702,2
-378:704,2
-384:706,8
-386:714,3
-387:717
-388:718,3
-389:721,4
-388:725
-386:726,2
-393:728
-394:729
-398:733,2
-399:735,2
-400:737,2
-401:739
-402:740
-403:741
-404:742,3
-405:745
-406:746
-411:750,2
-412:752,2
-413:754,2
-414:756,2
-415:758
-417:759,4
-418:763,6
-419:769,7
-420:776,7
-421:783,7
-417:790,3
-411:793,3
-426:799,2
-427:801,2
-428:803,2
-429:805,2
-430:807,2
-431:809
-433:810
-434:811
-435:812
-426:813,3
-440:819,2
-441:821,2
-442:823,2
-443:825,2
-444:827,2
-445:829
-447:830
-448:831
-449:832
-440:833,3
-168:839,3
-183:842,3
-145:845,3
-165:848,3
-252:858,3
-265:861,3
-222:864,3
-250:867,3
-*E

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

@@ -1,828 +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.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.ExecutionRegion;
-import org.yakindu.sct.model.sexec.ExecutionState;
-import org.yakindu.sct.model.sexec.ExecutionSynchronization;
-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.Reaction;
-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.DefaultEvent;
-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.OnCycleEvent;
-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 _create(final InterfaceScope scope) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(scope);
-    final InterfaceScope _result;
-    synchronized (_createCache_create_1) {
-      if (_createCache_create_1.containsKey(_cacheKey)) {
-        return _createCache_create_1.get(_cacheKey);
-      }
-      StextFactory _stextFactory = this.stextFactory();
-      InterfaceScope _createInterfaceScope = _stextFactory.createInterfaceScope();
-      _result = _createInterfaceScope;
-      _createCache_create_1.put(_cacheKey, _result);
-    }
-    _init_create_1(_result, scope);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,Scope> _createCache_create_1 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_1(final InterfaceScope r, final InterfaceScope scope) {
-    String _name = scope.getName();
-    r.setName(_name);
-  }
-  
-  protected Scope _create(final Scope scope) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(scope);
-    final InternalScope _result;
-    synchronized (_createCache_create_2) {
-      if (_createCache_create_2.containsKey(_cacheKey)) {
-        return _createCache_create_2.get(_cacheKey);
-      }
-      StextFactory _stextFactory = this.stextFactory();
-      InternalScope _createInternalScope = _stextFactory.createInternalScope();
-      _result = _createInternalScope;
-      _createCache_create_2.put(_cacheKey, _result);
-    }
-    _init_create_2(_result, scope);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,Scope> _createCache_create_2 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_2(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 EventDefinition create(final EventDefinition event) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(event);
-    final EventDefinition _result;
-    synchronized (_createCache_create_3) {
-      if (_createCache_create_3.containsKey(_cacheKey)) {
-        return _createCache_create_3.get(_cacheKey);
-      }
-      EventDefinition _copy = EcoreUtil.<EventDefinition>copy(event);
-      _result = _copy;
-      _createCache_create_3.put(_cacheKey, _result);
-    }
-    _init_create_3(_result, event);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,EventDefinition> _createCache_create_3 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_3(final EventDefinition r, final EventDefinition event) {
-  }
-  
-  public VariableDefinition create(final VariableDefinition v) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(v);
-    final VariableDefinition _result;
-    synchronized (_createCache_create_4) {
-      if (_createCache_create_4.containsKey(_cacheKey)) {
-        return _createCache_create_4.get(_cacheKey);
-      }
-      VariableDefinition _copy = EcoreUtil.<VariableDefinition>copy(v);
-      _result = _copy;
-      _createCache_create_4.put(_cacheKey, _result);
-    }
-    _init_create_4(_result, v);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,VariableDefinition> _createCache_create_4 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_4(final VariableDefinition r, final VariableDefinition v) {
-  }
-  
-  public OperationDefinition create(final OperationDefinition v) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(v);
-    final OperationDefinition _result;
-    synchronized (_createCache_create_5) {
-      if (_createCache_create_5.containsKey(_cacheKey)) {
-        return _createCache_create_5.get(_cacheKey);
-      }
-      OperationDefinition _copy = EcoreUtil.<OperationDefinition>copy(v);
-      _result = _copy;
-      _createCache_create_5.put(_cacheKey, _result);
-    }
-    _init_create_5(_result, v);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,OperationDefinition> _createCache_create_5 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_5(final OperationDefinition r, final OperationDefinition v) {
-  }
-  
-  public ExecutionState create(final RegularState state) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(state);
-    final ExecutionState _result;
-    synchronized (_createCache_create_6) {
-      if (_createCache_create_6.containsKey(_cacheKey)) {
-        return _createCache_create_6.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionState _createExecutionState = _sexecFactory.createExecutionState();
-      _result = _createExecutionState;
-      _createCache_create_6.put(_cacheKey, _result);
-    }
-    _init_create_6(_result, state);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionState> _createCache_create_6 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_6(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_7) {
-      if (_createCache_create_7.containsKey(_cacheKey)) {
-        return _createCache_create_7.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionChoice _createExecutionChoice = _sexecFactory.createExecutionChoice();
-      _result = _createExecutionChoice;
-      _createCache_create_7.put(_cacheKey, _result);
-    }
-    _init_create_7(_result, choice);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionChoice> _createCache_create_7 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_7(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_8) {
-      if (_createCache_create_8.containsKey(_cacheKey)) {
-        return _createCache_create_8.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionEntry _createExecutionEntry = _sexecFactory.createExecutionEntry();
-      _result = _createExecutionEntry;
-      _createCache_create_8.put(_cacheKey, _result);
-    }
-    _init_create_8(_result, entry);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionEntry> _createCache_create_8 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_8(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);
-    }
-  }
-  
-  public ExecutionSynchronization create(final Synchronization sync) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(sync);
-    final ExecutionSynchronization _result;
-    synchronized (_createCache_create_9) {
-      if (_createCache_create_9.containsKey(_cacheKey)) {
-        return _createCache_create_9.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionSynchronization _createExecutionSynchronization = _sexecFactory.createExecutionSynchronization();
-      _result = _createExecutionSynchronization;
-      _createCache_create_9.put(_cacheKey, _result);
-    }
-    _init_create_9(_result, sync);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionSynchronization> _createCache_create_9 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_9(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_10) {
-      if (_createCache_create_10.containsKey(_cacheKey)) {
-        return _createCache_create_10.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      ExecutionRegion _createExecutionRegion = _sexecFactory.createExecutionRegion();
-      _result = _createExecutionRegion;
-      _createCache_create_10.put(_cacheKey, _result);
-    }
-    _init_create_10(_result, region);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,ExecutionRegion> _createCache_create_10 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_10(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) {
-    Reaction _reaction = this.sce.reaction(tr);
-    String _id = this.sce.id(_reaction);
-    r.setName(_id);
-  }
-  
-  public org.yakindu.sct.model.sexec.Reaction create(final Transition tr) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(tr);
-    final org.yakindu.sct.model.sexec.Reaction _result;
-    synchronized (_createCache_create_11) {
-      if (_createCache_create_11.containsKey(_cacheKey)) {
-        return _createCache_create_11.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
-      _result = _createReaction;
-      _createCache_create_11.put(_cacheKey, _result);
-    }
-    _init_create_11(_result, tr);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_11 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_11(final org.yakindu.sct.model.sexec.Reaction r, final Transition tr) {
-    String _id = this.sce.id(tr);
-    r.setName(_id);
-    r.setTransition(true);
-    r.setSourceElement(tr);
-  }
-  
-  public org.yakindu.sct.model.sexec.Reaction create(final LocalReaction lr) {
-    final ArrayList<?>_cacheKey = CollectionLiterals.newArrayList(lr);
-    final org.yakindu.sct.model.sexec.Reaction _result;
-    synchronized (_createCache_create_12) {
-      if (_createCache_create_12.containsKey(_cacheKey)) {
-        return _createCache_create_12.get(_cacheKey);
-      }
-      SexecFactory _sexecFactory = this.sexecFactory();
-      org.yakindu.sct.model.sexec.Reaction _createReaction = _sexecFactory.createReaction();
-      _result = _createReaction;
-      _createCache_create_12.put(_cacheKey, _result);
-    }
-    _init_create_12(_result, lr);
-    return _result;
-  }
-  
-  private final HashMap<ArrayList<? extends Object>,org.yakindu.sct.model.sexec.Reaction> _createCache_create_12 = CollectionLiterals.newHashMap();
-  
-  private void _init_create_12(final org.yakindu.sct.model.sexec.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 OnCycleEvent 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 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 Expression _raised(final DefaultEvent 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;
-  }
-  
-  public SexecFactory sexecFactory() {
-    return SexecFactory.eINSTANCE;
-  }
-  
-  public StextFactory stextFactory() {
-    return StextFactory.eINSTANCE;
-  }
-  
-  public Scope create(final Scope scope) {
-    if (scope instanceof InterfaceScope) {
-      return _create((InterfaceScope)scope);
-    } else if (scope != null) {
-      return _create(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 DefaultEvent) {
-      return _raised((DefaultEvent)e);
-    } else if (e instanceof OnCycleEvent) {
-      return _raised((OnCycleEvent)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());
-    }
-  }
-}

+ 0 - 146
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.smap

@@ -1,146 +0,0 @@
-SMAP
-SexecElementMapping.java
-Xtend
-*S Xtend
-*F
-+ 0 SexecElementMapping.xtend
-src/org/yakindu/sct/model/sexec/transformation/SexecElementMapping.xtend
-*L
-68:103,2
-69:115,2
-70:117
-73:127,2
-74:139,2
-77:150,2
-81:171,2
-82:183,2
-86:194
-88:214
-90:234
-93:254,2
-94:266,2
-95:268,5
-96:273,9
-97:282,4
-98:286
-94:287
-102:297,2
-103:309,2
-104:311,5
-105:316,3
-106:319,4
-107:323
-108:324,3
-103:327
-113:337,2
-114:349,2
-115:351,2
-116:353,2
-117:355,9
-118:364,11
-119:375,41
-120:416,4
-121:420
-122:421,2
-123:423
-124:424,4
-125:428,6
-126:434,6
-127:440,6
-124:446
-128:447
-124:448,2
-129:450,2
-124:452,2
-131:454
-114:455
-136:465,2
-137:477,2
-138:479,5
-139:484,3
-140:487,4
-141:491
-142:492,3
-137:495
-148:505,2
-149:517,2
-150:519,3
-151:522,2
-152:524,2
-153:526,2
-150:528
-155:529,2
-150:531
-157:532
-149:533
-162:543,2
-163:555,3
-166:567,2
-167:579,2
-168:581
-169:582
-172:592,2
-173:604,2
-174:606
-177:610,2
-178:612,2
-179:614
-177:615,3
-183:621,2
-184:623,2
-185:625
-183:626,3
-189:632,2
-190:634,2
-191:636
-192:637
-189:638,3
-197:644,2
-198:646,2
-199:648
-197:649,3
-204:661,2
-205:673,3
-208:679
-212:683,2
-213:685,3
-214:688
-217:692
-218:696,9
-219:708,9
-220:720,9
-221:732,2
-225:737,2
-226:739,2
-227:741
-231:745,2
-232:747,2
-233:749
-234:750
-235:751
-239:755,2
-240:757,2
-241:759
-242:760
-243:761
-247:765,2
-248:767,2
-249:769
-250:770
-251:771
-255:775
-256:779
-73:783,2
-77:785,2
-238:794,2
-246:796,2
-230:798,2
-211:800,2
-224:802,2
-208:804,2
-221:813,2
-220:815,2
-219:817,2
-218:819,2
-217:821,2
-*E

+ 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 - 239
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StateVectorBuilder.java

@@ -1,239 +0,0 @@
-package org.yakindu.sct.model.sexec.transformation;
-
-import com.google.common.collect.Iterators;
-import com.google.inject.Inject;
-import java.util.Arrays;
-import java.util.Iterator;
-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.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();
-    int _size = _regions.size();
-    boolean _greaterThan = (_size > 0);
-    if (_greaterThan) {
-      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;
-  }
-  
-  /**
-   * 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 - 318
plugins/org.yakindu.sct.model.sexec/xtend-gen/org/yakindu/sct/model/sexec/transformation/StructureMapping.java

@@ -1,318 +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.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;
-  
-  /**
-   * 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.create(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);
-    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);
-          String _name = state.getName();
-          String _plus = (_name + "_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;
-  }
-}

+ 0 - 553
plugins/org.yakindu.sct.model.stext/xtend-gen/org/yakindu/sct/model/stext/validation/TypeInferrer.java

@@ -1,553 +0,0 @@
-package org.yakindu.sct.model.stext.validation;
-
-import com.google.common.base.Objects;
-import com.google.inject.Inject;
-import java.util.Arrays;
-import org.eclipse.emf.ecore.EObject;
-import org.yakindu.base.types.Feature;
-import org.yakindu.base.types.ITypeSystemAccess;
-import org.yakindu.base.types.Type;
-import org.yakindu.sct.model.sgraph.Statement;
-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.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.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.model.stext.validation.ITypeInferrer;
-import org.yakindu.sct.model.stext.validation.TypeCheckException;
-import org.yakindu.sct.model.stext.validation.TypeInferrerCache;
-import org.yakindu.sct.model.stext.validation.TypeInferrerCache.ICacheableTypeAnalyzer;
-
-/**
- * The TypeInferrer checks an expression AST for type conformance
- * 
- * @author andreas muelder - Initial contribution and API
- */
-@SuppressWarnings("all")
-public class TypeInferrer implements ITypeInferrer, ICacheableTypeAnalyzer {
-  @Inject
-  private ITypeSystemAccess ts;
-  
-  @Inject
-  private TypeInferrerCache cache;
-  
-  public Type getType(final Statement stmt) {
-    Type _xblockexpression = null;
-    {
-      boolean _equals = Objects.equal(stmt, null);
-      if (_equals) {
-        return null;
-      }
-      Type _get = this.cache.get(stmt, this);
-      _xblockexpression = (_get);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Type _inferType(final Statement statement) {
-    return null;
-  }
-  
-  public Type check(final Statement stmt) {
-    Type _type = this.getType(stmt);
-    return _type;
-  }
-  
-  /**
-   * Check Variable assignments
-   */
-  protected Type _inferType(final AssignmentExpression assignment) {
-    Expression _expression = assignment.getExpression();
-    Type valueType = this.getType(_expression);
-    Expression _varRef = assignment.getVarRef();
-    Type type = this.getType(_varRef);
-    boolean _isAssignable = this.ts.isAssignable(type, valueType);
-    boolean _not = (!_isAssignable);
-    if (_not) {
-      String _name = valueType==null?(String)null:valueType.getName();
-      String _plus = ("Can not assign a value of type " + _name);
-      String _plus_1 = (_plus + " to a variable of type ");
-      String _name_1 = type==null?(String)null:type.getName();
-      String _plus_2 = (_plus_1 + _name_1);
-      this.error(_plus_2);
-      return null;
-    }
-    return type;
-  }
-  
-  /**
-   * Check Event value assignments
-   */
-  protected Type _inferType(final EventRaisingExpression eventRaising) {
-    Expression _value = eventRaising.getValue();
-    Type valueType = this.getType(_value);
-    Expression _event = eventRaising.getEvent();
-    Type type = this.getType(_event);
-    boolean _isAssignable = this.ts.isAssignable(type, valueType);
-    boolean _not = (!_isAssignable);
-    if (_not) {
-      String _name = valueType==null?(String)null:valueType.getName();
-      String _plus = ("Can not assign a value of type " + _name);
-      String _plus_1 = (_plus + " to a variable of type ");
-      String _name_1 = type==null?(String)null:type.getName();
-      String _plus_2 = (_plus_1 + _name_1);
-      this.error(_plus_2);
-      return null;
-    }
-    return type;
-  }
-  
-  protected Type _inferType(final LogicalAndExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Type _type = this.getType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    Type _type_1 = this.getType(_rightOperand);
-    return this.assertBooleanTypes(_type, _type_1, "&&");
-  }
-  
-  protected Type _inferType(final LogicalOrExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Type _type = this.getType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    Type _type_1 = this.getType(_rightOperand);
-    return this.assertBooleanTypes(_type, _type_1, "||");
-  }
-  
-  public Type assertBooleanTypes(final Type left, final Type right, final String literal) {
-    boolean _and = false;
-    Type _assertIsBoolean = this.assertIsBoolean(left, literal);
-    boolean _notEquals = (!Objects.equal(_assertIsBoolean, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      Type _assertIsBoolean_1 = this.assertIsBoolean(right, literal);
-      boolean _notEquals_1 = (!Objects.equal(_assertIsBoolean_1, null));
-      _and = (_notEquals && _notEquals_1);
-    }
-    if (_and) {
-      return this.ts.combine(left, right);
-    }
-    return null;
-  }
-  
-  protected Type _inferType(final LogicalNotExpression expression) {
-    Expression _operand = expression.getOperand();
-    final Type type = this.getType(_operand);
-    return this.assertIsBoolean(type, "!");
-  }
-  
-  protected Type _inferType(final BitwiseAndExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Type _type = this.getType(_leftOperand);
-    this.assertIsInteger(_type, "&");
-    Expression _rightOperand = expression.getRightOperand();
-    Type _type_1 = this.getType(_rightOperand);
-    this.assertIsInteger(_type_1, "&");
-    return this.ts.getInteger();
-  }
-  
-  protected Type _inferType(final BitwiseOrExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Type _type = this.getType(_leftOperand);
-    this.assertIsInteger(_type, "|");
-    Expression _rightOperand = expression.getRightOperand();
-    Type _type_1 = this.getType(_rightOperand);
-    this.assertIsInteger(_type_1, "|");
-    return this.ts.getInteger();
-  }
-  
-  protected Type _inferType(final BitwiseXorExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Type _type = this.getType(_leftOperand);
-    this.assertIsInteger(_type, "^");
-    Expression _rightOperand = expression.getRightOperand();
-    Type _type_1 = this.getType(_rightOperand);
-    this.assertIsInteger(_type_1, "^");
-    return this.ts.getInteger();
-  }
-  
-  protected Type _inferType(final LogicalRelationExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    final Type leftType = this.getType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    final Type rightType = this.getType(_rightOperand);
-    boolean _and = false;
-    boolean _isBoolean = this.ts.isBoolean(leftType);
-    if (!_isBoolean) {
-      _and = false;
-    } else {
-      boolean _isBoolean_1 = this.ts.isBoolean(rightType);
-      _and = (_isBoolean && _isBoolean_1);
-    }
-    if (_and) {
-      boolean _and_1 = false;
-      RelationalOperator _operator = expression.getOperator();
-      boolean _notEquals = (!Objects.equal(_operator, RelationalOperator.EQUALS));
-      if (!_notEquals) {
-        _and_1 = false;
-      } else {
-        RelationalOperator _operator_1 = expression.getOperator();
-        boolean _notEquals_1 = (!Objects.equal(_operator_1, RelationalOperator.NOT_EQUALS));
-        _and_1 = (_notEquals && _notEquals_1);
-      }
-      if (_and_1) {
-        RelationalOperator _operator_2 = expression.getOperator();
-        String _literal = _operator_2==null?(String)null:_operator_2.getLiteral();
-        String _plus = ("operator \'" + _literal);
-        String _plus_1 = (_plus + "\' can not be applied to boolean values!");
-        this.error(_plus_1);
-        return null;
-      }
-    } else {
-      final Type combined = this.ts.combine(leftType, rightType);
-      boolean _equals = Objects.equal(combined, null);
-      if (_equals) {
-        String _name = leftType==null?(String)null:leftType.getName();
-        String _plus_2 = ("Incompatible operands " + _name);
-        String _plus_3 = (_plus_2 + " and ");
-        String _name_1 = rightType==null?(String)null:rightType.getName();
-        String _plus_4 = (_plus_3 + _name_1);
-        String _plus_5 = (_plus_4 + " for operator \'");
-        RelationalOperator _operator_3 = expression.getOperator();
-        String _literal_1 = _operator_3.getLiteral();
-        String _plus_6 = (_plus_5 + _literal_1);
-        String _plus_7 = (_plus_6 + "\'");
-        this.error(_plus_7);
-      }
-    }
-    return this.ts.getBoolean();
-  }
-  
-  public Type assertNumericalTypes(final Type left, final Type right, final String operator) {
-    boolean _and = false;
-    Type _assertIsNumber = this.assertIsNumber(left, operator);
-    boolean _notEquals = (!Objects.equal(_assertIsNumber, null));
-    if (!_notEquals) {
-      _and = false;
-    } else {
-      Type _assertIsNumber_1 = this.assertIsNumber(right, operator);
-      boolean _notEquals_1 = (!Objects.equal(_assertIsNumber_1, null));
-      _and = (_notEquals && _notEquals_1);
-    }
-    if (_and) {
-      return this.ts.combine(left, right);
-    }
-    return null;
-  }
-  
-  protected Type _inferType(final NumericalAddSubtractExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Type _type = this.getType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    Type _type_1 = this.getType(_rightOperand);
-    AdditiveOperator _operator = expression.getOperator();
-    String _literal = _operator.getLiteral();
-    return this.assertNumericalTypes(_type, _type_1, _literal);
-  }
-  
-  protected Type _inferType(final NumericalMultiplyDivideExpression expression) {
-    Expression _leftOperand = expression.getLeftOperand();
-    Type _type = this.getType(_leftOperand);
-    Expression _rightOperand = expression.getRightOperand();
-    Type _type_1 = this.getType(_rightOperand);
-    MultiplicativeOperator _operator = expression.getOperator();
-    String _literal = _operator.getLiteral();
-    return this.assertNumericalTypes(_type, _type_1, _literal);
-  }
-  
-  protected Type _inferType(final NumericalUnaryExpression expression) {
-    Expression _operand = expression.getOperand();
-    final Type type = this.getType(_operand);
-    UnaryOperator _operator = expression.getOperator();
-    boolean _equals = Objects.equal(_operator, UnaryOperator.COMPLEMENT);
-    if (_equals) {
-      UnaryOperator _operator_1 = expression.getOperator();
-      String _literal = _operator_1.getLiteral();
-      return this.assertIsInteger(type, _literal);
-    }
-    UnaryOperator _operator_2 = expression.getOperator();
-    String _literal_1 = _operator_2.getLiteral();
-    return this.assertIsNumber(type, _literal_1);
-  }
-  
-  protected Type _inferType(final PrimitiveValueExpression expression) {
-    Literal _value = expression.getValue();
-    final Type t = this.getLiteralType(_value);
-    return t;
-  }
-  
-  protected Type _inferType(final ActiveStateReferenceExpression expression) {
-    return this.ts.getBoolean();
-  }
-  
-  protected Type _inferType(final ShiftExpression expression) {
-    Type _xblockexpression = null;
-    {
-      Expression _leftOperand = expression.getLeftOperand();
-      Type _type = this.getType(_leftOperand);
-      ShiftOperator _operator = expression.getOperator();
-      String _literal = _operator.getLiteral();
-      this.assertIsInteger(_type, _literal);
-      Expression _rightOperand = expression.getRightOperand();
-      Type _type_1 = this.getType(_rightOperand);
-      ShiftOperator _operator_1 = expression.getOperator();
-      String _literal_1 = _operator_1.getLiteral();
-      Type _assertIsInteger = this.assertIsInteger(_type_1, _literal_1);
-      _xblockexpression = (_assertIsInteger);
-    }
-    return _xblockexpression;
-  }
-  
-  protected Type _inferType(final ConditionalExpression expression) {
-    Expression _condition = expression.getCondition();
-    final Type condType = this.getType(_condition);
-    boolean _isBoolean = this.ts.isBoolean(condType);
-    boolean _not = (!_isBoolean);
-    if (_not) {
-      this.error("Condition type have to be boolean");
-      return null;
-    }
-    Expression _trueCase = expression.getTrueCase();
-    final Type trueType = this.getType(_trueCase);
-    Expression _falseCase = expression.getFalseCase();
-    final Type falseType = this.getType(_falseCase);
-    return this.ts.combine(trueType, falseType);
-  }
-  
-  protected Type _inferType(final FeatureCall featureCall) {
-    EObject _feature = featureCall.getFeature();
-    if ((_feature instanceof Feature)) {
-      EObject _feature_1 = featureCall.getFeature();
-      return ((Feature) _feature_1)==null?(Type)null:((Feature) _feature_1).getType();
-    } else {
-      EObject _feature_2 = featureCall.getFeature();
-      boolean _notEquals = (!Objects.equal(_feature_2, null));
-      if (_notEquals) {
-        String _plus = ("Type of FeatureCall is unknown: " + featureCall);
-        this.error(_plus);
-        return null;
-      } else {
-        return null;
-      }
-    }
-  }
-  
-  protected Type _inferType(final ElementReferenceExpression expression) {
-    EObject _reference = expression.getReference();
-    return this.inferType(_reference, expression);
-  }
-  
-  protected Type _inferType(final EObject object, final ElementReferenceExpression expression) {
-    return null;
-  }
-  
-  protected Type _inferType(final VariableDefinition definition, final ElementReferenceExpression expression) {
-    return definition.getType();
-  }
-  
-  protected Type _inferType(final EventDefinition definition, final ElementReferenceExpression expression) {
-    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));
-    }
-    if (_or) {
-      return definition.getType();
-    }
-    return this.ts.getBoolean();
-  }
-  
-  protected Type _inferType(final OperationDefinition definition, final ElementReferenceExpression expression) {
-    return definition.getType();
-  }
-  
-  protected Type _inferType(final EventValueReferenceExpression expression) {
-    Expression _value = expression.getValue();
-    return this.getType(_value);
-  }
-  
-  protected Type _getLiteralType(final HexLiteral literal) {
-    return this.ts.getInteger();
-  }
-  
-  protected Type _getLiteralType(final IntLiteral literal) {
-    return this.ts.getInteger();
-  }
-  
-  protected Type _getLiteralType(final BoolLiteral bool) {
-    return this.ts.getBoolean();
-  }
-  
-  protected Type _getLiteralType(final RealLiteral literal) {
-    return this.ts.getReal();
-  }
-  
-  protected Type _getLiteralType(final StringLiteral literal) {
-    return this.ts.getString();
-  }
-  
-  public Type assertIsInteger(final Type object, final String operator) {
-    boolean _isInteger = this.ts.isInteger(object);
-    boolean _not = (!_isInteger);
-    if (_not) {
-      String _plus = ("operator \'" + operator);
-      String _plus_1 = (_plus + "\' can only be applied to integers!");
-      this.error(_plus_1);
-      return null;
-    }
-    return object;
-  }
-  
-  public Type assertIsNumber(final Type object, final String operator) {
-    boolean _and = false;
-    boolean _isReal = this.ts.isReal(object);
-    boolean _not = (!_isReal);
-    if (!_not) {
-      _and = false;
-    } else {
-      boolean _isInteger = this.ts.isInteger(object);
-      boolean _not_1 = (!_isInteger);
-      _and = (_not && _not_1);
-    }
-    if (_and) {
-      String _plus = ("operator \'" + operator);
-      String _plus_1 = (_plus + "\' can only be applied to numbers!");
-      this.error(_plus_1);
-      return null;
-    }
-    return object;
-  }
-  
-  public Type assertIsBoolean(final Type object, final String operator) {
-    boolean _isBoolean = this.ts.isBoolean(object);
-    boolean _not = (!_isBoolean);
-    if (_not) {
-      String _plus = ("operator \'" + operator);
-      String _plus_1 = (_plus + "\' can only be applied to boolean values!");
-      this.error(_plus_1);
-    }
-    return object;
-  }
-  
-  public void error(final String msg) {
-    TypeCheckException _typeCheckException = new TypeCheckException(msg);
-    throw _typeCheckException;
-  }
-  
-  protected Type _inferType(final Expression expr) {
-    return null;
-  }
-  
-  public Type inferType(final Statement expression) {
-    if (expression instanceof ActiveStateReferenceExpression) {
-      return _inferType((ActiveStateReferenceExpression)expression);
-    } else if (expression instanceof AssignmentExpression) {
-      return _inferType((AssignmentExpression)expression);
-    } else if (expression instanceof BitwiseAndExpression) {
-      return _inferType((BitwiseAndExpression)expression);
-    } else if (expression instanceof BitwiseOrExpression) {
-      return _inferType((BitwiseOrExpression)expression);
-    } else if (expression instanceof BitwiseXorExpression) {
-      return _inferType((BitwiseXorExpression)expression);
-    } else if (expression instanceof ConditionalExpression) {
-      return _inferType((ConditionalExpression)expression);
-    } else if (expression instanceof ElementReferenceExpression) {
-      return _inferType((ElementReferenceExpression)expression);
-    } else if (expression instanceof EventRaisingExpression) {
-      return _inferType((EventRaisingExpression)expression);
-    } else if (expression instanceof EventValueReferenceExpression) {
-      return _inferType((EventValueReferenceExpression)expression);
-    } else if (expression instanceof FeatureCall) {
-      return _inferType((FeatureCall)expression);
-    } else if (expression instanceof LogicalAndExpression) {
-      return _inferType((LogicalAndExpression)expression);
-    } else if (expression instanceof LogicalNotExpression) {
-      return _inferType((LogicalNotExpression)expression);
-    } else if (expression instanceof LogicalOrExpression) {
-      return _inferType((LogicalOrExpression)expression);
-    } else if (expression instanceof LogicalRelationExpression) {
-      return _inferType((LogicalRelationExpression)expression);
-    } else if (expression instanceof NumericalAddSubtractExpression) {
-      return _inferType((NumericalAddSubtractExpression)expression);
-    } else if (expression instanceof NumericalMultiplyDivideExpression) {
-      return _inferType((NumericalMultiplyDivideExpression)expression);
-    } else if (expression instanceof NumericalUnaryExpression) {
-      return _inferType((NumericalUnaryExpression)expression);
-    } else if (expression instanceof PrimitiveValueExpression) {
-      return _inferType((PrimitiveValueExpression)expression);
-    } else if (expression instanceof ShiftExpression) {
-      return _inferType((ShiftExpression)expression);
-    } else if (expression instanceof Expression) {
-      return _inferType((Expression)expression);
-    } else if (expression != null) {
-      return _inferType(expression);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(expression).toString());
-    }
-  }
-  
-  public Type inferType(final EObject definition, final ElementReferenceExpression expression) {
-    if (definition instanceof EventDefinition) {
-      return _inferType((EventDefinition)definition, expression);
-    } else if (definition instanceof OperationDefinition) {
-      return _inferType((OperationDefinition)definition, expression);
-    } else if (definition instanceof VariableDefinition) {
-      return _inferType((VariableDefinition)definition, expression);
-    } else if (definition != null) {
-      return _inferType(definition, expression);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(definition, expression).toString());
-    }
-  }
-  
-  public Type getLiteralType(final Literal bool) {
-    if (bool instanceof BoolLiteral) {
-      return _getLiteralType((BoolLiteral)bool);
-    } else if (bool instanceof HexLiteral) {
-      return _getLiteralType((HexLiteral)bool);
-    } else if (bool instanceof IntLiteral) {
-      return _getLiteralType((IntLiteral)bool);
-    } else if (bool instanceof RealLiteral) {
-      return _getLiteralType((RealLiteral)bool);
-    } else if (bool instanceof StringLiteral) {
-      return _getLiteralType((StringLiteral)bool);
-    } else {
-      throw new IllegalArgumentException("Unhandled parameter types: " +
-        Arrays.<Object>asList(bool).toString());
-    }
-  }
-}