Although it is older than a fair number of HN readers, a great book from 1990 on compilers is Allen Holub's "Compiler Design in C". It's long out of print but there is a free PDF on Holub's website [1].
The book covers the usual theory and then puts it to use to develop tools for writing compilers (e.g., lexical analyzer generators similar to lex and parser generators similar to yacc) and then with those tools develops a C compiler.
This approach won't work if you live somewhere windy^ - the cables will chafe and even with the nylon spacer, will likely short and/or electrify the soffit with obvious associated risks.
^source: first hand experience, albeit with cuphooks rather than magnets.
Mainly that it‘s impossible to go back a step! Sorry if my comment sounded negative — I learnt a lot just by clicking through the steps. Very easy to follow. The steps are just the right size of complexity, the code is very clear.
Thanks!
You cant go back a step at all?
Going back a step might fail in certain cases that I dont have tests for but it should work in general.
I'll keep digging.
The book covers the usual theory and then puts it to use to develop tools for writing compilers (e.g., lexical analyzer generators similar to lex and parser generators similar to yacc) and then with those tools develops a C compiler.
[1] https://holub.com/compiler/