{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

chapter7 - H D D 7.1 7.1.1 E E opE | uopE |(E | id | num E...

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

View Full Document Right Arrow Icon
H ž ( ž ( ( ª*Ð ÀD À[email protected] À Z ª*
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
7.1 º 7.1.1 . E E opE | uopE | ( E ) | id | num . E EE 0 E E E E id id num num E 1 opE 2 E 1 E 2 op uopE E uop ( E ) E
Background image of page 2
7.1 Ø (8 - 5) + 2 q 8 5 - 2 + ˜ x ª q (sμ ª* 8 5 - 2 + 8 5 - 2 + 8 5 - 2 + 3 2 + 3 2 + 5
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
7.1 ¼ Ø (8 - 5) + 2 q 8 5 - 2 + ˜ x ª q (sμ ª* À [email protected] 0¿
Background image of page 4
7.1 u 7.1.2 ª *ÐÀ D assign a + + b c d uminus (b) DAG assign a + + b c d c d uminus (a) a a = ( - b + c d) + c d b
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
7.1 `^Á ª* ÐÀ D ˜§+ ª* ¨o μ S id = E S . nptr = mkNode (‘assign’, mkLeaf (id, id. entry ), E . nptr ) E E 1 + E 2 E . nptr = mkNode ( ‘+’, E 1 . nptr , E 2 . nptr ) E E 1 E 2 E . nptr = mkNode ( ‘ ’, E 1 . nptr , E 2 . nptr ) E - E 1 E . nptr = mkUNode ( ‘uminus’, E 1 . nptr ) E ( E 1 ) E . nptr = E 1 . nptr F id E . nptr = mkLeaf (id, id. entry )
Background image of page 6
7.1 x 7.1.3 x = y op z x + y z t 1 = y z t 2 = x + t 1
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
7.1 A ðA DAG ª * . a = ( - b + c d ) + c d q t 1 = - b t 2 = c d t 3 = t 1 + t 2 t 4 = c d t 5 = t 3 + t 4 a = t 5 assign a + + b c d c d uminus
Background image of page 8
7.1 m xm DAG ª * . a = ( - b + c d ) + c d q DAG . t 1 = - b t 1 = - b t 2 = c d t 2 = c d t 3 = t 1 + t 2 t 3 = t 1 + t 2 t 4 = c d t 4 = t 3 + t 2 t 5 = t 3 + t 4 a = t 4 a = t 5 assign a + + b c d uminus
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
7.1 { À { x = y op z E x = op y E x = y < ª goto L . if x relop y goto L . param x . call p , n E return y E x = y [ i ] . x [ i ] = y < ª q x = & y E x = y EE x = y
Background image of page 10
7.1 E 7.1.4 < q q ÐÀ D •G ^ ˜ xq ¨o μ ª* ˆ < ˆ <q p = a +b p 1 = a +b q = p - c q 1 = p 1 - c p = q d p 2 = q 1 d p = e - p p 3 = e - p 2 q = p + q q 2 = p 3 + q 1
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.1 i 7.1.4 < q ]q ÐÀ D kn ˜ xq ¨o μ ª* ˜ xq ¨o μ ª* if (flag) x = - 1; else x = 1; y = x a; . if (flag) x 1 = - 1; else x 2 = 1; x 3 = φ (x 1 , x 2 ); // . flag< x 1 . x 2
Background image of page 12
7.2 è < ª p kn μ èƒ < ª * À [email protected]
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
7.2 8 < ª 7.2.1 è < *
Background image of page 14
7.2 ˆ ª ª*Ð À D P { offset = 0} D ; S D D ; D D id : T { enter ( id. lexeme , T . type , offset ); offset = offset + T . width } T integer { T . type = integer ; T . width = 4 } T real { T . type = real ; T . width = 8 } T array [ num ] of T 1 { T . type = array (num. val , T 1 . type );
Background image of page 15

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

View Full Document Right Arrow Icon
7.2 È < ª ª*Ð À D P { offset = 0} D ; S D D ; D D id : T { enter ( id. lexeme , T . type , offset ); offset = offset + T . width } T integer { T . type = integer ; T . width = 4 } T real { T . type = real ; T . width = 8 } T array [ num ] of T 1 { T . type = array (num. val , T 1 . type ); T .width = num. val × T 1 .width} T T 1 { T . type = pointer ( T 1 . type ); T . width = 4 }
Background image of page 16
7.2 ˜ ª 7.2.2 q ª q P D ; S D D ; D | id : T | proc id ; D ; S sort var a:…; x:…; readarray var i:…; exchange quicksort var k, v:…; partition var i, j:…; a 6.14 a
Background image of page 17

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

View Full Document Right Arrow Icon
7.2 H ª exchange readarray x a i a sort quicksort a readarray partition v k i quicksort readarray i i exchange i a exchange partition sort readarray exchange quicksort partition
Background image of page 18
7.2 Ø < ª X‰ < ª * ¨o ¨ xq n μ xq n μ ¨ mkTable ( previous ) enter ( table, name, type, offset ) addWidth ( table , width ) enterProc ( table , name , newtable ) sort var a:…; x:…; readarray var i:…; exchange quicksort var k, v:…; partition var i, j:…; a 6.14 a
Background image of page 19

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

View Full Document Right Arrow Icon
7.2 8 ª P M D ; S { addWidth ( top ( tblptr ), top ( offset )); pop ( tblptr ); pop ( offset ) } M ε { t = mkTable ( nil ); push ( t , tblprt ); push (0, offset ) } D D 1 ; D 2
Background image of page 20
Image of page 21
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}