Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: wclodius@earthlink.net (William Clodius) Newsgroups: comp.compilers Subject: Re: Programming language and IDE design Date: Fri, 22 Nov 2013 18:27:41 -0700 Organization: Compilers Central Lines: 35 Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <13-11-027@comp.compilers> References: <13-10-016@comp.compilers> <13-10-017@comp.compilers> <13-11-003@comp.compilers> <13-11-011@comp.compilers> <13-11-016@comp.compilers> <13-11-018@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1385170347 36430 64.57.183.58 (23 Nov 2013 01:32:27 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sat, 23 Nov 2013 01:32:27 +0000 (UTC) Keywords: Fortran, parse, comment Posted-Date: 22 Nov 2013 20:32:27 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1051 George Neuner wrote: > On Sat, 16 Nov 2013 15:55:10 +0000, Martin Ward > wrote: > > >On Friday 08 Nov 2013 at 21:04, George Neuner wrote: > > > >> The majority of successful languages are LL(k) for small k. It's hard > >> to get much simpler than that for parsing. > > > >C is not LL(K), neither is COBOL, nor C++, nor I think is Java. > >That probably covers the majority of successful languages: > >if "success" is defined as "total lines of code in production". > > They _all_ are LL(k). More specifically, I believe all of your > examples are, at most, LL(2). > > AFAIK, Fortran's DO loop requires the most lookahead of any of the > classic language features: LL(4) [if I'm counting correctly]. > > 10DOI=42 > 10DOI=42,45 > > Card Fortran didn't require whitespace separation. You had to look > ahead to find [or not] the comma to distinguish DO "I = m,n" from the > assignment "DOI = n". In Fortran typically staement classification (and identification of tokens in fixed form) was performed as an initial pass. Once the statement is identified as to whether or not it is an assignment then the syntactic interpretation of the first token is LL(1), and I suspect all tokens including Holleriths. [I wrote some F77 parsers 30 years ago, and there was some reason I needed to deal with the Hollerith strings before the rest of the pre-parse, but I don't remember offhand what it was. -John]