Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!cs.dal.ca!silvert From: silvert@cs.dal.ca (Bill Silvert) Newsgroups: comp.lang.fortran Subject: Fxref & Flink -- deficiencies? Message-ID: <1989Jul3.125106.27708@cs.dal.ca> Date: 3 Jul 89 12:51:06 GMT Organization: Habitat Ecology Div., Bedford Inst. of Oceanography Lines: 32 Mike Fischbein has pointed out to me that the fxref and flink utilities which I have written and distributed do not handle suitably obfuscated, but perfectly legal, Fortran code. For example, they cannot find the correct variable names in the following lines of code: DO 100 I = 1.5 DO100I = 1,5 and Mike wonders whether lex-based analyzers can handle Fortran syntax. As the above example shows, lexical analysis of Fortran requires complete analysis of each line. Ignoring blanks is easy (just modify input.h as distributed with flink and fxref to skip blanks), but a complete analytical tool would have to include the complete Fortran parser. Therefore I always use white space to separate tokens in my code, and the tools I develop use this to simplify the task. If you don't insert white space, my tools won't help you. Granted, it is cute to include code like MY MAN = NO GOOD in one's code, but flink and fxref don't know from cute. I am sure that lex could handle this sort of thing if one worked at it (BASIC has the same problem, and I have seen a BASIC written with lex), but where I work we write very simple, straightforward, and (I hope) clean code, and these tools do the job for us. By the way, if anyone has a Fortran beautifier available, we would like to get one. -- Bill Silvert, Habitat Ecology Division. Bedford Institute of Oceanography, Dartmouth, NS, Canada B2Y 4A2 UUCP: ...!{uunet,watmath}!dalcs!biomel!bill Internet: biomel@cs.dal.CA BITNET: bs%dalcs@dalac.BITNET