C++ Divide By Zero Parser

Hi everyone,

I am interested in writing a script/tool to parse C++ code in order to find lines when division is being used. I guess this could be accomplished by simply doing a search on "/" on all of the code. Only problem is that this will return lines with comments as well.

Do you have any suggestions on how to implement this?

Thanks.
Don't scan / that have another / next to them?
yeah, you'll have to ignore //, /* and */
thanks guys. I'm wondering if I should do this in Python (have never used Python before, but heard it would be great for this kind of task).
You will need some regular expression engine. If you can't use boost regex I suggest uding perl. python or whatever language you find suitable.
Topic archived. No new replies allowed.