1
(***********************************************************************)
5
(* Pierre Weis, projet Cristal, INRIA Rocquencourt *)
7
(* Copyright 2001 Institut National de Recherche en Informatique et *)
8
(* en Automatique. All rights reserved. This file is distributed *)
9
(* only by permission. *)
11
(***********************************************************************)
14
let interpr�te_fichier nom =
16
let canal = open_in nom in
18
let prog = lire_programme (Stream.of_channel canal) in
20
Typage.type_programme prog; (* ligne ajout�e *)
21
Interp.ex�cute_programme prog
25
("Erreur de syntaxe : " ^ s ^ " aux alentours du caract�re num�ro ");
26
prerr_int (pos_in canal);
28
| Typage.Erreur_typage err ->
29
Typage.affiche_erreur err;
31
| Valeur.Erreur_ex�cution message ->
32
prerr_string "Erreur pendant l'ex�cution: ";
35
| Sys_error message ->
36
prerr_string "Erreur du syst�me: ";
38
| Stream.Failure -> ();;
40
if not !Sys.interactive
41
then begin interpr�te_fichier Sys.argv.(1); exit 0 end;;