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

noitalmost <noitalmost@cox.net>
Wed, 29 Jun 2011 13:13:32 -0400

          From comp.compilers

Related articles
[5 earlier articles]
Re: How to handle qualified identifiers such as x.y in a Pascal-like l DrDiettrich1@aol.com (Hans-Peter Diettrich) (2011-06-24)
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)
[3 later articles]
| List of all articles for this month |

From: noitalmost <noitalmost@cox.net>
Newsgroups: comp.compilers
Date: Wed, 29 Jun 2011 13:13:32 -0400
Organization: Compilers Central
References: 11-06-037 11-06-046 11-06-047
Keywords: symbols, storage
Posted-Date: 29 Jun 2011 14:04:20 EDT

On Saturday, June 25, 2011 06:55:06 am Hans-Peter Diettrich wrote:
> IMO qualifiers should allow to address identifiers in *external* (here:
> outer) scopes, which otherwise would be hidden by a local identifier of
> the same name.


For my language, this is my intention.


> A more elaborate example:
>
> program P;
> var P;
> var x;
> procedure P;
> var P: RecordContainingX;
> var x;
> procedure P;
> var x;
> ... P.x ...
> ... P.P.x ...
> end; //inner P
> ... P.x ... //x in var P or in outer procedure P?
# should be x in the record var P
> ... P() ... //recursive or local procedure call?
# local call


My language's scopes for this program would have the following symbols:
global scope:
P # the program
program P's scope:
P, x # variables
P # procedure
procedure P's scope:
P # record containing x
x
P # procedure
inner procedure P's scope:
x


Thanks for this example. It has helped me to consider some additional cases. I
never thought about the recursive vs. local call of P() in the above.


I'm parsing the dots left to right, which seems like it will give the results
I desire.



Post a followup to this message

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