use of org.wso2.ballerinalang.compiler.tree.BLangIdentifier 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.BLangIdentifier 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.BLangIdentifier in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addAnonObjectType.
public void addAnonObjectType(DiagnosticPos pos, Set<Whitespace> ws) {
// Generate a name for the anonymous struct
String genName = anonymousModelHelper.getNextAnonymousStructKey(pos.src.pkgID);
IdentifierNode anonStructGenName = createIdentifier(genName);
// Create an anonymous struct and add it to the list of structs in the current package.
BLangStruct structNode = populateStructNode(pos, ws, anonStructGenName, true);
this.compUnit.addTopLevelNode(structNode);
addType(createUserDefinedType(pos, ws, (BLangIdentifier) TreeBuilder.createIdentifierNode(), structNode.name));
}
use of org.wso2.ballerinalang.compiler.tree.BLangIdentifier 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.BLangIdentifier 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