Re: Is the dangling else a syntax bug?

Esmond Pitt <esmond.pitt@bigpond.com>
18 Jul 2001 20:09:33 -0400

          From comp.compilers

Related articles
[8 earlier articles]
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)
Re: Is the dangling else a syntax bug? joachim_d@gmx.de (Joachim Durchholz) (2001-07-23)
Re: Is the dangling else a syntax bug? vbdis@aol.com (2001-07-27)
Re: Is the dangling else a syntax bug? wb@vestein.arb-phys.uni-dortmund.de (2001-07-30)
Re: Is the dangling else a syntax bug? mike@dimmick.demon.co.uk (Mike Dimmick) (2001-07-30)
[5 later articles]
| List of all articles for this month |
From: Esmond Pitt <esmond.pitt@bigpond.com>
Newsgroups: comp.compilers
Date: 18 Jul 2001 20:09:33 -0400
Organization: Melbourne Software Company Pty Ltd
References: 01-06-073 01-07-020 01-07-029 01-07-072
Keywords: parse, Cobol
Posted-Date: 18 Jul 2001 20:09:33 EDT

Actually COBOL is not LALR(k) for any k, because of issues in the READ
statement where the syntax depends on the organization of the file.


EJP


David Thompson wrote:
> > 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.


Post a followup to this message

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