Search in sources :

Example 1 with BLangArrayType

use of org.wso2.ballerinalang.compiler.tree.types.BLangArrayType in project ballerina by ballerina-lang.

the class BLangPackageBuilder method addArrayType.

public void addArrayType(DiagnosticPos pos, Set<Whitespace> ws, int dimensions) {
    BLangType eType = (BLangType) this.typeNodeStack.pop();
    BLangArrayType arrayTypeNode = (BLangArrayType) TreeBuilder.createArrayTypeNode();
    arrayTypeNode.addWS(ws);
    arrayTypeNode.pos = pos;
    arrayTypeNode.elemtype = eType;
    arrayTypeNode.dimensions = dimensions;
    addType(arrayTypeNode);
}
Also used : BLangType(org.wso2.ballerinalang.compiler.tree.types.BLangType) BLangArrayType(org.wso2.ballerinalang.compiler.tree.types.BLangArrayType)

Example 2 with BLangArrayType

use of org.wso2.ballerinalang.compiler.tree.types.BLangArrayType in project ballerina by ballerina-lang.

the class BLangPackageBuilder method addRestParam.

public void addRestParam(DiagnosticPos pos, Set<Whitespace> ws, String identifier, int annotCount) {
    BLangVariable restParam = (BLangVariable) this.generateBasicVarNode(pos, ws, identifier, false);
    attachAnnotations(restParam, annotCount);
    restParam.pos = pos;
    BLangArrayType typeNode = (BLangArrayType) TreeBuilder.createArrayTypeNode();
    typeNode.elemtype = restParam.typeNode;
    typeNode.dimensions = 1;
    restParam.typeNode = typeNode;
    this.restParamStack.push(restParam);
}
Also used : BLangArrayType(org.wso2.ballerinalang.compiler.tree.types.BLangArrayType) BLangVariable(org.wso2.ballerinalang.compiler.tree.BLangVariable)

Aggregations

BLangArrayType (org.wso2.ballerinalang.compiler.tree.types.BLangArrayType)2 BLangVariable (org.wso2.ballerinalang.compiler.tree.BLangVariable)1 BLangType (org.wso2.ballerinalang.compiler.tree.types.BLangType)1