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 >
Text File  |  2006-02-17  |  3KB  |  103 lines

  1. PROGRAM IS
  2.     VAR
  3.         x: real := 0.0;
  4.         i: integer := 0;
  5.         b: boolean := FALSE;
  6.     PROCEDURE foo1 () IS
  7.         BEGIN
  8.             WRITE ("Within foo1...");
  9.             WRITE ("x+i = ", (x + intToReal (i)));
  10.             WRITE ("b = ", b, "True = ", TRUE, "Bool-expr = ", (b AND NOT b));
  11.             RETURN;
  12.         END;
  13.     PROCEDURE foo2 () IS
  14.         BEGIN
  15.             WRITE ("Within foo2...");
  16.             WRITE ("x-i = ", (x - intToReal (i)));
  17.             RETURN;
  18.         END;
  19.     BEGIN
  20.         WRITE ("Hello, world!");
  21.         WRITE ("x = ", x, "i = ", i);
  22.     END;
  23. maxLexicalLevel = 1
  24. =====  String List Follows  =====
  25.    str10:  "x-i = "
  26.    str9:  "Within foo2..."
  27.    str8:  "Bool-expr = "
  28.    str7:  "True = "
  29.    str6:  "b = "
  30.    str5:  "x+i = "
  31.    str4:  "Within foo1..."
  32.    str3:  "i = "
  33.    str2:  "x = "
  34.    str1:  "Hello, world!"
  35. =====  Float List Follows  =====
  36.    float1:  0.0
  37. =====  Intermediate Code Follows  =====
  38. ! MAIN...
  39.                 mainEntry
  40. ! VAR INITIALIZATION...
  41.                 x := 0.0
  42. ! VAR INITIALIZATION...
  43.                 i := 0
  44. ! VAR INITIALIZATION...
  45.                 b := 0
  46. ! WRITE STMT...
  47.                 writeString str1
  48.                 writeNewline
  49. ! WRITE STMT...
  50.                 writeString str2
  51.                 writeFloat x
  52.                 writeString str3
  53.                 writeInt i
  54.                 writeNewline
  55. ! MAIN EXIT...
  56.                 mainExit
  57. ! PROCEDURE...
  58.                 procEntry p1_foo1,lexLevel=1,frameSize=104
  59. ! WRITE STMT...
  60.                 writeString str4
  61.                 writeNewline
  62. ! WRITE STMT...
  63.                 writeString str5
  64.                 t1 := intToFloat (i)
  65.                 t2 := x + t1        (float)
  66.                 writeFloat t2
  67.                 writeNewline
  68. ! WRITE STMT...
  69.                 writeString str6
  70.                 writeBoolean b
  71.                 writeString str7
  72.                 writeBoolean 1
  73.                 writeString str8
  74.                 if b = 0 then goto Label_2        (integer)
  75.                 goto Label_4
  76.         Label_4:
  77.                 if b = 0 then goto Label_1        (integer)
  78.                 goto Label_2
  79.         Label_1:
  80.                 t3 := 1
  81.                 goto Label_3
  82.         Label_2:
  83.                 t3 := 0
  84.         Label_3:
  85.                 writeBoolean t3
  86.                 writeNewline
  87. ! RETURN...
  88.                 returnVoid 
  89. ! PROCEDURE...
  90.                 procEntry p2_foo2,lexLevel=1,frameSize=104
  91. ! WRITE STMT...
  92.                 writeString str9
  93.                 writeNewline
  94. ! WRITE STMT...
  95.                 writeString str10
  96.                 t4 := intToFloat (i)
  97.                 t5 := x - t4        (float)
  98.                 writeFloat t5
  99.                 writeNewline
  100. ! RETURN...
  101.                 returnVoid 
  102. =======================================
  103.