use of org.wso2.ballerinalang.compiler.tree.BLangXMLNS.BLangPackageXMLNS in project ballerina by ballerina-lang.
the class Desugar method visit.
@Override
public void visit(BLangXMLNS xmlnsNode) {
BLangXMLNS generatedXMLNSNode;
xmlnsNode.namespaceURI = rewriteExpr(xmlnsNode.namespaceURI);
BSymbol ownerSymbol = xmlnsNode.symbol.owner;
// Local namespace declaration in a function/resource/action/worker
if ((ownerSymbol.tag & SymTag.INVOKABLE) == SymTag.INVOKABLE) {
generatedXMLNSNode = new BLangLocalXMLNS();
} else {
generatedXMLNSNode = new BLangPackageXMLNS();
}
generatedXMLNSNode.namespaceURI = xmlnsNode.namespaceURI;
generatedXMLNSNode.prefix = xmlnsNode.prefix;
generatedXMLNSNode.symbol = xmlnsNode.symbol;
result = generatedXMLNSNode;
}
use of org.wso2.ballerinalang.compiler.tree.BLangXMLNS.BLangPackageXMLNS in project ballerina by ballerina-lang.
the class CodeGenerator method visit.
@Override
public void visit(BLangPackageXMLNS xmlnsNode) {
BLangExpression nsURIExpr = xmlnsNode.namespaceURI;
Operand pvIndex = getPVIndex(TypeTags.STRING);
BXMLNSSymbol nsSymbol = (BXMLNSSymbol) xmlnsNode.symbol;
genNode(nsURIExpr, env);
nsSymbol.nsURIIndex = pvIndex;
emit(InstructionCodes.SGSTORE, nsURIExpr.regIndex, pvIndex);
}
Aggregations