Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.compilers > #1058
| From | Martin Ward <martin@gkc.org.uk> |
|---|---|
| Newsgroups | comp.compilers |
| Subject | Re: Programming language and IDE design |
| Date | 2013-12-03 15:15 +0000 |
| Organization | Compilers Central |
| Message-ID | <13-12-003@comp.compilers> (permalink) |
| References | <13-11-016@comp.compilers> <13-11-018@comp.compilers> <13-11-031@comp.compilers> |
On Sunday 24 Nov 2013 at 23:33, "robin" <robin51@dodo.com.au> wrote:
> > 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
>
> The statements are
> DO 10 I = 42
> DO 10 I = 42, 45
The difference is even smaller than this:
DO 10 I = 42.45
DO 10 I = 42,45
The first is an assignment of a floating point value to variable DO10I,
the second is a loop with I as the loop variable.
Fortran allows spaces in the middle of identifiers, so requiring
spaces around keywords does not help (unless you *also*
disallow spaces within identifiers).
The fact that the two statements can be distinguished with an LL(k)
parser does not necessarily mean that the language is easy to read.
Disallowing spaces within identifiers, insisting on spaces around keywords,
insisting on correct indentation and correct and distinct closing keywords
to block structures, and requiring all identifiers to be declared with an
appropriate type, all make the language harder to write:
but also easier for humans to read (even if they make no difference
to the language parser). Any, or all, of these restrictions would have
prevented the confusion between an assignment and a loop.
--
Martin
Dr Martin Ward STRL Principal Lecturer and Reader in Software Engineering
martin@gkc.org.uk http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4
G.K.Chesterton web site: http://www.cse.dmu.ac.uk/~mward/gkc/
Mirrors: http://www.gkc.org.uk and http://www.gkc.org.uk/gkc
Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Programming language and IDE design Martin Ward <martin@gkc.org.uk> - 2013-11-16 15:55 +0000
Re: Programming language and IDE design Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2013-11-16 19:48 +0100
Re: Programming language and IDE design George Neuner <gneuner2@comcast.net> - 2013-11-18 19:02 -0500
Re: Programming language and IDE design "Steven G. Kargl" <sgk@REMOVEtroutmask.apl.washington.edu> - 2013-11-19 15:36 +0000
Re: Programming language and IDE design George Neuner <gneuner2@comcast.net> - 2013-11-19 12:41 -0500
Re: Parsing Fortran, was Programming language and IDE design glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-11-19 20:18 +0000
Re: Parsing Fortran, was Programming language and IDE design glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2013-11-21 21:22 +0000
Re: Programming language and IDE design wclodius@earthlink.net (William Clodius) - 2013-11-22 18:27 -0700
Re: Programming language and IDE design "robin" <robin51@dodo.com.au> - 2013-11-25 10:33 +1100
Re: Programming language and IDE design Martin Ward <martin@gkc.org.uk> - 2013-12-03 15:15 +0000
Re: Programming language and IDE design Hans-Peter Diettrich <DrDiettrich1@aol.com> - 2013-12-05 03:35 +0100
Re: Programming language and IDE design hu47121@usenet.kitty.sub.org (Hannah) - 2014-03-02 00:03 +0000
Re: LL vs LR, was Programming language and IDE design Ivan Godard <ivan@ootbcomp.com> - 2014-03-01 20:31 -0800
Re: LL vs LR, was Programming language and IDE design Kaz Kylheku <kaz@kylheku.com> - 2014-03-02 18:41 +0000
Re: Programming language and IDE design George Neuner <gneuner2@comcast.net> - 2014-03-02 12:21 -0500
Re: Programming language and IDE design Jonathan Thornburg <jonathan@cobalt.astro.indiana.edu> - 2013-11-19 19:39 +0000
csiph-web