Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Parser generator

43 views
Skip to first unread message

Dennis Boone

unread,
Jan 8, 2012, 12:47:06 PM1/8/12
to
Folks,

I'm looking for a parser generator that generates output in PL/I.
That is, in the same way that there are variants of yacc that generate
Pascal or Perl or Java, I want "pl1yacc" (or pl1antlr or pl1eli or
.... you get the idea.)

Anyone know of such a tool?

Thanks,

De
[In the 35 years I've been in this biz, I've never seen one. It wouldn't
be hard in principle to translate the parser skeleton in bison or yacc to
generate PL/I, but it'd still be a chunk of work. -John]

glen herrmannsfeldt

unread,
Jan 8, 2012, 4:58:47 PM1/8/12
to
Dennis Boone <d...@msu.edu> wrote:

> I'm looking for a parser generator that generates output in PL/I.
> That is, in the same way that there are variants of yacc that generate

(snip)

> [In the 35 years I've been in this biz, I've never seen one. It wouldn't
> be hard in principle to translate the parser skeleton in bison or yacc to
> generate PL/I, but it'd still be a chunk of work. -John]

One reason that I learned C was that none of the computers I was using
at the time had PL/I compilers. PL/I was much more fun to write than
Fortran 66 or even Fortran 77.

Most C statements should translate fairly easy into PL/I, such that
you could almost do it statement by statement.

Not having actually looked at the code recently, it might be that it
could be done using an automated system of some kind, possibly even
written with flex and yacc (or bison).

-- glen

SLK Systems

unread,
Jan 8, 2012, 8:26:53 PM1/8/12
to
>I'm looking for a parser generator that generates output in PL/I.

Easy to add this or most any language to SLK since it is tables with a
very small driver and fully separate action code. Have a look at the C
output from the sample grammar. If you can translate that to PL/I, I
can add it as a standard language.

http://slkpg.byethost7.com

glen herrmannsfeldt

unread,
Jan 11, 2012, 2:22:51 AM1/11/12
to
SLK Systems <slk...@gmail.com> wrote:

(snip)
> http://slkpg.byethost7.com

"You may not reverse engineer, decompile, or disassemble
the Product, except and only to the extent that such activity is
expressly permitted by applicable law, notwithstanding this
limitation."

I wonder if translating to PL/I is disallowed by one of those.
Otherwise, it sounds pretty useful.

-- glen

Aharon Robbins

unread,
Jan 11, 2012, 3:06:55 PM1/11/12
to
glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
>Dennis Boone <d...@msu.edu> wrote:
>One reason that I learned C was that none of the computers I was using
>at the time had PL/I compilers. PL/I was much more fun to write than
>Fortran 66 or even Fortran 77.

Are there PL/I compilers available for modern platforms? E.g. Windows,
Linux 32 and 64 bit Intel, sparc, power pc, etc.... (I see there was
a start at one for GCC.)

Is there a reason to prefer PL/I over C++ or Java?

Just wondering.

Thanks,

Arnold
--
Aharon (Arnold) Robbins arnold AT skeeve DOT com
P.O. Box 354 Home Phone: +972 8 979-0381
Nof Ayalon Cell Phone: +972 50 729-7545
D.N. Shimshon 99785 ISRAEL
[Yes, there's PL/I for a surprising array of computers. If you're doing a
lot of formatted I/O it's a considerable improvement over its
successors. -John]

Dennis Boone

unread,
Jan 11, 2012, 5:19:13 PM1/11/12
to
> Are there PL/I compilers available for modern platforms? E.g. Windows,
> Linux 32 and 64 bit Intel, sparc, power pc, etc.... (I see there was
> a start at one for GCC.)

There are a few commercial ones. IBM supports Windows, OS/2, AIX I
think. Iron Spring's is in beta and available for Linux and Windows.
One of the big compiler outfits whose identity is escaping me right
now has one for Windows, at least.

The pl1gcc effort seems to have stalled a couple of years ago.
A shame; I was looking forward to being able to use it. (So of course
I should have contributed to help keep it going. Sigh.)

> Is there a reason to prefer PL/I over C++ or Java?

For the project I'm planning, "modern" isn't a valid limitation,
and C++/Java are not available on all the platforms.

In general, for new development on modern platforms, I would think
it'd be hard to guarantee long-term ability to hire programmers to
do anything in PL/I, more's the pity.

De

Robert AH Prins

unread,
Jan 11, 2012, 6:42:13 PM1/11/12
to
On 2012-01-11 20:06, Aharon Robbins wrote:
> glen herrmannsfeldt<g...@ugcs.caltech.edu> wrote:
>> Dennis Boone<d...@msu.edu> wrote:
>> One reason that I learned C was that none of the computers I was using
>> at the time had PL/I compilers. PL/I was much more fun to write than
>> Fortran 66 or even Fortran 77.
>
> Are there PL/I compilers available for modern platforms? E.g. Windows,
> Linux 32 and 64 bit Intel, sparc, power pc, etc.... (I see there was
> a start at one for GCC.)

Yes, IBM sells a PL/I compiler for Windows, though not separately. It's
part of the USD 5,800(ish) RDz product, but a free 60-day trial is
available. The compiler is currently at the same level as z/OS
Enterprise PL/I V4R1, but there have been rumors that the product is
being deprecated, and according to the current chairman of the German
GSE PL/I-Cobol group, nobody of those present at a meeting of this group
in Germany last year was actually using the product when asked by one of
the IBM developers...

Another indication of it possibly being deprecated is the fact that IBM
refuses to acknowledge a severe bug in the product, despite being told
about this almost 18 months ago.

Another PL/I compiler is being developed by Iron Spring Software
<http://www.iron-spring.com/index.html>, for Linux and OS/2(!)...

Robert
--
Robert AH Prins
robert(a)prino(d)org

SLK Systems

unread,
Jan 11, 2012, 8:28:06 PM1/11/12
to
>I wonder if translating to PL/I is disallowed by one of those.

Not meant to be. I will try to simplify that license. PL/I is very
slightly before my time, so I would need someone to show me what the
output of SLK should look like for PL/I.

http://slkpg.byethost7.com

comp...@is-not-my.name

unread,
Jan 12, 2012, 11:30:06 AM1/12/12
to
On Thu Jan 12 07:18:12 2012 arn...@skeeve.com wrote:

> Is there a reason to prefer PL/I over C++ or Java?

Yes, several. It would be more relevant to ask if PL/I is preferable to C
since PL/I is not an object oriented language, is suitable for systems
programming (usually has but does not necessarily require a runtime), does
not have garbage collection, implementations don't use a VM, etc.

People coming from IBM envionments usually don't have any C experience but
often do have a reasonable working knowledge of PL/I or at least exposure to
it. PL/I is more powerful than C, is older, has good optimizing compilers
available, and I personally prefer it. About the only advantage of C over
PL/I is C usually has some provision for dropping into assembler. PL/I
doesn't offer this feature.

As usual, it comes down to what tools are available on your target platforms
and what you prefer.

Robert AH Prins

unread,
Jan 14, 2012, 4:20:34 AM1/14/12
to
On 2012-01-12 16:30, comp...@is-not-my.name wrote:
> On Thu Jan 12 07:18:12 2012 arn...@skeeve.com wrote:
>
>> Is there a reason to prefer PL/I over C++ or Java?
>
> Yes, several. It would be more relevant to ask if PL/I is preferable
> to C since PL/I is not an object oriented language, is suitable for
> systems programming (usually has but does not necessarily require a
> runtime), does not have garbage collection, implementations don't use
> a VM, etc.
>
> People coming from IBM environments usually don't have any C
> experience but often do have a reasonable working knowledge of PL/I
> or at least exposure to it. PL/I is more powerful than C, is older,
> has good optimizing compilers available,

The IBM PL/I for Windows compiler generates code that is in many cases
no better than the code generated by the likes of Turbo Pascal V3, and
even the code generated by IBM's Enterprise PL/I compiler for z/OS
leaves a lot to be desired. (Disclaimer, I don't have access to anything
after Enterprise PL/I V3R7, current is V4R2, so things may have improved)

> and I personally prefer it. About the only advantage of C over PL/I
> is C usually has some provision for dropping into assembler. PL/I
> doesn't offer this feature. As usual, it comes down to what tools
> are available on your target platforms and what you prefer.

Derek M. Jones

unread,
Jan 14, 2012, 9:08:29 AM1/14/12
to
Hello,

It is interesting to hear someone stand up for PL/1 these days.
http://shape-of-code.coding-guidelines.com/2011/09/25/does-the-uk-need-the-pl1-standard/

>> Is there a reason to prefer PL/I over C++ or Java?
>
> People coming from IBM envionments usually don't have any C experience but
> often do have a reasonable working knowledge of PL/I or at least exposure to
> it. PL/I is more powerful than C,

Since both are Turing complete languages how is PL/1 more powerful?

> is older, has good optimizing compilers
> available,

But are they available for cpus that most people use today?

> and I personally prefer it.

Probably the major reason why people promote the benefits of any language.
[This is getting a bit far from compiler design. PL/I suffers and
benefits from being a kitchen sink language. Cobol-style pictures
are really handy if you're doing formatted numeric I/O, just
strange otherwise. -John]

robin

unread,
Jan 14, 2012, 10:00:05 AM1/14/12
to
> From: "Dennis Boone" <d...@msu.edu>
> Sent: Monday, 9 January 2012 4:47 AM

> I'm looking for a parser generator that generates output in PL/I.
> That is, in the same way that there are variants of yacc that generate
> Pascal or Perl or Java, I want "pl1yacc" (or pl1antlr or pl1eli or
> .... you get the idea.)

> Anyone know of such a tool?

Have you looked at XPL?

The output is almost PL/I.

The XPL translator-writing system consists of a compiler, XPL, a
grammar analysis program that accepts a definition of the desired
language expressed in BNF, and other tools. The analyser produces the
required parse tables etc.

Details are contained in McKeeman, Horning, and Wortman,
"A Compiler Generator", published by Prentice-Hall in 1971.

For more info on the history of the system, see
http://en.wikipedia.org/wiki/XPL

One of the URLs there is a link to XPL software.
A PL/I version of the XPL compiler is available.

The Analyser could be readily modified to produce its output in PL/I,
(and of course, the output--which is in XPL--could in any case be modified
as it it reasonably close to PL/I anyway).

glen herrmannsfeldt

unread,
Jan 14, 2012, 8:01:17 PM1/14/12
to
Derek M. Jones <derek@_nospam_knosof.co.uk> wrote:

(snip, someone previously wrote)

>>> Is there a reason to prefer PL/I over C++ or Java?

(snip, someone else wrote)
>> PL/I is more powerful than C,

> Since both are Turing complete languages how is PL/1 more powerful?

It seems to me that there are at least to ways to consider a language
powerful. One is that it lets you do many different things, the other
is that it allows them to be expressed easily.

This has at least some connection to compilers, so maybe not too
far off topic.

One PL/I feature that C doesn't have is array and structure expressions.

You can write:

A = B + C;

for arrays or structures (or arrays of structures) in PL/I, but you
need loops, possibly nested loops, in C. (For structures, usually many
statements, as it isn't so easy to loop over a structure.)

Fortran now has array expressions, but still not structure expressions.

> Probably the major reason why people promote the benefits of any language.

(snip)

> [This is getting a bit far from compiler design. PL/I suffers and
> benefits from being a kitchen sink language. Cobol-style pictures
> are really handy if you're doing formatted numeric I/O, just
> strange otherwise. -John]

I do hope that sometimes language feature discussions, related to the
ability, or lack thereof, to implement them in a compiler would be on
topic.

I do remember Picture format and Picture variables, though maybe I
never tried them. I liked the idea of picture format, but thought that
picture variables were strange. I even remember that there were
Picture format options for British Pounds/Shillings/Pence, though
maybe not in newer compilers.

-- glen
[Those came straight from Cobol. For what they're intended for, printing tidy
columns of numbers in reports, they work very well. -John]

Dennis Boone

unread,
Jan 15, 2012, 12:40:38 AM1/15/12
to
> Have you looked at XPL?

> The output is almost PL/I.

I've actually been trying to figure out what the differences are
between XPL and Extended XPL.

De

glen herrmannsfeldt

unread,
Jan 15, 2012, 6:36:56 AM1/15/12
to
glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:

(snip, I wrote)
> I do remember Picture format and Picture variables, though maybe I
> never tried them. I liked the idea of picture format, but thought that
> picture variables were strange.

(snip)
> [Those came straight from Cobol. For what they're intended for, printing tidy
> columns of numbers in reports, they work very well. -John]

Hopefully discussions on internal data representation by compilers
aren't too far off topic.

As I understood it, picture variables stored the value as a text
representation, what IBM calls unpacked decimal. I still have not run
even one COBOL program, though recently I was scanning some COBOL
manuals to send to bitsavers.

You can write tidy columns with Fortran FORMAT, but you don't get so
much choice in how they come out. There is currently a discussion in
comp.lang.fortran on optional leading zeros that the standard allows,
(or allowed in older versions of the standard) and that different
compilers implement differently.

Picture allows you to specify, for example, exactly how many leading
zeros you want. C allows for zero padding or blank padding, but
nothing in between. (And I don't remember what it does for leading
zeros with %f format.)

-- glen
[I'm way ahead of you, I wrote one program in Cobol, but a lot of
programs in PL/I. Picture variables specify the display format and
computational behavior of variables, not the internal representation.
IBM's implementation, the one I know the best, has a USAGE keyword
that lets you tell it what representation to use, e.g. USAGE
PACKED-DECIMAL. Pictures are a lot more powerful than Fortran
formats, since they can insert commas, CR and DB codes, and the
like. There is also surprisingly modern stuff like REDEFINES
to get the effect of unions in C, and SYNCHRONIZED to do
alignment padding in structures and arrays. -John]
0 new messages