|Re: Pascal parser wanted, was COBOL ! email@example.com (Dave Gillespie) (1992-11-19)|
|Re: Pascal parser wanted, was COBOL ! firstname.lastname@example.org (1992-11-23)|
|From:||Dave Gillespie <email@example.com>|
|Date:||Thu, 19 Nov 1992 21:45:09 GMT|
> 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.)
Return to the
Search the comp.compilers archives again.