2. To prepare, you can look at the third chapter of "C Expert Programming": Analysis of C language statements. This example is the simplest lexical+parser, which is enough to give you some hints. Of course, this is not enough. You may want to find a standard C language.
3. Classification is nothing more than modifiers, types, keywords, identifiers, operators and so on.
4. On the basis of 2. It is not difficult to solve.
5. This is very simple. Even the direct file processing has been solved. I vaguely remember that Lex might be easier to do.
Generally speaking, it may be difficult to do it yourself, so using lex should save a lot of trouble.
=========================================================================
The above is just an impression, I hope it will help you. Wait and see if Daniel can help you finish it. Or we can study it together when I'm free.