Re: Languages that are hard to parse

Alexios Zavras <zvr@pobox.com>
2 Jun 2005 15:00:15 -0400

          From comp.compilers

Related articles
[10 earlier articles]
Re: Languages that are hard to parse DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2005-05-22)
Re: Languages that are hard to parse dot@dotat.at (Tony Finch) (2005-05-24)
Re: Languages that are hard to parse wclodius@lanl.gov (2005-05-24)
Re: Languages that are hard to parse Martin.Ward@durham.ac.uk (Martin Ward) (2005-05-24)
Re: Languages that are hard to parse ralph@inputplus.co.uk (2005-05-26)
Re: Languages that are hard to parse hannah@schlund.de (2005-06-02)
Re: Languages that are hard to parse zvr@pobox.com (Alexios Zavras) (2005-06-02)
Re: Languages that are hard to parse gene@abhost.us (Gene Wirchenko) (2005-06-04)
| List of all articles for this month |

From: Alexios Zavras <zvr@pobox.com>
Newsgroups: comp.compilers
Date: 2 Jun 2005 15:00:15 -0400
Organization: National Technical University of Athens, Greece
References: 05-05-119 05-05-155 05-05-166 05-05-182 05-05-192 05-05-200
Keywords: Cobol, parse, Basic
Posted-Date: 02 Jun 2005 15:00:15 EDT

Hans-Peter Diettrich <DrDiettrich@compuserve.de> writes:
>Henry Spencer wrote:
>>
>> Our moderator writes:
>> >[...The reason that PL/I doesn't have
>> >reserved words is that COBOL has a huge list, so that programmers either
>> >need to keep a chart of them on the office wall to consult every time they
>> >invent a new name, or be sure every name includes a hyphen or digit to
>> >be sure it doesn't collide with one. -John]
>>
>> Actually, it's worse than that. The usual approach is to keep a chart on
>> the wall of the *keywords* that have hyphens in them -- there are some --
>> and always put at least one hyphen in your names. The hyphenated-keywords
>> chart is a lot more manageable than the full keywords chart.
>
>Perhaps the keyword issue only is related to a specific lexer/parser
>philosophy? I'm no more familiar with COBOL, but in other programming
>languages many keywords have a special meaning only in specific
>context.


Back in the era of '80s 8-bit micros with built-in BASIC, a difference
of the Oric Atmos ("we use Microsoft BASIC!"), compared to other
machines like Sinclair/Timex of the time, was that you could not use
reserved words *anywhere* in your program (not even as part of other
words).


No much problem with RANDOMIZE, but you couldn't have a variable named
"SCORE" because "OR" was reserved...
--
-- zvr --
-- +---------------------------+ Alexios Zavras (-zvr-)
        | H eytyxia den exei enoxes | zvr@pobox.com
        +-----------------------zvr-+
[COBOL has the same problem. The huge list of reserved words is reserved
everywhere. -John]



Post a followup to this message

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