Re: How to handle qualified identifiers such as x.y in a Pascal-like language

Tony Finch <dot@dotat.at>
29 Jun 2011 18:55:26 +0100 (BST)

          From comp.compilers

Related articles
[6 earlier articles]
Re: How to handle qualified identifiers such as x.y in a Pascal-like l uu3kw29sb7@snkmail.com (\[Linux Magazine\]) (2011-06-24)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l gneuner2@comcast.net (George Neuner) (2011-06-24)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l gene.ressler@gmail.com (Gene) (2011-06-24)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l DrDiettrich1@aol.com (Hans-Peter Diettrich) (2011-06-25)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l gneuner2@comcast.net (George Neuner) (2011-06-25)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l noitalmost@cox.net (noitalmost) (2011-06-29)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l dot@dotat.at (Tony Finch) (2011-06-29)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l cr88192@hotmail.com (BGB) (2011-06-29)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l cr88192@hotmail.com (BGB) (2011-06-29)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l cr88192@hotmail.com (BGB) (2011-07-01)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l anton@mips.complang.tuwien.ac.at (2011-07-02)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l gneuner2@comcast.net (George Neuner) (2011-07-02)
Re: How to handle qualified identifiers such as x.y in a Pascal-like l cr88192@hotmail.com (BGB) (2011-07-03)
[2 later articles]
| List of all articles for this month |

From: Tony Finch <dot@dotat.at>
Newsgroups: comp.compilers
Date: 29 Jun 2011 18:55:26 +0100 (BST)
Organization: dotat labs
References: 11-06-037 11-06-042
Keywords: storage, symbols
Posted-Date: 01 Jul 2011 09:44:03 EDT
Originator: fanf@chiark.greenend.org.uk ([212.13.197.229])

noitalmost <noitalmost@cox.net> wrote:
>
>I looked at Aho's description of displays. Currently, my interpreter
>is using a more abstract stack. It's a stack of pointers, so the first
>declared variable in a scope goes at frame offset 0, the second at
>offset 1, etc. I was thinking of dedicating offset 0 to be a pointer
>to all the bookkeeping info, such as enclosing scope pointers. Will
>this work as my language matures, or are there some glaring gotchas?


The paper on the implementation of Lua 5.0 describes how it deals with
references to variables in outer scopes.
http://www.lua.org/doc/jucs05.pdf
Lua keeps book-keeping information outside the main evaluation stack;
there's a parallel stack of procedure invocation records, and function
closures are stored on the heap.


Tony.
--
f.anthony.n.finch <dot@dotat.at> http://dotat.at/



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.