comparison lab2/dict.mli @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 (* lab2/dict.mli *)
2 (* Copyright (c) 2017 J. M. Spivey *)
3
4 type ident = string
5
6 type ptype =
7 Integer
8 | Boolean
9 | Array of int * ptype
10 | Void
11
12 (* |def| -- definitions in environment *)
13 type def =
14 { d_tag: ident; (* Name *)
15 d_type: ptype; (* Type *)
16 d_lab: string } (* Global label *)
17
18 type environment
19
20 (* |define| -- add a definition, raise Exit if already declared *)
21 val define : def -> environment -> environment
22
23 (* |lookup| -- search an environment or raise Not_found *)
24 val lookup : ident -> environment -> def
25
26 (* |init_env| -- initial empty environment *)
27 val init_env : environment