Search in sources :

Example 46 with DiagnosticPos

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

the class BLangPackageBuilder method startPatternClause.

public void startPatternClause(DiagnosticPos pos, Set<Whitespace> ws) {
    PatternClause patternClause = TreeBuilder.createPatternClause();
    ((BLangPatternClause) patternClause).pos = pos;
    patternClause.addWS(ws);
    this.patternClauseStack.push(patternClause);
}
Also used : BLangMatchStmtPatternClause(org.wso2.ballerinalang.compiler.tree.statements.BLangMatch.BLangMatchStmtPatternClause) BLangPatternClause(org.wso2.ballerinalang.compiler.tree.clauses.BLangPatternClause) PatternClause(org.ballerinalang.model.tree.clauses.PatternClause)

Example 47 with DiagnosticPos

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

the class BLangPackageBuilder method addConstVariable.

public void addConstVariable(DiagnosticPos pos, Set<Whitespace> ws, String identifier, boolean publicVar, boolean safeAssignment) {
    BLangVariable var = (BLangVariable) this.generateBasicVarNode(pos, ws, identifier, true);
    var.flagSet.add(Flag.CONST);
    if (publicVar) {
        var.flagSet.add(Flag.PUBLIC);
    }
    var.docTag = DocTag.VARIABLE;
    var.safeAssignment = safeAssignment;
    attachAnnotations(var);
    attachDocumentations(var);
    attachDeprecatedNode(var);
    this.compUnit.addTopLevelNode(var);
}
Also used : BLangVariable(org.wso2.ballerinalang.compiler.tree.BLangVariable)

Example 48 with DiagnosticPos

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

the class BLangPackageBuilder method addFailStatement.

public void addFailStatement(DiagnosticPos pos, Set<Whitespace> ws) {
    BLangFail failNode = (BLangFail) TreeBuilder.createFailNode();
    failNode.pos = pos;
    failNode.addWS(ws);
    addStmtToCurrentBlock(failNode);
}
Also used : BLangFail(org.wso2.ballerinalang.compiler.tree.statements.BLangFail)

Example 49 with DiagnosticPos

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

the class BLangPackageBuilder method addNameReference.

public void addNameReference(DiagnosticPos currentPos, Set<Whitespace> ws, String pkgName, String name) {
    IdentifierNode pkgNameNode = createIdentifier(pkgName);
    IdentifierNode nameNode = createIdentifier(name);
    nameReferenceStack.push(new BLangNameReference(currentPos, ws, pkgNameNode, nameNode));
}
Also used : BLangNameReference(org.wso2.ballerinalang.compiler.tree.BLangNameReference) IdentifierNode(org.ballerinalang.model.tree.IdentifierNode)

Example 50 with DiagnosticPos

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

the class BLangPackageBuilder method addReturnParam.

public BLangVariable addReturnParam(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;
    this.varStack.push(var);
    return var;
}
Also used : BLangVariable(org.wso2.ballerinalang.compiler.tree.BLangVariable)

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