-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Hi,
I stumbled upon your project whilst researching a PL/I grammar question and wondered if you might be able to answer it.
The Plithon project looks very interesting and I'm going to have a good look shortly!'
I'm a former PL/I developer and quite a few years ago built a PL/I compiler for Windows NT (it was able to generate linkable runnable code for part of the language). I based that on the ANSI X3.74-1987 standard and that (now shelved) project is now here.
Much more recently I began work on a new programming language intended to be systems programming language superior to C, designed for this role and based on several other languages but mainly on PL/I. The language aims to make it easier to write code for systems like operating systems and also microcontrollers where C dominates but lacks many features one expects when working at this level.
I trained in the 1980s on IBM mainframe PL/I then later started working on Stratus fault tolerant minicomputers who's OS (VOS) was written in PL/I by Bob Freiburghouse a former compiler developer and a lead developer of the Multics PL/I compiler. Stratus used PL/I as their preferred programming language (their compiler was written in PL/I).
But I no longer have access to any solid representative PL/I environments and cannot cross check my thinking for some areas that are rusty.
Here's my current puzzling question
The formal grammar defined in ANSI X3.74-1987 is primarily the basis for my own grammar and the bulk of it is quite familiar to me, I've developed a solid Antlr4 grammar that works very well and is able to correctly parse inputs where keywords are not reserved, statements split across lines and a number of other capabilities.
But I'm puzzled by something, probably something I even did or used twenty five years ago but since forgotten look at this:
table.entries.layers.count(a,b,c,d) = 0;
As you likely know subscripts can be moved to the left without impacting the meaning (assuming each name is an array in some structure of arrays) . So this too is valid syntax:
table.entries(a,b).layers.count(c,d) = 0;
as is
table(a).entries.layers(b).count(c,d) = 0;
and so on, these are all valid according to the ANSI 87 standard.
But the grammar also allows this:
table.entries.layers.count(a,b)(c,d) = 0;
Which I just can't ever recall seeing or using.
It allows a multiplicity of parenthesized subscript lists but I can't really find out what it would mean if one were to write it. I can see how it would make total sense if this table.entries.layers.count(a,b) identified a PL/I entry variable, in that case the (c,d) would the the arguments to the procedure call.
But it might also just be another aspect of the flexible subscripting notation PL/I supports.
The ANSI standard does define that meaning but it is very cryptic and before I spend days and days trying to unravel that I wanted to ask someone who has a good knowledge of PLI !
(If you're interested the current grammar definition can be found here. The language is named Syscode and sprung up after some exploratory work I did on a hypothetical language I called Imperium which was simply research. The parser rule that allows multiple sets of parenthesized commalists is named argumentList (these names are all the same as are used in the ANSI standard. This is a grammar stress test file).