gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Call graph for Modula-2


From: Fischlin Andreas
Subject: Re: Call graph for Modula-2
Date: Sat, 11 Feb 2023 14:58:45 +0000

Dear Michael,

A shell script that does it all and accepts as first argument a module name (for demo purposes kept as simple as possible):

#!/bin/bash

module=${1-DMWindIO.mod}
showOnlyNeverUsed=FALSE  # set to TRUE if you wish to find only PROCEDURES never called

tmpF=$module.procusestats
procListF=$module.proclist
if [ ! -f $procListF ]; then
    cat $module | grep PROCEDURE | awk '{print $2}' | awk '{print$1}' FS="(" | sed -e "s|;||g" > $procListF
fi
procList=`cat $procListF`
echo > $tmpF
for p in $procList; do
    printf "%s$p: " >> $tmpF
    cat $module | grep -c $p >> $tmpF
done
if [ $showOnlyNeverUsed = TRUE ]; then
    cat $tmpF | grep " 1" |  grep -v "10" |  grep -v "100"
else
    cat $tmpF
fi
rm -f $tmpF
rm -f $procListF

Cheers,
Andreas


ETH Zurich
Prof. em. Dr. Andreas Fischlin
IPCC Vice-Chair WGII
Systems Ecology - Institute of Biogeochemistry and Pollutant Dynamics
CHN E 24
Universitaetstrasse 16
8092 Zurich
SWITZERLAND


+41 44 633-6090 phone
+41 44 633-1136 fax
+41 79 595-4050 mobile

             Make it as simple as possible, but distrust it!
________________________________________________________________________









On 10/02/2023, at 23:46, Michael Riedl <udo-michael.riedl@t-online.de> wrote:

Hallo,

is anybody aware about a tool to generate a call graph for a Modula-2 library / program ?

I would like to use such a tool to be sure that all procedures in a library are at least indirectly referred to in a test routine.

(well knowing that this might not be sufficient, but it would be at least a starting point :-)

Any hint would be helpful

Thanks in advance

Michael




Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]