Re: Is the dangling else a syntax bug?

"David Thompson" <david.thompson1@worldnet.att.net>
17 Jul 2001 23:24:23 -0400

          From comp.compilers

Related articles
[4 earlier articles]
Re: Is the dangling else a syntax bug? ralph@inputplus.demon.co.uk (2001-07-06)
Re: Is the dangling else a syntax bug? ralph@inputplus.demon.co.uk (2001-07-06)
Re: Is the dangling else a syntax bug? gsc@zip.com.au (Sean Case) (2001-07-06)
Re: Is the dangling else a syntax bug? lars@bearnip.com (2001-07-06)
Re: Is the dangling else a syntax bug? vbdis@aol.com (2001-07-17)
Re: Is the dangling else a syntax bug? dynagen@eircom.net (Barry Kelly) (2001-07-17)
Re: Is the dangling else a syntax bug? david.thompson1@worldnet.att.net (David Thompson) (2001-07-17)
Re: Is the dangling else a syntax bug? genew@shuswap.net (2001-07-17)
Re: Is the dangling else a syntax bug? genew@shuswap.net (2001-07-17)
Re: Is the dangling else a syntax bug? toon@moene.indiv.nluug.nl (Toon Moene) (2001-07-18)
Re: Is the dangling else a syntax bug? esmond.pitt@bigpond.com (Esmond Pitt) (2001-07-18)
Re: Is the dangling else a syntax bug? jcrens@earthlink.net (Jack Crenshaw) (2001-07-23)
Re: Is the dangling else a syntax bug? marcov@toad.stack.nl (2001-07-23)
[9 later articles]
| List of all articles for this month |

From: "David Thompson" <david.thompson1@worldnet.att.net>
Newsgroups: comp.compilers
Date: 17 Jul 2001 23:24:23 -0400
Organization: AT&T Worldnet
References: 01-06-073 01-07-020 01-07-029
Keywords: syntax, design
Posted-Date: 17 Jul 2001 23:24:23 EDT

Lasse Hillerĝe Petersen <lhp+news@toft-hp.dk> wrote :
....
> On the other hand, most languages _do_ use the comma (and perhaps
> semicolon) as a separator. In any case, comparison with natural
> language is rather futile, as you rarely have nested periods.
>
> However, in natural languages, omitting a comma is rarely a cause for
> misunderstanding, whereas in programming languages it is almost always
> considered a syntactic error. Few languages make the semicolon
> optional (I don't consider line-oriented languages in that group); ...


If we consider any statement terminator not just semicolon, FWIW COBOL
uses period followed by a space to terminate a sequence of one or more
statements, which is almost isomorphic to terminating a statement but
being omittable on all but the last in a "sentence" or paragraph.
(COBOL85 adds END-IF etc. to specifically terminate nestable
statements, but still allows the old way.) But all statements begin
(at least) with a reserved keyword avoiding any ambiguity; in fact it
wouldn't surprise me if COBOL is LL(1), though I haven't checked. And
of course it tried unusually hard to "look like" natural language, at
least in PROCEDURE DIVISION.


--
- David.Thompson 1 now at worldnet.att.net


Post a followup to this message

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