SHARE
TWEET

Untitled

a guest Nov 19th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. output="/tmp/compteRendu.txt"
  2. rm $output 2> /dev/null
  3. touch $output
  4. echo "--- Compte rendu $1 ---" >> $output
  5.  
  6. IFS=$'\n'
  7. mode=""
  8. mode2=""
  9. shift
  10. for file in $@; do
  11.     echo "" >> $output
  12.     echo "--- Fichier $file ---" >> $output
  13.  
  14.     for line in $(cat $file); do
  15.         truncatedLine=$(echo "$line" | tr -d " ")
  16.         if echo "$truncatedLine" | egrep "/*TYPEDEF" > /dev/null && echo $mode | egrep -v "I" > /dev/null; then
  17.             mode="I"
  18.             continue
  19.         fi
  20.  
  21.         if echo "$truncatedLine" | egrep "/*ENDTYPEDEF" > /dev/null; then
  22.             mode=""
  23.             continue
  24.         fi
  25.  
  26.         if echo $mode | egrep "I" > /dev/null; then
  27.             continue
  28.         fi
  29.         if echo $file | egrep -v ".*\.h" > /dev/null && echo "$line" | egrep -v "^(/|(typedef))" | egrep "^[a-Z].*\(" > /dev/null; then
  30.             echo "" >> $output
  31.             echo "/* Fonction $(echo "$line" | cut -d " " -f 2 | cut -d "(" -f 1)" >> $output
  32.             for subLine in $(cat "$file"); do
  33.                 if echo "$subLine" | grep "$line" > /dev/null; then
  34.                     mode2="I"
  35.                     printf "\tFinalité: $(echo "$subLine" | tr -s "/" | cut -d "/" -f 2 | sed -e "s/\ *\(.*\)/\1/g")\n" >> $output
  36.                    printf "\tVariables:\n" >> $output
  37.                    continue
  38.                fi
  39.  
  40.                if echo "$subLine" | egrep "^}" > /dev/null && echo $mode2 | egrep "I" > /dev/null; then
  41.                    mode2=""
  42.                    if echo "$subLine" | egrep -v "^}$"> /dev/null; then
  43.                        printf "\tValeur Retournée: $(echo "$subLine" | sed -e "s/.*\/\ *//g")\n" >> $output
  44.                    fi
  45.                    break
  46.                fi
  47.  
  48.                if echo $mode2 | egrep "I" > /dev/null && echo $subLine | grep "/" > /dev/null; then
  49.                    printf "\t\t- $(echo "$subLine" | grep "/" | sed -e "s/\ *\(.*\)/\1/g" | tr -s " " | cut -d " " -f 2- | sed -e "s/;\ *\/\//:/g")\n" >> $output
  50.                fi
  51.            done
  52.            echo "*/" >> $output
  53.        fi
  54.  
  55.        echo "$line" | sed -e "s/\/.*$//g">> $output
  56.    done
  57. done
  58.  
  59. cat $output
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top