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


Groups > comp.compilers > #408 > unrolled thread

Re: Parser generator

Started bydrb@msu.edu (Dennis Boone)
First post2012-01-08 11:47 -0600
Last post2012-01-11 20:28 -0500
Articles 15 — 9 participants

Back to article view | Back to comp.compilers


Contents

  Re: Parser generator drb@msu.edu (Dennis Boone) - 2012-01-08 11:47 -0600
    Re: Parser generator glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-08 21:58 +0000
      Re: Parser generator arnold@skeeve.com (Aharon Robbins) - 2012-01-11 20:06 +0000
        Re: PL/I, was Parser generator drb@ihatespam.msu.edu (Dennis Boone) - 2012-01-11 16:19 -0600
        Re: PL/I, was Parser generator Robert AH Prins <robert@prino.org> - 2012-01-11 23:42 +0000
        Re: programming in PL/I compilers@is-not-my.name - 2012-01-12 16:30 +0000
          Re: programming in PL/I Robert AH Prins <robert@prino.org> - 2012-01-14 09:20 +0000
          Re: programming in PL/I "Derek M. Jones" <derek@_NOSPAM_knosof.co.uk> - 2012-01-14 14:08 +0000
            Re: programming in PL/I glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-15 01:01 +0000
              Re: programming in PL/I glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-15 11:36 +0000
      Re: Parser generator for PL/I "robin" <robin51@dodo.com.au> - 2012-01-15 02:00 +1100
        Re: Parser generator for PL/I drb@ihatespam.msu.edu (Dennis Boone) - 2012-01-14 23:40 -0600
    Re: Parser generator SLK Systems <slkpg3@gmail.com> - 2012-01-08 20:26 -0500
      Re: Parser generator glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-01-11 07:22 +0000
        Re: Parser generator SLK Systems <slkpg3@gmail.com> - 2012-01-11 20:28 -0500

#408 — Re: Parser generator

Fromdrb@msu.edu (Dennis Boone)
Date2012-01-08 11:47 -0600
SubjectRe: Parser generator
Message-ID<12-01-009@comp.compilers>
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]

[toc] | [next] | [standalone]


#409

Fromglen herrmannsfeldt <gah@ugcs.caltech.edu>
Date2012-01-08 21:58 +0000
Message-ID<12-01-010@comp.compilers>
In reply to#408
Dennis Boone <drb@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

[toc] | [prev] | [next] | [standalone]


#412

Fromarnold@skeeve.com (Aharon Robbins)
Date2012-01-11 20:06 +0000
Message-ID<12-01-013@comp.compilers>
In reply to#409
glen herrmannsfeldt  <gah@ugcs.caltech.edu> wrote:
>Dennis Boone <drb@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]

[toc] | [prev] | [next] | [standalone]


#413 — Re: PL/I, was Parser generator

Fromdrb@ihatespam.msu.edu (Dennis Boone)
Date2012-01-11 16:19 -0600
SubjectRe: PL/I, was Parser generator
Message-ID<12-01-014@comp.compilers>
In reply to#412
 > 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

[toc] | [prev] | [next] | [standalone]


#414 — Re: PL/I, was Parser generator

FromRobert AH Prins <robert@prino.org>
Date2012-01-11 23:42 +0000
SubjectRe: PL/I, was Parser generator
Message-ID<12-01-015@comp.compilers>
In reply to#412
On 2012-01-11 20:06, Aharon Robbins wrote:
> glen herrmannsfeldt<gah@ugcs.caltech.edu>  wrote:
>> Dennis Boone<drb@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

[toc] | [prev] | [next] | [standalone]


#416 — Re: programming in PL/I

Fromcompilers@is-not-my.name
Date2012-01-12 16:30 +0000
SubjectRe: programming in PL/I
Message-ID<12-01-017@comp.compilers>
In reply to#412
On Thu Jan 12 07:18:12 2012 arnold@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.

[toc] | [prev] | [next] | [standalone]


#418 — Re: programming in PL/I

FromRobert AH Prins <robert@prino.org>
Date2012-01-14 09:20 +0000
SubjectRe: programming in PL/I
Message-ID<12-01-019@comp.compilers>
In reply to#416
On 2012-01-12 16:30, compilers@is-not-my.name wrote:
> On Thu Jan 12 07:18:12 2012 arnold@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.

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

[toc] | [prev] | [next] | [standalone]


#419 — Re: programming in PL/I

From"Derek M. Jones" <derek@_NOSPAM_knosof.co.uk>
Date2012-01-14 14:08 +0000
SubjectRe: programming in PL/I
Message-ID<12-01-020@comp.compilers>
In reply to#416
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]

[toc] | [prev] | [next] | [standalone]


#422 — Re: programming in PL/I

Fromglen herrmannsfeldt <gah@ugcs.caltech.edu>
Date2012-01-15 01:01 +0000
SubjectRe: programming in PL/I
Message-ID<12-01-023@comp.compilers>
In reply to#419
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]

[toc] | [prev] | [next] | [standalone]


#426 — Re: programming in PL/I

Fromglen herrmannsfeldt <gah@ugcs.caltech.edu>
Date2012-01-15 11:36 +0000
SubjectRe: programming in PL/I
Message-ID<12-01-027@comp.compilers>
In reply to#422
glen herrmannsfeldt <gah@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]

[toc] | [prev] | [next] | [standalone]


#420 — Re: Parser generator for PL/I

From"robin" <robin51@dodo.com.au>
Date2012-01-15 02:00 +1100
SubjectRe: Parser generator for PL/I
Message-ID<12-01-021@comp.compilers>
In reply to#409
> From: "Dennis Boone" <drb@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).

[toc] | [prev] | [next] | [standalone]


#424 — Re: Parser generator for PL/I

Fromdrb@ihatespam.msu.edu (Dennis Boone)
Date2012-01-14 23:40 -0600
SubjectRe: Parser generator for PL/I
Message-ID<12-01-025@comp.compilers>
In reply to#420
 > 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

[toc] | [prev] | [next] | [standalone]


#410

FromSLK Systems <slkpg3@gmail.com>
Date2012-01-08 20:26 -0500
Message-ID<12-01-011@comp.compilers>
In reply to#408
>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

[toc] | [prev] | [next] | [standalone]


#411

Fromglen herrmannsfeldt <gah@ugcs.caltech.edu>
Date2012-01-11 07:22 +0000
Message-ID<12-01-012@comp.compilers>
In reply to#410
SLK Systems <slkpg3@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

[toc] | [prev] | [next] | [standalone]


#415

FromSLK Systems <slkpg3@gmail.com>
Date2012-01-11 20:28 -0500
Message-ID<12-01-016@comp.compilers>
In reply to#411
>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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.compilers


csiph-web