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 >
Text File  |  2006-02-17  |  4KB  |  115 lines

  1. PROGRAM IS
  2.     TYPE
  3.         R1 IS RECORD f1: integer; f2: real; f3: boolean; END;
  4.         R2 IS RECORD f1: integer; f2: real; f3: boolean; f4: R3; END;
  5.         R3 IS RECORD g1: integer; g2: real; g3: boolean; g4: R4; END;
  6.         R4 IS RECORD h1: integer; h2: real; h3: boolean; END;
  7.     VAR
  8.         r1: R1 := NIL;
  9.         r2: R2 := NIL;
  10.         b: boolean := FALSE;
  11.         c: boolean := b;
  12.     BEGIN
  13.         r1 := R1 { f1 := 123; f2 := 23.45; f3 := FALSE };
  14.         r1 := R1 { f2 := 23.45; f1 := 123; f3 := FALSE };
  15.         r1 := R1 { f1 := (100 + 23); f2 := (23.45 * 1.1); f3 := (b OR c) };
  16.         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 } } };
  17.     END;
  18. maxLexicalLevel = 0
  19. =====  String List Follows  =====
  20. =====  Float List Follows  =====
  21.    float7:  77.77
  22.    float6:  2.2
  23.    float5:  23.45
  24.    float4:  1.1
  25.    float3:  23.45
  26.    float2:  23.45
  27.    float1:  23.45
  28. =====  Intermediate Code Follows  =====
  29. ! MAIN...
  30.                 mainEntry
  31. ! VAR INITIALIZATION...
  32.                 r1 := 0
  33. ! VAR INITIALIZATION...
  34.                 r2 := 0
  35. ! VAR INITIALIZATION...
  36.                 b := 0
  37. ! VAR INITIALIZATION...
  38.                 c := b
  39. ! ASSIGNMENT STMT...
  40.                 t1 := alloc (12)
  41.                 if t1 = 0 then goto runtimeError1        (integer)
  42.                 t2 := t1 + 0        (integer)
  43.                 *t2 := 123
  44.                 t2 := t1 + 4        (integer)
  45.                 *t2 := 23.45
  46.                 t2 := t1 + 8        (integer)
  47.                 *t2 := 0
  48.                 r1 := t1
  49. ! ASSIGNMENT STMT...
  50.                 t3 := alloc (12)
  51.                 if t3 = 0 then goto runtimeError1        (integer)
  52.                 t4 := t3 + 4        (integer)
  53.                 *t4 := 23.45
  54.                 t4 := t3 + 0        (integer)
  55.                 *t4 := 123
  56.                 t4 := t3 + 8        (integer)
  57.                 *t4 := 0
  58.                 r1 := t3
  59. ! ASSIGNMENT STMT...
  60.                 t5 := alloc (12)
  61.                 if t5 = 0 then goto runtimeError1        (integer)
  62.                 t7 := 100 + 23        (integer)
  63.                 t6 := t5 + 0        (integer)
  64.                 *t6 := t7
  65.                 t8 := 23.45 * 1.1        (float)
  66.                 t6 := t5 + 4        (integer)
  67.                 *t6 := t8
  68.                 if b = 0 then goto Label_4        (integer)
  69.                 goto Label_1
  70.         Label_4:
  71.                 if c = 0 then goto Label_2        (integer)
  72.                 goto Label_1
  73.         Label_1:
  74.                 t9 := 1
  75.                 goto Label_3
  76.         Label_2:
  77.                 t9 := 0
  78.         Label_3:
  79.                 t6 := t5 + 8        (integer)
  80.                 *t6 := t9
  81.                 r1 := t5
  82. ! ASSIGNMENT STMT...
  83.                 t10 := alloc (16)
  84.                 if t10 = 0 then goto runtimeError1        (integer)
  85.                 t11 := t10 + 0        (integer)
  86.                 *t11 := 123
  87.                 t11 := t10 + 4        (integer)
  88.                 *t11 := 23.45
  89.                 t11 := t10 + 8        (integer)
  90.                 *t11 := 0
  91.                 t12 := alloc (16)
  92.                 if t12 = 0 then goto runtimeError1        (integer)
  93.                 t13 := t12 + 0        (integer)
  94.                 *t13 := 1
  95.                 t13 := t12 + 4        (integer)
  96.                 *t13 := 2.2
  97.                 t13 := t12 + 8        (integer)
  98.                 *t13 := 1
  99.                 t14 := alloc (12)
  100.                 if t14 = 0 then goto runtimeError1        (integer)
  101.                 t15 := t14 + 0        (integer)
  102.                 *t15 := 666
  103.                 t15 := t14 + 4        (integer)
  104.                 *t15 := 77.77
  105.                 t15 := t14 + 8        (integer)
  106.                 *t15 := 0
  107.                 t13 := t12 + 12        (integer)
  108.                 *t13 := t14
  109.                 t11 := t10 + 12        (integer)
  110.                 *t11 := t12
  111.                 r2 := t10
  112. ! MAIN EXIT...
  113.                 mainExit
  114. =======================================
  115.