| java.lang.Object jsint.LocalVariable
LocalVariable | public class LocalVariable implements java.io.Serializable(Code) | | A LocalVariable is denoted by its position in the environment, in terms
of the number of levels "up" we have to go (number of nested environments),
the number of variables "in" we have to go (ordinal position of variable),
and whether the variable is a "rest" (or "dotted") variable.
Example of variables in (list x y z a b):
(lambda (x y) x.up=2, x.in=0 y.up=2, y.in=1
(lambda (z . a) z.up=1, z.in=0 a.up=1, a.in=1
(lambda b b.up=0, b.in=0
(list x y z a b))))
author: Peter Norvig, Copyright 1998, peter@norvig.com, license author: subsequently modified by Jscheme project members author: licensed under zlib licence (see license.txt) |
Field Summary | |
public int | in The ordinal position in the environment where the variable is. | Symbol | name The name of the variable (for debugging purposes only). | public int | up The number of levels up in the parent chain where the variable is. |
Method Summary | |
public String | toString() Use the name, up and in of the variable as its String
representation so they distinguish themselves from a Global
variable. |
in | public int in(Code) | | The ordinal position in the environment where the variable is. *
|
name | Symbol name(Code) | | The name of the variable (for debugging purposes only). *
|
up | public int up(Code) | | The number of levels up in the parent chain where the variable is. *
|
LocalVariable | public LocalVariable(int up, int in, Symbol name)(Code) | | Create a new variable. *
|
toString | public String toString()(Code) | | Use the name, up and in of the variable as its String
representation so they distinguish themselves from a Global
variable. *
|
|
|