Module aya.base

Interface Context

All Known Subinterfaces:
ModuleContext
All Known Implementing Classes:
BindContext, EmptyContext, NoExportContext, PhysicalModuleContext

public interface Context
  • Method Details

    • parent

      @Nullable @Nullable Context parent()
    • reporter

      @NotNull @NotNull org.aya.util.reporter.Reporter reporter()
    • underlyingFile

      @NotNull @NotNull Path underlyingFile()
    • iterate

      @Nullable default <T> T iterate(@NotNull @NotNull Function<@NotNull Context,@Nullable T> f)
    • modulePath

      @NotNull default @NotNull ModulePath modulePath()
      The path of this module
    • reportAndThrow

      @Contract("_ -> fail") @NotNull default <T> T reportAndThrow(@NotNull @NotNull org.aya.util.reporter.Problem problem)
    • reportAllAndThrow

      @Contract("_ -> fail") @NotNull default <T> T reportAllAndThrow(@NotNull @NotNull kala.collection.SeqLike<org.aya.util.reporter.Problem> problems)
    • reportAll

      default void reportAll(@NotNull @NotNull kala.collection.SeqLike<org.aya.util.reporter.Problem> problems)
    • get

      @NotNull default @NotNull AnyVar get(@NotNull @NotNull QualifiedID name)
      Getting a symbol by name .
      Parameters:
      name - an id which probably unqualified
    • getMaybe

      @Nullable default @Nullable AnyVar getMaybe(@NotNull @NotNull QualifiedID name)
      See Also:
    • collect

      default kala.collection.mutable.MutableList<LocalVar> collect(@NotNull @NotNull kala.collection.mutable.MutableList<LocalVar> container)
    • getUnqualifiedLocalMaybe

      @Nullable @Nullable AnyVar getUnqualifiedLocalMaybe(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      Trying to get a symbol by unqualified name in this context.
    • getUnqualifiedMaybe

      @Nullable default @Nullable AnyVar getUnqualifiedMaybe(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      Trying to get a symbol which can referred by unqualified name in the whole context.
      Parameters:
      name - the unqualified name
      sourcePos - the source pos for error reporting
      Returns:
      null if not found
      See Also:
    • getUnqualified

      @NotNull default @NotNull AnyVar getUnqualified(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      See Also:
    • getQualifiedLocalMaybe

      @Nullable @Nullable AnyVar getQualifiedLocalMaybe(@NotNull ModuleName.Qualified modName, @NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      Trying to get a symbol by qualified id {modName}::{name} in this context
      Returns:
      a symbol in component , even it is ModuleName.This; null if not found
    • getQualifiedMaybe

      @Nullable default @Nullable AnyVar getQualifiedMaybe(@NotNull ModuleName.Qualified modName, @NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      Trying to get a symbol by qualified id {modName}::{name} in the whole context with .
      See Also:
    • getQualified

      @NotNull default @NotNull AnyVar getQualified(@NotNull ModuleName.Qualified modName, @NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      See Also:
    • getModuleLocalMaybe

      @Nullable @Nullable ModuleExport getModuleLocalMaybe(@NotNull ModuleName.Qualified modName)
      Trying to get a ModuleExport by a module in this context.
      Parameters:
      modName - qualified module name
      Returns:
      a ModuleExport of that module; null if no such module.
    • getModuleMaybe

      @Nullable default @Nullable ModuleExport getModuleMaybe(@NotNull ModuleName.Qualified modName)
      Trying to get a ModuleExport by a module in the whole context.
      Parameters:
      modName - qualified module name
      Returns:
      a ModuleExport of that module; null if no such module.
    • bind

      @NotNull default @NotNull Context bind(@NotNull @NotNull LocalVar ref, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos, @NotNull @NotNull Predicate<@Nullable AnyVar> toWarn)
    • bind

      @NotNull default @NotNull Context bind(@NotNull @NotNull LocalVar ref, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
    • bind

      @NotNull default @NotNull Context bind(@NotNull @NotNull String name, @NotNull @NotNull LocalVar ref, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos, @NotNull @NotNull Predicate<@Nullable AnyVar> toWarn)
    • derive

      @NotNull default @NotNull PhysicalModuleContext derive(@NotNull @NotNull String extraName)
    • derive

      @NotNull default @NotNull PhysicalModuleContext derive(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<@NotNull String> extraName)