Re: Pascal parser wanted, was COBOL !

Dave Gillespie <daveg@thymus.synaptics.com>
Thu, 19 Nov 1992 21:45:09 GMT

          From comp.compilers

Related articles
Re: Pascal parser wanted, was COBOL ! daveg@thymus.synaptics.com (Dave Gillespie) (1992-11-19)
Re: Pascal parser wanted, was COBOL ! wjw@eb.ele.tue.nl (1992-11-23)
| List of all articles for this month |
Newsgroups: comp.compilers
From: Dave Gillespie <daveg@thymus.synaptics.com>
Organization: Compilers Central
Date: Thu, 19 Nov 1992 21:45:09 GMT
Keywords: Pascal, parse

> Does anyone out there know where I could get source for a COBOL compiler ?
> Similarly for PASCAL... even a subset !
> [Past requests for Cobol parsers have turned up nothing free. Isn't there
> some Pascal code in comp.sources.something? -John]


You can get my Pascal to C translator, p2c, from csvax.cs.caltech.edu. An
earlier version of it was also posted to comp.sources.unix a couple years
ago; that may be what John is thinking of.


P2c parses a number of Pascal dialects, including Turbo Pascal, HP Pascal,
and several others, as well as some Modula-2. It generates C code with a
variety of stylistic options. If you wanted to strip off just the parser,
you could probably do that fairly easily. The parser is an ad-hoc
recursive-descent affair, rather than a Yacc or Bison grammar. (I found
the ad-hoc approach to work well for Pascal, and especially for the
bizarre composite of many Pascal dialects that I have to parse.)


-- Dave
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.