Class 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 Detail

      • Unifier

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

      • 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()
      • 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()
      • 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.