package minicaml

  1. Overview
  2. Docs

Module Minicaml.TypesSource

Sourcetype ide = string

An identifier

Sourcetype expr =
  1. | Integer of int
  2. | Boolean of bool
  3. | Symbol of ide
  4. | Sum of expr * expr
  5. | Sub of expr * expr
  6. | Mult of expr * expr
  7. | Eq of expr * expr
  8. | Gt of expr * expr
  9. | Lt of expr * expr
  10. | And of expr * expr
  11. | Or of expr * expr
  12. | Not of expr
  13. | IfThenElse of expr * expr * expr
  14. | Let of ide * expr * expr
  15. | Letrec of ide * expr * expr
  16. | Lambda of ide list * expr
  17. | Apply of expr * expr list
Sourceval show_expr : expr -> string
Sourcetype 'a env_t = (string * 'a) list

A purely functional environment type, parametrized

Sourcetype evt =
  1. | Int of int
  2. | Bool of bool
  3. | Closure of ide list * expr * evt env_t
    (*

    RecClosure keeps the function name in the environment for recursion

    *)
  4. | RecClosure of ide * ide list * expr * evt env_t

A type that represents an evaluated (reduced) value

Sourceval show_evt : evt -> string

Function to get a string representation of an evaluated type

Sourcetype env_type = evt env_t

An environment type with

Sourceexception UnboundVariable of string

Exception to specify an unbound value

Sourceexception WrongBindList

Exception that indicates an erroneous usage of bindlist

Sourceexception SyntaxError of string

Exception to represent a syntax error

OCaml

Innovation. Community. Security.