Re: KEYWORDS AND WHILE
- From: "Tom Linden" <tom@xxxxxxxxxx>
- Date: Wed, 07 Jun 2006 05:31:20 -0700
On Wed, 07 Jun 2006 03:58:31 -0700, robin <robin_v@xxxxxxxxxxx> wrote:
"Tom Linden" <tom@xxxxxxxxxx> wrote in messageI am not certain that this example is worthy of further analysis, but if
news:op.tam7g4y0zgicya@xxxxxxxxxxxx
On Sun, 04 Jun 2006 14:47:40 -0700, robin <robin_v@xxxxxxxxxxx> wrote:
"Tom LINDEN" <tom@xxxxxxxxxx> wrote in message
news:op.tajj53qrlvpiaf@xxxxxxxxxxxx
On Fri, 02 Jun 2006 15:42:13 -0700, James J. Weinkam <jjw@xxxxxxxxx> wrote:
|> Peter Flass wrote:
|>> James J. Weinkam wrote:
|>>> Having reserved words stands in the way of language evolution. The
|>>> "price" one pays for not having reserved words is essentially
|>>> syntactic. In the case of PL/I, the required use of apparently
|>>> redundant parentheses and the fact that procedures are "nouns" rather
|>>> than "verbs" are perhaps the most obvious syntactic idiosyncracies
|>> This last sounds like an interesting point, but I don't understand
|>> what you're saying. Care to expound?
|> I don't recall the reference anymore, but many years ago I saw an
|> article that showed that language design features such as requiring
|> things like the expression after WHILE to be in parentheses, using CALL
|> procname(...) instead of just procname(...), and so on reduced the
|> number of conflicts in the grammar and also simplified the lexical
|> analysis of languages where language keywords were not reserved.
|> In fact, for instance, without that rule,
|> do while(a)=b; ... end; is ambiguous -- you can't tell whether while(a)
|> is the index variable of while is a keyword and (a)=b is an expression,
|> so at least that particular instance seems to be necessary.
|Maybe another exmple with valid syntax might better illustrate what you
|were driving at.
He illustrated (hypothesised) the case where parentheses were not required.
In this case, it is ambiguous. You can't tell whether WHILE is a keyword
or a variable (assuming that you have an array called WHILE).
Well, if it were a keyword then it is syntactically malformed, at least by
ANSI rules.
But it's impossible to tell whether it's being used as a keyword
or as an array.
it is intended as a keyword, then it is a syntax error, if not then the
array is undefined. Either way it is "bad"code and the compiler will issue
a diagnostic as I have previously posted.
.
- References:
- Re: pl1gcc-0.0.11 released
- From: henrik . sorensen
- Re: pl1gcc-0.0.11 released
- From: James J. Weinkam
- Re: pl1gcc-0.0.11 released
- From: Peter Flass
- Re: pl1gcc-0.0.11 released
- From: James J. Weinkam
- Re: pl1gcc-0.0.11 released
- From: Tom LINDEN
- Re: KEYWORDS AND WHILE
- From: robin
- Re: KEYWORDS AND WHILE
- From: Tom Linden
- Re: KEYWORDS AND WHILE
- From: robin
- Re: pl1gcc-0.0.11 released
- Prev by Date: Re: PL/I support is still available
- Next by Date: Re: PL/I support is still available
- Previous by thread: Re: KEYWORDS AND WHILE
- Next by thread: Re: pl1gcc-0.0.11 released
- Index(es):
Relevant Pages
|