]> matita.cs.unibo.it Git - pkg-cerco/acc.git/blob - cparser/Parse_aux.ml
Package description and copyright added.
[pkg-cerco/acc.git] / cparser / Parse_aux.ml
1 (* *********************************************************************)
2 (*                                                                     *)
3 (*              The Compcert verified compiler                         *)
4 (*                                                                     *)
5 (*          Xavier Leroy, INRIA Paris-Rocquencourt                     *)
6 (*                                                                     *)
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.     *)
13 (*                                                                     *)
14 (* *********************************************************************)
15
16 open Format
17 open Errors
18 open Cabshelper
19
20 (* Report parsing errors *)
21
22 let parse_error msg =
23   error "%a: %s" format_cabsloc (currentLoc()) msg
24
25 (* Are we parsing msvc syntax? *)
26
27 let msvcMode = ref false
28
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)
34
35 let add_type: (string -> unit) ref = 
36   ref (fun _ -> assert false)
37
38 let push_context: (unit -> unit) ref = 
39   ref (fun _ -> assert false)
40
41 let pop_context: (unit -> unit) ref = 
42   ref (fun _ -> assert false)
43
44 (* Keep here the current pattern for formatparse *)
45 let currentPattern = ref ""
46