Chapter 6: Runtime System

Access to non-local names

. Scope rules determine the treatment of non-local names

. A common rule is lexical scoping or static scoping (most languages use lexical scoping)

The scope rules of a language decide how to reference the non-local variables. There are two methods that are commonly used:

1. Static or Lexical scoping: It determines the declaration that applies to a name by examining the program text alone. E.g., Pascal, C and ADA.

2. Dynamic Scoping: It determines the declaration applicable to a name at run time, by considering the current activations. E.g., Lisp