Script to read input and output files and child scripts

I have a directory where i have .sas; *.pl;.sh and *.c scripts

I need to find out what are the child scripts and input output files for each script:
say I have a shell script which calls a perl script and a sas script:
In my first line I want
I a) the parent script name;
b) the input files for this script;
c) the output files for this script
II a) the child script name:
b) input files for the child script
c) output files for the child script
d) If the child script has another child script; then the name of its child script; its input and output files

I have thousands of scripts and thought it be better if i use a master script to achieve this.

Thank you for your time,
Ram

You won't get a script or program that will do this for you. The logic and flow of a script is such that another script cannot really be expected to determine what files it reads or other scripts it calls.

For example a menu script may read some configuration data files to determine what menu items to display for a paticular user or group and what programs to then call. In the code it's likley to have a function something like this:

run_option()
{
    if [ "${option}" -ge 1 -a "${option}" -le "${Max_Options}" ]
    then
       command=`awk -F"|" -v row=${option} ' { if (NR == row) print $3 } ' $TEMPFILE 2>/dev/null`
    fi
    if [ "${command}" != "" ]
    then
      clear
      eval ${command}
    fi
    option=""
    command=""

A program cannot determine what something like the above is going to execute, it would have to process the rest of the script and determine what was written into TEMPFILE before this function was called!