dlk wrote
The code examples in project 10 seem not to have any instances of
unparenthesized expressions containing more than two terms.
From chapter 9:
Order of evaluation and operator priority Operator priority is
not defined by the language, except that expressions in parentheses are evaluated first. Thus an expression like 2+3*4 may yield either 20 or 14, whereas 2+(3*4) is guaranteed to yield 14. The need to use parentheses in such expressions makes Jack programming a bit cumbersome. At the same time, the lack of operator priority makes the writing of Jack compilers simpler.
Generally I find it a bit annoying that the need to compare parse output
with the specific XML format restricts one's parser to stay very close to the
surface syntax...
Keep in mind that this is course is designed to guide students with very little programming experience to a specific compiler design so that they can get it written in two weeks, which is an impressive accomplishment. Back in the late 70s it took us a semester to write an assembler, albeit in assembly language. (The final project was for our assembler to assemble itself.)
--Mark