Scope of Identifiers
• Problem:
Symbol table
Program P1;
var x, y: integer;
Procedure Proc1;
var x, y: integer;
begin
 … x := 1; …
end;
begin
 … x := 2; …
end.
?
?
y
…
5:
x
…
4:
Proc1
…
3:
y
…
2:
x
…
1:
• Solution: Scope Rules (Stack structure of ST)
25/35