use of org.yakindu.sct.model.sgen.PropertyDefinition in project statecharts by Yakindu.
the class SGenScopeProvider method getElementReferenceScope.
protected IScope getElementReferenceScope(EObject context) {
GeneratorModel generatorModel = (GeneratorModel) EcoreUtil.getRootContainer(context);
EList<PropertyDefinition> properties = generatorModel.getProperties();
List<Property> all = buildInDeclarations.getDeclarations();
return Scopes.scopeFor(properties, Scopes.scopeFor(all));
}
use of org.yakindu.sct.model.sgen.PropertyDefinition in project statecharts by Yakindu.
the class FeatureParameterValueImpl method getExecutionContext.
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
protected ExecutionContext getExecutionContext() {
if (!(EcoreUtil.getRootContainer(this) instanceof GeneratorModel)) {
return new ExecutionContextImpl();
}
ExecutionContext context = new ExecutionContextImpl();
GeneratorModel generatorModel = (GeneratorModel) EcoreUtil.getRootContainer(this);
EList<PropertyDefinition> properties = generatorModel.getProperties();
for (PropertyDefinition propertyDefinition : properties) {
ExecutionVariable variable = SRuntimeFactory.eINSTANCE.createExecutionVariable();
variable.setName(propertyDefinition.getName());
variable.setFqName(propertyDefinition.getName());
variable.setType(propertyDefinition.getType());
variable.setValue(interpreter.evaluate(propertyDefinition.getInitialValue(), context));
context.getSlots().add(variable);
}
return context;
}
Aggregations