ソースを参照

Changed sexec interpreter to support feature calls

Andreas Mülder 14 年 前
コミット
ba963da318

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

@@ -0,0 +1,597 @@
+package org.yakindu.sct.model.sexec.interpreter.impl;
+
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import java.util.List;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.xtext.naming.QualifiedName;
+import org.eclipse.xtext.xbase.lib.BooleanExtensions;
+import org.eclipse.xtext.xbase.lib.ComparableExtensions;
+import org.eclipse.xtext.xbase.lib.Conversions;
+import org.eclipse.xtext.xbase.lib.InputOutput;
+import org.eclipse.xtext.xbase.lib.IntegerExtensions;
+import org.eclipse.xtext.xbase.lib.ObjectExtensions;
+import org.eclipse.xtext.xbase.lib.StringExtensions;
+import org.yakindu.base.types.Type;
+import org.yakindu.sct.model.sexec.Call;
+import org.yakindu.sct.model.sexec.Check;
+import org.yakindu.sct.model.sexec.EnterState;
+import org.yakindu.sct.model.sexec.Execution;
+import org.yakindu.sct.model.sexec.ExecutionFlow;
+import org.yakindu.sct.model.sexec.ExecutionRegion;
+import org.yakindu.sct.model.sexec.ExecutionState;
+import org.yakindu.sct.model.sexec.ExitState;
+import org.yakindu.sct.model.sexec.HistoryEntry;
+import org.yakindu.sct.model.sexec.If;
+import org.yakindu.sct.model.sexec.SaveHistory;
+import org.yakindu.sct.model.sexec.ScheduleTimeEvent;
+import org.yakindu.sct.model.sexec.Sequence;
+import org.yakindu.sct.model.sexec.SexecFactory;
+import org.yakindu.sct.model.sexec.StateCase;
+import org.yakindu.sct.model.sexec.StateSwitch;
+import org.yakindu.sct.model.sexec.StateVector;
+import org.yakindu.sct.model.sexec.Step;
+import org.yakindu.sct.model.sexec.TimeEvent;
+import org.yakindu.sct.model.sexec.Trace;
+import org.yakindu.sct.model.sexec.TraceBeginRunCycle;
+import org.yakindu.sct.model.sexec.TraceEndRunCycle;
+import org.yakindu.sct.model.sexec.UnscheduleTimeEvent;
+import org.yakindu.sct.model.sexec.interpreter.IExecutionFlowInterpreter;
+import org.yakindu.sct.model.sexec.interpreter.IStatementInterpreter;
+import org.yakindu.sct.model.sexec.interpreter.ITimingService;
+import org.yakindu.sct.model.sexec.interpreter.impl.BufferingExecutionContext;
+import org.yakindu.sct.model.sgraph.Declaration;
+import org.yakindu.sct.model.sgraph.Scope;
+import org.yakindu.sct.model.sgraph.Statement;
+import org.yakindu.sct.model.stext.naming.StextNameProvider;
+import org.yakindu.sct.model.stext.stext.EventDefinition;
+import org.yakindu.sct.model.stext.stext.InterfaceScope;
+import org.yakindu.sct.model.stext.stext.InternalScope;
+import org.yakindu.sct.model.stext.stext.VariableDefinition;
+import org.yakindu.sct.simulation.core.runtime.AbstractExecutionFacade;
+import org.yakindu.sct.simulation.core.runtime.ExecutionException;
+import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
+import org.yakindu.sct.simulation.core.runtime.IExecutionContextListener;
+import org.yakindu.sct.simulation.core.runtime.impl.ExecutionEvent;
+import org.yakindu.sct.simulation.core.runtime.impl.ExecutionVariable;
+import org.yakindu.sct.simulation.core.runtime.timer.VirtualClock;
+
+@SuppressWarnings("all")
+public class ExecutionFlowInterpreter extends AbstractExecutionFacade implements IExecutionFlowInterpreter, IExecutionContextListener {
+  
+  @Inject
+  private IStatementInterpreter interpreter;
+  
+  @Inject
+  private IExecutionContext executionContext;
+  
+  private BufferingExecutionContext externalExecutionContext;
+  
+  @Inject
+  private StextNameProvider provider;
+  
+  @Inject
+  private ITimingService timingService;
+  
+  @Inject
+  @Named("InterpreterName")
+  private String interpreterName;
+  
+  private ExecutionFlow flow;
+  
+  private int nextSVIdx;
+  
+  private TraceBeginRunCycle brc;
+  
+  private TraceEndRunCycle erc;
+  
+  public void initialize(final ExecutionFlow flow) throws NumberFormatException {
+    {
+      this.flow = flow;
+      EList<Scope> _scopes = flow.getScopes();
+      for (final Scope scope : _scopes) {
+        this.declareContents(scope);
+      }
+      StateVector _stateVector = flow.getStateVector();
+      int _size = _stateVector.getSize();
+      this.executionContext.initStateConfigurationVector(_size);
+      this.executionContext.addExecutionContextListener(this);
+      VirtualClock _virtualClock = this.executionContext.getVirtualClock();
+      this.timingService.init(_virtualClock);
+      VirtualClock _virtualClock_1 = this.executionContext.getVirtualClock();
+      _virtualClock_1.start();
+      TraceBeginRunCycle _createTraceBeginRunCycle = SexecFactory.eINSTANCE.createTraceBeginRunCycle();
+      this.brc = _createTraceBeginRunCycle;
+      TraceEndRunCycle _createTraceEndRunCycle = SexecFactory.eINSTANCE.createTraceEndRunCycle();
+      this.erc = _createTraceEndRunCycle;
+      BufferingExecutionContext _bufferingExecutionContext = new BufferingExecutionContext(this.executionContext);
+      this.externalExecutionContext = _bufferingExecutionContext;
+    }
+  }
+  
+  public void tearDown() {
+    this.timingService.stop();
+  }
+  
+  public String getName() {
+    return this.interpreterName;
+  }
+  
+  public IExecutionContext getExecutionContext() {
+    return this.externalExecutionContext;
+  }
+  
+  protected void _declareContents(final InternalScope scope) throws NumberFormatException {
+    EList<Declaration> _declarations = scope.getDeclarations();
+    for (final Declaration declaration : _declarations) {
+      this.addToScope(declaration);
+    }
+  }
+  
+  protected void _declareContents(final Scope scope) throws NumberFormatException {
+    EList<Declaration> _declarations = scope.getDeclarations();
+    for (final Declaration declaration : _declarations) {
+      this.addToScope(declaration);
+    }
+  }
+  
+  protected void _declareContents(final InterfaceScope scope) throws NumberFormatException {
+    EList<Declaration> _declarations = scope.getDeclarations();
+    for (final Declaration declaration : _declarations) {
+      this.addToScope(declaration);
+    }
+  }
+  
+  public void runCycle() throws ExecutionException {
+    {
+      this.externalExecutionContext.flush();
+      this.nextSVIdx = 0;
+      this.execute(this.brc);
+      ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
+      int _size = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).size();
+      boolean _operator_lessThan = ComparableExtensions.<Integer>operator_lessThan(((Integer)this.nextSVIdx), ((Integer)_size));
+      Boolean _xwhileexpression = _operator_lessThan;
+      while (_xwhileexpression) {
+        {
+          ExecutionState[] _stateConfiguration_1 = this.executionContext.getStateConfiguration();
+          ExecutionState _get = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration_1)).get(this.nextSVIdx);
+          ExecutionState state = _get;
+          boolean _operator_notEquals = ObjectExtensions.operator_notEquals(state, null);
+          if (_operator_notEquals) {
+            Sequence _reactSequence = state.getReactSequence();
+            this.execute(_reactSequence);
+          }
+          int _operator_plus = IntegerExtensions.operator_plus(((Integer)this.nextSVIdx), ((Integer)1));
+          this.nextSVIdx = _operator_plus;
+        }
+        ExecutionState[] _stateConfiguration_2 = this.executionContext.getStateConfiguration();
+        int _size_1 = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration_2)).size();
+        boolean _operator_lessThan_1 = ComparableExtensions.<Integer>operator_lessThan(((Integer)this.nextSVIdx), ((Integer)_size_1));
+        _xwhileexpression = _operator_lessThan_1;
+      }
+      this.executionContext.resetRaisedEvents();
+      this.execute(this.erc);
+    }
+  }
+  
+  public boolean isBoolean(final Type type) {
+    boolean _operator_and = false;
+    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(type, null);
+    if (!_operator_notEquals) {
+      _operator_and = false;
+    } else {
+      String _name = type.getName();
+      boolean _operator_equals = ObjectExtensions.operator_equals(_name, "boolean");
+      _operator_and = BooleanExtensions.operator_and(_operator_notEquals, _operator_equals);
+    }
+    return _operator_and;
+  }
+  
+  public boolean isInteger(final Type type) {
+    boolean _operator_and = false;
+    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(type, null);
+    if (!_operator_notEquals) {
+      _operator_and = false;
+    } else {
+      String _name = type.getName();
+      boolean _operator_equals = ObjectExtensions.operator_equals(_name, "integer");
+      _operator_and = BooleanExtensions.operator_and(_operator_notEquals, _operator_equals);
+    }
+    return _operator_and;
+  }
+  
+  public boolean isReal(final Type type) {
+    boolean _operator_and = false;
+    boolean _operator_notEquals = ObjectExtensions.operator_notEquals(type, null);
+    if (!_operator_notEquals) {
+      _operator_and = false;
+    } else {
+      String _name = type.getName();
+      boolean _operator_equals = ObjectExtensions.operator_equals(_name, "real");
+      _operator_and = BooleanExtensions.operator_and(_operator_notEquals, _operator_equals);
+    }
+    return _operator_and;
+  }
+  
+  public boolean isVoid(final Type type) {
+    boolean _operator_or = false;
+    boolean _operator_equals = ObjectExtensions.operator_equals(type, null);
+    if (_operator_equals) {
+      _operator_or = true;
+    } else {
+      String _name = type.getName();
+      boolean _operator_equals_1 = ObjectExtensions.operator_equals(_name, "void");
+      _operator_or = BooleanExtensions.operator_or(_operator_equals, _operator_equals_1);
+    }
+    return _operator_or;
+  }
+  
+  protected Object _addToScope(final VariableDefinition variable) throws NumberFormatException {
+    Object _xblockexpression = null;
+    {
+      QualifiedName _qualifiedName = this.provider.qualifiedName(variable);
+      String _string = _qualifiedName.toString();
+      String fqName = _string;
+      Type _type = variable.getType();
+      boolean _isBoolean = this.isBoolean(_type);
+      if (_isBoolean) {
+        ExecutionVariable _executionVariable = new ExecutionVariable(fqName, java.lang.Boolean.class, ((Boolean)false));
+        this.executionContext.declareVariable(_executionVariable);
+      } else {
+        Type _type_1 = variable.getType();
+        boolean _isInteger = this.isInteger(_type_1);
+        if (_isInteger) {
+          ExecutionVariable _executionVariable_1 = new ExecutionVariable(fqName, java.lang.Integer.class, ((Integer)0));
+          this.executionContext.declareVariable(_executionVariable_1);
+        } else {
+          Type _type_2 = variable.getType();
+          boolean _isReal = this.isReal(_type_2);
+          if (_isReal) {
+            float _parseFloat = Float.parseFloat("0.0");
+            ExecutionVariable _executionVariable_2 = new ExecutionVariable(fqName, java.lang.Float.class, ((Float)_parseFloat));
+            this.executionContext.declareVariable(_executionVariable_2);
+          }
+        }
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _addToScope(final EventDefinition event) {
+    Object _xblockexpression = null;
+    {
+      QualifiedName _qualifiedName = this.provider.qualifiedName(event);
+      String _string = _qualifiedName.toString();
+      String fqName = _string;
+      Type _type = event.getType();
+      boolean _isBoolean = this.isBoolean(_type);
+      if (_isBoolean) {
+        ExecutionEvent _executionEvent = new ExecutionEvent(fqName, java.lang.Boolean.class, null);
+        this.executionContext.declareEvent(_executionEvent);
+      } else {
+        Type _type_1 = event.getType();
+        boolean _isInteger = this.isInteger(_type_1);
+        if (_isInteger) {
+          ExecutionEvent _executionEvent_1 = new ExecutionEvent(fqName, java.lang.Integer.class, null);
+          this.executionContext.declareEvent(_executionEvent_1);
+        } else {
+          Type _type_2 = event.getType();
+          boolean _isReal = this.isReal(_type_2);
+          if (_isReal) {
+            ExecutionEvent _executionEvent_2 = new ExecutionEvent(fqName, java.lang.Float.class, null);
+            this.executionContext.declareEvent(_executionEvent_2);
+          } else {
+            Type _type_3 = event.getType();
+            boolean _isVoid = this.isVoid(_type_3);
+            if (_isVoid) {
+              ExecutionEvent _executionEvent_3 = new ExecutionEvent(fqName, java.lang.Void.class);
+              this.executionContext.declareEvent(_executionEvent_3);
+            }
+          }
+        }
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _addToScope(final TimeEvent event) {
+    Object _xblockexpression = null;
+    {
+      String _name = event.getName();
+      ExecutionEvent _executionEvent = new ExecutionEvent(_name, java.lang.Long.class);
+      this.executionContext.declareEvent(_executionEvent);
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  public void enter() throws ExecutionException {
+    Sequence _enterSequence = this.flow.getEnterSequence();
+    EList<Step> _steps = _enterSequence.getSteps();
+    for (final Step step : _steps) {
+      this.execute(step);
+    }
+  }
+  
+  protected Object _execute(final Step step) {
+    String _operator_plus = StringExtensions.operator_plus("Missing dispatch function for ", step);
+    String _println = InputOutput.<String>println(_operator_plus);
+    return _println;
+  }
+  
+  protected Object _execute(final Call call) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      Step _step = call.getStep();
+      this.execute(_step);
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final Trace trace) {
+    Object _xblockexpression = null;
+    {
+      this.notifyTraceStepEntered(trace);
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final Check check) throws ExecutionException {
+    {
+      Statement _condition = check.getCondition();
+      boolean _operator_equals = ObjectExtensions.operator_equals(_condition, null);
+      if (_operator_equals) {
+        return ((Boolean)true);
+      }
+      Statement _condition_1 = check.getCondition();
+      Object _evaluateStatement = this.interpreter.evaluateStatement(_condition_1, this.executionContext);
+      Object interpreterResult = _evaluateStatement;
+      return interpreterResult;
+    }
+  }
+  
+  protected Object _execute(final EnterState enterState) {
+    Object _xblockexpression = null;
+    {
+      ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
+      ExecutionState _state = enterState.getState();
+      StateVector _stateVector = _state.getStateVector();
+      int _offset = _stateVector.getOffset();
+      ExecutionState _state_1 = enterState.getState();
+      ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).set(_offset, _state_1);
+      ExecutionState _state_2 = enterState.getState();
+      StateVector _stateVector_1 = _state_2.getStateVector();
+      int _offset_1 = _stateVector_1.getOffset();
+      this.nextSVIdx = _offset_1;
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final HistoryEntry entry) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      ExecutionRegion _region = entry.getRegion();
+      ExecutionState _historyStateConfiguration = this.executionContext.getHistoryStateConfiguration(_region);
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_historyStateConfiguration, null);
+      if (_operator_notEquals) {
+        Step _historyStep = entry.getHistoryStep();
+        this.execute(_historyStep);
+      } else {
+        Step _initialStep = entry.getInitialStep();
+        boolean _operator_equals = ObjectExtensions.operator_equals(_initialStep, null);
+        if (_operator_equals) {
+          String _operator_plus = StringExtensions.operator_plus("Missing initial transition ", entry);
+          InputOutput.<String>println(_operator_plus);
+        } else {
+          Step _initialStep_1 = entry.getInitialStep();
+          this.execute(_initialStep_1);
+        }
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final Execution execution) throws ExecutionException {
+    Statement _statement = execution.getStatement();
+    Object _evaluateStatement = this.interpreter.evaluateStatement(_statement, this.executionContext);
+    return _evaluateStatement;
+  }
+  
+  protected Object _execute(final ExitState exitState) {
+    Object _xblockexpression = null;
+    {
+      ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
+      ExecutionState _state = exitState.getState();
+      StateVector _stateVector = _state.getStateVector();
+      int _offset = _stateVector.getOffset();
+      ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).set(_offset, null);
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final If ifStep) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      Check _check = ifStep.getCheck();
+      Object _execute = this.execute(_check);
+      Object check = _execute;
+      if (((Boolean) check)) {
+        Step _thenStep = ifStep.getThenStep();
+        this.execute(_thenStep);
+      } else {
+        Step _elseStep = ifStep.getElseStep();
+        boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_elseStep, null);
+        if (_operator_notEquals) {
+          Step _elseStep_1 = ifStep.getElseStep();
+          this.execute(_elseStep_1);
+        }
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final Sequence sequence) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      EList<Step> _steps = sequence.getSteps();
+      for (final Step step : _steps) {
+        this.execute(step);
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final SaveHistory action) {
+    Object _xblockexpression = null;
+    {
+      ExecutionRegion _region = action.getRegion();
+      this.executionContext.saveHistoryStateConfiguration(_region);
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final StateSwitch stateSwitch) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      ExecutionRegion _historyRegion = stateSwitch.getHistoryRegion();
+      final ExecutionRegion historyRegion = _historyRegion;
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(historyRegion, null);
+      if (_operator_notEquals) {
+        {
+          ExecutionState _historyStateConfiguration = this.executionContext.getHistoryStateConfiguration(historyRegion);
+          final ExecutionState historyState = _historyStateConfiguration;
+          EList<StateCase> _cases = stateSwitch.getCases();
+          for (final StateCase stateCase : _cases) {
+            ExecutionState _state = stateCase.getState();
+            boolean _operator_equals = ObjectExtensions.operator_equals(historyState, _state);
+            if (_operator_equals) {
+              Step _step = stateCase.getStep();
+              this.execute(_step);
+            }
+          }
+        }
+      } else {
+        EList<StateCase> _cases_1 = stateSwitch.getCases();
+        for (final StateCase stateCase_1 : _cases_1) {
+          ExecutionState[] _stateConfiguration = this.executionContext.getStateConfiguration();
+          ExecutionState _state_1 = stateCase_1.getState();
+          boolean _contains = ((List<ExecutionState>)Conversions.doWrapArray(_stateConfiguration)).contains(_state_1);
+          if (_contains) {
+            Step _step_1 = stateCase_1.getStep();
+            this.execute(_step_1);
+          }
+        }
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final ScheduleTimeEvent scheduleTimeEvent) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      TimeEvent _timeEvent = scheduleTimeEvent.getTimeEvent();
+      TimeEvent timeEvent = _timeEvent;
+      Statement _timeValue = scheduleTimeEvent.getTimeValue();
+      Object _evaluateStatement = this.interpreter.evaluateStatement(_timeValue, this.executionContext);
+      Object duration = _evaluateStatement;
+      String _name = timeEvent.getName();
+      boolean _isPeriodic = timeEvent.isPeriodic();
+      this.timingService.scheduleTimeEvent(this.executionContext, _name, _isPeriodic, ((Integer) duration));
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final UnscheduleTimeEvent timeEvent) {
+    Object _xblockexpression = null;
+    {
+      TimeEvent _timeEvent = timeEvent.getTimeEvent();
+      String _name = _timeEvent.getName();
+      this.timingService.unscheduleTimeEvent(_name);
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  public void eventRaised(final ExecutionEvent event) {
+  }
+  
+  public void variableValueChanged(final ExecutionVariable variable) {
+  }
+  
+  public void timeScaleFactorChanged(final double oldFactor, final double newFactor) {
+    this.timingService.setTimeScaleFactor(newFactor);
+  }
+  
+  public void declareContents(final Scope scope) throws NumberFormatException {
+    if ((scope instanceof InterfaceScope)) {
+      _declareContents((InterfaceScope)scope);
+    } else if ((scope instanceof InternalScope)) {
+      _declareContents((InternalScope)scope);
+    } else if ((scope instanceof Scope)) {
+      _declareContents((Scope)scope);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(scope).toString());
+    }
+  }
+  
+  public Object addToScope(final Declaration event) throws NumberFormatException {
+    if ((event instanceof TimeEvent)) {
+      return _addToScope((TimeEvent)event);
+    } else if ((event instanceof EventDefinition)) {
+      return _addToScope((EventDefinition)event);
+    } else if ((event instanceof VariableDefinition)) {
+      return _addToScope((VariableDefinition)event);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(event).toString());
+    }
+  }
+  
+  public Object execute(final Step call) throws ExecutionException {
+    if ((call instanceof Call)) {
+      return _execute((Call)call);
+    } else if ((call instanceof Check)) {
+      return _execute((Check)call);
+    } else if ((call instanceof EnterState)) {
+      return _execute((EnterState)call);
+    } else if ((call instanceof Execution)) {
+      return _execute((Execution)call);
+    } else if ((call instanceof ExitState)) {
+      return _execute((ExitState)call);
+    } else if ((call instanceof HistoryEntry)) {
+      return _execute((HistoryEntry)call);
+    } else if ((call instanceof If)) {
+      return _execute((If)call);
+    } else if ((call instanceof SaveHistory)) {
+      return _execute((SaveHistory)call);
+    } else if ((call instanceof ScheduleTimeEvent)) {
+      return _execute((ScheduleTimeEvent)call);
+    } else if ((call instanceof Sequence)) {
+      return _execute((Sequence)call);
+    } else if ((call instanceof StateSwitch)) {
+      return _execute((StateSwitch)call);
+    } else if ((call instanceof Trace)) {
+      return _execute((Trace)call);
+    } else if ((call instanceof UnscheduleTimeEvent)) {
+      return _execute((UnscheduleTimeEvent)call);
+    } else if ((call instanceof Step)) {
+      return _execute((Step)call);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(call).toString());
+    }
+  }
+}

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

@@ -0,0 +1,573 @@
+package org.yakindu.sct.model.sexec.interpreter.stext;
+
+import com.google.inject.Inject;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.xtext.naming.QualifiedName;
+import org.eclipse.xtext.xbase.lib.BooleanExtensions;
+import org.eclipse.xtext.xbase.lib.ObjectExtensions;
+import org.yakindu.base.base.NamedElement;
+import org.yakindu.base.types.Feature;
+import org.yakindu.sct.model.sexec.interpreter.stext.AbstractStatementInterpreter;
+import org.yakindu.sct.model.sexec.interpreter.stext.CoreFunction;
+import org.yakindu.sct.model.sgraph.RegularState;
+import org.yakindu.sct.model.sgraph.State;
+import org.yakindu.sct.model.sgraph.Statement;
+import org.yakindu.sct.model.stext.naming.StextNameProvider;
+import org.yakindu.sct.model.stext.stext.ActiveStateReferenceExpression;
+import org.yakindu.sct.model.stext.stext.AdditiveOperator;
+import org.yakindu.sct.model.stext.stext.AssignmentExpression;
+import org.yakindu.sct.model.stext.stext.AssignmentOperator;
+import org.yakindu.sct.model.stext.stext.BitwiseAndExpression;
+import org.yakindu.sct.model.stext.stext.BitwiseOrExpression;
+import org.yakindu.sct.model.stext.stext.BitwiseXorExpression;
+import org.yakindu.sct.model.stext.stext.BoolLiteral;
+import org.yakindu.sct.model.stext.stext.ConditionalExpression;
+import org.yakindu.sct.model.stext.stext.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.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.TypedElementReferenceExpression;
+import org.yakindu.sct.model.stext.stext.UnaryOperator;
+import org.yakindu.sct.simulation.core.runtime.ExecutionException;
+import org.yakindu.sct.simulation.core.runtime.IExecutionContext;
+import org.yakindu.sct.simulation.core.runtime.impl.ExecutionEvent;
+import org.yakindu.sct.simulation.core.runtime.impl.ExecutionVariable;
+
+@SuppressWarnings("all")
+public class StextStatementInterpreter extends AbstractStatementInterpreter {
+  
+  @Inject
+  private StextNameProvider provider;
+  
+  private IExecutionContext context;
+  
+  public Object evaluateStatement(final Statement statement, final IExecutionContext context) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      this.context = context;
+      Object _execute = this.execute(statement);
+      _xblockexpression = (_execute);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final Statement statement) {
+    return null;
+  }
+  
+  protected Object _execute(final AssignmentExpression assignment) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      Expression _varRef = assignment.getVarRef();
+      NamedElement _variable = this.variable(_varRef);
+      QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_variable);
+      String _string = _fullyQualifiedName.toString();
+      ExecutionVariable _variable_1 = this.context.getVariable(_string);
+      ExecutionVariable scopeVariable = _variable_1;
+      Expression _expression = assignment.getExpression();
+      Object _execute = this.execute(_expression);
+      Object result = _execute;
+      AssignmentOperator _operator = assignment.getOperator();
+      boolean _operator_equals = ObjectExtensions.operator_equals(_operator, AssignmentOperator.ASSIGN);
+      if (_operator_equals) {
+        String _name = scopeVariable.getName();
+        this.context.setVariableValue(_name, result);
+      } else {
+        {
+          AssignmentOperator _operator_1 = assignment.getOperator();
+          String _name_1 = _operator_1.getName();
+          String _get = AbstractStatementInterpreter.assignFunctionMap.get(_name_1);
+          String operator = _get;
+          String _name_2 = scopeVariable.getName();
+          Object _value = scopeVariable.getValue();
+          Object _evaluate = this.evaluate(operator, _value, result);
+          this.context.setVariableValue(_name_2, _evaluate);
+        }
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected NamedElement _variable(final TypedElementReferenceExpression e) {
+    NamedElement _xifexpression = null;
+    NamedElement _reference = e.getReference();
+    if ((_reference instanceof org.yakindu.sct.model.stext.stext.VariableDefinition)) {
+      NamedElement _reference_1 = e.getReference();
+      _xifexpression = _reference_1;
+    } else {
+      _xifexpression = null;
+    }
+    return _xifexpression;
+  }
+  
+  protected NamedElement _variable(final FeatureCall e) {
+    Feature _xifexpression = null;
+    Feature _feature = e.getFeature();
+    if ((_feature instanceof org.yakindu.sct.model.stext.stext.VariableDefinition)) {
+      Feature _feature_1 = e.getFeature();
+      _xifexpression = _feature_1;
+    } else {
+      _xifexpression = null;
+    }
+    return _xifexpression;
+  }
+  
+  protected NamedElement _event(final TypedElementReferenceExpression e) {
+    NamedElement _xifexpression = null;
+    NamedElement _reference = e.getReference();
+    if ((_reference instanceof org.yakindu.sct.model.stext.stext.EventDefinition)) {
+      NamedElement _reference_1 = e.getReference();
+      _xifexpression = _reference_1;
+    } else {
+      _xifexpression = null;
+    }
+    return _xifexpression;
+  }
+  
+  protected NamedElement _event(final FeatureCall e) {
+    Feature _xifexpression = null;
+    Feature _feature = e.getFeature();
+    if ((_feature instanceof org.yakindu.sct.model.stext.stext.EventDefinition)) {
+      Feature _feature_1 = e.getFeature();
+      _xifexpression = _feature_1;
+    } else {
+      _xifexpression = null;
+    }
+    return _xifexpression;
+  }
+  
+  protected Object _execute(final EventRaisingExpression eventRaising) throws ExecutionException {
+    Object _xblockexpression = null;
+    {
+      Expression _value = eventRaising.getValue();
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(_value, null);
+      if (_operator_notEquals) {
+        Expression _event = eventRaising.getEvent();
+        NamedElement _event_1 = this.event(_event);
+        QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_event_1);
+        String _string = _fullyQualifiedName.toString();
+        Expression _value_1 = eventRaising.getValue();
+        Object _execute = this.execute(_value_1);
+        this.context.raiseEvent(_string, _execute);
+      } else {
+        Expression _event_2 = eventRaising.getEvent();
+        NamedElement _event_3 = this.event(_event_2);
+        QualifiedName _fullyQualifiedName_1 = this.provider.getFullyQualifiedName(_event_3);
+        String _string_1 = _fullyQualifiedName_1.toString();
+        this.context.raiseEvent(_string_1, null);
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final ConditionalExpression expression) throws ExecutionException {
+    Expression _condition = expression.getCondition();
+    Object _execute = this.execute(_condition);
+    if (((Boolean) _execute)) {
+      Expression _trueCase = expression.getTrueCase();
+      Object _execute_1 = this.execute(_trueCase);
+      return _execute_1;
+    } else {
+      Expression _falseCase = expression.getFalseCase();
+      Object _execute_2 = this.execute(_falseCase);
+      return _execute_2;
+    }
+  }
+  
+  protected Object _execute(final TypedElementReferenceExpression expression) {
+    {
+      NamedElement _reference = expression.getReference();
+      QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_reference);
+      String _string = _fullyQualifiedName.toString();
+      ExecutionVariable _variable = this.context.getVariable(_string);
+      ExecutionVariable variableRef = _variable;
+      boolean _operator_notEquals = ObjectExtensions.operator_notEquals(variableRef, null);
+      if (_operator_notEquals) {
+        Object _value = variableRef.getValue();
+        return _value;
+      }
+      NamedElement _reference_1 = expression.getReference();
+      QualifiedName _fullyQualifiedName_1 = this.provider.getFullyQualifiedName(_reference_1);
+      String _string_1 = _fullyQualifiedName_1.toString();
+      boolean _isEventRaised = this.context.isEventRaised(_string_1);
+      return ((Boolean)_isEventRaised);
+    }
+  }
+  
+  protected Object _execute(final EventValueReferenceExpression expression) {
+    Object _xblockexpression = null;
+    {
+      List<ExecutionEvent> _raisedEvents = this.context.getRaisedEvents();
+      for (final ExecutionEvent event : _raisedEvents) {
+        String _name = event.getName();
+        Expression _value = expression.getValue();
+        String _qname = this.qname(_value);
+        Boolean _equals = this.equals(_name, _qname);
+        if (_equals) {
+          Object _value_1 = event.getValue();
+          return _value_1;
+        }
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected String _name(final FeatureCall e) {
+    Feature _feature = e.getFeature();
+    String _name = _feature.getName();
+    return _name;
+  }
+  
+  protected String _name(final TypedElementReferenceExpression e) {
+    NamedElement _reference = e.getReference();
+    String _name = _reference.getName();
+    return _name;
+  }
+  
+  protected String _qname(final FeatureCall e) {
+    Feature _feature = e.getFeature();
+    QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_feature);
+    String _string = _fullyQualifiedName.toString();
+    return _string;
+  }
+  
+  protected String _qname(final TypedElementReferenceExpression e) {
+    NamedElement _reference = e.getReference();
+    QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_reference);
+    String _string = _fullyQualifiedName.toString();
+    return _string;
+  }
+  
+  protected Object _execute(final ActiveStateReferenceExpression expression) {
+    {
+      Set<RegularState> _allActiveStates = this.context.getAllActiveStates();
+      for (final RegularState activeState : _allActiveStates) {
+        State _value = expression.getValue();
+        boolean _operator_equals = ObjectExtensions.operator_equals(activeState, _value);
+        if (_operator_equals) {
+          return true;
+        }
+      }
+      return false;
+    }
+  }
+  
+  protected Object _execute(final LogicalAndExpression expression) throws ExecutionException {
+    {
+      Expression _leftOperand = expression.getLeftOperand();
+      Object _execute = this.execute(_leftOperand);
+      Object leftResult = _execute;
+      boolean _operator_not = BooleanExtensions.operator_not(((Boolean) leftResult));
+      if (_operator_not) {
+        return false;
+      }
+      Expression _rightOperand = expression.getRightOperand();
+      Object _execute_1 = this.execute(_rightOperand);
+      Object rightResult = _execute_1;
+      boolean _operator_and = false;
+      if (!((Boolean) leftResult)) {
+        _operator_and = false;
+      } else {
+        _operator_and = BooleanExtensions.operator_and(((Boolean) leftResult), ((Boolean) rightResult));
+      }
+      return _operator_and;
+    }
+  }
+  
+  protected Object _execute(final LogicalOrExpression expression) throws ExecutionException {
+    {
+      Expression _leftOperand = expression.getLeftOperand();
+      Object _execute = this.execute(_leftOperand);
+      Object leftResult = _execute;
+      if (((Boolean) leftResult)) {
+        return true;
+      }
+      Expression _rightOperand = expression.getRightOperand();
+      Object _execute_1 = this.execute(_rightOperand);
+      Object rightResult = _execute_1;
+      boolean _operator_or = false;
+      if (((Boolean) leftResult)) {
+        _operator_or = true;
+      } else {
+        _operator_or = BooleanExtensions.operator_or(((Boolean) leftResult), ((Boolean) rightResult));
+      }
+      return _operator_or;
+    }
+  }
+  
+  protected Object _execute(final LogicalNotExpression expression) {
+    Expression _operand = expression.getOperand();
+    Object _execute = this.execute(_operand);
+    boolean _operator_not = BooleanExtensions.operator_not(((Boolean) _execute));
+    return _operator_not;
+  }
+  
+  protected Object _execute(final BitwiseAndExpression expression) throws ExecutionException {
+    Expression _leftOperand = expression.getLeftOperand();
+    Expression _rightOperand = expression.getRightOperand();
+    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, CoreFunction.BIT_AND);
+    return _executeBinaryCoreFunction;
+  }
+  
+  protected Object _execute(final BitwiseOrExpression expression) throws ExecutionException {
+    Expression _leftOperand = expression.getLeftOperand();
+    Expression _rightOperand = expression.getRightOperand();
+    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, CoreFunction.BIT_OR);
+    return _executeBinaryCoreFunction;
+  }
+  
+  protected Object _execute(final BitwiseXorExpression expression) throws ExecutionException {
+    Expression _leftOperand = expression.getLeftOperand();
+    Expression _rightOperand = expression.getRightOperand();
+    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, CoreFunction.BIT_XOR);
+    return _executeBinaryCoreFunction;
+  }
+  
+  protected Object _execute(final LogicalRelationExpression expression) throws ExecutionException {
+    Expression _leftOperand = expression.getLeftOperand();
+    Expression _rightOperand = expression.getRightOperand();
+    RelationalOperator _operator = expression.getOperator();
+    String _name = _operator.getName();
+    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, _name);
+    return _executeBinaryCoreFunction;
+  }
+  
+  protected Object _execute(final NumericalAddSubtractExpression expression) throws ExecutionException {
+    Expression _leftOperand = expression.getLeftOperand();
+    Expression _rightOperand = expression.getRightOperand();
+    AdditiveOperator _operator = expression.getOperator();
+    String _name = _operator.getName();
+    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, _name);
+    return _executeBinaryCoreFunction;
+  }
+  
+  protected Object _execute(final NumericalMultiplyDivideExpression expression) throws ExecutionException {
+    Expression _leftOperand = expression.getLeftOperand();
+    Expression _rightOperand = expression.getRightOperand();
+    MultiplicativeOperator _operator = expression.getOperator();
+    String _name = _operator.getName();
+    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, _name);
+    return _executeBinaryCoreFunction;
+  }
+  
+  protected Object _execute(final ShiftExpression expression) throws ExecutionException {
+    Expression _leftOperand = expression.getLeftOperand();
+    Expression _rightOperand = expression.getRightOperand();
+    ShiftOperator _operator = expression.getOperator();
+    String _name = _operator.getName();
+    Object _executeBinaryCoreFunction = this.executeBinaryCoreFunction(_leftOperand, _rightOperand, _name);
+    return _executeBinaryCoreFunction;
+  }
+  
+  protected Object _execute(final NumericalUnaryExpression expression) throws ExecutionException {
+    Expression _operand = expression.getOperand();
+    UnaryOperator _operator = expression.getOperator();
+    String _name = _operator.getName();
+    Object _executeUnaryCoreFunction = this.executeUnaryCoreFunction(_operand, _name);
+    return _executeUnaryCoreFunction;
+  }
+  
+  public Object executeBinaryCoreFunction(final Statement leftStatement, final Statement rightStatement, final String operator) throws ExecutionException {
+    {
+      Object _execute = this.execute(leftStatement);
+      Object leftResult = _execute;
+      Object _execute_1 = this.execute(rightStatement);
+      Object rightResult = _execute_1;
+      Object _evaluate = this.evaluate(operator, leftResult, rightResult);
+      return _evaluate;
+    }
+  }
+  
+  public Object executeUnaryCoreFunction(final Statement statement, final String operator) throws ExecutionException {
+    {
+      Object _execute = this.execute(statement);
+      Object result = _execute;
+      Object _evaluate = this.evaluate(operator, result);
+      return _evaluate;
+    }
+  }
+  
+  protected Object _execute(final FeatureCall call) {
+    Object _xblockexpression = null;
+    {
+      boolean _isOperationCall = call.isOperationCall();
+      if (_isOperationCall) {
+        Feature _feature = call.getFeature();
+        String _name = _feature.getName();
+        this.context.call(_name);
+      } else {
+        {
+          Feature _feature_1 = call.getFeature();
+          QualifiedName _fullyQualifiedName = this.provider.getFullyQualifiedName(_feature_1);
+          String _string = _fullyQualifiedName.toString();
+          ExecutionVariable _variable = this.context.getVariable(_string);
+          ExecutionVariable variableRef = _variable;
+          boolean _operator_notEquals = ObjectExtensions.operator_notEquals(variableRef, null);
+          if (_operator_notEquals) {
+            Object _value = variableRef.getValue();
+            return _value;
+          }
+          Feature _feature_2 = call.getFeature();
+          QualifiedName _fullyQualifiedName_1 = this.provider.getFullyQualifiedName(_feature_2);
+          String _string_1 = _fullyQualifiedName_1.toString();
+          boolean _isEventRaised = this.context.isEventRaised(_string_1);
+          return ((Boolean)_isEventRaised);
+        }
+      }
+      _xblockexpression = (null);
+    }
+    return _xblockexpression;
+  }
+  
+  protected Object _execute(final PrimitiveValueExpression expression) {
+    Literal _value = expression.getValue();
+    Comparable<? extends Object> _valueLiteral = this.valueLiteral(_value);
+    return _valueLiteral;
+  }
+  
+  protected Comparable<? extends Object> _valueLiteral(final IntLiteral literal) {
+    int _value = literal.getValue();
+    return _value;
+  }
+  
+  protected Comparable<? extends Object> _valueLiteral(final HexLiteral literal) {
+    int _value = literal.getValue();
+    return _value;
+  }
+  
+  protected Comparable<? extends Object> _valueLiteral(final BoolLiteral bool) {
+    boolean _isValue = bool.isValue();
+    return _isValue;
+  }
+  
+  protected Comparable<? extends Object> _valueLiteral(final RealLiteral literal) {
+    float _value = literal.getValue();
+    return _value;
+  }
+  
+  public Object execute(final Statement expression) throws ExecutionException {
+    if ((expression instanceof ActiveStateReferenceExpression)) {
+      return _execute((ActiveStateReferenceExpression)expression);
+    } else if ((expression instanceof AssignmentExpression)) {
+      return _execute((AssignmentExpression)expression);
+    } else if ((expression instanceof BitwiseAndExpression)) {
+      return _execute((BitwiseAndExpression)expression);
+    } else if ((expression instanceof BitwiseOrExpression)) {
+      return _execute((BitwiseOrExpression)expression);
+    } else if ((expression instanceof BitwiseXorExpression)) {
+      return _execute((BitwiseXorExpression)expression);
+    } else if ((expression instanceof ConditionalExpression)) {
+      return _execute((ConditionalExpression)expression);
+    } else if ((expression instanceof EventRaisingExpression)) {
+      return _execute((EventRaisingExpression)expression);
+    } else if ((expression instanceof EventValueReferenceExpression)) {
+      return _execute((EventValueReferenceExpression)expression);
+    } else if ((expression instanceof FeatureCall)) {
+      return _execute((FeatureCall)expression);
+    } else if ((expression instanceof LogicalAndExpression)) {
+      return _execute((LogicalAndExpression)expression);
+    } else if ((expression instanceof LogicalNotExpression)) {
+      return _execute((LogicalNotExpression)expression);
+    } else if ((expression instanceof LogicalOrExpression)) {
+      return _execute((LogicalOrExpression)expression);
+    } else if ((expression instanceof LogicalRelationExpression)) {
+      return _execute((LogicalRelationExpression)expression);
+    } else if ((expression instanceof NumericalAddSubtractExpression)) {
+      return _execute((NumericalAddSubtractExpression)expression);
+    } else if ((expression instanceof NumericalMultiplyDivideExpression)) {
+      return _execute((NumericalMultiplyDivideExpression)expression);
+    } else if ((expression instanceof NumericalUnaryExpression)) {
+      return _execute((NumericalUnaryExpression)expression);
+    } else if ((expression instanceof PrimitiveValueExpression)) {
+      return _execute((PrimitiveValueExpression)expression);
+    } else if ((expression instanceof ShiftExpression)) {
+      return _execute((ShiftExpression)expression);
+    } else if ((expression instanceof TypedElementReferenceExpression)) {
+      return _execute((TypedElementReferenceExpression)expression);
+    } else if ((expression instanceof Statement)) {
+      return _execute((Statement)expression);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(expression).toString());
+    }
+  }
+  
+  public NamedElement variable(final Expression e) {
+    if ((e instanceof FeatureCall)) {
+      return _variable((FeatureCall)e);
+    } else if ((e instanceof TypedElementReferenceExpression)) {
+      return _variable((TypedElementReferenceExpression)e);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(e).toString());
+    }
+  }
+  
+  public NamedElement event(final Expression e) {
+    if ((e instanceof FeatureCall)) {
+      return _event((FeatureCall)e);
+    } else if ((e instanceof TypedElementReferenceExpression)) {
+      return _event((TypedElementReferenceExpression)e);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(e).toString());
+    }
+  }
+  
+  public String name(final Expression e) {
+    if ((e instanceof FeatureCall)) {
+      return _name((FeatureCall)e);
+    } else if ((e instanceof TypedElementReferenceExpression)) {
+      return _name((TypedElementReferenceExpression)e);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(e).toString());
+    }
+  }
+  
+  public String qname(final Expression e) {
+    if ((e instanceof FeatureCall)) {
+      return _qname((FeatureCall)e);
+    } else if ((e instanceof TypedElementReferenceExpression)) {
+      return _qname((TypedElementReferenceExpression)e);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(e).toString());
+    }
+  }
+  
+  public Comparable<? extends Object> valueLiteral(final Literal bool) {
+    if ((bool instanceof BoolLiteral)) {
+      return _valueLiteral((BoolLiteral)bool);
+    } else if ((bool instanceof HexLiteral)) {
+      return _valueLiteral((HexLiteral)bool);
+    } else if ((bool instanceof IntLiteral)) {
+      return _valueLiteral((IntLiteral)bool);
+    } else if ((bool instanceof RealLiteral)) {
+      return _valueLiteral((RealLiteral)bool);
+    } else {
+      throw new IllegalArgumentException("Unhandled parameter types: " +
+        java.util.Arrays.<Object>asList(bool).toString());
+    }
+  }
+}