• ALGOLW parser

    From gah4@21:1/5 to All on Tue Jul 26 23:31:33 2022
    I am looking at the source for the OS/360 ALGOLW compiler,
    written by Wirth in about 1969.

    There is a file which seems to be for a parser generator
    that starts out like this:


    <K REG> ::= <ID>
    <T CELL ID> ::= <ID>
    <PROC ID> ::= <ID>
    <FUNC ID> ::= <ID>
    <T CELL> ::= <T CELL ID>
    <T CELL1> )
    <T CELL2> )
    <T CELL1> ::= <T CELL2> <ARITH OP> <T NUMBER>
    <T CELL3> <T NUMBER>
    <T CELL2> ::= <T CELL3> <K REG>
    <T CELL3> ::= <T CELL ID>
    <UNARY OP> ::= ABS
    NEG
    NEG ABS
    <ARITH OP> ::= +
    -
    *
    /
    + +
    - -
    <LOG OP> ::= AND
    OR
    XOR
    <K REG ASS> ::= <K REG> := <T CELL>
    <K REG> := <T NUMBER>
    <K REG> := <STRING>
    <K REG> := <T CELL>


    It looks like actual input to a program, and there is some output
    from the processor, but I don't know what program it is.

    This seems a little too early for lex/yacc.
    [Algol W was written in PL360, a very nice little assembler with
    Algol-like syntax. I'm pretty sure it used a hand-written parser and
    what you have is part of the documentation. I also believe I saw a
    thread somewhere saying the source code for both was lost, although
    PL360 was used for other stuff and there may be later versions of it.
    -John]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gah4@21:1/5 to And our moderator on Wed Jul 27 10:39:16 2022
    (I wrote)

    I am looking at the source for the OS/360 ALGOLW compiler,
    written by Wirth in about 1969.

    There is a file which seems to be for a parser generator

    (snip)

    It looks like actual input to a program, and there is some output
    from the processor, but I don't know what program it is.

    And our moderator replied:

    [Algol W was written in PL360, a very nice little assembler with
    Algol-like syntax. I'm pretty sure it used a hand-written parser and
    what you have is part of the documentation. I also believe I saw a
    thread somewhere saying the source code for both was lost, although
    PL360 was used for other stuff and there may be later versions of it.
    -John]

    There is a scanned listing of at least some parts of ALGOLW, and yes
    mostly PL360, and some assembler. And this file is from that listing.

    It seems to be output of a program, so I believe not only documentation.

    Looking more closely, though, it is related to the syntax of PL360,
    and not of ALGOLW, even though it is in the middle of source listings
    of the ALGOLW compiler.

    The listings are here:

    http://bitsavers.org/pdf/stanford/listing/Algol_W_Listing_Nov69.pdf

    and it is on about page 101.

    It seems that in addition to the listings, the source of the MTS
    ALGOLW compiler from some years later is available. The low
    level I/O routines and other OS specific parts will be different,
    but the internal compiler routines should be close.
    [Well, whaddaya know. The PL360 table generator that reads the BNF is
    just before the BNF, starting on page 81. -John]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gah4@21:1/5 to And our moderator on Wed Jul 27 13:36:09 2022
    On Wednesday, July 27, 2022 at 11:01:09 AM UTC-7, gah4 wrote:
    (I wrote)

    It seems that in addition to the listings, the source of the MTS
    ALGOLW compiler from some years later is available. The low
    level I/O routines and other OS specific parts will be different,
    but the internal compiler routines should be close.

    And our moderator wrote:
    [Well, whaddaya know. The PL360 table generator that reads the BNF is
    just before the BNF, starting on page 81. -John]

    Aha!

    Since I didn't know where to start, and especially as I want to compare to the MTS source, I was going through looking for PROCEDURE statements
    (and for CSECT in the assembly code). I wanted a rough idea about
    how the modules went together, without too many details.

    I did notice that the one on page 81 didn't start with PROCEDURE,
    and thought that was strange, but it didn't occur to me that it was a completely different program.

    (Even though that is the obvious reason.)

    So, what was usual for parser generators in 1969?

    I also noted a linkage editor map for a PL/I (F) program named ALPHA,
    though the program itself seems not to be there. I was, just a little, suspecting that was the program to read it.

    thanks!
    [My recollection is that there were a lot of programs that would read some
    form of BNF and create parser tables, but yacc was the first one that let
    you interspese the rules and the action code which made it a lot easier
    to use. -John]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)