Source code analyser

UKStratfordMike

New Member
Receiving error message in log from an app vendor's package (hundreds of modules). Error message as useful as a chocolate teapot from a diagnostic point of view. App vendor similar - Problem logged in March but no joy.
So...trying another way. Want to find the module responsible so can get an indication of what is causing error message and hopefully fix another way (param settings probably).

In a previous existence (before I retired and then came back for a spell) one of our guys wrote me a routine which analysed source along lines of

For each source program in a directory
for each source line in the program
search for character string 'xxxxxxxxx'

Anybody got anything out there? I am no programmer but can follow baby instructions
:rolleyes:
 

TomBascom

Curmudgeon
If you are running UNIX, or some variant thereof, then you want "grep". For a single file you'd do something like:

Code:
grep "pattern to look for" filename

to apply that to multiple files whose extensions are *.i or *.p you might combine "grep" with "find" like so:

Code:
find . -name "*.[ip]" -exec grep "pattern to look for" {} \; -print

IOW -- find files starting in the current directory and descending through the directory structure whose names end with .i or .p; when you find a file execute grep on it ( {} is replaced by the current file name) and, if grep succeeds, print the filename (so that you can tell which file the grep output is from).
 

tamhas

ProgressTalk.com Sponsor
Of course, grep has its significant limitations since it can't distinguish the syntactic meaning of a string. Check out Proparse and ProRefactor for tools that are intelligent about the ABL meaning.
 
Top