1 (* *********************************************************************)
3 (* The Compcert verified compiler *)
5 (* Xavier Leroy, INRIA Paris-Rocquencourt *)
7 (* Copyright Institut National de Recherche en Informatique et en *)
8 (* Automatique. All rights reserved. This file is distributed *)
9 (* under the terms of the GNU General Public License as published by *)
10 (* the Free Software Foundation, either version 2 of the License, or *)
11 (* (at your option) any later version. This file is also distributed *)
12 (* under the terms of the INRIA Non-Commercial License Agreement. *)
14 (* *********************************************************************)
20 (* Report parsing errors *)
23 error "%a: %s" format_cabsloc (currentLoc()) msg
25 (* Are we parsing msvc syntax? *)
27 let msvcMode = ref false
29 (* We provide here a pointer to a function. It will be set by the lexer and
30 * used by the parser. In Ocaml lexers depend on parsers, so we we have put
31 * such functions in a separate module. *)
32 let add_identifier: (string -> unit) ref =
33 ref (fun _ -> assert false)
35 let add_type: (string -> unit) ref =
36 ref (fun _ -> assert false)
38 let push_context: (unit -> unit) ref =
39 ref (fun _ -> assert false)
41 let pop_context: (unit -> unit) ref =
42 ref (fun _ -> assert false)
44 (* Keep here the current pattern for formatparse *)
45 let currentPattern = ref ""