8 LOOPS
In this chapter, you’ll add all things loop-related. That includes for, while, and do loops, plus break and continue statements to skip over parts of a loop. These are the last statements you’ll implement in this book. Once you finish this chapter, if you’ve implemented all the extra credit features, your compiler will be able to handle every kind of C statement.
But you have work to do first! You’ll update the lexer and parser to support all five new statements. Then, you’ll add a new semantic analysis pass, which ...
Get Writing a C Compiler now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.