29.04.2015 Views

Syntax Directed Translation

Syntax Directed Translation

Syntax Directed Translation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Directed</strong> Acyclic Graphs for Expressions (<br />

ASU Ch 5.2 Fig 5.11)<br />

• a + a * ( b - c ) + ( b - c ) * d<br />

• note the common sub-expressions a and (b-c)<br />

+<br />

+ *<br />

*<br />

-<br />

d<br />

a<br />

b<br />

c<br />

• see ASU Fig 5.12 (p291) for the instructions (mknode / mkleaf) and Fig 5.13<br />

(p292) for an array implementation of the nodes<br />

12<br />

14/10/2014 DFR - CC - SDT

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!