Re: Programming language and IDE design

Hans-Peter Diettrich <DrDiettrich1@aol.com>
Thu, 05 Dec 2013 03:35:43 +0100

          From comp.compilers

Related articles
[19 earlier articles]
Re: Programming language and IDE design sgk@REMOVEtroutmask.apl.washington.edu (Steven G. Kargl) (2013-11-19)
Re: Programming language and IDE design gneuner2@comcast.net (George Neuner) (2013-11-19)
Re: Programming language and IDE design jonathan@cobalt.astro.indiana.edu (Jonathan Thornburg) (2013-11-19)
Re: Programming language and IDE design wclodius@earthlink.net (2013-11-22)
Re: Programming language and IDE design robin51@dodo.com.au (robin) (2013-11-25)
Re: Programming language and IDE design martin@gkc.org.uk (Martin Ward) (2013-12-03)
Re: Programming language and IDE design DrDiettrich1@aol.com (Hans-Peter Diettrich) (2013-12-05)
Re: Programming language and IDE design hu47121@usenet.kitty.sub.org (2014-03-02)
Re: Programming language and IDE design gneuner2@comcast.net (George Neuner) (2014-03-02)
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: Thu, 05 Dec 2013 03:35:43 +0100
Organization: Compilers Central
References: 13-11-016 13-11-018 13-11-031 13-12-003
Keywords: Fortran, parse, comment
Posted-Date: 04 Dec 2013 21:45:56 EST

Martin Ward schrieb:


> 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.


How would a LL grammar look like, when the lexer returns multiple tokens
for an identifier, here "DO","10" and "I"? With a traditional lexer I'd
suspect that such a language is *context sensitive*, with something else
for "LL(k)".


DoDi
[I suppose the prepass to tell whether it's an assignment is LL(1). You definitely
need to preprocess the statement to tell whether it's an assignment or something
else. After that, the parsing is very easy. -John]


Post a followup to this message

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