Board index » delphi » Pascal code analyzer...where?

Pascal code analyzer...where?

I'm looking for software that will "analyze" my Pascal files and give me information like this:

        1.      Which variables are not being used
        2.      A list of procedures/functions and their callers
        3.      Procs/funcs that are not used
        4.      General overview of program flow (what calls what, given primary file starting point).

We have a directory (BP7) that contains more than 150 source files that are all part of a single application.  Obviously, it'd be great to have something that would tell us these things and help to maintain it.

Anyone seen anything like this?  I wish we could run the old FoxDoc program (came with FoxPro) on it -- FoxDoc produced very informative reports.

Michael Griffin
grif...@intpro.com

 

Re:Pascal code analyzer...where?


Quote
Michael Griffin wrote:

> I'm looking for software that will "analyze" my Pascal files and give me information like this:

>         1.      Which variables are not being used
>         2.      A list of procedures/functions and their callers
>         3.      Procs/funcs that are not used
>         4.      General overview of program flow (what calls what, given primary file starting point).

> We have a directory (BP7) that contains more than 150 source files that are all part of a single application.  Obviously, it'd be great to have
something that

> Anyone seen anything like this?  I wish we could run the old FoxDoc program (came with FoxPro) on it -- FoxDoc produced very informative
reports.

> Michael Griffin
> grif...@intpro.com

I used to have a program called TurboProfiler which does more or less
what you ask. I believe it was delivered with TP 6.0. Maybe you can get
it directly from Borland.

Ronny Marinusse

Re:Pascal code analyzer...where?


Quote
grif...@magicnet.net (Michael Griffin) wrote:
>I'm looking for software that will "analyze" my Pascal files and give me information like this:
>    1.      Which variables are not being used
>    2.      A list of procedures/functions and their callers

Callers?  Meaning what calls the functions?
Quote
>    3.      Procs/funcs that are not used
>    4.      General overview of program flow (what calls what, given primary file starting point).

What would 4 look like for output as a key?

What kind of need might there be for such a program?  I might consider
making that my next project...

Re:Pascal code analyzer...where?


Since Michael Hermann asked, here's what I'd envision as the input and output for such a program:

Input (on command line):

        > panalyze *.pas /out=outfile.lis

Output (into file outfile.lis):

Function/Procedure
    Program         Referenced
------------------------------------------------------------------
Get_Data
    *Program1.pas   <defined>
    Program2.pas    Read_User_File
                    Process_New_User_File
    Program3.pas    Read_Operator_Files

Display_Sensor_Info
    Program2.pas    Operator_Processing
    Program5.pas    Join_User_Data
   *Program8.pas    <defined>

Shutdown_Probe1
   *Program2.pas    <defined>
------------------------------------------------------------------

This output tells me that the Function or Procedure "Get_Data" is defined in Program1.pas and is called (referenced) in two procedures (named Read_User_File and Process_New_User_File) in Program2.pas and one procedure in Program3.pas.

It also tells me that "Shutdown_Probe1" isn't used at all -- it's only defined.

Of course, it would help if the listing was alphabetized by Function/Proc name. That is, in this list "Get_Data" and "Display_Sensor_Info" would swap places.

I'll leave a note for Borland asking them if they have anything similar.  The Turbo Profiler doesn't do this -- it provides an analysis of a running program and includes mostly timing information.

Michael Griffin
grif...@intpro.com

Re:Pascal code analyzer...where?


Quote
>grif...@magicnet.net (Michael Griffin) wrote:
>>I'm looking for software that will "analyze" my Pascal files and give me

information like this:
Quote
>>       1.      Which variables are not being used
>>       2.      A list of procedures/functions and their callers
>Callers?  Meaning what calls the functions?
>>       3.      Procs/funcs that are not used
>>       4.      General overview of program flow (what calls what, given primary file starting point).
>What would 4 look like for output as a key?

The Turbo Analyst suite of programs from TurboPower Software does this and
lots more. It has been one of my better investments (see www.turbopower.com).
I wish they would update it so it ran my delphi code properly - the new
keywords confuse it.
Mark Horridge

Re:Pascal code analyzer...where?


Hello Glenn!

 GG> @RFC.Gate: Thu, 19 Sep 96 22:53:58

 GG> From: ggr...@internetland.net (Glenn Grotzinger)

 GG> grif...@magicnet.net (Michael Griffin) wrote:

 >> I'm looking for software that will "analyze" my Pascal files and give me
 >> information like this:

 >> 1.  Which variables are not being used
 >> 2.  A list of procedures/functions and their callers

 GG> Callers?  Meaning what calls the functions?

 >> 3.  Procs/funcs that are not used
 >> 4.  General overview of program flow (what calls what, given primary
 >> file starting point).

 GG> What would 4 look like for output as a key?

How about a tree starting from left going to the right.
Or a structure diagram facing the usual way (down).

 GG> What kind of need might there be for such a program?  I might
 GG> consider making that my next project...

I think I could use that, remember to include support for units which are
called and which have proc's & func's not used by client code. This would be
ideal way to see if theere is too much old or unused code in a library.

Regards Mikkel Breiler, Cosysop Renoz BBS, Amateur Lego Technic engineer
Vinyl/Intuition, LEGO: TC+++(850) PA-- # A@ S- LS>+ Hal M?- YB70m -DL81JUN16

Re:Pascal code analyzer...where?


Quote
Michael Griffin (grif...@magicnet.net) wrote:
> I'm looking for software that will "analyze" my Pascal files and give me information like this:
>    1.      Which variables are not being used
>    2.      A list of procedures/functions and their callers
>    3.      Procs/funcs that are not used
>    4.      General overview of program flow (what calls what, given primary file starting point).
> We have a directory (BP7) that contains more than 150 source files that are all part of a single application.  Obviously, it'd be great to have something that would tell us these things and help to maintain it.
> Anyone seen anything like this?  I wish we could run the old FoxDoc program (came with FoxPro) on it -- FoxDoc produced very informative reports.

with borland 7 for windows you can look up the symbols. lists every
procedure, variables etc. but it seems you can only use it efficiently if
you programmed in OOP.

----------------------------------------------------------------------
Support Chips.. nothing runs without us

Email address: sof...@chat.carleton.ca
----------------------------------------------------------------------

Other Threads