Module aya.base
Package org.aya.terck

Record Class CallResolver

java.lang.Object
java.lang.Record
org.aya.terck.CallResolver
Record Components:
targets - only search calls to those definitions
All Implemented Interfaces:
Consumer<Term>, DefConsumer, TermConsumer

public record CallResolver(PrimDef.Factory factory, @NotNull FnDef caller, @NotNull kala.collection.mutable.MutableSet<Def> targets, @NotNull kala.value.MutableValue<Term.Matching> currentMatching, @NotNull CallGraph<Def,Term.Param> graph) extends Record implements DefConsumer
Resolve calls and build call graph of recursive functions, after StmtTycker.
  • Constructor Details

    • CallResolver

      public CallResolver(@NotNull PrimDef.Factory factory, @NotNull @NotNull FnDef fn, @NotNull @NotNull kala.collection.mutable.MutableSet<Def> targets, @NotNull @NotNull CallGraph<Def,Term.Param> graph)
    • CallResolver

      public CallResolver(@NotNull PrimDef.Factory factory, @NotNull @NotNull FnDef caller, @NotNull @NotNull kala.collection.mutable.MutableSet<Def> targets, @NotNull @NotNull kala.value.MutableValue<Term.Matching> currentMatching, @NotNull @NotNull CallGraph<Def,Term.Param> graph)
      Creates an instance of a CallResolver record class.
      Parameters:
      factory - the value for the factory record component
      caller - the value for the caller record component
      targets - the value for the targets record component
      currentMatching - the value for the currentMatching record component
      graph - the value for the graph record component
  • Method Details

    • visitMatching

      public void visitMatching(@NotNull Term.Matching matching)
      Specified by:
      visitMatching in interface DefConsumer
    • pre

      public void pre(@NotNull @NotNull Term term)
      Specified by:
      pre in interface TermConsumer
    • 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.
    • factory

      @NotNull public PrimDef.Factory factory()
      Returns the value of the factory record component.
      Returns:
      the value of the factory record component
    • caller

      @NotNull public @NotNull FnDef caller()
      Returns the value of the caller record component.
      Returns:
      the value of the caller record component
    • targets

      @NotNull public @NotNull kala.collection.mutable.MutableSet<Def> targets()
      Returns the value of the targets record component.
      Returns:
      the value of the targets record component
    • currentMatching

      @NotNull public @NotNull kala.value.MutableValue<Term.Matching> currentMatching()
      Returns the value of the currentMatching record component.
      Returns:
      the value of the currentMatching record component
    • graph

      @NotNull public @NotNull CallGraph<Def,Term.Param> graph()
      Returns the value of the graph record component.
      Returns:
      the value of the graph record component