Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 694 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 694 Bytes

While

Interpreter implementing the denotational semantics of the While language, as defined in Chapter 4 of the book Semantics With Applications: A Formal Introduction.

Usage

Start by running

ghci while.hs

Parse a program, given as a string

parse <parser> <program>
-- returns all possible parses as a list of (String, Stm) tuples

Evaluate the final state of a program

eval <program>

Check the value of a variable at the end of the program

value <var> <program>

Only single letters ('a' - 'z') can be used as variable names.

Examples