use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createXMLQuotedLiteral.
public void createXMLQuotedLiteral(DiagnosticPos pos, Set<Whitespace> ws, Stack<String> precedingTextFragments, String endingText, QuoteType quoteType) {
List<BLangExpression> templateExprs = getExpressionsInTemplate(pos, ws, precedingTextFragments, endingText, NodeKind.LITERAL);
BLangXMLQuotedString quotedString = (BLangXMLQuotedString) TreeBuilder.createXMLQuotedStringNode();
quotedString.pos = pos;
quotedString.quoteType = quoteType;
quotedString.textFragments = templateExprs;
addExpressionNode(quotedString);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addEndpointDefinition.
public void addEndpointDefinition(DiagnosticPos pos, Set<Whitespace> ws, String identifier, boolean initExprExist) {
final BLangEndpoint endpointNode = (BLangEndpoint) TreeBuilder.createEndpointNode();
attachAnnotations(endpointNode);
endpointNode.pos = pos;
endpointNode.name = (BLangIdentifier) this.createIdentifier(identifier);
endpointNode.endpointTypeNode = (BLangUserDefinedType) typeNodeStack.pop();
if (initExprExist) {
endpointNode.configurationExpr = (BLangExpression) this.exprNodeStack.pop();
}
endpointNode.addWS(ws);
if (endpointListStack.empty()) {
// Top level node.
lastBuiltEndpoint = endpointNode;
this.compUnit.addTopLevelNode(endpointNode);
} else {
endpointListStack.peek().add(endpointNode);
}
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createIndexBasedAccessNode.
public void createIndexBasedAccessNode(DiagnosticPos pos, Set<Whitespace> ws) {
BLangIndexBasedAccess indexBasedAccess = (BLangIndexBasedAccess) TreeBuilder.createIndexBasedAccessNode();
indexBasedAccess.pos = pos;
indexBasedAccess.addWS(ws);
indexBasedAccess.indexExpr = (BLangExpression) exprNodeStack.pop();
indexBasedAccess.expr = (BLangVariableReference) exprNodeStack.pop();
addExpressionNode(indexBasedAccess);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createFunctionInvocation.
public void createFunctionInvocation(DiagnosticPos pos, Set<Whitespace> ws, boolean argsAvailable) {
BLangInvocation invocationNode = (BLangInvocation) TreeBuilder.createInvocationNode();
invocationNode.pos = pos;
invocationNode.addWS(ws);
if (argsAvailable) {
List<ExpressionNode> exprNodes = exprNodeListStack.pop();
exprNodes.forEach(exprNode -> invocationNode.argExprs.add((BLangExpression) exprNode));
invocationNode.addWS(commaWsStack.pop());
}
BLangNameReference nameReference = nameReferenceStack.pop();
invocationNode.name = (BLangIdentifier) nameReference.name;
invocationNode.addWS(nameReference.ws);
invocationNode.pkgAlias = (BLangIdentifier) nameReference.pkgAlias;
addExpressionNode(invocationNode);
}
use of org.wso2.ballerinalang.compiler.tree.expressions.BLangExpression in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createXMLPILiteral.
public void createXMLPILiteral(DiagnosticPos pos, Set<Whitespace> ws, String targetQName, Stack<String> precedingTextFragments, String endingText) {
List<BLangExpression> dataExprs = getExpressionsInTemplate(pos, ws, precedingTextFragments, endingText, NodeKind.LITERAL);
addLiteralValue(pos, ws, TypeTags.STRING, targetQName);
BLangXMLProcInsLiteral xmlProcInsLiteral = (BLangXMLProcInsLiteral) TreeBuilder.createXMLProcessingIntsructionLiteralNode();
xmlProcInsLiteral.pos = pos;
xmlProcInsLiteral.dataFragments = dataExprs;
xmlProcInsLiteral.target = (BLangLiteral) exprNodeStack.pop();
;
addExpressionNode(xmlProcInsLiteral);
}
Aggregations