use of org.wso2.ballerinalang.compiler.tree.expressions.BLangIsAssignableExpr in project ballerina by ballerina-lang.
the class CodeGenerator method visit.
@Override
public void visit(BLangIsAssignableExpr assignableExpr) {
genNode(assignableExpr.lhsExpr, this.env);
RegIndex regIndex = calcAndGetExprRegIndex(assignableExpr);
Operand typeCPIndex = getTypeCPIndex(assignableExpr.targetType);
emit(assignableExpr.opSymbol.opcode, assignableExpr.lhsExpr.regIndex, typeCPIndex, regIndex);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangIsAssignableExpr in project ballerina by ballerina-lang.
the class ASTBuilderUtil method createIsAssignableExpr.
static BLangIsAssignableExpr createIsAssignableExpr(DiagnosticPos pos, BLangExpression lhsExpr, BType targetType, BType type, Names names) {
final BLangIsAssignableExpr assignableExpr = new BLangIsAssignableExpr();
assignableExpr.pos = pos;
assignableExpr.lhsExpr = lhsExpr;
assignableExpr.targetType = targetType;
assignableExpr.type = type;
assignableExpr.opSymbol = new BOperatorSymbol(names.fromString(assignableExpr.opKind.value()), null, targetType, null, InstructionCodes.IS_ASSIGNABLE);
return assignableExpr;
}
Aggregations