Spring 2011 CSCI 565 - Compiler Design
Spring 2011 CSCI 565 - Compiler Design
Spring 2011 CSCI 565 - Compiler Design
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Pedro Diniz<br />
pedro@isi.edu<br />
x = a * b + c * d - e * f;<br />
S<br />
id =<br />
x<br />
*<br />
E E<br />
id<br />
a<br />
id<br />
b<br />
<strong>CSCI</strong> <strong>565</strong> - <strong>Compiler</strong> <strong>Design</strong><br />
Assignment: Example<br />
E<br />
E<br />
*<br />
E E<br />
id<br />
c<br />
E<br />
+<br />
id<br />
d<br />
E<br />
-<br />
Production:<br />
E<br />
*<br />
E E<br />
id<br />
e<br />
id<br />
f<br />
<strong>Spring</strong> <strong>2011</strong><br />
E → id { p = lookup(id.name);<br />
}<br />
if (p != NULL)<br />
else<br />
E.place = p;<br />
error;<br />
E.code = null list;