I would like to parse existing C programs ( may be using JAVACC
parser) and get some data like

List of Functions
List of Variables (Static , External, Local)...
Whether the variable is input, output or bidirectional in a function
etc....
and use the same for our modelling work.

I would like to know if there is open source static code analyzer
available in source code form which I can tailor to my specific
requirement. Ideal if some tool is there reading programs in C and
populate RDBMS database