Chapter 7: Blocks

Chapter 6 of Writing a C Compiler was a short one. So will Chapter 7. Do not even bother to buckle up. Syntax Tree and Parsing See? Not even new tokens for lexer. This chapter is all about implementing compound statements. To abstract the similarities between a function body and compound statements, a new Block AST node shall be created. Along with a tiny change in FuncDef , you get this beauty.…