use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class ASTBuilderUtil method createIfElseStmt.
static BLangIf createIfElseStmt(DiagnosticPos pos, BLangExpression conditionExpr, BLangBlockStmt thenBody, BLangStatement elseStmt) {
final BLangIf ifNode = (BLangIf) TreeBuilder.createIfElseStatementNode();
ifNode.pos = pos;
ifNode.expr = conditionExpr;
ifNode.body = thenBody;
ifNode.elseStmt = elseStmt;
return ifNode;
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class ASTBuilderUtil method createVariable.
static BLangVariable createVariable(DiagnosticPos pos, String name, BType type, BLangExpression expr, BVarSymbol varSymbol) {
final BLangVariable varNode = (BLangVariable) TreeBuilder.createVariableNode();
varNode.pos = pos;
varNode.name = createIdentifier(pos, name);
varNode.type = type;
varNode.expr = expr;
varNode.symbol = varSymbol;
return varNode;
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class ASTBuilderUtil method createNextStmt.
static void createNextStmt(DiagnosticPos pos, BLangBlockStmt target) {
final BLangNext nextStmt = (BLangNext) TreeBuilder.createNextNode();
nextStmt.pos = pos;
target.addStatement(nextStmt);
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class ASTBuilderUtil method createUnaryExpr.
static BLangUnaryExpr createUnaryExpr(DiagnosticPos pos, BLangExpression expr, BType type, OperatorKind kind, BOperatorSymbol symbol) {
final BLangUnaryExpr unaryExpr = (BLangUnaryExpr) TreeBuilder.createUnaryExpressionNode();
unaryExpr.pos = pos;
unaryExpr.expr = expr;
unaryExpr.type = type;
unaryExpr.operator = kind;
unaryExpr.opSymbol = symbol;
return unaryExpr;
}
use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.
the class ASTBuilderUtil method createAssignmentStmt.
static BLangAssignment createAssignmentStmt(DiagnosticPos pos, BLangBlockStmt target) {
final BLangAssignment assignment = (BLangAssignment) TreeBuilder.createAssignmentNode();
assignment.pos = pos;
target.addStatement(assignment);
return assignment;
}
Aggregations