use of org.wso2.ballerinalang.compiler.tree.BLangPackageDeclaration 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);
}
Aggregations