Module aya.base

Record Class ExprResolver

java.lang.Object
java.lang.Record
org.aya.resolve.visitor.ExprResolver
Record Components:
allowedGeneralizes - will be filled with generalized vars if allowGeneralized, and represents the allowed generalized level vars otherwise
All Implemented Interfaces:
Function<Expr,Expr>, UnaryOperator<Expr>, EndoExpr, EndoPattern

public record ExprResolver(@NotNull Context ctx, @NotNull ExprResolver.Options options, @NotNull kala.collection.mutable.MutableMap<GeneralizedVar,Expr.Param> allowedGeneralizes, @NotNull kala.collection.mutable.MutableList<TyckOrder> reference, @NotNull kala.collection.mutable.MutableStack<org.aya.resolve.visitor.ExprResolver.Where> where, @Nullable Consumer<TyckUnit> parentAdd) extends Record implements EndoExpr
Resolves bindings.
See Also:
Implementation Requirements:
allowedGeneralizes must be linked map
  • Field Details

  • Constructor Details

    • ExprResolver

      public ExprResolver(@NotNull @NotNull Context ctx, @NotNull @NotNull ExprResolver.Options options)
    • ExprResolver

      public ExprResolver(@NotNull @NotNull Context ctx, @NotNull @NotNull ExprResolver.Options options, @NotNull @NotNull kala.collection.mutable.MutableMap<GeneralizedVar,Expr.Param> allowedGeneralizes, @NotNull @NotNull kala.collection.mutable.MutableList<TyckOrder> reference, @NotNull @NotNull kala.collection.mutable.MutableStack<org.aya.resolve.visitor.ExprResolver.Where> where, @Nullable @Nullable Consumer<TyckUnit> parentAdd)
      Creates an instance of a ExprResolver record class.
      Parameters:
      ctx - the value for the ctx record component
      options - the value for the options record component
      allowedGeneralizes - the value for the allowedGeneralizes record component
      reference - the value for the reference record component
      where - the value for the where record component
      parentAdd - the value for the parentAdd record component
  • Method Details

    • enterHead

      public void enterHead()
    • enterBody

      public void enterBody()
    • enter

      @NotNull public @NotNull ExprResolver enter(Context ctx)
    • member

      @NotNull public @NotNull ExprResolver member(@NotNull @NotNull TyckUnit decl)
    • body

      @NotNull public @NotNull ExprResolver body()
    • pre

      @NotNull public @NotNull Expr pre(@NotNull @NotNull Expr expr)
      Specified by:
      pre in interface EndoExpr
    • apply

      @NotNull public @NotNull Expr apply(@NotNull @NotNull Expr expr)
      Special handling of terms with binding structure. We need to invoke a resolver with a different context under the binders.
      Specified by:
      apply in interface EndoExpr
      Specified by:
      apply in interface Function<Expr,Expr>
    • apply

      @NotNull public Pattern.Clause apply(@NotNull Pattern.Clause clause)
    • resolve

      @NotNull public static @NotNull Pattern resolve(@NotNull @NotNull Pattern pattern, @NotNull @NotNull kala.value.MutableValue<Context> ctx)
    • resolve

      @NotNull public Expr.Param resolve(@NotNull Expr.Param param, @NotNull @NotNull kala.value.MutableValue<Context> ctx)
    • resolve

      @NotNull public @NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind> resolve(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind> binds, @NotNull @NotNull kala.value.MutableValue<Context> ctx)
    • 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.
    • ctx

      @NotNull public @NotNull Context ctx()
      Returns the value of the ctx record component.
      Returns:
      the value of the ctx record component
    • options

      @NotNull public @NotNull ExprResolver.Options options()
      Returns the value of the options record component.
      Returns:
      the value of the options record component
    • allowedGeneralizes

      @NotNull public @NotNull kala.collection.mutable.MutableMap<GeneralizedVar,Expr.Param> allowedGeneralizes()
      Returns the value of the allowedGeneralizes record component.
      Returns:
      the value of the allowedGeneralizes record component
    • reference

      @NotNull public @NotNull kala.collection.mutable.MutableList<TyckOrder> reference()
      Returns the value of the reference record component.
      Returns:
      the value of the reference record component
    • where

      @NotNull public @NotNull kala.collection.mutable.MutableStack<org.aya.resolve.visitor.ExprResolver.Where> where()
      Returns the value of the where record component.
      Returns:
      the value of the where record component
    • parentAdd

      @Nullable public @Nullable Consumer<TyckUnit> parentAdd()
      Returns the value of the parentAdd record component.
      Returns:
      the value of the parentAdd record component