Package de.monticore.types3
Interface ISymTypeRelations
Deprecated.
use SymTypeRelations
Relations of SymTypeExpressions
some are dependent on the specific type system and as such not hardcoded in the SymTypeExpressions themselves
-
Method Summary
Modifier and TypeMethodDescriptionbox(SymTypeExpression unboxed) Deprecated.Boxes SymTypeExpressions, including, but not limited to, Java primitive boxing e.g.,int -> java.lang.Integere.g.,List -> java.util.ListgetNominalSuperTypes(SymTypeExpression thisType) Deprecated.returns nominal supertypes.booleanisBoolean(SymTypeExpression type) Deprecated.booleanisByte(SymTypeExpression type) Deprecated.booleanisChar(SymTypeExpression type) Deprecated.booleanisCompatible(SymTypeExpression assignee, SymTypeExpression assigner) Deprecated.whether the assignee can be assigned to by the assigner, e.g., assignment operator: x = 2, type of x and type of 2 need to be compatible, e.g., functions call:(float -> void)(2), float and type of 2 need to be compatiblebooleanisDouble(SymTypeExpression type) Deprecated.booleanisFloat(SymTypeExpression type) Deprecated.booleanisInt(SymTypeExpression type) Deprecated.booleanDeprecated.test if the expression is of integral type, e.g., in Java: (long, int, char, short, byte)booleanisLong(SymTypeExpression type) Deprecated.booleanDeprecated.test if the expression is of numeric type, e.g., in Java: (double, float, long, int, char, short, byte)booleanisShort(SymTypeExpression type) Deprecated.booleanisString(SymTypeExpression type) Deprecated.booleanisSubTypeOf(SymTypeExpression subType, SymTypeExpression superType) Deprecated.whether subType is the sub-type of superType, Examples: isSubType(Person, Person) isSubType(Student, Person) !isSubType(Person, Student) isSubType(int, float) !isSubType(float, int)default Optional<SymTypeExpression> leastUpperBound(SymTypeExpression... types) Deprecated.Deprecated.least upper bound for a set of types for e.g.normalize(SymTypeExpression type) Deprecated.normalizes the SymTypeExpression, e.g.,(A & B[])[] -> (A[] & B[][])default SymTypeExpressionnumericPromotion(SymTypeExpression... types) Deprecated.numericPromotion(List<SymTypeExpression> types) Deprecated.calculates the one promoted numeric type, ignoring the specifics of the context s.unbox(SymTypeExpression boxed) Deprecated.Unboxes SymTypeExpressions, including, but not limited to, Java primitive unboxing e.g.,java.lang.Integer -> inte.g.,java.util.List -> List
-
Method Details
-
isCompatible
Deprecated.whether the assignee can be assigned to by the assigner, e.g., assignment operator: x = 2, type of x and type of 2 need to be compatible, e.g., functions call:(float -> void)(2), float and type of 2 need to be compatible -
isSubTypeOf
Deprecated.whether subType is the sub-type of superType, Examples: isSubType(Person, Person) isSubType(Student, Person) !isSubType(Person, Student) isSubType(int, float) !isSubType(float, int) -
getNominalSuperTypes
Deprecated.returns nominal supertypes. Nominal supertypes are those that are explicitly listed as super types, e.g., in Java those specified using "extends" or "implements". The return value is neither the reflexive nor the transitive closure, i.e., only the direct supertypes are included (s. Java spec 20 4.10). Note that the "direct" supertype-relation is deliberately underspecified, such that it can be refined according to the specific type system's needs. -
box
Deprecated.Boxes SymTypeExpressions, including, but not limited to, Java primitive boxing e.g.,int -> java.lang.Integere.g.,List -> java.util.List -
unbox
Deprecated.Unboxes SymTypeExpressions, including, but not limited to, Java primitive unboxing e.g.,java.lang.Integer -> inte.g.,java.util.List -> List -
normalize
Deprecated.normalizes the SymTypeExpression, e.g.,(A & B[])[] -> (A[] & B[][])Within our type systems, each type has ONE normalized representation. This can be used to, e.g., compare SymTypeExpressions
-
leastUpperBound
Deprecated.least upper bound for a set of types for e.g. union types unlike the Java counterpart, we specify it for non-reference types as well, making it more akin to Java conditional expressions, where "a?b:c" has type leastUpperBound(b,c)empty represents the universal type (aka the lack of a bound) Obscure is returned, if no lub could be calculated, e.g. lub(int, Person)
-
leastUpperBound
Deprecated. -
numericPromotion
Deprecated.calculates the one promoted numeric type, ignoring the specifics of the context s. Java spec. 20 5.6 e.g.,short -> inte.g.,byte, float -> float -
numericPromotion
Deprecated. -
isNumericType
Deprecated.test if the expression is of numeric type, e.g., in Java: (double, float, long, int, char, short, byte) -
isIntegralType
Deprecated.test if the expression is of integral type, e.g., in Java: (long, int, char, short, byte) -
isBoolean
Deprecated. -
isInt
Deprecated. -
isDouble
Deprecated. -
isFloat
Deprecated. -
isLong
Deprecated. -
isChar
Deprecated. -
isShort
Deprecated. -
isByte
Deprecated. -
isString
Deprecated.
-