home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / compiler / 1924 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.6 KB  |  35 lines

  1. Newsgroups: comp.compilers
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!wupost!emory!sol.ctr.columbia.edu!eff!world!iecc!compilers-sender
  3. From: Dave Gillespie <daveg@thymus.synaptics.com>
  4. Subject: Re: Pascal parser wanted, was COBOL !
  5. Reply-To: Dave Gillespie <daveg@thymus.synaptics.com>
  6. Organization: Compilers Central
  7. Date: Thu, 19 Nov 1992 21:45:09 GMT
  8. Approved: compilers@iecc.cambridge.ma.us
  9. Message-ID: <92-11-115@comp.compilers>
  10. Keywords: Pascal, parse
  11. Sender: compilers-sender@iecc.cambridge.ma.us
  12. Lines: 21
  13.  
  14. > Does anyone out there know where I could get source for a COBOL compiler ?
  15. > Similarly for PASCAL... even a subset !
  16. > [Past requests for Cobol parsers have turned up nothing free.  Isn't there
  17. > some Pascal code in comp.sources.something? -John]
  18.  
  19. You can get my Pascal to C translator, p2c, from csvax.cs.caltech.edu.  An
  20. earlier version of it was also posted to comp.sources.unix a couple years
  21. ago; that may be what John is thinking of.
  22.  
  23. P2c parses a number of Pascal dialects, including Turbo Pascal, HP Pascal,
  24. and several others, as well as some Modula-2.  It generates C code with a
  25. variety of stylistic options.  If you wanted to strip off just the parser,
  26. you could probably do that fairly easily.  The parser is an ad-hoc
  27. recursive-descent affair, rather than a Yacc or Bison grammar.  (I found
  28. the ad-hoc approach to work well for Pascal, and especially for the
  29. bizarre composite of many Pascal dialects that I have to parse.)
  30.  
  31.                                 -- Dave
  32. -- 
  33. Send compilers articles to compilers@iecc.cambridge.ma.us or
  34. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  35.