This project was given by Prof. JS Choi.
After studying PL, I made a toy interpreter by using Ocaml.
- To study Ocaml
- To understand functional programming
- To understand PL and interpreting process
- To get ready for Static Analysis
Exp ->
| UNIT
| TRUE
| FALSE
| CONST of int
| VAR of var
| ADD of exp * exp
| SUB of exp * exp
| MUL of exp * exp
| EQUAL of exp * exp
| LESS of exp * exp
| IF of exp * exp * exp
| LET of var * exp * exp
| LETREC of var * var * exp * exp
| PROC of var * exp
| CALL of exp * exp
(skip)
Var = string
Value = Unit + Int of int + Bool of bool + Procedure of var * exp * env + RecProcedure of var * var * exp * env
Env = var -> val