A tool for static analysis of some code is not an interpreter.
In any case, writing such a tool is not a trivial task; it requires a good understanding of how compilers work. Usually, such a task is divided into many tasks: tokenizing the code, parsing it, and building an abstract syntax tree in the first place
These operations are simple as soon as you declare your language (in this case, C), and there are many tools to automate the process. The most famous tool is probably the bison (which is for C); There are also many really good and easy-to-use C ++ libraries (like boost.spirit) and even some languages ββthat were designed to do these things.
My suggestion is to improve your knowledge of compilers and try to write some parsers for simpler languages. You cannot start parsing C from nowhere.
source share