use of cz.cuni.mff.d3s.trupple.language.nodes.utils.BinaryArgumentPrimitiveTypes in project TrufflePascal by Aspect26.
the class BinaryExpressionNode method verifyChildrenNodeTypes.
@Override
public boolean verifyChildrenNodeTypes() {
TypeDescriptor leftType = getLeftNode().getType();
TypeDescriptor rightType = getRightNode().getType();
if (this.typeTable.containsKey(new BinaryArgumentPrimitiveTypes(leftType, rightType))) {
return true;
}
for (BinaryArgumentPrimitiveTypes allowedType : this.typeTable.keySet()) {
TypeDescriptor allowedLeftType = allowedType.getLeftType();
TypeDescriptor allowedRightType = allowedType.getRightType();
if (leftType.convertibleTo(allowedLeftType) && rightType.convertibleTo(allowedRightType)) {
return true;
}
}
return this.verifyNonPrimitiveArgumentTypes(getLeftNode().getType(), getRightNode().getType());
}
Aggregations