[comp.lang.fortran] lex and ratfor

kenkel@mcnc.UUCP (Stephen Kenkel) (03/18/87)

  Has anyone gotten lex working with ratfor?  The documentation claims
  that -r produced ratfor output.  A quick try looks unpromising,
  lex is generating things like yylval.ival which ratfor cannot understand.

  Is there an older version of lex around for which the -r option works?

  (The application is a program which MUST be written in FORTRAN, and 
  needs a decent parser)

  Any help will be appreciated.

tps@sdchem.UUCP (Tom Stockfisch) (03/18/87)

In article <2133@alvin.mcnc.UUCP> kenkel@mcnc.UUCP (Stephen Kenkel) writes:

>  Has anyone gotten lex working with ratfor?  The documentation claims
>  that -r produced ratfor output.  A quick try looks unpromising,
>  lex is generating things like yylval.ival which ratfor cannot understand.

"yylval" is used in yacc, and shouldn't even appear in a lex-only program.
Are you using yacc as well?  If so, you're "stuck" with using C.

>  (The application is a program which MUST be written in FORTRAN, and 
>  needs a decent parser)

Does ALL of the program have to be written in fortran?  It is not hard on
most systems to mix fortran with C, especially if their tasks are well
separated (like parsing (C) and number crunching (fortran)).  Although,
it is better if the C portion does all or most all of the i/o.

|| Tom Stockfisch, UCSD Chemistry	tps%chem@sdcsvax.ucsd.edu
					or  sdcsvax!sdchem!tps