Re:Show HN: A work-in-progress C compiler from scratch
by SavantIdiot on Tuesday August 03, 2021 @02:19PM
(#28052326)
Really? That's probably why I failed! Ironically (given my post) I've never looked at Clang's parser. I have looked at GCC's and, well, sheepishly: I don't get it, it is a beast of a project and I wasn't able to crack the architecture. I should try again tho.
[ Parent
| on HN ]
Re:Show HN: A work-in-progress C compiler from scratch
by rot13xor on Tuesday August 03, 2021 @04:56PM
(#28054081)
C is almost context-free with the exception of typedef. A custom parser helps with error diagnostics, e.g. missed semicolon or a "." swapped with "->".
https://eli.thegreenplace.net/2007/11/24/the-context-sensiti...