- All Implemented Interfaces:
- ViewableStack, java.lang.Iterable, java.util.Collection, java.util.List
public class Enclosure
extends Stack
An Enclosure is the stack of scopes that are enclosing a
given subexpression. Besides stack operations, it provides the
method setLocalInfo(Local) that computes and sets the de
Bruijn index for the specified Local according to its
runtime sort by looking it up the stack of scopes' parameters as
it walks up through the enclosure from the subexpression's
occurrence to its outermost enclosing expression's root. Along
the way, the Local is recorded in each enclosing
abstraction in which it occurs free - this is needed to compute
the maximal closure frame size to allocate for each abstraction.