Search in sources :

Example 21 with DiagnosticPos

use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos 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;
}
Also used : BLangMatchStmtPatternClause(org.wso2.ballerinalang.compiler.tree.statements.BLangMatch.BLangMatchStmtPatternClause)

Example 22 with DiagnosticPos

use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.

the class ASTBuilderUtil method createTypeofExpr.

static BLangTypeofExpr createTypeofExpr(DiagnosticPos pos, BType type, BType resolvedType) {
    final BLangTypeofExpr typeofExpr = (BLangTypeofExpr) TreeBuilder.createTypeAccessNode();
    typeofExpr.pos = pos;
    typeofExpr.type = type;
    typeofExpr.resolvedType = resolvedType;
    return typeofExpr;
}
Also used : BLangTypeofExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeofExpr)

Example 23 with DiagnosticPos

use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos 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;
}
Also used : BLangBlockStmt(org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt)

Example 24 with DiagnosticPos

use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.

the class ASTBuilderUtil method createVariableDef.

static BLangVariableDef createVariableDef(DiagnosticPos pos, BLangVariable variable) {
    final BLangVariableDef variableDef = (BLangVariableDef) TreeBuilder.createVariableDefinitionNode();
    variableDef.pos = pos;
    variableDef.var = variable;
    return variableDef;
}
Also used : BLangVariableDef(org.wso2.ballerinalang.compiler.tree.statements.BLangVariableDef)

Example 25 with DiagnosticPos

use of org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos in project ballerina by ballerina-lang.

the class ASTBuilderUtil method createMatchStatement.

static BLangMatch createMatchStatement(DiagnosticPos pos, BLangExpression expr, List<BLangMatchStmtPatternClause> patternClauses) {
    BLangMatch matchStmt = (BLangMatch) TreeBuilder.createMatchStatement();
    matchStmt.pos = pos;
    matchStmt.expr = expr;
    matchStmt.patternClauses = patternClauses;
    return matchStmt;
}
Also used : BLangMatch(org.wso2.ballerinalang.compiler.tree.statements.BLangMatch)

Aggregations

DiagnosticPos (org.wso2.ballerinalang.compiler.util.diagnotic.DiagnosticPos)56 BLangVariable (org.wso2.ballerinalang.compiler.tree.BLangVariable)33 BLangBlockStmt (org.wso2.ballerinalang.compiler.tree.statements.BLangBlockStmt)22 BLangAssignment (org.wso2.ballerinalang.compiler.tree.statements.BLangAssignment)17 ArrayList (java.util.ArrayList)15 BLangExpression (org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression)14 Whitespace (org.ballerinalang.model.Whitespace)13 BLangVariableDef (org.wso2.ballerinalang.compiler.tree.statements.BLangVariableDef)12 BLangFunction (org.wso2.ballerinalang.compiler.tree.BLangFunction)11 BLangInvocation (org.wso2.ballerinalang.compiler.tree.expressions.BLangInvocation)11 IdentifierNode (org.ballerinalang.model.tree.IdentifierNode)9 SelectExpressionNode (org.ballerinalang.model.tree.clauses.SelectExpressionNode)9 ExpressionNode (org.ballerinalang.model.tree.expressions.ExpressionNode)9 BLangNameReference (org.wso2.ballerinalang.compiler.tree.BLangNameReference)9 BLangBinaryExpr (org.wso2.ballerinalang.compiler.tree.expressions.BLangBinaryExpr)9 BLangExpressionStmt (org.wso2.ballerinalang.compiler.tree.statements.BLangExpressionStmt)9 BLangIdentifier (org.wso2.ballerinalang.compiler.tree.BLangIdentifier)8 BLangStruct (org.wso2.ballerinalang.compiler.tree.BLangStruct)8 BLangSimpleVarRef (org.wso2.ballerinalang.compiler.tree.expressions.BLangSimpleVarRef)8 BLangXMLQuotedString (org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLQuotedString)8