I recommend these two free online/e-books by Niklaus Wirth: Compiler Construction https://inf.ethz.ch/personal/wirth/CompilerConstruction/inde... (https://inf.ethz.ch/personal/wirth/CompilerConstruction/index.html) How to build a compiler from scractch (if you read German, there is an even more concise book by him, "Übersetzerbau)". Project Oberon https://inf.ethz.ch/personal/wirth/ProjectOberon/index.html How to build a personal workstation including all software from scratch.
Also recommended in this reply