comparison ppc/check.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 (* ppc/check.mli *)
2 (* Copyright (c) 2017 J. M. Spivey *)
3
4 open Tree
5
6 (*
7 This module is the semantic analysis pass of the compiler. It
8 provides a single function |annotate| that takes a program, checks it
9 for semantic errors, and annotates defining and applied occurrences
10 identifiers with the corresponding definitions. These annotations are
11 used by the code generation pass to generate code for variable
12 references.
13
14 If a semantic error is detected, |annotate| raises the exception
15 |Sem_error|. There is no way of resuming the analysis, and only
16 one error can be detected per run of the compiler.
17 *)
18
19 (* |annotate| -- check tree for type errors and annotate with definitions *)
20 val annotate : program -> unit
21
22 (* |Sem_error| -- semantic error *)
23 exception Sem_error of string * Print.arg list * int