Marist-CMPT331-TOPL / adder

Adder is a small but usable subset of the Python language. It is named for the Blackadder comedy series, much as the Python language is named for Monty Python.
MIT License
0 stars 2 forks source link

Interpret a sequence of statements #45

Open Tientuine opened 1 year ago

Tientuine commented 1 year ago

@Marist-CMPT331-TOPL/students

The interpreter should know how to correctly execute a sequence of statements in order, accumulating successive changes to the free store appropriately,. by implementing the corresponding semantic rule(s).

  1. [ ] Declare and implement a helper function called resultOfStmts that takes a list of statements and executes them, one at a time, with each successive statement executed in the context of the modified free store resulting from the execution of the previous statement.
  2. [ ] Add a case to resultOf for StmtList that uses your helper function to do its work.

Note: See the implementation of MultiStmt from some of the HOPL languages for implementation ideas.