Search in sources :

Example 16 with BPackageSymbol

use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol in project ballerina by ballerina-lang.

the class CodeGenerator method generateBALX.

public ProgramFile generateBALX(BLangPackage pkgNode) {
    programFile = new ProgramFile();
    // TODO: Fix this. Added temporally for codegen. Load this from VM side.
    genPackage(this.symTable.builtInPackageSymbol);
    // Normal Flow.
    BPackageSymbol pkgSymbol = pkgNode.symbol;
    genPackage(pkgSymbol);
    programFile.entryPkgCPIndex = addPackageRefCPEntry(programFile, pkgSymbol.pkgID);
    setEntryPoints(programFile, pkgNode);
    // Add global variable indexes to the ProgramFile
    prepareIndexes(pvIndexes);
    // Create Global variable attribute info
    addVarCountAttrInfo(programFile, programFile, pvIndexes);
    return programFile;
}
Also used : BPackageSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol) ProgramFile(org.wso2.ballerinalang.programfile.CompiledBinaryFile.ProgramFile)

Example 17 with BPackageSymbol

use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol in project ballerina by ballerina-lang.

the class CodeGenerator method visit.

public void visit(BLangImportPackage importPkgNode) {
    BPackageSymbol pkgSymbol = importPkgNode.symbol;
    genPackage(pkgSymbol);
}
Also used : BPackageSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol)

Example 18 with BPackageSymbol

use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol in project ballerina by ballerina-lang.

the class Desugar method visit.

@Override
public void visit(BLangImportPackage importPkgNode) {
    BPackageSymbol pkgSymbol = importPkgNode.symbol;
    SymbolEnv pkgEnv = this.symTable.pkgEnvMap.get(pkgSymbol);
    rewrite(pkgEnv.node, pkgEnv);
    result = importPkgNode;
}
Also used : BPackageSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol) SymbolEnv(org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv)

Example 19 with BPackageSymbol

use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol in project ballerina by ballerina-lang.

the class IterableCodeDesugar method defineFunction.

private void defineFunction(BLangFunction funcNode, BLangPackage targetPkg) {
    final BPackageSymbol packageSymbol = targetPkg.symbol;
    final SymbolEnv packageEnv = this.symTable.pkgEnvMap.get(packageSymbol);
    symbolEnter.defineNode(funcNode, packageEnv);
    packageEnv.enclPkg.functions.add(funcNode);
    packageEnv.enclPkg.topLevelNodes.add(funcNode);
}
Also used : BPackageSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol) SymbolEnv(org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv)

Example 20 with BPackageSymbol

use of org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol in project ballerina by ballerina-lang.

the class TreeVisitor method visit.

public void visit(BLangImportPackage importPkgNode) {
    BPackageSymbol pkgSymbol = importPkgNode.symbol;
    SymbolEnv pkgEnv = symTable.pkgEnvMap.get(pkgSymbol);
    acceptNode(pkgEnv.node, pkgEnv);
}
Also used : BPackageSymbol(org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol) SymbolEnv(org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv)

Aggregations

BPackageSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BPackageSymbol)24 SymbolEnv (org.wso2.ballerinalang.compiler.semantics.model.SymbolEnv)11 ArrayList (java.util.ArrayList)8 SymbolInfo (org.ballerinalang.langserver.completions.SymbolInfo)6 BInvokableSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BInvokableSymbol)6 BSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BSymbol)6 BTypeSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BTypeSymbol)5 BLangXMLQName (org.wso2.ballerinalang.compiler.tree.expressions.BLangXMLQName)4 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 TokenStream (org.antlr.v4.runtime.TokenStream)3 PackageActionFunctionAndTypesFilter (org.ballerinalang.langserver.completions.util.filters.PackageActionFunctionAndTypesFilter)3 SymbolKind (org.ballerinalang.model.symbols.SymbolKind)3 Scope (org.wso2.ballerinalang.compiler.semantics.model.Scope)3 BType (org.wso2.ballerinalang.compiler.semantics.model.types.BType)3 Name (org.wso2.ballerinalang.compiler.util.Name)3 Arrays (java.util.Arrays)2 Map (java.util.Map)2 Token (org.antlr.v4.runtime.Token)2 DocumentServiceKeys (org.ballerinalang.langserver.DocumentServiceKeys)2