R
R
rusianvodka2014-03-29 22:44:02
C++ / C#
rusianvodka, 2014-03-29 22:44:02

Which c/c++ code parser to choose, in c/c++?

Hello ladies and gentlemen.
Would you mind spending a couple of minutes of your precious evening time on my question?
I had a need to analyze the code written in c/c++ (term paper, thesis)
There is an mfc project with an edit where the code is copied and pasted.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexanius, 2014-03-30
@alexanius

If you only need to select all numbers, then use regular expressions. They are also suitable for more complex tasks (for example, finding assignments). I usually use qt's regexps, but if the project is bound to mfc, then look at the standard . For integers, the simplest pattern would be [0-9]+. Of course, in a real task, everything will not be limited to them.
If the task is still to parse the code, then everything becomes more complicated. You can write your bike on flex + bison. In the case of C/C++, you are guaranteed an unforgettable experience.
If you need an accurate analysis of the program, look towards clang.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question