java.lang.Object
java.lang.Record
org.aya.resolve.visitor.ExprResolver
- Record Components:
allowedGeneralizes- will be filled with generalized vars ifExprResolver.Options.allowIntroduceGeneralized, 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<ExprResolver.Where> where, @Nullable Consumer<TyckUnit> parentAdd)
extends Record
implements EndoExpr
Resolves bindings.
- See Also:
- Implementation Requirements:
- allowedGeneralizes must be linked map
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final @NotNull ExprResolver.Optionsstatic final @NotNull ExprResolver.Options -
Constructor Summary
ConstructorsConstructorDescriptionExprResolver(@NotNull Context ctx, @NotNull ExprResolver.Options options) 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<ExprResolver.Where> where, @Nullable Consumer<TyckUnit> parentAdd) Creates an instance of aExprResolverrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull kala.collection.mutable.MutableMap<GeneralizedVar,Expr.Param> Returns the value of theallowedGeneralizesrecord component.@NotNull ExprSpecial handling of terms with binding structure.apply(Pattern.Clause clause) @NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind>bind(@NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind> binds, @NotNull kala.value.MutableValue<Context> ctx) @NotNull Patternbind(Expr.Param param, @NotNull kala.value.MutableValue<Context> ctx) @NotNull Contextctx()Returns the value of thectxrecord component.@NotNull ExprResolvervoid@NotNull ExprResolverGetting anExprResolverthat resolves the rhs of clauses.voidfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull ExprResolvermember(@NotNull TyckUnit decl, ExprResolver.Where initial) @NotNull ExprResolver.Optionsoptions()Returns the value of theoptionsrecord component.Returns the value of theparentAddrecord component.@NotNull Expr@NotNull kala.collection.mutable.MutableList<TyckOrder>Returns the value of thereferencerecord component.final StringtoString()Returns a string representation of this record class.@NotNull kala.collection.mutable.MutableStack<ExprResolver.Where>where()Returns the value of thewhererecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.aya.concrete.visitor.EndoPattern
apply, post, pre
-
Field Details
-
RESTRICTIVE
-
LAX
-
-
Constructor Details
-
ExprResolver
-
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<ExprResolver.Where> where, @Nullable @Nullable Consumer<TyckUnit> parentAdd) Creates an instance of aExprResolverrecord class.- Parameters:
ctx- the value for thectxrecord componentoptions- the value for theoptionsrecord componentallowedGeneralizes- the value for theallowedGeneralizesrecord componentreference- the value for thereferencerecord componentwhere- the value for thewhererecord componentparentAdd- the value for theparentAddrecord component
-
-
Method Details
-
enterHead
public void enterHead() -
enterBody
public void enterBody() -
enter
-
member
@NotNull public @NotNull ExprResolver member(@NotNull @NotNull TyckUnit decl, ExprResolver.Where initial) -
enterClauses
Getting anExprResolverthat resolves the rhs of clauses. -
pre
-
apply
Special handling of terms with binding structure. We need to invoke a resolver with a different context under the binders. -
apply
-
bind
-
bind
@NotNull public Expr.Param bind(@NotNull Expr.Param param, @NotNull @NotNull kala.value.MutableValue<Context> ctx) -
bind
@NotNull public @NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind> bind(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<Expr.DoBind> binds, @NotNull @NotNull kala.value.MutableValue<Context> ctx) -
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
ctx
Returns the value of thectxrecord component.- Returns:
- the value of the
ctxrecord component
-
options
Returns the value of theoptionsrecord component.- Returns:
- the value of the
optionsrecord component
-
allowedGeneralizes
@NotNull public @NotNull kala.collection.mutable.MutableMap<GeneralizedVar,Expr.Param> allowedGeneralizes()Returns the value of theallowedGeneralizesrecord component.- Returns:
- the value of the
allowedGeneralizesrecord component
-
reference
Returns the value of thereferencerecord component.- Returns:
- the value of the
referencerecord component
-
where
Returns the value of thewhererecord component.- Returns:
- the value of the
whererecord component
-
parentAdd
Returns the value of theparentAddrecord component.- Returns:
- the value of the
parentAddrecord component
-