Package com.google.errorprone.refaster
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 Summary
Constructors Constructor Description Unifier(com.sun.tools.javac.util.Context context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearBinding(Bindings.Key<?> key)
Inliner
createInliner()
Unifier
fork()
Returns aUnifier
containing all the bindings from thisUnifier
, but which can succeed or fail independently of thisUnifier
.<V> V
getBinding(Bindings.Key<V> key)
Bindings
getBindings()
com.sun.tools.javac.util.Context
getContext()
<V> V
putBinding(Bindings.Key<V> key, V value)
<V> V
replaceBinding(Bindings.Key<V> key, V value)
com.sun.tools.javac.tree.JCTree.JCExpression
thisExpression(com.sun.tools.javac.code.Type type)
String
toString()
com.sun.tools.javac.code.Types
types()
static <T,U extends Unifiable<? super T>>
com.google.common.base.Function<Unifier,Choice<Unifier>>unifications(List<U> toUnify, List<? extends T> targets)
static <T,U extends Unifiable<? super T>>
com.google.common.base.Function<Unifier,Choice<Unifier>>unifications(List<U> toUnify, List<? extends T> targets, boolean allowVarargs)
static <T,U extends Unifiable<? super T>>
com.google.common.base.Function<Unifier,Choice<Unifier>>unifications(U unifiable, T target)
static <T,U extends Unifiable<? super T>>
Choice<Unifier>unifyList(Unifier unifier, List<U> toUnify, List<? extends T> targets)
Returns all successful unification paths from the specifiedUnifier
unifying the specified lists, disallowing varargs.static <T,U extends Unifiable<? super T>>
Choice<Unifier>unifyList(Unifier unifier, List<U> toUnify, List<? extends T> targets, boolean allowVarargs)
Returns all successful unification paths from the specifiedUnifier
unifying the specified lists, allowing varargs if and only ifallowVarargs
is true.static <T,U extends Unifiable<? super T>>
Choice<Unifier>unifyNullable(Unifier unifier, U unifiable, T target)
-
-
-
Method Detail
-
fork
public Unifier fork()
Returns aUnifier
containing all the bindings from thisUnifier
, but which can succeed or fail independently of thisUnifier
.
-
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()
-
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 specifiedUnifier
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 specifiedUnifier
unifying the specified lists, allowing varargs if and only ifallowVarargs
is true.
-
-