Changes between Version 3 and Version 4 of Fundamentals


Ignore:
Timestamp:
05/12/23 20:30:13 (3 years ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Fundamentals

    v3 v4  
    1616== Example Illustrating Scopes and Processes
    1717
    18 To understand the static and dynamic nature of scopes and processes, and the relations between them, we consider the (artificial) example code below. The static scopes in the scope are numbered from 0 to 6.
     18To understand the static and dynamic nature of scopes and processes, and the relations between them, we consider the (artificial) example code in Fig. 1. The static scopes in the scope are numbered from 0 to 6.
    1919
    20 [[Image(picture.gif)]]
     20[[Image(scopeCodeExample.png, width=250px, align=center)]] || [[Image(staticScopeTree.png, width=200px, align=center)]] ||
     21  Fig. 1.  CIVL-C code skeleton to illustrate scope hierarchy.
    2122
    22 The static scopes have a tree structure: one scope is a child of another if the first is immediately contained in the second. Scope 0, which is the file scope (or root scope) is the root of this tree. The static scope tree is depicted in Figure 5.2 (left). Each scope is identified by its integer ID. Additionally, if the scope happens to be the scope of a function definition, the name of the function is included in this identifier. A node in this tree also shows the variables and functions declared in the scope. For brevity, we omit the proc variables.
     23The static scopes have a tree structure: one scope is a child of another if the first is immediately contained in the second. Scope 0, which is the file scope (or root scope) is the root of this tree. The static scope tree is depicted in Fig. 2 (left). Each scope is identified by its integer ID. Additionally, if the scope happens to be the scope of a function definition, the name of the function is included in this identifier. A node in this tree also shows the variables and functions declared in the scope. For brevity, we omit the proc variables.
    2324
    24 We now look at what happens when this program executes. Figure 5.2 (right) illustrates a
     25
     26We now look at what happens when this program executes. Fig. 2 (right) illustrates a