On Tuesday 07 February 2006 07:55 am, Carl Lowenstein wrote: > > Note the really neat use of the switch statement. If n__ != 1, 2, or 3 it > > falls through to the goto L999; which is how the flag intg=TRUE_ gets set > > for the code associated with L_reaval ... I suspect this code resulted > > from a FORTRAN computed goto. > > > > Ah that was "Back in the day ..." > > > > The horrible thing is that after you look at this stuff long enough it > > starts to make a weird sort of sense. That is when you know that > > your brain is really being messed up badly by even trying to work > > with code that looks like this. God only knows what the next code > > I write for myself with look like. > > The weird sort of sense is due to the fact that this code was > generated by a program that was parsing Fortran and compiling it into > C. Perhaps the approach could be to make a decompiler to go back to > the original source. Of course the comments in the source have been > lost long ago.
That is right. I have written compilers myself so I can see how you get constructs like that. I cannot claim to be in love with working with them as my main source. > I once spent some time on manual decompilation back to Fortran from > threaded-code PDP-11 machine instructions. First, of course, turning > them into pseudo-assembly language. By the time I had finished this, > I had identified a couple of coding errors in the original Fortran, by > the mental process of "why does the code do this weird thing." Like > INCHES is an integer but CENTIMETERS is not. I could ... no, no. I am not going to write a decompiler for this trash. I have handed it back to the original author and requested that he make it run. I was supposed to simply use the inputs to this programs as a target for my real work, which is to translate some well defined XML into a form that can be input into this system. BobLQ > carl > -- > carl lowenstein marine physical lab u.c. san diego > [EMAIL PROTECTED] -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
