Updates from precode Oblig 2 to precode Oblig 3
For Oblig 3 you should continue working from your code in Oblig 2 and extend this. To ease the start we will give you some help. Specifically, the REPL (read-evaluate-print-loop) that is needed to handle code.
This text will give an overview of what is changed to the precode for Oblig 2, so you easily can updated this.
Generally the code have added the comments
// START ADDED TO OBLIG3// END ADDED TO OBLIG3
to indicated the start and end of added code, respectively, in existing files
Main.java
The file Main.java has three additions as indicated above
- Line 8, importing
runtime.REPL - Lines 17 - 118, importing a couple of line reader libraries
- Lines 88 - 104, the code for the REPL
type/Memoty.java
Everything in this file is updated, so just overwrite (if you did not add anything here).
stmt/Execution.java
Everything in this file is updated, so just overwrite (if you did not add anything here).
runtime/REPL.java
This file is completely new and imported by Main.java
runtime/Interpreter.java
There is one addition in this file
- Lines 25 - 37, three methods are added that are used by the REPL. It is your task to implement these.