Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #3390

Re: syntax complexity

From gah4 <gah4@u.washington.edu>
Newsgroups comp.compilers
Subject Re: syntax complexity
Date 2023-02-16 16:08 -0800
Organization Compilers Central
Message-ID <23-02-051@comp.compilers> (permalink)
References <23-02-045@comp.compilers> <23-02-047@comp.compilers> <23-02-050@comp.compilers>

Show all headers | View raw


On Thursday, February 16, 2023 at 2:46:25 PM UTC-8, gah4 wrote:

(snip)

> When I wrote that one, I was thinking about the places where Fortran uses
> special characters and PL/I uses words.

> DO I=1,10,3

> DO I = 1 TO 10 BY 3;

> I think about them in a different way, such that the thought complexity is different.

> A compiler doesn't "think" in that way.

> I suppose I agree with the above, the length of the standard, with some
> assumptions on how it is written, or the length of the front end.

(and our moderator wrote)
> [Having written a couple of Fortran parsers, I can say that while the hacks
> to deal with ignored spaces were ugly, they weren't that hard. PL/I has a
> separate issue that the same token might be a keyword or a variable depending
> on context, and the kinds of parsers you build with bison et al don't deal
> very well with that. -John]

Well there is that, but so far I was only thinking about the difference
between commas and keywords.

      WRITE(2,*) A, B, C
      PUT  FILE(TWO) SKIP LIST(A, B, C);

or

      READ(3'K) X
      READ FILE(THREE) INTO(X) KEY(K);

the funny IBM use of a single apostrophe for direct access files.

I had a part of a summer undergrad project working with the STEP
macro processor, which I wrote about some time ago.
I was writing the parser for IBM Fortran (not including leaving
out spaces between words), but there is no way to match a single
apostrophe!   Parsing string constants was done at a very low level.
[Like I said the hacks were ugly.  For example, this statement
contains a Hollerith constant:

123   FORMAT(4HELLO)

but this one does not:

      REAL*4HELLO

I was doing F77 which didn't do that strange quote thing but it's easy
enough to tell from context, since a quoted string has to follow a
punctuation mark that is not a close paren. -John]

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

syntax complexity gah4 <gah4@u.washington.edu> - 2023-02-15 15:08 -0800
  Re: syntax complexity Thomas Koenig <tkoenig@netcologne.de> - 2023-02-16 06:32 +0000
  Re: syntax complexity Hans-Peter Diettrich <DrDiettrich1@netscape.net> - 2023-02-16 12:03 +0100
    Re: syntax complexity gah4 <gah4@u.washington.edu> - 2023-02-16 11:33 -0800
      Re: syntax complexity gah4 <gah4@u.washington.edu> - 2023-02-16 16:08 -0800
      Re: syntax complexity Roger L Costello <costello@mitre.org> - 2023-02-20 15:09 +0000
        Re: syntax complexity gah4 <gah4@u.washington.edu> - 2023-02-20 09:57 -0800
          Re: syntax complexity anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2023-02-21 08:14 +0000
            Re: syntax complexity anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2023-02-21 18:39 +0000
              Re: ireegular expressions, syntax complexity anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2023-02-22 10:55 +0000
            Re: irregular expressions, syntax complexity arnold@freefriends.org (Aharon Robbins) - 2023-02-22 08:53 +0000
            Re: irregular expressions, syntax complexity Kaz Kylheku <864-117-4973@kylheku.com> - 2023-02-23 00:34 +0000
        Re: syntax complexity George Neuner <gneuner2@comcast.net> - 2023-02-20 13:49 -0500
      syntax complexity Christopher F Clark <christopher.f.clark@compiler-resources.com> - 2023-02-21 20:54 +0200

csiph-web