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
/
p10
/
tst
/
record2.out.bak
< prev
next >
Wrap
Text File
|
2006-02-17
|
4KB
|
115 lines
PROGRAM IS
TYPE
R1 IS RECORD f1: integer; f2: real; f3: boolean; END;
R2 IS RECORD f1: integer; f2: real; f3: boolean; f4: R3; END;
R3 IS RECORD g1: integer; g2: real; g3: boolean; g4: R4; END;
R4 IS RECORD h1: integer; h2: real; h3: boolean; END;
VAR
r1: R1 := NIL;
r2: R2 := NIL;
b: boolean := FALSE;
c: boolean := b;
BEGIN
r1 := R1 { f1 := 123; f2 := 23.45; f3 := FALSE };
r1 := R1 { f2 := 23.45; f1 := 123; f3 := FALSE };
r1 := R1 { f1 := (100 + 23); f2 := (23.45 * 1.1); f3 := (b OR c) };
r2 := R2 { f1 := 123; f2 := 23.45; f3 := FALSE; f4 := R3 { g1 := 1; g2 := 2.2; g3 := TRUE; g4 := R4 { h1 := 666; h2 := 77.77; h3 := FALSE } } };
END;
maxLexicalLevel = 0
===== String List Follows =====
===== Float List Follows =====
float7: 77.77
float6: 2.2
float5: 23.45
float4: 1.1
float3: 23.45
float2: 23.45
float1: 23.45
===== Intermediate Code Follows =====
! MAIN...
mainEntry
! VAR INITIALIZATION...
r1 := 0
! VAR INITIALIZATION...
r2 := 0
! VAR INITIALIZATION...
b := 0
! VAR INITIALIZATION...
c := b
! ASSIGNMENT STMT...
t1 := alloc (12)
if t1 = 0 then goto runtimeError1 (integer)
t2 := t1 + 0 (integer)
*t2 := 123
t2 := t1 + 4 (integer)
*t2 := 23.45
t2 := t1 + 8 (integer)
*t2 := 0
r1 := t1
! ASSIGNMENT STMT...
t3 := alloc (12)
if t3 = 0 then goto runtimeError1 (integer)
t4 := t3 + 4 (integer)
*t4 := 23.45
t4 := t3 + 0 (integer)
*t4 := 123
t4 := t3 + 8 (integer)
*t4 := 0
r1 := t3
! ASSIGNMENT STMT...
t5 := alloc (12)
if t5 = 0 then goto runtimeError1 (integer)
t7 := 100 + 23 (integer)
t6 := t5 + 0 (integer)
*t6 := t7
t8 := 23.45 * 1.1 (float)
t6 := t5 + 4 (integer)
*t6 := t8
if b = 0 then goto Label_4 (integer)
goto Label_1
Label_4:
if c = 0 then goto Label_2 (integer)
goto Label_1
Label_1:
t9 := 1
goto Label_3
Label_2:
t9 := 0
Label_3:
t6 := t5 + 8 (integer)
*t6 := t9
r1 := t5
! ASSIGNMENT STMT...
t10 := alloc (16)
if t10 = 0 then goto runtimeError1 (integer)
t11 := t10 + 0 (integer)
*t11 := 123
t11 := t10 + 4 (integer)
*t11 := 23.45
t11 := t10 + 8 (integer)
*t11 := 0
t12 := alloc (16)
if t12 = 0 then goto runtimeError1 (integer)
t13 := t12 + 0 (integer)
*t13 := 1
t13 := t12 + 4 (integer)
*t13 := 2.2
t13 := t12 + 8 (integer)
*t13 := 1
t14 := alloc (12)
if t14 = 0 then goto runtimeError1 (integer)
t15 := t14 + 0 (integer)
*t15 := 666
t15 := t14 + 4 (integer)
*t15 := 77.77
t15 := t14 + 8 (integer)
*t15 := 0
t13 := t12 + 12 (integer)
*t13 := t14
t11 := t10 + 12 (integer)
*t11 := t12
r2 := t10
! MAIN EXIT...
mainExit
=======================================