Class SkeltonItreeVisitor<T>

java.lang.Object
org.kink_lang.kink.internal.program.itree.SkeltonItreeVisitor<T>
Type Parameters:
T - the type of the result.
All Implemented Interfaces:
ItreeVisitor<T>
Direct Known Subclasses:
BaseOptimizer

public class SkeltonItreeVisitor<T> extends Object implements ItreeVisitor<T>
An itree visitor with a default make.

The visit methods are supposed to be overridden by subclasses where the default make is not appropriate.

  • Constructor Details

    • SkeltonItreeVisitor

      public SkeltonItreeVisitor(Function<Itree,T> defaultAction)
      Constructs a visitor.
      Parameters:
      defaultAction - the default make of visitor methods.
  • Method Details

    • visit

      public T visit(BindingItree binding)
      Description copied from interface: ItreeVisitor
      Visits a context binding itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      binding - the context binding itree.
      Returns:
      the result.
    • visit

      public T visit(RecvItree recv)
      Description copied from interface: ItreeVisitor
      Visits a context recv itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      recv - the context recv itree.
      Returns:
      the result.
    • visit

      public T visit(ArgVecItree argVec)
      Description copied from interface: ItreeVisitor
      Visits a context arg vec itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      argVec - the context arg vec itree.
      Returns:
      the result.
    • visit

      public T visit(NumItree num)
      Description copied from interface: ItreeVisitor
      Visits a num itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      num - the num itree.
      Returns:
      the result.
    • visit

      public T visit(StrItree str)
      Description copied from interface: ItreeVisitor
      Visits a str itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      str - the str itree.
      Returns:
      the result.
    • visit

      public T visit(NadaItree nada)
      Description copied from interface: ItreeVisitor
      Visits a nada itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      nada - the nada itree.
      Returns:
      the result.
    • visit

      public T visit(SeqItree seq)
      Description copied from interface: ItreeVisitor
      Visits a seq itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      seq - the seq itree.
      Returns:
      the result.
    • visit

      public T visit(SlowFunItree fun)
      Description copied from interface: ItreeVisitor
      Visits a fun itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      fun - the fun itree.
      Returns:
      the result.
    • visit

      public T visit(FastFunItree fun)
      Description copied from interface: ItreeVisitor
      Visits an indexable fun itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      fun - the indexable fun itree.
      Returns:
      the result.
    • visit

      public T visit(VecItree vec)
      Description copied from interface: ItreeVisitor
      Visits a vec itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      vec - the vec itree.
      Returns:
      the result.
    • visit

      public T visit(DerefItree deref)
      Description copied from interface: ItreeVisitor
      Visits a deref itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      deref - the deref itree.
      Returns:
      the result.
    • visit

      public T visit(LderefItree lderef)
      Description copied from interface: ItreeVisitor
      Visits a lderef itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      lderef - the lderef itree.
      Returns:
      the result.
    • visit

      public T visit(VarrefItree varref)
      Description copied from interface: ItreeVisitor
      Visits a varref itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      varref - the varref itree.
      Returns:
      the result.
    • visit

      public T visit(LetRecItree letrec)
      Description copied from interface: ItreeVisitor
      Visits an itree of letrec.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      letrec - the letrec itree.
      Returns:
      the result.
    • visit

      public T visit(AssignmentItree assignment)
      Description copied from interface: ItreeVisitor
      Visits an assignment itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      assignment - the assignment itree.
      Returns:
      the result.
    • visit

      public T visit(OptVecAssignmentItree assignment)
      Description copied from interface: ItreeVisitor
      Visits an assignment itree in the form [:A :B :C.opt :D.opt] <- xxx.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      assignment - the itree.
      Returns:
      the result.
    • visit

      public T visit(OptRestVecAssignmentItree assignment)
      Description copied from interface: ItreeVisitor
      Visits an assignment itree in the form [:A :B :C.opt :D.opt :R.rest] <- xxx.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      assignment - the itree.
      Returns:
      the result.
    • visit

      public T visit(RestVecAssignmentItree assignment)
      Description copied from interface: ItreeVisitor
      Visits an assignment itree in the form [:R.rest] <- xxx.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      assignment - the itree.
      Returns:
      the result.
    • visit

      public T visit(NestedVecAssignmentItree assignment)
      Description copied from interface: ItreeVisitor
      Visits an assignment itree in the form [:Foo [:X :Y]] <- xxx.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      assignment - the itree.
      Returns:
      the result.
    • visit

      public T visit(VarrefVecAssignmentItree assignment)
      Description copied from interface: ItreeVisitor
      Visits an assignment itree in the form [:Foo X:Bar] <- Rhs.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      assignment - the itree.
      Returns:
      the result.
    • visit

      public T visit(LstoreItree lstore)
      Description copied from interface: ItreeVisitor
      Visits a lstore itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      lstore - the lstore itree.
      Returns:
      the result.
    • visit

      public T visit(StoreItree store)
      Description copied from interface: ItreeVisitor
      Visists a store itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      store - the store itree.
      Returns:
      the result.
    • visit

      public T visit(ArgsPassingItree argsPassing)
      Description copied from interface: ItreeVisitor
      Visists an args passing itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      argsPassing - the arg passing itree.
      Returns:
      the result.
    • visit

      public T visit(NestedArgsPassingItree nestedArgsPassing)
      Description copied from interface: ItreeVisitor
      Visists a nested args passing itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      nestedArgsPassing - the nested args passing itree.
      Returns:
      the result.
    • visit

      public T visit(BiArithmeticItree arithmetic)
      Description copied from interface: ItreeVisitor
      Visits a bi arithmetic operation.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      arithmetic - the arithmetic operation itree.
      Returns:
      the result.
    • visit

      public T visit(NoTraitNewValItree newVal)
      Description copied from interface: ItreeVisitor
      Visits an itree of new_val('X' x 'Y' y).
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      newVal - the new_val itree.
      Returns:
      the result.
    • visit

      public T visit(TraitNewValItree newVal)
      Description copied from interface: ItreeVisitor
      Visits an itree of new_val(... Trait 'X' x 'Y' y).
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      newVal - the new_val itree.
      Returns:
      the result.
    • visit

      public T visit(IfItree preloadedIf)
      Description copied from interface: ItreeVisitor
      Visits an itree of preloaded if on the tail context.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      preloadedIf - the preloaded if itree.
      Returns:
      the result.
    • visit

      public T visit(BranchItree branch)
      Description copied from interface: ItreeVisitor
      Visits an itree of branch without an else block on the tail context.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      branch - the branch itree.
      Returns:
      the result.
    • visit

      public T visit(BranchWithElseItree branch)
      Description copied from interface: ItreeVisitor
      Visits an itree of branch with an else block on the tail context.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      branch - the branch itree.
      Returns:
      the result.
    • visit

      public T visit(McallItree mcall)
      Description copied from interface: ItreeVisitor
      Visits a mcall itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      mcall - the mcall itree.
      Returns:
      the result.
    • visit

      public T visit(SymcallItree scall)
      Description copied from interface: ItreeVisitor
      Visits a symcall itree.
      Specified by:
      visit in interface ItreeVisitor<T>
      Parameters:
      scall - the symcall itree.
      Returns:
      the result.