Related articles |
---|
Interpreted Basic control-flow analysis ajonospam@andrew.cmu.edu (Arthur J. O'Dwyer) (2006-07-05) |
Re: Interpreted Basic control-flow analysis DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-07-06) |
Re: Interpreted Basic control-flow analysis chris.dollin@hp.com (Chris Dollin) (2006-07-06) |
Re: Interpreted Basic control-flow analysis ajonospam@andrew.cmu.edu (Arthur J. O'Dwyer) (2006-07-06) |
From: | Chris Dollin <chris.dollin@hp.com> |
Newsgroups: | comp.compilers |
Date: | 6 Jul 2006 08:58:14 -0400 |
Organization: | HP labs, Bristol |
References: | 06-07-006 06-07-009 |
Keywords: | Basic |
Posted-Date: | 06 Jul 2006 08:58:14 EDT |
Hans-Peter Diettrich wrote:
> "Arthur J. O'Dwyer" wrote:
>
>> The runtime nesting of control structures isn't
>> necessarily reflected by a lexical nesting.
>
> How that?
>
> AFAIK most BASIC interpreters embed links to related code places,
> whenever a jump is required (at the end of a loop, before an ELSE...),
> and do not rely on any kind of control stack. These references are
> updated before the start of a program, based on a static analysis of the
> code.
The BBC Basic interpreters (both the original Beeb ones and the
ARM-based ones) used dynamic control stacks for at least some of the
control structures. You could, for example, exit a procedure (with
ENDPROC) but still be "inside" a FOR loop.
So maybe /most/ Basic interpreters do it by static analysis, but /some/
don't, and presumably Arthur's [1] Basic is one of those.
[1] A highly appropriate name in this context!
--
Chris "once an Arc user" Dollin
"People are part of the design. It's dangerous to forget that." /Star Cops/
Return to the
comp.compilers page.
Search the
comp.compilers archives again.