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
/
write.out.bak
< prev
next >
Wrap
Text File
|
2006-02-17
|
3KB
|
103 lines
PROGRAM IS
VAR
x: real := 0.0;
i: integer := 0;
b: boolean := FALSE;
PROCEDURE foo1 () IS
BEGIN
WRITE ("Within foo1...");
WRITE ("x+i = ", (x + intToReal (i)));
WRITE ("b = ", b, "True = ", TRUE, "Bool-expr = ", (b AND NOT b));
RETURN;
END;
PROCEDURE foo2 () IS
BEGIN
WRITE ("Within foo2...");
WRITE ("x-i = ", (x - intToReal (i)));
RETURN;
END;
BEGIN
WRITE ("Hello, world!");
WRITE ("x = ", x, "i = ", i);
END;
maxLexicalLevel = 1
===== String List Follows =====
str10: "x-i = "
str9: "Within foo2..."
str8: "Bool-expr = "
str7: "True = "
str6: "b = "
str5: "x+i = "
str4: "Within foo1..."
str3: "i = "
str2: "x = "
str1: "Hello, world!"
===== Float List Follows =====
float1: 0.0
===== Intermediate Code Follows =====
! MAIN...
mainEntry
! VAR INITIALIZATION...
x := 0.0
! VAR INITIALIZATION...
i := 0
! VAR INITIALIZATION...
b := 0
! WRITE STMT...
writeString str1
writeNewline
! WRITE STMT...
writeString str2
writeFloat x
writeString str3
writeInt i
writeNewline
! MAIN EXIT...
mainExit
! PROCEDURE...
procEntry p1_foo1,lexLevel=1,frameSize=104
! WRITE STMT...
writeString str4
writeNewline
! WRITE STMT...
writeString str5
t1 := intToFloat (i)
t2 := x + t1 (float)
writeFloat t2
writeNewline
! WRITE STMT...
writeString str6
writeBoolean b
writeString str7
writeBoolean 1
writeString str8
if b = 0 then goto Label_2 (integer)
goto Label_4
Label_4:
if b = 0 then goto Label_1 (integer)
goto Label_2
Label_1:
t3 := 1
goto Label_3
Label_2:
t3 := 0
Label_3:
writeBoolean t3
writeNewline
! RETURN...
returnVoid
! PROCEDURE...
procEntry p2_foo2,lexLevel=1,frameSize=104
! WRITE STMT...
writeString str9
writeNewline
! WRITE STMT...
writeString str10
t4 := intToFloat (i)
t5 := x - t4 (float)
writeFloat t5
writeNewline
! RETURN...
returnVoid
=======================================