use of org.yakindu.sct.model.sruntime.impl.ExecutionVariableImpl in project statecharts by Yakindu.
the class STextInterpreterTest method initContext.
private void initContext() {
// "event abc operation foo() var intVar : integer var boolVar : boolean
// var realVar : real
ExecutionVariable intVar = new ExecutionVariableImpl();
intVar.setName("intVar");
intVar.setFqName("intVar");
intVar.setType(typeSystem.getType(GenericTypeSystem.INTEGER));
intVar.setValue(0);
context.getSlots().add(intVar);
ExecutionVariable boolVar = new ExecutionVariableImpl();
boolVar.setName("boolVar");
boolVar.setFqName("boolVar");
boolVar.setType(typeSystem.getType(GenericTypeSystem.BOOLEAN));
boolVar.setValue(false);
context.getSlots().add(boolVar);
ExecutionVariable realVar = new ExecutionVariableImpl();
realVar.setName("realVar");
realVar.setFqName("realVar");
realVar.setType(typeSystem.getType(GenericTypeSystem.REAL));
realVar.setValue(0.0f);
context.getSlots().add(realVar);
ExecutionVariable stringVar = new ExecutionVariableImpl();
stringVar.setName("stringVar");
stringVar.setFqName("stringVar");
stringVar.setType(typeSystem.getType(GenericTypeSystem.STRING));
stringVar.setValue("");
context.getSlots().add(stringVar);
ExecutionEvent event = new ExecutionEventImpl();
event.setName("abc");
event.setFqName("abc");
event.setType(typeSystem.getType(GenericTypeSystem.INTEGER));
context.getSlots().add(event);
ExecutionVariable enumVar = new ExecutionVariableImpl();
enumVar.setName("enumVar");
enumVar.setFqName("enumVar");
enumVar.setType(typeSystem.getType(GenericTypeSystem.INTEGER));
context.getSlots().add(enumVar);
CompositeSlot cpVar = new CompositeSlotImpl();
cpVar.setName("cpVar");
cpVar.setFqName("cpVar");
ExecutionVariable featureVar = new ExecutionVariableImpl();
featureVar.setName("x");
featureVar.setFqName("cpVar.x");
featureVar.setType(typeSystem.getType(GenericTypeSystem.INTEGER));
featureVar.setValue(0);
cpVar.getSlots().add(featureVar);
context.getSlots().add(cpVar);
}
Aggregations