Search in sources :

Example 6 with SymbolTable

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

the class ParserUtils method loadBuiltInPackage.

/**
 * Loading builtin packages.
 *
 * @param context compiler context
 * @return {BLangPackage} builtIn package
 */
private static BLangPackage loadBuiltInPackage(CompilerContext context) {
    PackageLoader pkgLoader = PackageLoader.getInstance(context);
    SymbolTable symbolTable = SymbolTable.getInstance(context);
    SemanticAnalyzer semAnalyzer = SemanticAnalyzer.getInstance(context);
    CodeAnalyzer codeAnalyzer = CodeAnalyzer.getInstance(context);
    Desugar desugar = Desugar.getInstance(context);
    BLangPackage builtInPkg = desugar.perform(codeAnalyzer.analyze(semAnalyzer.analyze(pkgLoader.loadAndDefinePackage(Names.BUILTIN_ORG.getValue(), Names.BUILTIN_PACKAGE.getValue()))));
    symbolTable.builtInPackageSymbol = builtInPkg.symbol;
    return builtInPkg;
}
Also used : CodeAnalyzer(org.wso2.ballerinalang.compiler.semantics.analyzer.CodeAnalyzer) LSPackageLoader(org.ballerinalang.langserver.LSPackageLoader) PackageLoader(org.wso2.ballerinalang.compiler.PackageLoader) BLangPackage(org.wso2.ballerinalang.compiler.tree.BLangPackage) SymbolTable(org.wso2.ballerinalang.compiler.semantics.model.SymbolTable) Desugar(org.wso2.ballerinalang.compiler.desugar.Desugar) SemanticAnalyzer(org.wso2.ballerinalang.compiler.semantics.analyzer.SemanticAnalyzer)

Aggregations

SymbolTable (org.wso2.ballerinalang.compiler.semantics.model.SymbolTable)4 ArrayList (java.util.ArrayList)2 BTypeSymbol (org.wso2.ballerinalang.compiler.semantics.model.symbols.BTypeSymbol)2 BInvokableType (org.wso2.ballerinalang.compiler.semantics.model.types.BInvokableType)2 BType (org.wso2.ballerinalang.compiler.semantics.model.types.BType)2 BLangPackage (org.wso2.ballerinalang.compiler.tree.BLangPackage)2 Arrays (java.util.Arrays)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 Token (org.antlr.v4.runtime.Token)1 TokenStream (org.antlr.v4.runtime.TokenStream)1 SymbolInformation (org.ballerinalang.composer.service.ballerina.parser.service.model.SymbolInformation)1 DocumentServiceKeys (org.ballerinalang.langserver.DocumentServiceKeys)1 LSPackageLoader (org.ballerinalang.langserver.LSPackageLoader)1 TextDocumentServiceContext (org.ballerinalang.langserver.TextDocumentServiceContext)1 UtilSymbolKeys (org.ballerinalang.langserver.common.UtilSymbolKeys)1 CommonUtil (org.ballerinalang.langserver.common.utils.CommonUtil)1 CompletionKeys (org.ballerinalang.langserver.completions.CompletionKeys)1