From 9258a457d583b3f461615a43a76be6e20143f6f7 Mon Sep 17 00:00:00 2001 From: "Matteo Nastasi (mop)" Date: Thu, 14 Feb 2008 20:29:43 +0000 Subject: [PATCH] script to check functions and classes --- bin/getdep.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 bin/getdep.sh diff --git a/bin/getdep.sh b/bin/getdep.sh new file mode 100755 index 0000000..1d7f88a --- /dev/null +++ b/bin/getdep.sh @@ -0,0 +1,45 @@ +#!/bin/bash +IFS=' +' +for f in `find | grep '\.ph[ph]$'`; do + echo "-- file: $f ---------------------------------------" + st="out" + + for l in `egrep '^ *class |^} // end class|^ *function +' $f`; do + if [ $st = "out" ]; then + echo "$l" | grep -q '^ *class \+' + if [ $? -eq 0 ]; then + st="in" + class="`echo "$l" | sed 's/^ *class \+//g; s/ *{ *//g'`" + continue + fi + elif [ $st = "in" ]; then + echo "$l" | grep -q '^} // end class' + if [ $? -eq 0 ]; then + st="out" + continue + fi + fi + + fun="`echo "$l" | sed 's/ *function *//g'`" + funame="`echo "$fun" | sed 's/ *(.*//g'`" + if [ $st = "out" ]; then + echo "ss $f - $fun sssssssssssssssssss" + elif [ $st = "in" ]; then + echo "xx $f - $class :: $fun xxxxxxxxxxxxxxxxxxxxxx" + if [ "$class" = "$funame" ]; then + # constructor case + egrep "new *$class" `find | grep '\.ph[ph]$'` + else + egrep -- "$class::$funame\(|->$funame\(" `find | grep '\.ph[ph]$'` + fi + echo + fi + done + echo -------------------------------------------------------- +done + + +#grep -r '^ *function \+' +#grep -r '^ *class' `find -name '*.ph*'` +#grep -ir '} // end class' \ No newline at end of file -- 2.17.1