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