Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!nerds-end From: noitalmost Newsgroups: comp.compilers Subject: Re: How to handle qualified identifiers such as x.y in a Pascal-like language Date: Wed, 29 Jun 2011 13:13:32 -0400 Organization: Compilers Central Lines: 44 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <11-06-050@comp.compilers> References: <11-06-037@comp.compilers> <11-06-046@comp.compilers> <11-06-047@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: gal.iecc.com 1309370660 14405 64.57.183.58 (29 Jun 2011 18:04:20 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Wed, 29 Jun 2011 18:04:20 +0000 (UTC) Keywords: symbols, storage Posted-Date: 29 Jun 2011 14:04:20 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:176 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.