Package com.google.turbine.binder.env
Class LazyEnv<S extends Symbol,T,V extends T>
- java.lang.Object
-
- com.google.turbine.binder.env.LazyEnv<S,T,V>
-
- Type Parameters:
T- the interface type of the bound nodeLazyEnv, shared by any underlying environments.V- a specific implementation ofT. For example, during hierarchy bindingSourceHeaderBoundClassnodes are being completed from the sources being compiled, and the analysis of a given symbol may require looking upHeaderBoundClassnodes that will either be backed by otherSourceHeaderBoundClassnodes orBytecodeBoundClassnodes. So the phase uses anLazyEnv<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 anLazyEnv.LazyBindingErrorbeing thrown.This is used primarily for resolving the supertype hierarchy in
HierarchyBinder. The supertype hierarchy forms a directed acyclic graph, andHierarchyBinderneeds 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 interfaceLazyEnv.Completer<S extends Symbol,T,V extends T>A lazy value provider which is given access to the current environment.static classLazyEnv.LazyBindingErrorIndicates that a completer tried to complete itself, possibly transitively.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable Vget(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
-
-