Read chapter 7 of "Basics of Compiler Design", which you can download
from http://www.diku.dk/~torbenm/Basics/ . It shows how logical
expressions, including sequential operators, can be compiled.
Torben
The Red Dragon Book (Aho Sethi and Ullman) does a nice job with this.
Yes, the Red Dragon Book did prove to be an excellent source, this
time after spending weeks trying to figure this out on my own and re-
reading chapter eight yet another time, it was quite clear.
Although section on compound conditional expressions (pages 500-503)
provided a superb solution, it seems that I was able to improve upon
the way to process control flow statements discussed on pages 504-506.
I found no use what-so-ever for the nextlist construct, thus my
solution was exactly this much simpler.
Another aspect that I improved upon (that would certainly be out of
the scope of the original author's intention) was that I found a very
simple way to generate optimal jump code on the first pass.
I see now why I was able to simplify the implementation removing the
nextlist construct. This construct is probably still required for a
single pass compiler.
Since I parsed all of the code into an Abstract Syntax Tree and
annotated this tree as code generation progressed the nextlist was not
needed. Also on pages 468-469 of the Red Dragon Book, the E.code
construct was not needed for this same reason.
After the code was parsed into an Abstract Syntax Tree, the code was
generated from a single function that was recursively called with the
YACC production number. The YACC production number formed the cases in
a large switch statement.
A very useful debugging function that I created was to output the
Abstract Syntax Tree to XML using a very simple function that was
recursively called. Then I could use the freeware "XML Viewer" to
examine the structure of the tree.