home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.compilers
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!wupost!emory!sol.ctr.columbia.edu!eff!world!iecc!compilers-sender
- From: Dave Gillespie <daveg@thymus.synaptics.com>
- Subject: Re: Pascal parser wanted, was COBOL !
- Reply-To: Dave Gillespie <daveg@thymus.synaptics.com>
- Organization: Compilers Central
- Date: Thu, 19 Nov 1992 21:45:09 GMT
- Approved: compilers@iecc.cambridge.ma.us
- Message-ID: <92-11-115@comp.compilers>
- Keywords: Pascal, parse
- Sender: compilers-sender@iecc.cambridge.ma.us
- Lines: 21
-
- > 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
- --
- Send compilers articles to compilers@iecc.cambridge.ma.us or
- {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
-