| 
#!/bin/awk -f
{
    if ($0 == "") { ; }
    else if ($1 ~ /^\/\*/ && $NF ~ /\*\/$/) { ; }
    else if ($0 ~ /\/\*/ && $0 !~ /\*\//) { comment = 1 }
    else if ($0 !~ /\/\*/ && $0 ~ /\*\//) { comment = 0 }
    else if (comment) { ; }
    else if ($1 ~ /^\/\//) { ; }
    else if ($1 ~ /^#/) { ppd++ }
    else { nl++ }
}
END { 
    printf("Lines: %d\n",nl+ppd)
    printf("Preprocessor: %d\n",ppd)
    printf("SLOC: %d\n",nl)
}
 |