home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.ee.pdx.edu
/
2014.02.ftp.ee.pdx.edu.tar
/
ftp.ee.pdx.edu
/
pub
/
users
/
Harry
/
compilers
/
p9
/
tst
/
nested.out.bak
< prev
next >
Wrap
Text File
|
2006-02-07
|
9KB
|
328 lines
PROGRAM IS
VAR
i: integer := 0;
PROCEDURE foo1 (a: integer; b: integer; c: integer) IS
VAR
x: integer := 100;
PROCEDURE foo2 (a: integer; b: integer; c: integer) IS
VAR
x: integer := 200;
BEGIN
i := 222;
foo1 (1, 2, 3);
foo2 (1, 2, 3);
foo3 (1, 2, 3);
RETURN;
END;
PROCEDURE foo5 (a: integer; b: integer; c: integer) IS
VAR
x: integer := 500;
PROCEDURE foo6 (a: integer; b: integer; c: integer) IS
VAR
x: integer := 600;
BEGIN
i := 666;
foo1 (1, 2, 3);
foo5 (1, 2, 3);
foo6 (1, 2, 3);
RETURN;
END;
PROCEDURE foo7 (a: integer; b: integer; c: integer) IS
VAR
x: integer := 700;
BEGIN
i := 777;
foo1 (1, 2, 3);
foo5 (1, 2, 3);
foo7 (1, 2, 3);
RETURN;
END;
BEGIN
i := 555;
foo1 (1, 2, 3);
foo5 (1, 2, 3);
foo3 (1, 2, 3);
RETURN;
END;
BEGIN
i := 111;
RETURN;
END;
PROCEDURE foo3 (a: integer; b: integer; c: integer) IS
VAR
x: integer := 300;
PROCEDURE foo8 (a: integer; b: integer; c: integer) IS
VAR
x: integer := 800;
BEGIN
i := 888;
foo1 (1, 2, 3);
foo8 (1, 2, 3);
foo3 (1, 2, 3);
RETURN;
END;
BEGIN
i := 333;
RETURN;
END;
PROCEDURE foo4 (a: integer; b: integer; c: integer) IS
VAR
x: integer := 400;
BEGIN
i := 444;
RETURN;
END;
BEGIN
foo1 (1, 2, 3);
END;
maxLexicalLevel = 3
===== Intermediate Code Follows =====
! MAIN...
mainEntry
! VAR INITIALIZATION...
t1 := 0
i := t1
! CALL STMT...
t2 := 1
t3 := 2
t4 := 3
param 1,t2
param 2,t3
param 3,t4
call foo1
! MAIN EXIT...
mainExit
! PROCEDURE...
procEntry foo1,lexLevel=1,frameSize=0
formal 1,a
formal 2,b
formal 3,c
! VAR INITIALIZATION...
t5 := 100
x := t5
! ASSIGNMENT STMT...
t6 := &i
t7 := 111
*t6 := t7
! RETURN...
returnVoid
! PROCEDURE...
procEntry foo2,lexLevel=2,frameSize=0
formal 1,a
formal 2,b
formal 3,c
! VAR INITIALIZATION...
t8 := 200
x := t8
! ASSIGNMENT STMT...
t9 := &i
t10 := 222
*t9 := t10
! CALL STMT...
t11 := 1
t12 := 2
t13 := 3
param 1,t11
param 2,t12
param 3,t13
call foo1
! CALL STMT...
t14 := 1
t15 := 2
t16 := 3
param 1,t14
param 2,t15
param 3,t16
call foo2
! CALL STMT...
t17 := 1
t18 := 2
t19 := 3
param 1,t17
param 2,t18
param 3,t19
call foo3
! RETURN...
returnVoid
! PROCEDURE...
procEntry foo5,lexLevel=2,frameSize=0
formal 1,a
formal 2,b
formal 3,c
! VAR INITIALIZATION...
t20 := 500
x := t20
! ASSIGNMENT STMT...
t21 := &i
t22 := 555
*t21 := t22
! CALL STMT...
t23 := 1
t24 := 2
t25 := 3
param 1,t23
param 2,t24
param 3,t25
call foo1
! CALL STMT...
t26 := 1
t27 := 2
t28 := 3
param 1,t26
param 2,t27
param 3,t28
call foo5
! CALL STMT...
t29 := 1
t30 := 2
t31 := 3
param 1,t29
param 2,t30
param 3,t31
call foo3
! RETURN...
returnVoid
! PROCEDURE...
procEntry foo6,lexLevel=3,frameSize=0
formal 1,a
formal 2,b
formal 3,c
! VAR INITIALIZATION...
t32 := 600
x := t32
! ASSIGNMENT STMT...
t33 := &i
t34 := 666
*t33 := t34
! CALL STMT...
t35 := 1
t36 := 2
t37 := 3
param 1,t35
param 2,t36
param 3,t37
call foo1
! CALL STMT...
t38 := 1
t39 := 2
t40 := 3
param 1,t38
param 2,t39
param 3,t40
call foo5
! CALL STMT...
t41 := 1
t42 := 2
t43 := 3
param 1,t41
param 2,t42
param 3,t43
call foo6
! RETURN...
returnVoid
! PROCEDURE...
procEntry foo7,lexLevel=3,frameSize=0
formal 1,a
formal 2,b
formal 3,c
! VAR INITIALIZATION...
t44 := 700
x := t44
! ASSIGNMENT STMT...
t45 := &i
t46 := 777
*t45 := t46
! CALL STMT...
t47 := 1
t48 := 2
t49 := 3
param 1,t47
param 2,t48
param 3,t49
call foo1
! CALL STMT...
t50 := 1
t51 := 2
t52 := 3
param 1,t50
param 2,t51
param 3,t52
call foo5
! CALL STMT...
t53 := 1
t54 := 2
t55 := 3
param 1,t53
param 2,t54
param 3,t55
call foo7
! RETURN...
returnVoid
! PROCEDURE...
procEntry foo3,lexLevel=1,frameSize=0
formal 1,a
formal 2,b
formal 3,c
! VAR INITIALIZATION...
t56 := 300
x := t56
! ASSIGNMENT STMT...
t57 := &i
t58 := 333
*t57 := t58
! RETURN...
returnVoid
! PROCEDURE...
procEntry foo8,lexLevel=2,frameSize=0
formal 1,a
formal 2,b
formal 3,c
! VAR INITIALIZATION...
t59 := 800
x := t59
! ASSIGNMENT STMT...
t60 := &i
t61 := 888
*t60 := t61
! CALL STMT...
t62 := 1
t63 := 2
t64 := 3
param 1,t62
param 2,t63
param 3,t64
call foo1
! CALL STMT...
t65 := 1
t66 := 2
t67 := 3
param 1,t65
param 2,t66
param 3,t67
call foo8
! CALL STMT...
t68 := 1
t69 := 2
t70 := 3
param 1,t68
param 2,t69
param 3,t70
call foo3
! RETURN...
returnVoid
! PROCEDURE...
procEntry foo4,lexLevel=1,frameSize=0
formal 1,a
formal 2,b
formal 3,c
! VAR INITIALIZATION...
t71 := 400
x := t71
! ASSIGNMENT STMT...
t72 := &i
t73 := 444
*t72 := t73
! RETURN...
returnVoid
=======================================