Here is C++ implementation of Lexical analyser (a phase of compiler).
Here is implementation of Code generation stage of complier in C++. You have to provide input in AIP.TXT file and the output will be stored in ANOP.TXT file.
Here is implementation of Macro processor in C. Here you will need to provide Assembly program containing Macro as input in MACIN.TXT. The result will be stored in MACOUT.TXT.
Here is implementation of multi-pass assembler in C. You have to provide Assembly Language Program, MOT table and POT table as input.