Henoktes722 wrote
Do I need to write a new code for handling expression for code generation? Like in my first implementation, project 10, compileExpression works like the grammar in Fig 10.5. "term (op term)*".
Example "1 + 2"
So my code first compiles the term, integer constant, then the operation add, then the integer constant 2.
But as you described, for stack based platform, the above example must first push the operands before the operator. So do I need to change my compileExpression code? If that is not the case how can I implement it?
Focus on the material in Section 11.1.2.