Hi all, is there any tool that can parse a valid C program and generate a report which contains list of functions, global variables, #define constants, local variables in each function etc.
Try exuberant-ctags with the -x option and tell it to generate all of its kinds. Exuberant CTAGS is the default ctags on many linux distros.
You might try: exuberant-ctags -x --c-kinds=cdefglmnpstuvx --language-force=c filename
will even work if filename doesn't have .c extension.
You can use exuberant-ctags --list-kinds=c to see the possible tags.
Under windows, the cygwin environment supports ctags. I'm not sure if there's a windows build that doesn't need cygwin.
There are a few tools, depending on what you want to do. I'm not sure what you mean by "report", things like lxr will do html etc. cross referenced links. But for a person to use to help understand some code, then ncc or cscope (the later of which is in most Linux distributions) also some of the IDEs have some of these features (like eclipse). Older alternatives to cscope are ctags and etags.