From: | Hans-Peter Diettrich <DrDiettrich1@aol.com> |
Newsgroups: | comp.compilers |
Date: | Wed, 22 Jun 2011 11:47:19 +0100 |
Organization: | Compilers Central |
References: | 11-06-037 |
Posted-Date: | 23 Jun 2011 20:30:17 EDT |
noitalmost schrieb:
> What I don't quite understand is how to parse access to a variable in
> an outer stack frame. And I think this is similar to the problem of
> nested procedures (which I also don't quite know how to handle).
First of all: local procedures using local variables in an *outer*
stackframe are problematic. Such a language feature deserves much
work, in detail when you also want to allow to use local procedures as
callbacks (procedure pointers). I'd drop that from my language.
Otherwise John already explained how to pass a reference to outer
stackspace(s) to the nested procedure, as an hidden parameter. But
this added parameter will disallow to give away references to the
local subroutine, because the caller then doesn't know about that
parameter.
DoDi
Return to the
comp.compilers page.
Search the
comp.compilers archives again.