0

I am trying to code a C++ program which will read a .cpp/.c file and find the syntax error in that like missing semi colons,braces,etc. I need this program to find at least 15 syntax error. Any idea on logic like how to do it?

I came up with this for braces like to count the number of opening braces and no of closing braces and both should be equal

1 Answers1

2

The easiest solution is to use Clang compiler, and create a plugin for it to do any custom checks on the code.

Yousf
  • 3,957
  • 3
  • 27
  • 37
  • I dont know what it is, I am saying that the program will open the file read it character by character or lines –  Jan 03 '14 at 12:51
  • If you don´t know clang, just google it. You´ll need some time to learn how to write a plugin, but (as others said before) writing such a thing from scatch is not only much work and hard work, but impossible without much experience. – deviantfan Jan 03 '14 at 13:26