Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!sumax!polari!thebes!nwnexus!intek01!mark From: mark@intek01.UUCP (Mark McWiggins) Newsgroups: comp.sources.wanted Subject: Re: Lex/Yacc for Fortran-77 Summary: F77 ignores blanks; why not buy a translator? Message-ID: <210@intek01.UUCP> Date: 21 Jun 89 18:03:22 GMT References: <13729@umn-cs.CS.UMN.EDU> Organization: Integration Technologies Inc. (Intek), Bellevue WA Lines: 31 In article <13729@umn-cs.CS.UMN.EDU>, zuhn@umn-cs.CS.UMN.EDU (david d "zoo" zuhn) writes: > I will be undertaking a large scale translation from Fortran-77 to > C this summer, and I'm thinking that an automated conversion routine > can do the job well. > > To create this converter, I need a lex .l file and a yacc .y parser > for Fortran-77. Any ideas where I can get such a beast? > I presume there's a public domain Yacc grammar floating around somewhere, but Lex won't do the job for F77. As I recall, Fortran ignores blanks and has no reserved words, so distinguishing identifiers from keywords is a more challenging task than for more modern languages. Several years ago there was a public-domain lexer available called "fortlex", written in lowest-common-denominator F66 by Bell Labs' Stu Feldman (of "make" fame). I don't remember if it handled F77, but I presume it should still be available. Have you considered one of the commercial products that claim to do this? It's a nontrivial task, and I believe I've seen translators for no less than $1000 or so. Good luck. Mark McWiggins Integration Technologies, Inc. (Intek) 1400 112th Ave. SE #202 Bellevue WA 98004 (206) 455-9935 uunet!intek01!mark