Class Unifier

java.lang.Object
com.google.errorprone.refaster.Unifier

public final class Unifier extends Object
A mutable representation of an attempt to match a template source tree against a target source tree.
Author:
Louis Wasserman
  • Constructor Details

    • Unifier

      public Unifier(com.sun.tools.javac.util.Context context)
  • Method Details

    • fork

      public Unifier fork()
      Returns a Unifier containing all the bindings from this Unifier, but which can succeed or fail independently of this Unifier.
    • types

      public com.sun.tools.javac.code.Types types()
    • thisExpression

      public com.sun.tools.javac.tree.JCTree.JCExpression thisExpression(com.sun.tools.javac.code.Type type)
    • createInliner

      public Inliner createInliner()
    • getBinding

      @Nullable public <V> V getBinding(Bindings.Key<V> key)
    • putBinding

      public <V> V putBinding(Bindings.Key<V> key, V value)
    • replaceBinding

      public <V> V replaceBinding(Bindings.Key<V> key, V value)
    • clearBinding

      public void clearBinding(Bindings.Key<?> key)
    • getBindings

      public Bindings getBindings()
    • getContext

      public com.sun.tools.javac.util.Context getContext()
    • toString

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

      public static <T, U extends Unifiable<? super T>> com.google.common.base.Function<Unifier,Choice<Unifier>> unifications(@Nullable U unifiable, @Nullable T target)
    • unifyNullable

      public static <T, U extends Unifiable<? super T>> Choice<Unifier> unifyNullable(Unifier unifier, @Nullable U unifiable, @Nullable T target)
    • unifications

      public static <T, U extends Unifiable<? super T>> com.google.common.base.Function<Unifier,Choice<Unifier>> unifications(@Nullable List<U> toUnify, @Nullable List<? extends T> targets)
    • unifications

      public static <T, U extends Unifiable<? super T>> com.google.common.base.Function<Unifier,Choice<Unifier>> unifications(@Nullable List<U> toUnify, @Nullable List<? extends T> targets, boolean allowVarargs)
    • unifyList

      public static <T, U extends Unifiable<? super T>> Choice<Unifier> unifyList(Unifier unifier, @Nullable List<U> toUnify, @Nullable List<? extends T> targets)
      Returns all successful unification paths from the specified Unifier unifying the specified lists, disallowing varargs.
    • unifyList

      public static <T, U extends Unifiable<? super T>> Choice<Unifier> unifyList(Unifier unifier, @Nullable List<U> toUnify, @Nullable List<? extends T> targets, boolean allowVarargs)
      Returns all successful unification paths from the specified Unifier unifying the specified lists, allowing varargs if and only if allowVarargs is true.