annotate lab3/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 (* lab3/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 codelab = int
mike@0 7
mike@0 8 val label : unit -> codelab
mike@0 9
mike@0 10 (* |def| -- definitions in environment *)
mike@0 11 type def =
mike@0 12 { d_tag : ident; (* Name *)
mike@0 13 d_kind : def_kind; (* Definition *)
mike@0 14 d_level : int; (* Nesting level *)
mike@0 15 d_lab : string; (* Label if global *)
mike@0 16 d_off : int } (* Offset if local *)
mike@0 17
mike@0 18 and def_kind =
mike@0 19 VarDef (* Variable *)
mike@0 20 | ProcDef of int (* Procedure (nparams) *)
mike@0 21
mike@0 22 type environment
mike@0 23
mike@0 24 (* |define| -- add a definition, raise Exit if already declared *)
mike@0 25 val define : def -> environment -> environment
mike@0 26
mike@0 27 (* |lookup| -- search an environment or raise Not_found *)
mike@0 28 val lookup : ident -> environment -> def
mike@0 29
mike@0 30 (* |new_block| -- add new block to top of environment *)
mike@0 31 val new_block : environment -> environment
mike@0 32
mike@0 33 (* |empty| -- initial empty environment *)
mike@0 34 val empty : environment
mike@0 35