Class TypeCheck3AsTypeCalculator
java.lang.Object
de.monticore.types.check.TypeCalculator
de.monticore.types.check.types3wrapper.TypeCheck3AsTypeCalculator
- All Implemented Interfaces:
ITypeRelations
the TypeCalculator class using the TypeCheck3.
While the TypeCheck3 should be used directly,
this can be used to try the TypeCheck without major rewrites.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Type4AstDeprecated.protected de.monticore.visitor.ITraverserDeprecated.Fields inherited from class de.monticore.types.check.TypeCalculator
iDerive, iSynthesize, iTypeRelations -
Constructor Summary
ConstructorsConstructorDescriptionTypeCheck3AsTypeCalculator(ILValueRelations lValueRelations) Deprecated.TypeCheck3AsTypeCalculator(de.monticore.visitor.ITraverser typeTraverser, Type4Ast type4Ast, ILValueRelations lValueRelations) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbooleancompatible(SymTypeExpression left, SymTypeExpression right) Function 3: Given two SymTypeExpressions super, sub: This function answers, whether the right type is a subtype of the left type in an assignment.booleanisSubtypeOf(SymTypeExpression subType, SymTypeExpression superType) determines if one SymTypeExpression is a subtype of another SymTypeExpressionMethods inherited from class de.monticore.types.check.TypeCalculator
calculateInheritanceDistance, calculateInheritanceDistance, isBoolean, isByte, isChar, isDouble, isFloat, isInt, isIntegralType, isLong, isNumericType, isOfTypeForAssign, isShort, isString, isVoid, symTypeFromAST, symTypeFromAST, symTypeFromAST, symTypeFromAST, typeOf, typeOf
-
Field Details
-
type4Ast
Deprecated. -
typeTraverser
Deprecated.
-
-
Constructor Details
-
TypeCheck3AsTypeCalculator
@Deprecated public TypeCheck3AsTypeCalculator(de.monticore.visitor.ITraverser typeTraverser, Type4Ast type4Ast, ILValueRelations lValueRelations) Deprecated.- Parameters:
typeTraverser- traverser filling type4Ast, language specifictype4Ast- a map of types to be filledlValueRelations- is expression a variable?, language specific
-
TypeCheck3AsTypeCalculator
Deprecated.- Parameters:
lValueRelations- is expression a variable?, language specific
-
TypeCheck3AsTypeCalculator
public TypeCheck3AsTypeCalculator()
-
-
Method Details
-
compatible
Description copied from interface:ITypeRelationsFunction 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- Specified by:
compatiblein interfaceITypeRelations- Overrides:
compatiblein classTypeCalculator- Parameters:
left- Super-Typeright- Sub-Type (assignment-compatible to supertype?)
-
isSubtypeOf
Description copied from interface:ITypeRelationsdetermines if one SymTypeExpression is a subtype of another SymTypeExpression- Specified by:
isSubtypeOfin interfaceITypeRelations- Overrides:
isSubtypeOfin classTypeCalculator- Parameters:
subType- the SymTypeExpression that could be a subtype of the other SymTypeExpressionsuperType- the SymTypeExpression that could be a supertype of the other SymTypeExpression
-