use of org.wso2.ballerinalang.compiler.tree.BLangIdentifier in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createXMLQName.
public void createXMLQName(DiagnosticPos pos, Set<Whitespace> ws, String localname, String prefix) {
BLangXMLQName qname = (BLangXMLQName) TreeBuilder.createXMLQNameNode();
qname.localname = (BLangIdentifier) createIdentifier(localname);
qname.prefix = (BLangIdentifier) createIdentifier(prefix);
qname.pos = pos;
qname.addWS(ws);
addExpressionNode(qname);
}
use of org.wso2.ballerinalang.compiler.tree.BLangIdentifier in project ballerina by ballerina-lang.
the class BLangPackageBuilder method createInvocationNode.
public void createInvocationNode(DiagnosticPos pos, Set<Whitespace> ws, String invocation, boolean argsAvailable) {
BLangInvocation invocationNode = (BLangInvocation) TreeBuilder.createInvocationNode();
invocationNode.pos = pos;
invocationNode.addWS(ws);
invocationNode.addWS(invocationWsStack.pop());
if (argsAvailable) {
List<ExpressionNode> exprNodes = exprNodeListStack.pop();
exprNodes.forEach(exprNode -> invocationNode.argExprs.add((BLangExpression) exprNode));
invocationNode.addWS(commaWsStack.pop());
}
invocationNode.expr = (BLangVariableReference) exprNodeStack.pop();
invocationNode.name = (BLangIdentifier) createIdentifier(invocation);
invocationNode.pkgAlias = (BLangIdentifier) createIdentifier(null);
addExpressionNode(invocationNode);
}
use of org.wso2.ballerinalang.compiler.tree.BLangIdentifier in project ballerina by ballerina-lang.
the class BLangPackageBuilder method endEnumDef.
public void endEnumDef(String identifier, boolean publicEnum) {
BLangEnum enumNode = (BLangEnum) this.enumStack.pop();
enumNode.name = (BLangIdentifier) this.createIdentifier(identifier);
if (publicEnum) {
enumNode.flagSet.add(Flag.PUBLIC);
}
enumeratorList.forEach(enumNode::addEnumerator);
this.compUnit.addTopLevelNode(enumNode);
enumeratorList = new ArrayList<>();
}
use of org.wso2.ballerinalang.compiler.tree.BLangIdentifier in project ballerina by ballerina-lang.
the class BLangPackageBuilder method setPackageDeclaration.
public void setPackageDeclaration(DiagnosticPos pos, Set<Whitespace> ws, List<String> nameComps, String version) {
List<BLangIdentifier> pkgNameComps = new ArrayList<>();
nameComps.forEach(e -> pkgNameComps.add((BLangIdentifier) this.createIdentifier(e)));
BLangIdentifier versionNode = (BLangIdentifier) this.createIdentifier(version);
BLangPackageDeclaration pkgDcl = (BLangPackageDeclaration) TreeBuilder.createPackageDeclarationNode();
pkgDcl.pos = pos;
// TODO: orgname is null, fix it.
pkgDcl.addWS(ws);
pkgDcl.pkgNameComps = pkgNameComps;
pkgDcl.version = versionNode;
this.compUnit.addTopLevelNode(pkgDcl);
}
use of org.wso2.ballerinalang.compiler.tree.BLangIdentifier in project ballerina by ballerina-lang.
the class BLangPackageBuilder method addJoinCondition.
public void addJoinCondition(Set<Whitespace> ws, String joinType, List<String> workerNames, int joinCount) {
BLangForkJoin forkJoin = (BLangForkJoin) this.forkJoinNodesStack.peek();
forkJoin.joinedWorkerCount = joinCount;
forkJoin.joinType = ForkJoinNode.JoinType.valueOf(joinType);
forkJoin.addWS(ws);
workerNames.forEach(s -> forkJoin.joinedWorkers.add((BLangIdentifier) createIdentifier(s)));
}
Aggregations