diagram.html 0000644 0001753 0001001 00000011352 10563605130 012154 0 ustar owner None
These programs diagram source code in the following languages:
C and C++
FORTRAN
HTML (very incomplete)
IDL, PV-WAVE, GDL and FL
They do things like draw lines showing the start and end of routines and blocks, put * next to jumps, and = next to commented out sections, and can warn you of certain classes of error.
They can help you find problems in your own code, or help you look at other people's long complicated legacy code.
For example:
+---------------- subroutine a(x) | 1 |+--------------- do i=1,5 | 2 ||+---------------- if(i/2*2.eq.i)then | 3 ||| x=x*i | 4 ||+---------------- else | 5 ||| x=x/i | 6 ||+---------------- endif | 7 |+--------------- enddo | 8 +---------------- end | 9
The VAX and MS-DOS procedures have not recently been tested.
If you like or dislike these programs, send e-mail to username grunes at domain yahoo.com.
Bug reports must include sample code on which it failed.
The programs themselves are in FORTRAN. I know that is a problem for users of other programming languages, but FORTRAN is freely available as g77 or g95 under Cygwin (under Windows) or Linux, and is available as f77, f90 or f95 on many other platforms. Compilation is simple, e.g.
g77 diagramf.f -o diagramfrem ---diagram9.bat--- rem MS-DOS procedure to diagram a (free format) FORTRAN language program. rem (use diagramf.bat to diagram card format Fortran programs) rem by Mitchell R Grunes. rem I assume that the executable is in directory c:\grunes on rem your PC. rem Syntax: rem diagramf rem to be prompted for input parameters. rem Alternate Syntax: rem diagramf filename(s) rem to append diagram of file(s) into diagram.out if %1a == a c:\grunes\diagramf if %1a == a goto quit echo off :loop echo ========================-- %1 --======================== rem Prompt answers: input from %1, output to diagram2.sc (for now), rem place numbers in column 73, embed include files, use free rem format, use IBM PC graphics. echo %1 > diagram.sc echo diagram2.sc >> diagram.sc echo 73 >> diagram.sc echo 1 >> diagram.sc echo 1 >> diagram.sc echo 1 >> diagram.sc c:\grunes\diagramf < diagram.sc type diagram2.sc >> diagram.out del diagram.sc del diagram2.sc shift if not %1a == a goto loop :quit echo Note--This does not delete diagram.out before appending to it.diagram9.sh 0000755 0001753 0001001 00000002577 10563605130 011727 0 ustar owner None #!/bin/csh # ---diagram9.sh--- #Unix csh procedure to diagram a (free format) FORTRAN language program. #On some unix systems $1 should be replaced by %1. # by Mitchell R Grunes, for his own use, in his own time. #I assume that the executable and this procedure are in the search path, # and that this procedure has execute permission. #Syntax: # diagram9.sh #to be prompted for input parameters. #Alternate Syntax: # diagram9.sh filename(s) #to append diagram of file(s) into diagram.out if (${?noclobber}) then unset noclobber set noclobbersave endif if $1a == a then diagramf goto quit endif loop: echo ========================-- $1 --======================== #Prompt answers: input from $1, output to diagram2.sc (for now), # place numbers in column 73, embed include files, use free # format, don't use IBM PC graphics. echo $1 > diagram.sc echo diagram2.sc >> diagram.sc echo 73 >> diagram.sc echo 1 >> diagram.sc echo 1 >> diagram.sc echo 0 >> diagram.sc diagramf < diagram.sc cat diagram2.sc >> diagram.out rm -f diagram.sc rm -f diagram2.sc shift if ! ($1a == a) then goto loop endif quit: echo Note--This does not delete diagram.out before appending to it. if (${?noclobbersave}) then set noclobber unset noclobbersave endif diagram9.sh.html 0000644 0001753 0001001 00000003173 10563605130 012660 0 ustar owner None
#!/bin/csh # ---diagram9.sh--- #Unix csh procedure to diagram a (free format) FORTRAN language program. #On some unix systems $1 should be replaced by %1. # by Mitchell R Grunes, for his own use, in his own time. #I assume that the executable and this procedure are in the search path, # and that this procedure has execute permission. #Syntax: # diagram9.sh #to be prompted for input parameters. #Alternate Syntax: # diagram9.sh filename(s) #to append diagram of file(s) into diagram.out if (${?noclobber}) then unset noclobber set noclobbersave endif if $1a == a then diagramf goto quit endif loop: echo ========================-- $1 --======================== #Prompt answers: input from $1, output to diagram2.sc (for now), # place numbers in column 73, embed include files, use free # format, don't use IBM PC graphics. echo $1 > diagram.sc echo diagram2.sc >> diagram.sc echo 73 >> diagram.sc echo 1 >> diagram.sc echo 1 >> diagram.sc echo 0 >> diagram.sc diagramf < diagram.sc cat diagram2.sc >> diagram.out rm -f diagram.sc rm -f diagram2.sc shift if ! ($1a == a) then goto loop endif quit: echo Note--This does not delete diagram.out before appending to it. if (${?noclobbersave}) then set noclobber unset noclobbersave endif