Re: problems with identifiers and keywords...

Peter Flass <Peter_Flass@Yahoo.com>
20 Nov 2004 21:26:46 -0500

          From comp.compilers

Related articles
[13 earlier articles]
Re: problems with identifiers and keywords... lkrupp@pssw.NOSPAM.com.INVALID (Louis Krupp) (2004-11-17)
Re: problems with identifiers and keywords... cfc@shell01.TheWorld.com (Chris F Clark) (2004-11-17)
Re: problems with identifiers and keywords... nmm1@cus.cam.ac.uk (2004-11-19)
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-19)
Re: problems with identifiers and keywords... gracjan@acchsh.nospam.com (Gracjan Polak) (2004-11-19)
Re: problems with identifiers and keywords... Martin.Ward@durham.ac.uk (Martin Ward) (2004-11-19)
Re: problems with identifiers and keywords... Peter_Flass@Yahoo.com (Peter Flass) (2004-11-20)
Re: problems with identifiers and keywords... genew@mail.ocis.net (Gene Wirchenko) (2004-11-20)
Re: problems with identifiers and keywords... david.thompson1@worldnet.att.net (Dave Thompson) (2004-11-28)
Re: problems with identifiers and keywords... cgweav@aol.com (2004-11-29)
Re: problems with identifiers and keywords... nmm1@cus.cam.ac.uk (2004-12-01)
Re: problems with identifiers and keywords... cdc@maxnet.co.nz (Carl Cerecke) (2004-12-01)
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-12-05)
[1 later articles]
| List of all articles for this month |

From: Peter Flass <Peter_Flass@Yahoo.com>
Newsgroups: comp.compilers
Date: 20 Nov 2004 21:26:46 -0500
Organization: Road Runner
References: 04-10-148 04-11-031 04-11-052 04-11-075
Keywords: parse
Posted-Date: 20 Nov 2004 21:26:46 EST

Martin Ward wrote:
> On Wednesday 17 Nov 2004 4:36 pm, you wrote:
>
>>I am not sure I agree with this. Human languages are fairly hard
>>for machines to parse, yet presumably designed for humans to
>>understand. In a large number of cases, I don't believe humans have
>>problems with keywords used as identifiers,


> Humans very rarely use keywords as identifiers: how many (English)
> people do you know who are called "The" or "And"?
> "Pass me the the will you, And?" is not immediately obvious.
>
> More seriously, humans are good at pattern matching: with a small
> number of keywords (and properly indented code) a human can pick out
> the keywords instantly and work out the overall structure of a chunk
> of code very quickly. When keywords are also used as identifiers,
> this is not possible.
>
> So the real solution to the problem of lots of keywords (where a
> programmer might use an unfamiliar keyword as an identifier) is simply
> to define fewer keywords and *not* to use unique keywords for rarely
> used constructs in the language.


I fail to see the problem. Of course a rational programmer isn't
going to use "IF" and "ELSE" as variables, but the X11 example
recently given shows the obnoxiousness or having keywords as reserved
words. "CLASS" is a perfectly good name for a variable.


I hadn't really noticed too many problems parsing PL/I. Most
ambiguous cases require only a one- or two-token look-ahead to
resolve, rarely more.


Post a followup to this message

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