java.lang.Object
org.kink_lang.kink.internal.program.itree.FastFunItree
All Implemented Interfaces:
Itree, ItreeElem, UsedDefinedVars

public class FastFunItree extends Object implements Itree, UsedDefinedVars
A fun in SSA (static single assignment) form.
  • Constructor Details

    • FastFunItree

      public FastFunItree(Itree body, int pos)
      Constructs a fun itree in SSA form.
      Parameters:
      body - the fun body itree; must not expose the env.
      pos - the start pos of the fun.
  • Method Details

    • body

      public Itree body()
      Returns the fun body itree.
      Returns:
      the fun body itree.
    • pos

      public int pos()
      Description copied from interface: Itree
      Returns the pos of the itree on the program text.
      Specified by:
      pos in interface Itree
      Specified by:
      pos in interface ItreeElem
      Returns:
      the pos of the itree on the program text.
    • usedLvars

      public Set<LocalVar> usedLvars()
      Description copied from interface: UsedDefinedVars
      Returns the set of local vars used in the fun.
      Specified by:
      usedLvars in interface UsedDefinedVars
      Returns:
      the set of local vars used in the fun.
    • definedLvars

      public Set<LocalVar> definedLvars()
      Description copied from interface: UsedDefinedVars
      Returns the set of local vars defined in the fun.
      Specified by:
      definedLvars in interface UsedDefinedVars
      Returns:
      the set of local vars defined in the fun.
    • freeLvars

      public Set<LocalVar> freeLvars()
      Description copied from interface: UsedDefinedVars
      Returns the set of free local vars of the fun.
      Specified by:
      freeLvars in interface UsedDefinedVars
      Returns:
      the set of free local vars of the fun.
    • lvarContentMapping

      public Map<LocalVar,LocalVarContent> lvarContentMapping()
      Mapping from the local var to the content.
      Returns:
      the mapping.
    • getContent

      public LocalVarContent getContent(LocalVar lvar)
      Description copied from interface: UsedDefinedVars
      Returns the content for the local var.
      Specified by:
      getContent in interface UsedDefinedVars
      Parameters:
      lvar - the local var.
      Returns:
      the content for the local var.
    • accept

      public <T> T accept(ItreeVisitor<T> visitor)
      Description copied from interface: Itree
      Accepts a visitor.
      Specified by:
      accept in interface Itree
      Type Parameters:
      T - the result type of the visitor.
      Parameters:
      visitor - the visitor.
      Returns:
      the result of the visitor.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object arg)
      Overrides:
      equals in class Object