Search in sources :

Example 56 with DiagnosticPos

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

the class BLangPackageBuilder method createDocumentationAttribute.

public void createDocumentationAttribute(DiagnosticPos pos, Set<Whitespace> ws, String attributeName, String endText, String docPrefix) {
    BLangDocumentationAttribute attrib = (BLangDocumentationAttribute) TreeBuilder.createDocumentationAttributeNode();
    attrib.documentationField = (BLangIdentifier) createIdentifier(attributeName);
    attrib.documentationText = endText;
    attrib.docTag = DocTag.fromString(docPrefix);
    attrib.pos = pos;
    attrib.addWS(ws);
    docAttachmentStack.peek().addAttribute(attrib);
}
Also used : BLangDocumentationAttribute(org.wso2.ballerinalang.compiler.tree.expressions.BLangDocumentationAttribute)

Example 57 with DiagnosticPos

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

the class BLangPackageBuilder method createBracedOrTupleExpression.

public void createBracedOrTupleExpression(DiagnosticPos pos, Set<Whitespace> ws, int numberOfExpressions) {
    final BLangBracedOrTupleExpr expr = (BLangBracedOrTupleExpr) TreeBuilder.createBracedOrTupleExpression();
    expr.pos = pos;
    expr.addWS(ws);
    for (int i = 0; i < numberOfExpressions; i++) {
        expr.expressions.add(0, (BLangExpression) exprNodeStack.pop());
    }
    addExpressionNode(expr);
}
Also used : BLangAnnotationAttachmentPoint(org.wso2.ballerinalang.compiler.tree.BLangAnnotationAttachmentPoint) BLangEndpoint(org.wso2.ballerinalang.compiler.tree.BLangEndpoint) BLangBracedOrTupleExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangBracedOrTupleExpr)

Example 58 with DiagnosticPos

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

the class BLangPackageBuilder method createTypeCastExpr.

public void createTypeCastExpr(DiagnosticPos pos, Set<Whitespace> ws) {
    BLangTypeCastExpr typeCastNode = (BLangTypeCastExpr) TreeBuilder.createTypeCastNode();
    typeCastNode.pos = pos;
    typeCastNode.addWS(ws);
    typeCastNode.expr = (BLangExpression) exprNodeStack.pop();
    typeCastNode.typeNode = (BLangType) typeNodeStack.pop();
    addExpressionNode(typeCastNode);
}
Also used : BLangTypeCastExpr(org.wso2.ballerinalang.compiler.tree.expressions.BLangTypeCastExpr)

Example 59 with DiagnosticPos

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

the class BLangPackageBuilder method createFieldBasedAccessNode.

public void createFieldBasedAccessNode(DiagnosticPos pos, Set<Whitespace> ws, String fieldName, FieldType fieldType) {
    BLangFieldBasedAccess fieldBasedAccess = (BLangFieldBasedAccess) TreeBuilder.createFieldBasedAccessNode();
    fieldBasedAccess.pos = pos;
    fieldBasedAccess.addWS(ws);
    fieldBasedAccess.field = (BLangIdentifier) createIdentifier(fieldName);
    fieldBasedAccess.expr = (BLangVariableReference) exprNodeStack.pop();
    fieldBasedAccess.fieldType = fieldType;
    addExpressionNode(fieldBasedAccess);
}
Also used : BLangFieldBasedAccess(org.wso2.ballerinalang.compiler.tree.expressions.BLangFieldBasedAccess)

Example 60 with DiagnosticPos

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

the class BLangPackageBuilder method createDeprecatedNode.

public void createDeprecatedNode(DiagnosticPos pos, Set<Whitespace> ws, String content) {
    BLangDeprecatedNode deprecatedNode = (BLangDeprecatedNode) TreeBuilder.createDeprecatedNode();
    deprecatedNode.pos = pos;
    deprecatedNode.addWS(ws);
    deprecatedNode.documentationText = content;
    deprecatedAttachmentStack.push(deprecatedNode);
}
Also used : BLangDeprecatedNode(org.wso2.ballerinalang.compiler.tree.BLangDeprecatedNode)

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