Module aya.base

Class PhysicalModuleContext

java.lang.Object
org.aya.resolve.context.PhysicalModuleContext
All Implemented Interfaces:
Context, ModuleContext, Problematic

public non-sealed class PhysicalModuleContext extends Object implements ModuleContext
  • Field Details

    • parent

      @NotNull public final @NotNull Context parent
    • exports

      @NotNull public final @NotNull ModuleExport exports
    • symbols

      @NotNull public final @NotNull ModuleSymbol<org.aya.syntax.ref.AnyVar> symbols
    • modules

      @NotNull public final @NotNull kala.collection.mutable.MutableMap<org.aya.syntax.concrete.stmt.ModuleName.Qualified,ModuleExport> modules
  • Constructor Details

    • PhysicalModuleContext

      public PhysicalModuleContext(@NotNull @NotNull Context parent, @NotNull @NotNull org.aya.syntax.ref.ModulePath modulePath)
  • Method Details

    • modulePath

      @NotNull public @NotNull org.aya.syntax.ref.ModulePath modulePath()
      Description copied from interface: Context
      The path of this module
      Specified by:
      modulePath in interface Context
    • importModule

      public void importModule(@NotNull org.aya.syntax.concrete.stmt.ModuleName.Qualified modName, @NotNull @NotNull ModuleExport modExport, @NotNull org.aya.syntax.concrete.stmt.Stmt.Accessibility accessibility, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      Description copied from interface: ModuleContext
      Importing one module export.
      Specified by:
      importModule in interface ModuleContext
      Parameters:
      modName - the name of the module
      modExport - the module
      accessibility - of importing, re-export if public
    • exportSymbol

      public boolean exportSymbol(@NotNull @NotNull org.aya.syntax.concrete.stmt.ModuleName modName, @NotNull @NotNull String name, @NotNull @NotNull org.aya.syntax.ref.AnyDefVar ref)
      Description copied from interface: ModuleContext
      Exporting an AnyVar with qualified id {modName}::{name}
      Specified by:
      exportSymbol in interface ModuleContext
      Returns:
      true if exported successfully, otherwise (when there already exist a symbol with the same name) false.
    • exampleContext

      @NotNull public @NotNull NoExportContext exampleContext()
    • parent

      @NotNull public @NotNull Context parent()
      Specified by:
      parent in interface Context
      Specified by:
      parent in interface ModuleContext
    • symbols

      @NotNull public @NotNull ModuleSymbol<org.aya.syntax.ref.AnyVar> symbols()
      Description copied from interface: ModuleContext
      All available symbols in this context
      Specified by:
      symbols in interface ModuleContext
    • modules

      @NotNull public @NotNull kala.collection.mutable.MutableMap<org.aya.syntax.concrete.stmt.ModuleName.Qualified,ModuleExport> modules()
      Description copied from interface: ModuleContext
      All imported modules in this context.
      Qualified Module -> Module Export
      Specified by:
      modules in interface ModuleContext
    • exports

      @NotNull public @NotNull ModuleExport exports()
      Description copied from interface: ModuleContext
      Things (symbol or module) that are exported by this module.
      Specified by:
      exports in interface ModuleContext