use of org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt in project ballerina by ballerina-lang.
the class ASTBuilderUtil method createMatchStatementPattern.
static BLangMatchStmtPatternClause createMatchStatementPattern(DiagnosticPos pos, BLangVariable variable, BLangBlockStmt body) {
BLangMatchStmtPatternClause patternClause = (BLangMatchStmtPatternClause) TreeBuilder.createMatchStatementPattern();
patternClause.pos = pos;
patternClause.variable = variable;
patternClause.body = body;
return patternClause;
}
use of org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt in project ballerina by ballerina-lang.
the class ASTBuilderUtil method createBlockStmt.
static BLangBlockStmt createBlockStmt(DiagnosticPos pos, List<BLangStatement> stmts) {
final BLangBlockStmt blockNode = (BLangBlockStmt) TreeBuilder.createBlockNode();
blockNode.pos = pos;
blockNode.stmts = stmts;
return blockNode;
}
use of org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt 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.tree.statements.BLangBlockStmt 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.tree.statements.BLangBlockStmt 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