Load the file into memory. Scan the file for 1 type of error, print errors to the screen and scan for another type of error. Continue the process for each type of error. Making a perfect one would be vary hard, but if you only need to check for a few specific errors, it would be easy. For example, assuming that there is a new line after each semicolon except for lines that start with "#" would be easer than trying to find when a line is suppost to end.
Good luck.
Last edited by Hiroshe; Jul 27th, 2009 at 10:24 am.
> Tell me how this advice will help the op solves his(her) problem, I'm curious...
The OP is basically looking for the front end of a C compiler.
This is far from being a trivial problem.
lex / yacc / bison are parser generator tools (perfect for this problem).
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.