Groups | Search | Server Info | Login | Register
Groups > comp.compilers > #170
| From | "[Linux Magazine]" <uu3kw29sb7@snkmail.com> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: How to handle qualified identifiers such as x.y in a Pascal-like language |
| Date | 2011-06-24 13:58 +0200 |
| Organization | Compilers Central |
| Message-ID | <11-06-044@comp.compilers> (permalink) |
| References | <11-06-037@comp.compilers> <11-06-040@comp.compilers> |
A follow up to the discussion on displays and linked list of stack frames. Many languages allow for storing references to procedures in variables, or passing procedures as parameters. One example is the GNU variant of C and C++ implemented in GCC, which allows for both AND nested procedures. If thread starters language include storing references to procedures and/or passing procedures as parameters, then thread starter needs to consider, how to store references to procedures, and he better consider it now. When using linked lists of stack frames, the normal way of storing references to procedures is to store a reference to the start of the code implementing the procedure and a reference to the start of the linked list of stack frames. Thus you have a record with two fields. When using displays you have the problem of storing the display somewhere. In some cases GCC uses something like trapezes for storing references to procedures without having a record with two fields. Unfortunately that involves storing code in writable storage, and that is a big no no for security reasons. Storing code in writable storage makes life so much easier for hackers. In practice people do not write procedures in procedures that much, and procedures in procedures in procedures are rare. This also means that you need efficient access to global variables and variables local to the procedure currently being executed. Further the access to variables declared in the directly surrounding scope should be fairly efficient. The rest just needs to work. You will do fine with an implementation where all procedures have direct access to its own variables and global variables, and variables declared in surrounding procedures may be more difficult to access.
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar
How to handle qualified identifiers such as x.y in a Pascal-like language noitalmost <noitalmost@cox.net> - 2011-06-20 15:43 -0400
Re: How to handle qualified identifiers such as x.y in a Pascal-like language torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-06-22 10:57 +0200
Re: How to handle qualified identifiers such as x.y in a Pascal-like language Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2011-06-22 11:47 +0100
Re: How to handle qualified identifiers such as x.y in a Pascal-like language George Neuner <gneuner2@comcast.net> - 2011-06-24 18:13 -0400
Re: How to handle qualified identifiers such as x.y in a Pascal-like language BGB <cr88192@hotmail.com> - 2011-06-29 12:31 -0700
Re: How to handle qualified identifiers such as x.y in a Pascal-like language BGB <cr88192@hotmail.com> - 2011-07-01 12:46 -0700
Re: How to handle qualified identifiers such as x.y in a Pascal-like language anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-07-02 17:13 +0000
Re: How to handle qualified identifiers such as x.y in a Pascal-like language BGB <cr88192@hotmail.com> - 2011-07-03 13:14 -0700
Re: How to handle qualified identifiers such as x.y in a Pascal-like language torbenm@diku.dk (Torben Ægidius Mogensen) - 2011-07-07 10:27 +0200
Re: How to handle qualified identifiers such as x.y in a Pascal-like language BGB <cr88192@hotmail.com> - 2011-07-07 04:14 -0700
Re: How to handle qualified identifiers such as x.y in a Pascal-like language George Neuner <gneuner2@comcast.net> - 2011-07-02 16:58 -0400
Re: How to handle qualified identifiers such as x.y in a Pascal-like language Gene <gene.ressler@gmail.com> - 2011-06-22 19:21 -0700
Re: How to handle qualified identifiers such as x.y in a Pascal-like language Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2011-06-24 07:56 +0100
Re: How to handle qualified identifiers such as x.y in a Pascal-like language Gene <gene.ressler@gmail.com> - 2011-06-24 19:19 -0700
Re: How to handle qualified identifiers such as x.y in a Pascal-like language Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2011-06-25 11:55 +0100
Re: How to handle qualified identifiers such as x.y in a Pascal-like language noitalmost <noitalmost@cox.net> - 2011-06-29 13:13 -0400
Re: How to handle qualified identifiers such as x.y in a Pascal-like language "[Linux Magazine]" <uu3kw29sb7@snkmail.com> - 2011-06-24 13:58 +0200
Re: How to handle qualified identifiers such as x.y in a Pascal-like language George Neuner <gneuner2@comcast.net> - 2011-06-25 17:11 -0400
Re: How to handle qualified identifiers such as x.y in a Pascal-like language noitalmost <noitalmost@cox.net> - 2011-06-23 12:43 -0400
Re: How to handle qualified identifiers such as x.y in a Pascal-like language Tony Finch <dot@dotat.at> - 2011-06-29 18:55 +0100
Re: How to handle qualified identifiers such as x.y in a Pascal-like language BGB <cr88192@hotmail.com> - 2011-06-29 15:51 -0700
csiph-web