We add function declarations and function return to the example language by adding the productions FunDec → id ( Params ) Stat Params → id Params → id , Params Stat → return Exp Using the informal...



We add function declarations and function return to the example


language by adding the productions


FunDec → id ( Params ) Stat


Params → id


Params → id , Params


Stat → return Exp


Using the informal explanation in Sect. 6.9.2, extend TransStat and write translation functions TransFunDec and TransParams to implement these extensions. You


can assume that you already have a ftable that maps source-level function names


to intermediate-code function names, so this can be used as inherited attribute by


TransFunDec. You can also assume that there are no repeated parameter names, as


this would have been detected by a type checker.



May 26, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here