Module aya.base

Record Class BindContext

java.lang.Object
java.lang.Record
org.aya.resolve.context.BindContext
All Implemented Interfaces:
Context, Problematic

public record BindContext(@NotNull Context parent, @NotNull String name, @NotNull org.aya.syntax.ref.LocalVar ref) extends Record implements Context
Introduces a locally bound variable to the context.
  • Constructor Details

    • BindContext

      public BindContext(@NotNull @NotNull Context parent, @NotNull @NotNull String name, @NotNull @NotNull org.aya.syntax.ref.LocalVar ref)
      Creates an instance of a BindContext record class.
      Parameters:
      parent - the value for the parent record component
      name - the value for the name record component
      ref - the value for the ref record component
  • Method Details

    • parent

      @NotNull public @NotNull Context parent()
      Returns the value of the parent record component.
      Specified by:
      parent in interface Context
      Returns:
      the value of the parent record component
    • reporter

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

      @NotNull public @NotNull Path underlyingFile()
      Specified by:
      underlyingFile in interface Context
    • collect

      public kala.collection.mutable.MutableList<org.aya.syntax.ref.LocalVar> collect(@NotNull @NotNull kala.collection.mutable.MutableList<org.aya.syntax.ref.LocalVar> container)
      Specified by:
      collect in interface Context
    • getUnqualifiedLocalMaybe

      @Nullable public @Nullable org.aya.syntax.ref.LocalVar getUnqualifiedLocalMaybe(@NotNull @NotNull String name, @NotNull @NotNull org.aya.util.error.SourcePos sourcePos)
      Description copied from interface: Context
      Trying to get a symbol by unqualified name in this context.
      Specified by:
      getUnqualifiedLocalMaybe in interface Context
    • getQualifiedLocalMaybe

      @Nullable public @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)
      Description copied from interface: Context
      Trying to get a symbol by qualified id {modName}::{name} in this context
      Specified by:
      getQualifiedLocalMaybe in interface Context
      Returns:
      a symbol in component , even it is ModuleName.This; null if not found
    • getModuleLocalMaybe

      @Nullable public @Nullable ModuleExport getModuleLocalMaybe(@NotNull org.aya.syntax.concrete.stmt.ModuleName.Qualified modName)
      Description copied from interface: Context
      Trying to get a ModuleExport by a module in this context.
      Specified by:
      getModuleLocalMaybe in interface Context
      Parameters:
      modName - qualified module name
      Returns:
      a ModuleExport of that module; null if no such module.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      @NotNull public @NotNull String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • ref

      @NotNull public @NotNull org.aya.syntax.ref.LocalVar ref()
      Returns the value of the ref record component.
      Returns:
      the value of the ref record component