summaryrefslogtreecommitdiff
path: root/driver/pparse.mli
blob: 6a53f3fa99f9195514b2fde56bc54a3730a4fd1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*        Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt     *)
(*                                                                     *)
(*  Copyright 2002 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

open Format

type error =
  | CannotRun of string
  | WrongMagic of string

exception Error of error

val preprocess : string -> string
val remove_preprocessed : string -> unit
val file : formatter -> string -> (Lexing.lexbuf -> 'a) -> string -> 'a
val apply_rewriters : string -> 'a -> 'a
val report_error : formatter -> error -> unit


val parse_implementation: formatter -> string -> Parsetree.structure
val parse_interface: formatter -> string -> Parsetree.signature