Module aya.base

Interface Context

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

public interface Context extends Problematic
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default @NotNull Context
    bind(@NotNull String name, @NotNull org.aya.syntax.ref.LocalVar ref, @NotNull Predicate<@Nullable org.aya.syntax.ref.AnyVar> toWarn)
     
    default @NotNull Context
    bind(@NotNull org.aya.syntax.ref.LocalVar ref)
     
    default @NotNull Context
    bind(@NotNull org.aya.syntax.ref.LocalVar ref, @NotNull Predicate<@Nullable org.aya.syntax.ref.AnyVar> toWarn)
     
    default kala.collection.mutable.MutableList<org.aya.syntax.ref.LocalVar>
    collect(@NotNull kala.collection.mutable.MutableList<org.aya.syntax.ref.LocalVar> container)
     
    default @NotNull PhysicalModuleContext
    derive(@NotNull String extraName)
     
    default @NotNull PhysicalModuleContext
    derive(@NotNull org.aya.syntax.ref.ModulePath extraName)
     
    default @NotNull org.aya.syntax.ref.AnyVar
    get(@NotNull org.aya.syntax.concrete.stmt.QualifiedID name)
    Getting a symbol by name .
    default @Nullable org.aya.syntax.ref.AnyVar
    getMaybe(@NotNull org.aya.syntax.concrete.stmt.QualifiedID name)
     
    @Nullable ModuleExport
    getModuleLocalMaybe(org.aya.syntax.concrete.stmt.ModuleName.Qualified modName)
    Trying to get a ModuleExport by a module in this context.
    default @Nullable ModuleExport
    getModuleMaybe(org.aya.syntax.concrete.stmt.ModuleName.Qualified modName)
    Trying to get a ModuleExport by a module in the whole context.
    default @NotNull org.aya.syntax.ref.AnyVar
    getQualified(org.aya.syntax.concrete.stmt.ModuleName.Qualified modName, @NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos)
     
    @Nullable org.aya.syntax.ref.AnyVar
    getQualifiedLocalMaybe(org.aya.syntax.concrete.stmt.ModuleName.Qualified modName, @NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos)
    Trying to get a symbol by qualified id {modName}::{name} in this context
    default @Nullable org.aya.syntax.ref.AnyVar
    getQualifiedMaybe(org.aya.syntax.concrete.stmt.ModuleName.Qualified modName, @NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos)
    Trying to get a symbol by qualified id {modName}::{name} in the whole context with .
    default @NotNull org.aya.syntax.ref.AnyVar
    getUnqualified(@NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos)
     
    @Nullable org.aya.syntax.ref.AnyVar
    getUnqualifiedLocalMaybe(@NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos)
    Trying to get a symbol by unqualified name in this context.
    default @Nullable org.aya.syntax.ref.AnyVar
    getUnqualifiedMaybe(@NotNull String name, @NotNull org.aya.util.error.SourcePos sourcePos)
    Trying to get a symbol which can referred by unqualified name in the whole context.
    default <T> T
    iterate(@NotNull Function<@NotNull Context,@Nullable T> f)
     
    default @NotNull org.aya.syntax.ref.ModulePath
    The path of this module
    @Nullable Context
     
    default void
    reportAll(@NotNull kala.collection.SeqLike<org.aya.util.reporter.Problem> problems)
     
    default <T> T
    reportAllAndThrow(@NotNull kala.collection.SeqLike<org.aya.util.reporter.Problem> problems)
     
    default <T> T
    reportAndThrow(@NotNull org.aya.util.reporter.Problem problem)
     
    @NotNull org.aya.util.reporter.Reporter
     
    @NotNull Path
     

    Methods inherited from interface org.aya.tyck.tycker.Problematic

    fail, fail, fail
  • Method Details

    • parent

      @Nullable @Nullable Context parent()
    • reporter

      @NotNull @NotNull org.aya.util.reporter.Reporter reporter()
      Specified by:
      reporter in interface Problematic
    • underlyingFile

      @NotNull @NotNull Path underlyingFile()
    • iterate

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

      @NotNull default @NotNull org.aya.syntax.ref.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 org.aya.syntax.ref.AnyVar get(@NotNull @NotNull org.aya.syntax.concrete.stmt.QualifiedID name)
      Getting a symbol by name .
      Parameters:
      name - an id which probably unqualified
    • getMaybe

      @Nullable default @Nullable org.aya.syntax.ref.AnyVar getMaybe(@NotNull @NotNull org.aya.syntax.concrete.stmt.QualifiedID name)
      See Also:
    • collect

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

      @Nullable @Nullable org.aya.syntax.ref.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 org.aya.syntax.ref.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 org.aya.syntax.ref.AnyVar getUnqualified(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      See Also:
    • getQualifiedLocalMaybe

      @Nullable @Nullable org.aya.syntax.ref.AnyVar getQualifiedLocalMaybe(@NotNull org.aya.syntax.concrete.stmt.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 org.aya.syntax.ref.AnyVar getQualifiedMaybe(@NotNull org.aya.syntax.concrete.stmt.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 org.aya.syntax.ref.AnyVar getQualified(@NotNull org.aya.syntax.concrete.stmt.ModuleName.Qualified modName, @NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      See Also:
    • getModuleLocalMaybe

      @Nullable @Nullable ModuleExport getModuleLocalMaybe(@NotNull org.aya.syntax.concrete.stmt.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 org.aya.syntax.concrete.stmt.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 org.aya.syntax.ref.LocalVar ref, @NotNull @NotNull Predicate<@Nullable org.aya.syntax.ref.AnyVar> toWarn)
    • bind

      @NotNull default @NotNull Context bind(@NotNull @NotNull org.aya.syntax.ref.LocalVar ref)
    • bind

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

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

      @NotNull default @NotNull PhysicalModuleContext derive(@NotNull @NotNull org.aya.syntax.ref.ModulePath extraName)