
Project: Compiler for a MiniC 371
12.8.6 Function Definition and Call
The code for user-defined functions is to be generated in a slightly special way. The raw assembly
code output for the functions is written, as an intermediate step, to a temporary file, with file handle
fout3. All the code generated within a function definition is to be put in this file. To manage that,
we have a switch variable:
int definition = 0;
For normal code, this variable has a value zero, but when the code for a function definition is being
generated its value is set to 1.
The grammar and yacc action terms associated with function definition, function call and formal ...