For example, the Jack grammar
does not mandate the usual operator precedence (O.P.) in expressions evaluation (multiplication before addition,
and so on). This has enabled us to avoid parsing algorithms that are more powerful yet much more
technical than the elegant top-down parsing techniques presented in the chapter.
If there's one tip I can give to help with project 9 is don't forget that there isn't any O.P !
The amount of times my if statements didn't behave as I expected were many, because i'd forgotten brackets (())!
if ((startBlkNum > (MIDPOINT - 1)) & f1stNon_0Reslt)
Parentheses, Parentheses, Parentheses. Don't forget your Parentheses !
An interesting program to right is one to determine the precedence and associativity of your compiler. To do this you do a series of tests to tease the information out. This is useful if you choose to implement a more rational compiler that imposes a defined set of order of operations as it gives you a nice test program to use.