Is there a reliable tool for removing comments in ASM/C/C++ code? -
i know question has been asked before (e.g.: see remove comments c/c++ code), haven't found satisfiable result.
i parsing set of complex c/c++ code first must normalized, includes eliminating comments input source code.
all decommenting tools have tried failed degree, , includes:
- decomment
- stripcmt
- cloc
note: have tried "gcc -fpreprocessed -e", not lead perfect result; output has weird macro annotations keeping tack of lines of code.
to illustrate problem particular tool (cloc), removing comments this header file leads removing non-comments well, such includes in begining of file.
that said, there reliable tool comment removal can used in stripping out comments in exceptionally complex code?
much appreciated.
#!/bin/bash if [[ "$#" != 1 ]] ; echo "usage: stripcomments input-file" > /dev/stderr exit fi gcc -fpreprocessed -dd -e -p "$1" 2> /dev/null
Comments
Post a Comment