use of org.yakindu.base.types.Type in project statecharts by Yakindu.
the class AbstractTypeSystemTest method testMultipleInheritance.
@Test
public void testMultipleInheritance() {
// SubType extends SuperType
Type int16 = createPrimitive("int16");
declareType(int16, "int16");
Type uint16 = createPrimitive("uint16");
declareType(uint16, "uint16");
Type int8 = createPrimitive("int8");
declareType(int8, "int8");
Type uint8 = createPrimitive("uint8");
declareType(uint8, "uint8");
declareSuperType(int8, int16);
declareSuperType(uint8, int16);
assertTrue(isSame(getType("int16"), getCommonType(int8, uint8)));
}
use of org.yakindu.base.types.Type in project statecharts by Yakindu.
the class STextScopeProvider method scope_FeatureCall_feature.
public IScope scope_FeatureCall_feature(final FeatureCall context, EReference reference) {
Predicate<IEObjectDescription> predicate = calculateFilterPredicate(context, reference);
Expression owner = context.getOwner();
EObject element = null;
if (owner instanceof ElementReferenceExpression) {
element = ((ElementReferenceExpression) owner).getReference();
} else if (owner instanceof FeatureCall) {
element = ((FeatureCall) owner).getFeature();
} else {
return getDelegate().getScope(context, reference);
}
IScope scope = IScope.NULLSCOPE;
InferenceResult result = typeInferrer.infer(owner);
Type ownerType = result != null ? result.getType() : null;
if (element instanceof Scope) {
scope = Scopes.scopeFor(((Scope) element).getDeclarations());
return new FilteringScope(scope, predicate);
} else if (ownerType != null) {
scope = Scopes.scopeFor(typeSystem.getPropertyExtensions(ownerType));
scope = Scopes.scopeFor(typeSystem.getOperationExtensions(ownerType), scope);
}
if (ownerType instanceof ComplexType) {
return addScopeForComplexType((ComplexType) ownerType, scope, predicate);
}
if (ownerType instanceof EnumerationType) {
return addScopeForEnumType((EnumerationType) ownerType, scope, predicate);
}
return scope;
}
use of org.yakindu.base.types.Type in project statecharts by Yakindu.
the class ExecutionContextImpl method setType.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(Type newType) {
Type oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SRuntimePackage.EXECUTION_CONTEXT__TYPE, oldType, type));
}
use of org.yakindu.base.types.Type in project statecharts by Yakindu.
the class ExecutionSlotImpl method setType.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(Type newType) {
Type oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, SRuntimePackage.EXECUTION_SLOT__TYPE, oldType, type));
}
use of org.yakindu.base.types.Type in project statecharts by Yakindu.
the class StextTestFactory method _createBooleanType.
public static Type _createBooleanType(String name) {
Type t = TypesFactory.eINSTANCE.createPrimitiveType();
t.setName(name);
return t;
}
Aggregations