Exprent param1 = lstOperands.get(1); Exprent param2 = lstOperands.get(2); VarType supertype = VarType.getCommonSupertype(param1.getExprType(), param2.getExprType()); if (param1.type == Exprent.EXPRENT_CONST && param2.type == Exprent.EXPRENT_CONST && supertype.type != CodeConstants.TYPE_BOOLEAN && VarType.VARTYPE_INT.isSuperset(supertype)) {
@Override public CheckTypesResult checkExprTypeBounds() { CheckTypesResult result = new CheckTypesResult(); result.addMinTypeExprent(value, VarType.VARTYPE_BYTECHAR); result.addMaxTypeExprent(value, VarType.VARTYPE_INT); VarType valType = value.getExprType(); for (List<Exprent> lst : caseValues) { for (Exprent expr : lst) { if (expr != null) { VarType caseType = expr.getExprType(); if (!caseType.equals(valType)) { valType = VarType.getCommonSupertype(caseType, valType); result.addMinTypeExprent(value, valType); } } } } return result; }
@Override public CheckTypesResult checkExprTypeBounds() { CheckTypesResult result = new CheckTypesResult(); VarType typeLeft = left.getExprType(); VarType typeRight = right.getExprType(); if (typeLeft.typeFamily > typeRight.typeFamily) { result.addMinTypeExprent(right, VarType.getMinTypeInFamily(typeLeft.typeFamily)); } else if (typeLeft.typeFamily < typeRight.typeFamily) { result.addMinTypeExprent(left, typeRight); } else { result.addMinTypeExprent(left, VarType.getCommonSupertype(typeLeft, typeRight)); } return result; }
newMinType = VarType.getCommonSupertype(currentMinType, newType);
Exprent param1 = lstOperands.get(1); Exprent param2 = lstOperands.get(2); VarType supertype = VarType.getCommonSupertype(param1.getExprType(), param2.getExprType());
@Override public CheckTypesResult checkExprTypeBounds() { CheckTypesResult result = new CheckTypesResult(); VarType typeLeft = left.getExprType(); VarType typeRight = right.getExprType(); if (typeLeft.typeFamily > typeRight.typeFamily) { result.addMinTypeExprent(right, VarType.getMinTypeInFamily(typeLeft.typeFamily)); } else if (typeLeft.typeFamily < typeRight.typeFamily) { result.addMinTypeExprent(left, typeRight); } else { result.addMinTypeExprent(left, VarType.getCommonSupertype(typeLeft, typeRight)); } return result; }
@Override public CheckTypesResult checkExprTypeBounds() { CheckTypesResult result = new CheckTypesResult(); result.addMinTypeExprent(value, VarType.VARTYPE_BYTECHAR); result.addMaxTypeExprent(value, VarType.VARTYPE_INT); VarType valType = value.getExprType(); for (List<Exprent> lst : caseValues) { for (Exprent expr : lst) { if (expr != null) { VarType caseType = expr.getExprType(); if (!caseType.equals(valType)) { valType = VarType.getCommonSupertype(caseType, valType); result.addMinTypeExprent(value, valType); } } } } return result; }
newMinType = VarType.getCommonSupertype(currentMinType, newType);