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.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here