Table of Contents
Installment published 19th August 1988
In the first four chapters of this series, we've been concentrating on the parsing of math expressions and assignment statements. In this chapter , we'll take off on a new and exciting tangent: that of parsing and translating control constructs such as IF statements.
This subject is dear to my heart, because it represents a turning point for me. I had been playing with the parsing of expressions, just as we have done in this series, but I still felt that I was a long way from being able to handle a complete language. After all, real languages have branches and loops and subroutines and all that. Perhaps you've shared some of the same thoughts. Awhile back, though, I had to produce control constructs for a structured assembler preprocessor I was writing. Imagine my surprise to discover that it was far easier than the expression parsing I had already been through. I remember thinking, “Hey! This is easy!” After we've finished this session, I'll bet you'll be thinking so, too.