给出下面源程序: a=5; b=3; c=4; d=a+b; e=c-b; f=d+e; if ab and bc or cd and ef then begin x=x+1; y=y+1 end else begin x=x-1; y=y-1 end;1翻译为等价的四元式序列并正确填写所有转向地址规定第一个四元式从地址1开始存放;将翻译得到的四元式代码进行基
等价的四元式序列:
(1) a 5 _ _ (2) b 3 _ _ (3) c 4 _ _ (4) d a b + (5) e c b - (6) f d e + (7) t1 a b < (8) t2 b c < (9) t3 t1 t2 and (10) t4 c d > (11) t5 e f < (12) t6 t4 t5 and (13) t7 t3 t6 or (14) x _ _ (15) y _ _ (16) t8 1 _ (17) t9 x t8 (18) t10 y t8 (19) t11 x 1 (20) t12 x t11 (21) t13 y 1 (22) t14 y t13 (23) t15 _ _ goto
转向地址:
(1) 2 (2) 3 (3) 4 (4) 5 (5) 6 (7) 8 (8) 9 (9) 13 (10) 11 (11) 12 (12) 13 (23) 1
基本块划分:
BB1: (1) a 5 _ _ (2) b 3 _ _ (3) c 4 _ _ (4) d a b + (5) e c b - (6) f d e +
BB2: (7) t1 a b < (8) t2 b c < (9) t3 t1 t2 and
BB3: (10) t4 c d > (11) t5 e f < (12) t6 t4 t5 and (13) t7 t3 t6 or
BB4: (14) x _ _ (15) y _ _ (16) t8 1 _ (17) t9 x t8 (18) t10 y t8 (19) t11 x 1 (20) t12 x t11 (21) t13 y 1 (22) t14 y t13 (23) t15 _ _ got
原文地址: https://www.cveoy.top/t/topic/g7Jn 著作权归作者所有。请勿转载和采集!