Modify the CFG and attribute grammar of Figures 4.11 and 4.14 to permit mixed integer and real expressions, without the need for float and trunc. You will want to add an annotation to any node that...


Modify the CFG and attribute grammar of Figures 4.11 and 4.14 to permit


mixed integer and real expressions, without the need for float and trunc.


You will want to add an annotation to any node that must be coerced to the


opposite type, so that the code generator will know to generate code to do


so. Be sure to think carefully about your coercion rules. In the expression


my_int + my_real, for example, how will you know whether to coerce the


integer to be a real, or to coerce the real to be an integer?



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here