use of org.wso2.ballerinalang.compiler.tree.BLangNameReference in project ballerina by ballerina-lang.
the class BLangPackageBuilder method setAnnotationAttachmentName.
public void setAnnotationAttachmentName(Set<Whitespace> ws, boolean hasExpr, DiagnosticPos currentPos, boolean popAnnAttachment) {
BLangNameReference nameReference = nameReferenceStack.pop();
BLangAnnotationAttachment bLangAnnotationAttachment = (BLangAnnotationAttachment) annotAttachmentStack.peek();
bLangAnnotationAttachment.pos = currentPos;
bLangAnnotationAttachment.addWS(nameReference.ws);
bLangAnnotationAttachment.addWS(ws);
bLangAnnotationAttachment.setAnnotationName(nameReference.name);
bLangAnnotationAttachment.setPackageAlias(nameReference.pkgAlias);
if (hasExpr) {
bLangAnnotationAttachment.setExpression(exprNodeStack.pop());
}
if (popAnnAttachment) {
annotAttachmentStack.pop();
}
}
use of org.wso2.ballerinalang.compiler.tree.BLangNameReference in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addUserDefineType.
public void addUserDefineType(Set<Whitespace> ws) {
BLangNameReference nameReference = nameReferenceStack.pop();
BLangUserDefinedType userDefinedType = createUserDefinedType(nameReference.pos, ws, (BLangIdentifier) nameReference.pkgAlias, (BLangIdentifier) nameReference.name);
userDefinedType.addWS(nameReference.ws);
addType(userDefinedType);
}
use of org.wso2.ballerinalang.compiler.tree.BLangNameReference in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addServiceEndpointAttachments.
public void addServiceEndpointAttachments(int size, Set<Whitespace> ws) {
ServiceNode serviceNode = serviceNodeStack.peek();
serviceNode.addWS(ws);
for (int i = 0; i < size; i++) {
BLangNameReference nameReference = nameReferenceStack.pop();
BLangSimpleVarRef varRef = (BLangSimpleVarRef) TreeBuilder.createSimpleVariableReferenceNode();
varRef.pos = nameReference.pos;
varRef.addWS(nameReference.ws);
varRef.pkgAlias = (BLangIdentifier) nameReference.pkgAlias;
varRef.variableName = (BLangIdentifier) nameReference.name;
serviceNode.bindToEndpoint(varRef);
}
}
use of org.wso2.ballerinalang.compiler.tree.BLangNameReference in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createActionInvocationNode.
public void createActionInvocationNode(DiagnosticPos pos, Set<Whitespace> ws, boolean async) {
BLangInvocation invocationExpr = (BLangInvocation) exprNodeStack.pop();
invocationExpr.actionInvocation = true;
invocationExpr.pos = pos;
invocationExpr.addWS(ws);
invocationExpr.async = async;
BLangNameReference nameReference = nameReferenceStack.pop();
BLangSimpleVarRef varRef = (BLangSimpleVarRef) TreeBuilder.createSimpleVariableReferenceNode();
varRef.pos = nameReference.pos;
varRef.addWS(nameReference.ws);
varRef.pkgAlias = (BLangIdentifier) nameReference.pkgAlias;
varRef.variableName = (BLangIdentifier) nameReference.name;
invocationExpr.expr = varRef;
exprNodeStack.push(invocationExpr);
}
use of org.wso2.ballerinalang.compiler.tree.BLangNameReference in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createSimpleVariableReference.
public void createSimpleVariableReference(DiagnosticPos pos, Set<Whitespace> ws) {
BLangNameReference nameReference = nameReferenceStack.pop();
BLangSimpleVarRef varRef = (BLangSimpleVarRef) TreeBuilder.createSimpleVariableReferenceNode();
varRef.pos = pos;
varRef.addWS(ws);
varRef.addWS(nameReference.ws);
varRef.pkgAlias = (BLangIdentifier) nameReference.pkgAlias;
varRef.variableName = (BLangIdentifier) nameReference.name;
this.exprNodeStack.push(varRef);
}
Aggregations