use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addTupleType.
public void addTupleType(DiagnosticPos pos, Set<Whitespace> ws, int members) {
BLangTupleTypeNode tupleTypeNode = (BLangTupleTypeNode) TreeBuilder.createTupleTypeNode();
for (int i = 0; i < members; i++) {
final BLangType member = (BLangType) this.typeNodeStack.pop();
tupleTypeNode.memberTypeNodes.add(0, member);
}
tupleTypeNode.pos = pos;
tupleTypeNode.addWS(ws);
this.typeNodeStack.push(tupleTypeNode);
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addLockStmt.
public void addLockStmt(DiagnosticPos pos, Set<Whitespace> ws) {
BLangLock lockNode = (BLangLock) TreeBuilder.createLockNode();
lockNode.pos = pos;
lockNode.addWS(ws);
BLangBlockStmt lockBlock = (BLangBlockStmt) this.blockNodeStack.pop();
lockBlock.pos = pos;
lockNode.setBody(lockBlock);
addStmtToCurrentBlock(lockNode);
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addLiteralValue.
public void addLiteralValue(DiagnosticPos pos, Set<Whitespace> ws, int typeTag, Object value) {
BLangLiteral litExpr = (BLangLiteral) TreeBuilder.createLiteralExpression();
litExpr.addWS(ws);
litExpr.pos = pos;
litExpr.typeTag = typeTag;
litExpr.value = value;
addExpressionNode(litExpr);
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addBreakStatement.
public void addBreakStatement(DiagnosticPos pos, Set<Whitespace> ws) {
BLangBreak breakNode = (BLangBreak) TreeBuilder.createBreakNode();
breakNode.pos = pos;
breakNode.addWS(ws);
addStmtToCurrentBlock(breakNode);
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addCatchClause.
public void addCatchClause(DiagnosticPos poc, Set<Whitespace> ws, String paramName) {
BLangVariable variableNode = (BLangVariable) TreeBuilder.createVariableNode();
variableNode.typeNode = (BLangType) this.typeNodeStack.pop();
variableNode.name = (BLangIdentifier) createIdentifier(paramName);
variableNode.pos = variableNode.typeNode.pos;
variableNode.addWS(removeNthFromLast(ws, 3));
BLangCatch catchNode = (BLangCatch) TreeBuilder.createCatchNode();
catchNode.pos = poc;
catchNode.addWS(ws);
catchNode.body = (BLangBlockStmt) this.blockNodeStack.pop();
catchNode.param = variableNode;
tryCatchFinallyNodesStack.peek().catchBlocks.add(catchNode);
}
Aggregations