annotate lab2/dict.mli @ 1:b5139af1a420 tip basis

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