#! /bin/sh # cleanc.sh MR 19/09/98 # Shell script to "clean" C source code from comments, # replace backslash-character sequences, remove backslash-newline # combinations, and remove preprocessor directives. # Uses programs 'rplbs' and 'rmccmt'. # Step 1a: Remove /*...*/ comment with 'rmccmt2' # Step 1b: Remove //... comment with 'sed' # Step 2: Replace backslash-character sequences and remove backslash-newline # combinations, with 'rplbs' # Step 3: Remove preprocessor directives with 'sed' /mnt/3rdpr/analysistools/lexan/rmccmt2 | sed 's://.*$::' | /mnt/3rdpr/analysistools/lexan/rplbs | sed 's:^[ ]*#.*$::'