S - Intranet - Department of Computer Science: Login
S - Intranet - Department of Computer Science: Login
S - Intranet - Department of Computer Science: Login
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Attribute Grammars<br />
• Example: expressions <strong>of</strong> the form id + id<br />
– id's can be either int_type or real_type<br />
– types <strong>of</strong> the two id's must be the same<br />
– type <strong>of</strong> the expression must match it's expected type<br />
• BNF:<br />
→ + <br />
→ id<br />
• Attributes:<br />
– actual_type - synthesized for and <br />
– expected_type - inherited for <br />
Copyright © 2004 Pearson Addison-Wesley. All rights reserved.<br />
5