I'm also going to make my own Pascal compiler, but it's going to take a completely different approach, as it all has to run on a microcontroller.
Basically, my compile unit is a single statement and my source code unit is a single statement that is terminated by a semicolon. My first goal is to store the source in P-code format, to make it small. Then again, the most compact way to store the source code is probably as a compiled binary, with a limited amount of debug symbols.
So, my parsing will be done while editing the source code, one line at a time. The code generation will initially be JIT, when loading the code into memory. And later, if possible, the editor will use a disassembler to display and edit the source code.
If I finish the project, I'll update the wiki on how to do it.