These programs diagram source code.
They draw lines showing the start and end of routines and blocks, put a * next to jumps, an = next to commented out sections, and warn you of certain common programming errors which compilers miss, such as card format Fortran code that goes past column 72, and free format Fortran code that goes past column 132, and a few other things. They also help you figure out the structure of your own code, and make it easier to look at other people's long complicated legacy code.
These only work with ASCII input - e.g., not unicode.
Caution: Browsers don't display this source code quite right. So, load everything through this Zip archive of all diagram files instead.
For example:
/------ I_Hate_C() { | 1 |/------- if (You_Like(C)) { | 2 || BoyOrGirl=Bad; | 3 /-|| #ifdef SMART | 4 | || ReEducate(); | 5 \-|| #endif | 6 |+------- } else { | 7 || BoyOrGirl=Good; | 8 |\------- } | 9 \------ } | 10
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
For example:
/--------- <html> | 1 | | 2 |/-------- <head> | 3 |+-------- <title>My Title</title> | 4 |\-------- </head> | 5 | | 6 |/-------- <body> | 7 |+-------- <a href="./doc.html">doc.html</a> | 8 |\-------- </body> | 9 | | 10 \--------- </html> | 11
For example:
/--------- pro Sample,a,b,c | 1 | a=indgen(15)^2 | 2 |/-------- if a eq b then begin | 3 || print,'A equals B' | 4 || c=0 | 5 |+-------- endif else begin | 6 || print,'A does not equal B' | 7 || c=1 | 8 |\-------- endif | 9 \--------- end | 10
c <?xml version="1.0" encoding="UTF-8"?> | 1 c /--------- <tag1> | 2 c |/-------- <tag2> | 3 c |+-------- "ABCD" | 4 c |\-------- </tag2> | 5 c | | 6 c |/-------- <tag3> | 7 c |+-------- 15. | 8 c |\-------- </tag3> | 9 c | | 10 c \--------- </tag1> | 11
The VAX procedures have not recently been tested.
The programs themselves are in Fortran, which I know many people consider out of date. Fortran is freely available as f77, f90, f95, g77, g90, g95, or gfortran, on many platforms, any of which can compile this code. (But some early f77 can't handle my code.) In any event, you don't have to compile it: I placed MingW executables that also run under Cygwin and Windows in directory bin_Windows. I placed Executables that run under 64 bit Ubuntu Linux in directory bin_Ubuntu64. Both were linked statically to try to maintain future compatibility.
Nonethelss, a gfortran compilation procedure that works well under Cygwin, Mingw or Linux, and most other Unixes, is included in compile.sh.
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.