Class LazyEnv<S extends Symbol,​T,​V extends T>

  • Type Parameters:
    T - the interface type of the bound node LazyEnv, shared by any underlying environments.
    V - a specific implementation of T. For example, during hierarchy binding SourceHeaderBoundClass nodes are being completed from the sources being compiled, and the analysis of a given symbol may require looking up HeaderBoundClass nodes that will either be backed by other SourceHeaderBoundClass nodes or BytecodeBoundClass nodes. So the phase uses an LazyEnv<HeaderBoundClass, SourceHeaderBoundClass>.
    All Implemented Interfaces:
    Env<S,​V>

    public class LazyEnv<S extends Symbol,​T,​V extends T>
    extends java.lang.Object
    implements Env<S,​V>
    An env that permits an analysis pass to access information about symbols from the current pass, recursively. Cycles are detected, and result in an LazyEnv.LazyBindingError being thrown.

    This is used primarily for resolving the supertype hierarchy in HierarchyBinder. The supertype hierarchy forms a directed acyclic graph, and HierarchyBinder needs to process classes in a topological sort order of that graph. Unfortuntately, we can't produce a suitable sort order until the graph exists.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  LazyEnv.Completer<S extends Symbol,​T,​V extends T>
      A lazy value provider which is given access to the current environment.
      static class  LazyEnv.LazyBindingError
      Indicates that a completer tried to complete itself, possibly transitively.
    • Constructor Summary

      Constructors 
      Constructor Description
      LazyEnv​(com.google.common.collect.ImmutableMap<S,​LazyEnv.Completer<S,​T,​V>> completers, Env<S,​? extends T> base)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable V get​(S sym)
      Returns the information associated with the given symbol in this environment.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.google.turbine.binder.env.Env

        getNonNull
    • Constructor Detail

      • LazyEnv

        public LazyEnv​(com.google.common.collect.ImmutableMap<S,​LazyEnv.Completer<S,​T,​V>> completers,
                       Env<S,​? extends T> base)
    • Method Detail

      • get

        public @Nullable V get​(S sym)
        Description copied from interface: Env
        Returns the information associated with the given symbol in this environment.
        Specified by:
        get in interface Env<S extends Symbol,​T>