use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addVar.
public BLangVariable addVar(DiagnosticPos pos, Set<Whitespace> ws, String identifier, boolean exprAvailable, int annotCount) {
BLangVariable var = (BLangVariable) this.generateBasicVarNode(pos, ws, identifier, exprAvailable);
attachAnnotations(var, annotCount);
var.pos = pos;
if (this.varListStack.empty()) {
this.varStack.push(var);
} else {
this.varListStack.peek().add(var);
}
return var;
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addEndpointDefinition.
public void addEndpointDefinition(DiagnosticPos pos, Set<Whitespace> ws, String identifier, boolean initExprExist) {
final BLangEndpoint endpointNode = (BLangEndpoint) TreeBuilder.createEndpointNode();
attachAnnotations(endpointNode);
endpointNode.pos = pos;
endpointNode.name = (BLangIdentifier) this.createIdentifier(identifier);
endpointNode.endpointTypeNode = (BLangUserDefinedType) typeNodeStack.pop();
if (initExprExist) {
endpointNode.configurationExpr = (BLangExpression) this.exprNodeStack.pop();
}
endpointNode.addWS(ws);
if (endpointListStack.empty()) {
// Top level node.
lastBuiltEndpoint = endpointNode;
this.compUnit.addTopLevelNode(endpointNode);
} else {
endpointListStack.peek().add(endpointNode);
}
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class BLangPackageBuilder method startWithinClause.
public void startWithinClause(DiagnosticPos pos, Set<Whitespace> ws) {
WithinClause withinClause = TreeBuilder.createWithinClause();
((BLangWithinClause) withinClause).pos = pos;
withinClause.addWS(ws);
this.withinClauseStack.push(withinClause);
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createIndexBasedAccessNode.
public void createIndexBasedAccessNode(DiagnosticPos pos, Set<Whitespace> ws) {
BLangIndexBasedAccess indexBasedAccess = (BLangIndexBasedAccess) TreeBuilder.createIndexBasedAccessNode();
indexBasedAccess.pos = pos;
indexBasedAccess.addWS(ws);
indexBasedAccess.indexExpr = (BLangExpression) exprNodeStack.pop();
indexBasedAccess.expr = (BLangVariableReference) exprNodeStack.pop();
addExpressionNode(indexBasedAccess);
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos 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);
}
Aggregations