{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

chpt7-3 - 7.3 Intermediate code Intermediate representation...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
. . . 何何何何何何 ( Intermediate code ) ( Intermediate representation ) ( Intermediate language ) 何何何何何何何何何何何何何何何何何何何何何何何何何何何 何何何何何何何何何 何何何何何何何 何何何何何何何何何何何何何何何何何何何何何何何 何何何何何何何何何何何何 何何何何何何何何何何何何何何 何何何何何何何何何 何何何 何何何 何何何 何何何何何 7.3 何何何何何何
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
中中中中中中 中中中中中中中 中中中中中中
Background image of page 2
7.3.1 中中中中 de 中中 中中中中中 中中中中中中中中中中中 中中中中中中中中中中中中中中中中 中中中中中中中中 中中中中中中中中中中中中中中中中 中中中中中中中中中中中中中 中中中中中中中中中中中中中中中中 中中中中中中中中 中中中中中中中中中中中中中中中中中中中 中中中中中中 DAG
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
中中中中中中中 中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中 中中中中中中中中中中中中中中中中中中中中中中中中 中中中中中中中中中中中中中中中中中中中中中中中中中中 中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中
Background image of page 4
中中中中中中中中中 何何何 何何何何何何 何何何何何何何何 何何何何何何何何 何何何何何何何何 float a[10][20]; a[i][j+2]; t1 = a[i, j+2] t1 = j + 2 t2 = i * 20 t3 = t1 + t2 t4 = 4 * t3 t5 = addr a t6 = t5 + t4 t7 = *t6 r1 = [fp - 4] r2 = [r1 + 2] r3 = [fp - 8] r4 = r3 * 20 r5 = r4 + r2 r6 = 4 * r5 r7 = fp – 216 f1 = [r7 + r6]
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
何 何 何 : A B C D - * + E C D – N ^ / + 何 何 何 : (1) ( - C D T1 ) (2) ( * B T1 T2) (3) ( + A T2 T3) (4) ( - C D T4) (5) ( ^ T4 N T5) (6) ( / E T5 T6) (7) ( + T3 T6 T7) 何 : A + B * ( C - D ) + E / ( C - D ) ^N
Background image of page 6
何 何 何 : (1) ( - C D ) (2) ( * B (1) ) (3) ( + A (2) ) (4) ( - C D ) (5) ( ^ (4) N ) (6) ( / E (5) ) (7) ( + (3) (6) ) 何 : A + B * ( C - D ) + E / ( C - D ) ^N
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
何 何 何 何 何 : 何 何 何 何 何 何 何 何 何 何 何 (1) ( - C D ) 1 (2) ( * B (1) ) 2 (3) ( + A (2) ) 3 (4) ( ^ (1) N ) 1 (5) ( / E (4) ) 4 (6) ( + (3) (5) ) 5 6 何 : A + B * ( C - D ) + E / ( C - D ) ^N
Background image of page 8
中中中中中中 DAG 中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中 中中中中中中中中 Abstract Syntax Tree 中中 中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中中 中中中中 S→if B then S 1 else S 2 中中中中中中中 if-then- else B S1 S2
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
中中中中中中中中中
Background image of page 10
directed acyclic graph (DAG). b*c+b*c + * b c
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
7.3.2 何何何何何何何 ( 何何何何何何 何何何何何 : result := arg1 op arg2 何何何何何 id.name, E.place 何何何 lookup( id.name) ; 何何何 emit(t := arg1 op arg2); newtemp; 何何何何何何何何何 (1 ) S id := E { P :=lookup ( id.name) ; if P nil then emit( P := E.place) else error } (op ,arg1,arg2,result) 何
Background image of page 12
(2) E E 1 +E 2 {E.place:= newtemp; emit(E.place“:=” E 1 .place“+”E 2 .place)}
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}