Package de.monticore.types.check
Interface ITypeRelations
- All Known Implementing Classes:
TypeCalculator,TypeCheck3AsTypeCalculator,TypeRelations
Deprecated.
This class is intended to provide typeChecking functionality
with regard to relations of types
-
Method Summary
Modifier and TypeMethodDescriptionintcalculateInheritanceDistance(SymTypeExpression specific, SymTypeExpression general) Deprecated.calculate the minimum inheritance distance from the specific type to the general type e.g.intcalculateInheritanceDistance(SymTypePrimitive specific, SymTypePrimitive general) Deprecated.booleancompatible(SymTypeExpression left, SymTypeExpression right) Deprecated.Function 3: Given two SymTypeExpressions super, sub: This function answers, whether the right type is a subtype of the left type in an assignment.booleanisBoolean(SymTypeExpression type) Deprecated.booleanisByte(SymTypeExpression type) Deprecated.booleanisChar(SymTypeExpression type) Deprecated.booleanisDouble(SymTypeExpression type) Deprecated.booleanisFloat(SymTypeExpression type) Deprecated.booleanisInt(SymTypeExpression type) Deprecated.booleanDeprecated.booleanisLong(SymTypeExpression type) Deprecated.booleanDeprecated.booleanisShort(SymTypeExpression type) Deprecated.booleanisString(SymTypeExpression type) Deprecated.booleanisSubtypeOf(SymTypeExpression subType, SymTypeExpression superType) Deprecated.determines if one SymTypeExpression is a subtype of another SymTypeExpressionbooleanisVoid(SymTypeExpression type) Deprecated.
-
Method Details
-
compatible
Deprecated.Function 3: Given two SymTypeExpressions super, sub: This function answers, whether the right type is a subtype of the left type in an assignment. (This allows to store/use values of type "sub" at all positions of type "super". Compatibility examples: compatible("int", "long") (in all directions) compatible("long", "int") (in all directions) compatible("double", "float") (in all directions) compatible("Person", "Student") (uni-directional)Incompatible:
!compatible("double", "int")(in all directions)The concrete Typechecker has to decide on further issues, like
!compatible("List<double>", "List<int>")where e.g. Java and OCL/P differ in their answers- Parameters:
left- Super-Typeright- Sub-Type (assignment-compatible to supertype?)
-
isSubtypeOf
Deprecated.determines if one SymTypeExpression is a subtype of another SymTypeExpression- Parameters:
subType- the SymTypeExpression that could be a subtype of the other SymTypeExpressionsuperType- the SymTypeExpression that could be a supertype of the other SymTypeExpression
-
calculateInheritanceDistance
Deprecated.calculate the minimum inheritance distance from the specific type to the general type e.g. C extends B extends A: object of type C has distance of 2 to object of type A object of type B has distance of 1 to object of type A object of type A has distance of 0 to object of type A- Parameters:
specific- the specific typegeneral- the general type- Returns:
- 0 if they are the same type, else their minimum inheritance distance
-
calculateInheritanceDistance
Deprecated. -
isBoolean
Deprecated. -
isInt
Deprecated. -
isDouble
Deprecated. -
isFloat
Deprecated. -
isLong
Deprecated. -
isChar
Deprecated. -
isShort
Deprecated. -
isByte
Deprecated. -
isVoid
Deprecated. -
isString
Deprecated. -
isNumericType
Deprecated. -
isIntegralType
Deprecated.
-
SymTypeRelations