Run time vs. Compile time. The compiler must generate code to handle issues that arise at run time Representation of various data types Procedure linkage Storage organization. Data representation. Fundamental types are supported directly by machine operations Enumerated types? Booleans?
run 1 : a is positive
one() is called. The x in one() is bound to the
most recent declaration which is the global
one. The global x is given the value of 1 and
the program prints 1 in the end.
x, a: int;
x := 1;
x := 2;
if a>0 then one() else two();
run 2 : a is negative
two() is called. It declares a local x. Then it
calls one(). The x in one() is bound to the
most recent declaration which is the local
declaration in two(). That local x is given the
value of 1. one() exits. two() exits and the
local x dies. The global x is still 2. The
program prints 2 in the end.