|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorc.env.Env<T>
public class Env<T>
Generic indexed environment, used primarily at runtime. Env is also content addressable, so it can be used for the deBruijn index conversion in the compiler.
Nested Class Summary | |
---|---|
protected static class |
Env.ENode<T>
Individual entries in the environment. |
Constructor Summary | |
---|---|
|
Env()
|
protected |
Env(Env.ENode<T> node)
|
Method Summary | |
---|---|
Env<T> |
add(T item)
|
Env<T> |
addAll(java.util.List<T> items)
|
java.util.List<T> |
items()
Return a list of items in the order they were added. |
T |
lookup(int index)
Lookup a variable in the environment Currently uses a linear search. |
int |
search(T target)
Content addressable mode. |
java.lang.String |
toString()
|
Env<T> |
unwind(int width)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Env(Env.ENode<T> node)
public Env()
Method Detail |
---|
public Env<T> add(T item)
public java.util.List<T> items()
public Env<T> addAll(java.util.List<T> items)
public T lookup(int index)
index
- Stack depth (a deBruijn index)
public int search(T target)
target
- The item
public Env<T> unwind(int width)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |