Re: IDL routines dependencies map maker [message #79570 is a reply to message #79569] |
Mon, 12 March 2012 16:05   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 3/12/12 4:29 PM, DavidPS wrote:
>
>> Running on GPULib didn't take long (maybe a minute or so) and produced
>> useful results:
>>
>>
>> http://michaelgalloy.com/wp-content/uploads/2012/03/gpulib-d ependencies.png
>
> I'm actually impressed... definitely I don't have enough memory in my computer to run it properly.
>
>
>> I think this is a very useful project and have long thought about
>> including something like this in IDLdoc.
>
> Cool to know that I was not completely mad at trying something like this. I'm happy other people find it useful. A step in the future would be to make it interactive, so we could click one of the dots and open the file (or see the documentation).
>
> However, I'm still not completely sure that I'm having into account all the possible options... I still find some weird connections... I will try to improve it.
> An open issue... and which I probably won't do, is handling objects. I have no clue of how they work, and I'm not sure if my approach (or something similar) would work.
In general, 100% accuracy in static analysis like this is going to be
impossible for a dynamic language like IDL. But, a lot of useful
information can still be derived from the code.
It is impossible to handle the general case for objects. A routine can
call a method on an object without knowing, until runtime, what class
and method they are actually calling.
Also, CALL_PROCEDURE, CALL_FUNCTION, CALL_METHOD, and EXECUTE also make
the general case impossible to deal with. I would just ignore these cases.
Another problem case is determining the difference between function
calls and array indexing (IDL has a difficult time with this too, which
is why the "compile_opt strictarr" option is so useful).
IDLdoc has a :Uses: field which could be used to pass hints to the
dependency finding algorithm in the difficult cases, e.g., when using
EXECUTE you could just specify what routine you are calling in the
:Uses: field.
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
|
|
|