Interface Env<S extends Symbol,​V>

  • All Known Implementing Classes:
    CompoundEnv, LazyEnv, SimpleEnv

    public interface Env<S extends Symbol,​V>
    An environment that maps Symbols S to bound nodes V.

    For example, BoundClass represents superclasses as a ClassSymbol, which only contains the binary name of the type. To get the BoundClass for that supertype, an Env<BoundClass> is used.

    The indirection through env makes it possible to represent a graph with cycles using immutable nodes, and makes it easy to reason about the information produced and consumed by each pass.

    TODO(cushon): keep an eye on the cost of indirections, and consider caching lookups in bound nodes if it looks like it would make a difference.

    • Method Detail

      • get

        @Nullable V get​(S sym)
        Returns the information associated with the given symbol in this environment.
      • getNonNull

        default V getNonNull​(S sym)