use of org.wso2.ballerinalang.compiler.tree.statements.BLangXMLNSStatement in project ballerina by ballerina-lang.
the class SymbolEnter method createNamespaceDeclrStatement.
private BLangXMLNSStatement createNamespaceDeclrStatement(BLangXMLNS xmlns) {
BLangXMLNSStatement xmlnsStmt = (BLangXMLNSStatement) TreeBuilder.createXMLNSDeclrStatementNode();
xmlnsStmt.xmlnsDecl = xmlns;
xmlnsStmt.pos = xmlns.pos;
return xmlnsStmt;
}
use of org.wso2.ballerinalang.compiler.tree.statements.BLangXMLNSStatement in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addXMLNSDeclaration.
public void addXMLNSDeclaration(DiagnosticPos pos, Set<Whitespace> ws, String namespaceUri, String prefix, boolean isTopLevel) {
BLangXMLNS xmlns = (BLangXMLNS) TreeBuilder.createXMLNSNode();
BLangIdentifier prefixIdentifer = (BLangIdentifier) TreeBuilder.createIdentifierNode();
prefixIdentifer.pos = pos;
prefixIdentifer.value = prefix;
addLiteralValue(pos, removeNthFromStart(ws, 1), TypeTags.STRING, namespaceUri);
xmlns.namespaceURI = (BLangLiteral) exprNodeStack.pop();
xmlns.prefix = prefixIdentifer;
xmlns.pos = pos;
xmlns.addWS(ws);
if (isTopLevel) {
this.compUnit.addTopLevelNode(xmlns);
return;
}
BLangXMLNSStatement xmlnsStmt = (BLangXMLNSStatement) TreeBuilder.createXMLNSDeclrStatementNode();
xmlnsStmt.xmlnsDecl = xmlns;
xmlnsStmt.pos = pos;
addStmtToCurrentBlock(xmlnsStmt);
}
Aggregations