Search in sources :

Example 1 with BFunctionPointerInvocation

use of org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation.BFunctionPointerInvocation in project ballerina by ballerina-lang.

the class Desugar method visitFunctionPointerInvocation.

// private functions
private void visitFunctionPointerInvocation(BLangInvocation iExpr) {
    BLangVariableReference expr;
    if (iExpr.expr == null) {
        expr = new BLangSimpleVarRef();
    } else {
        BLangFieldBasedAccess fieldBasedAccess = new BLangFieldBasedAccess();
        fieldBasedAccess.expr = iExpr.expr;
        fieldBasedAccess.field = iExpr.name;
        expr = fieldBasedAccess;
    }
    expr.symbol = (BVarSymbol) iExpr.symbol;
    expr.type = iExpr.symbol.type;
    expr = rewriteExpr(expr);
    result = new BFunctionPointerInvocation(iExpr, expr);
}
Also used : BLangSimpleVarRef(org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef) BLangFieldBasedAccess(org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess) BLangVariableReference(org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference) BFunctionPointerInvocation(org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation.BFunctionPointerInvocation)

Aggregations

BLangFieldBasedAccess (org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess)1 BFunctionPointerInvocation (org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation.BFunctionPointerInvocation)1 BLangSimpleVarRef (org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef)1 BLangVariableReference (org.wso2.ballerinalang.compiler.tree.expressions.BLangVariableReference)1