Search in sources :

Example 1 with BLangTypeofExpr

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

the class TypeChecker method visit.

public void visit(BLangTypeofExpr accessExpr) {
    BType actualType = symTable.typeDesc;
    accessExpr.resolvedType = symResolver.resolveTypeNode(accessExpr.typeNode, env);
    resultTypes = types.checkTypes(accessExpr, Lists.of(actualType), expTypes);
}
Also used : BType(org.wso2.ballerinalang.compiler.semantics.model.types.BType)

Example 2 with BLangTypeofExpr

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

the class CodeGenerator method visit.

public void visit(BLangTypeofExpr accessExpr) {
    Operand typeCPIndex = getTypeCPIndex(accessExpr.resolvedType);
    emit(InstructionCodes.TYPELOAD, typeCPIndex, calcAndGetExprRegIndex(accessExpr));
}
Also used : Operand(org.wso2.ballerinalang.programfile.Instruction.Operand)

Example 3 with BLangTypeofExpr

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

the class ASTBuilderUtil method createTypeofExpr.

static BLangTypeofExpr createTypeofExpr(DiagnosticPos pos, BType type, BType resolvedType) {
    final BLangTypeofExpr typeofExpr = (BLangTypeofExpr) TreeBuilder.createTypeAccessNode();
    typeofExpr.pos = pos;
    typeofExpr.type = type;
    typeofExpr.resolvedType = resolvedType;
    return typeofExpr;
}
Also used : BLangTypeofExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeofExpr)

Example 4 with BLangTypeofExpr

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

the class EndpointDesugar method getTypeAccessExpression.

private BLangTypeofExpr getTypeAccessExpression(DiagnosticPos pos, BType serviceType) {
    BLangTypeofExpr typeAccessExpr = (BLangTypeofExpr) TreeBuilder.createTypeAccessNode();
    typeAccessExpr.pos = pos;
    typeAccessExpr.resolvedType = serviceType;
    typeAccessExpr.type = symTable.typeDesc;
    return typeAccessExpr;
}
Also used : BLangTypeofExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeofExpr)

Example 5 with BLangTypeofExpr

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

the class BLangPackageBuilder method createTypeAccessExpr.

public void createTypeAccessExpr(DiagnosticPos pos, Set<Whitespace> ws) {
    BLangTypeofExpr typeAccessExpr = (BLangTypeofExpr) TreeBuilder.createTypeAccessNode();
    typeAccessExpr.pos = pos;
    typeAccessExpr.addWS(ws);
    typeAccessExpr.typeNode = (BLangType) typeNodeStack.pop();
    addExpressionNode(typeAccessExpr);
}
Also used : BLangTypeofExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeofExpr)

Aggregations

BLangTypeofExpr (org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeofExpr)5 BType (org.wso2.ballerinalang.compiler.semantics.model.types.BType)3 BLangSimpleVarRef (org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef)2 ArrayList (java.util.ArrayList)1 BSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol)1 BLangExpression (org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression)1 BLangXMLQName (org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLQName)1 BLangXMLQuotedString (org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLQuotedString)1 BLangUserDefinedType (org.wso2.ballerinalang.compiler.tree.types.BLangUserDefinedType)1 Name (org.wso2.ballerinalang.compiler.util.Name)1 Operand (org.wso2.ballerinalang.programfile.Instruction.Operand)1