1

I am writing a compiler for language with nested functions.

I decided to use display to access local variables of outer functions from inner ones, I don't know how to represent writing of activation record to display array in intermediate representation, because to do this I need an access to stack pointer register, which is machine-depended.

There is another solution, instead of translate writing of activation record to display into intermediate representation, I can postpone this step to final stage of compilation, which do machine-depended translation.

So, my question is:

which solution is better, and if the first one, how to represent writing of activation record to display array in intermediate representation?

Makdous
  • 1,447
  • 1
  • 12
  • 24
cyberfined
  • 21
  • 3

0 Answers0