paterson / interpreter

CS4012 Project II - Reversible Debugger + Interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CS4012: Lab 2

Interpreter and Debugger

Milestones

  • Convert project to Stack project
  • Step through program
  • Inspect variable values
  • Inspect History of variable
  • Step Backwards through program
  • Static Analysis to detect unused variables
  • Bonus: Interactively execute arbitrary statements at any stage.

Screenshot

Screenshot

  • The file column is the statements that have been executed, and the statement that is next to be executed.

  • The variables column is the current environment.

  • The output column is the accumulated output for the program so far.

Setup

Build the stack project:

stack build

The program can be executed by passing in the path to the file as the first argument.

Run the interpreter with the input file test.input:

stack exec interpreter-exe tests/test.input

To test the static analysis for detecting unused variables, just use the failingtest.input file:

stack exec interpreter-exe tests/failingtest.input

Commands

  • next : Execute the next statement
  • back : Step back and undo the last statement
  • :<variablename> : Input a variable's name to view it's history
  • |<Statement>: Execute a statement at the current point of the program. E.g |Print (Const (I 10))

About

CS4012 Project II - Reversible Debugger + Interpreter

License:Other


Languages

Language:Haskell 100.0%