First page Back Continue Last page Summary Graphic
Example 4: id numbering
Each scope has an array of identifers, each with the usual symbol table info
Each array is indexed from 0
In a context, use a stack of surrounding scopes
The lookup algorithm is:
- if index within bounds, look in first array
- if not, subtract array size, pop array, repeat
In addition, allow array entries of the form:
- 3 = renumbering of outer 7
This allows you eg to document free variables