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:
BiFunction<org.aya.util.error.SourcePos,,org.aya.syntax.concrete.Expr, org.aya.syntax.concrete.Expr> org.aya.util.error.PosedUnaryOperator<org.aya.syntax.concrete.Expr>
public record ExprResolver(@NotNull Context ctx, @NotNull ExprResolver.Options options, @NotNull kala.collection.mutable.MutableMap<org.aya.syntax.ref.GeneralizedVar,org.aya.syntax.concrete.Expr.Param> allowedGeneralizes, @NotNull kala.collection.mutable.MutableList<org.aya.generic.stmt.TyckOrder> reference, @NotNull kala.collection.mutable.MutableStack<ExprResolver.Where> where)
extends Record
implements org.aya.util.error.PosedUnaryOperator<org.aya.syntax.concrete.Expr>
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<org.aya.syntax.ref.GeneralizedVar, org.aya.syntax.concrete.Expr.Param> allowedGeneralizes, @NotNull kala.collection.mutable.MutableList<org.aya.generic.stmt.TyckOrder> reference, @NotNull kala.collection.mutable.MutableStack<ExprResolver.Where> where) Creates an instance of aExprResolverrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull kala.collection.mutable.MutableMap<org.aya.syntax.ref.GeneralizedVar, org.aya.syntax.concrete.Expr.Param> Returns the value of theallowedGeneralizesrecord component.@NotNull org.aya.syntax.concrete.Exprapply(@NotNull org.aya.util.error.SourcePos pos, @NotNull org.aya.syntax.concrete.Expr expr) Special handling of terms with binding structure.@NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.concrete.Expr.DoBind> bind(@NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.concrete.Expr.DoBind> binds, @NotNull kala.value.MutableValue<Context> ctx) org.aya.syntax.concrete.Expr.Paramorg.aya.syntax.concrete.Pattern.Clauseclause(org.aya.syntax.concrete.Pattern.Clause clause) @NotNull Contextctx()Returns the value of thectxrecord component.@NotNull ExprResolverThe intended usage is to create anExprResolverthat resolves the body/bodies of something.@NotNull ExprResolvervoidenter(ExprResolver.Where loc) final booleanIndicates whether some other object is "equal to" this one.voidexit()final inthashCode()Returns a hash code value for this object.@NotNull ExprResolver.Optionsoptions()Returns the value of theoptionsrecord component.@NotNull org.aya.syntax.concrete.Exprpre(@NotNull org.aya.syntax.concrete.Expr expr) @NotNull kala.collection.mutable.MutableList<org.aya.generic.stmt.TyckOrder> Returns the value of thereferencerecord component.voidstatic org.aya.util.error.WithPos<org.aya.syntax.concrete.Expr> resolveLax(@NotNull ModuleContext context, @NotNull org.aya.util.error.WithPos<org.aya.syntax.concrete.Expr> expr) Do !!!NOT!!! use in the type checker.@NotNull org.aya.util.error.WithPos<org.aya.syntax.concrete.Pattern> resolvePattern(@NotNull org.aya.util.error.WithPos<org.aya.syntax.concrete.Pattern> pattern, kala.value.MutableValue<Context> ctx) 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 java.util.function.BiFunction
andThenMethods inherited from interface org.aya.util.error.PosedUnaryOperator
apply, forceApply
-
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<org.aya.syntax.ref.GeneralizedVar, org.aya.syntax.concrete.Expr.Param> allowedGeneralizes, @NotNull @NotNull kala.collection.mutable.MutableList<org.aya.generic.stmt.TyckOrder> reference, @NotNull @NotNull kala.collection.mutable.MutableStack<ExprResolver.Where> where) 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 component
-
-
Method Details
-
resolveLax
@Contract(pure=true) public static org.aya.util.error.WithPos<org.aya.syntax.concrete.Expr> resolveLax(@NotNull @NotNull ModuleContext context, @NotNull @NotNull org.aya.util.error.WithPos<org.aya.syntax.concrete.Expr> expr) Do !!!NOT!!! use in the type checker. This is solely for cosmetic features, such as literate mode inline expressions, or repl. -
resetRefs
public void resetRefs() -
enter
-
exit
public void exit() -
enter
-
deriveRestrictive
The intended usage is to create anExprResolverthat resolves the body/bodies of something. -
pre
@NotNull public @NotNull org.aya.syntax.concrete.Expr pre(@NotNull @NotNull org.aya.syntax.concrete.Expr expr) -
apply
@NotNull public @NotNull org.aya.syntax.concrete.Expr apply(@NotNull @NotNull org.aya.util.error.SourcePos pos, @NotNull @NotNull org.aya.syntax.concrete.Expr expr) Special handling of terms with binding structure. We need to invoke a resolver with a different context under the binders.- Specified by:
applyin interfaceBiFunction<org.aya.util.error.SourcePos,org.aya.syntax.concrete.Expr, org.aya.syntax.concrete.Expr>
-
clause
@NotNull public org.aya.syntax.concrete.Pattern.Clause clause(@NotNull org.aya.syntax.concrete.Pattern.Clause clause) -
resolvePattern
@NotNull public @NotNull org.aya.util.error.WithPos<org.aya.syntax.concrete.Pattern> resolvePattern(@NotNull @NotNull org.aya.util.error.WithPos<org.aya.syntax.concrete.Pattern> pattern, kala.value.MutableValue<Context> ctx) -
bind
@NotNull public org.aya.syntax.concrete.Expr.Param bind(@NotNull org.aya.syntax.concrete.Expr.Param param, @NotNull @NotNull kala.value.MutableValue<Context> ctx) -
bind
@NotNull public @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.concrete.Expr.DoBind> bind(@NotNull @NotNull kala.collection.immutable.ImmutableSeq<org.aya.syntax.concrete.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<org.aya.syntax.ref.GeneralizedVar,org.aya.syntax.concrete.Expr.Param> allowedGeneralizes()Returns the value of theallowedGeneralizesrecord component.- Returns:
- the value of the
allowedGeneralizesrecord component
-
reference
@NotNull public @NotNull kala.collection.mutable.MutableList<org.aya.generic.stmt.TyckOrder> 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
-