forked from cil-project/cil
-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathlexerhack.ml
More file actions
26 lines (17 loc) · 956 Bytes
/
lexerhack.ml
File metadata and controls
26 lines (17 loc) · 956 Bytes
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
module E = Errormsg
(* We provide here a pointer to a function. It will be set by the lexer and
used by the parser. In Ocaml lexers depend on parsers, so we we have put
such functions in a separate module. *)
let add_identifier: (string -> unit) ref =
ref (fun _ -> E.s (E.bug "You called an uninitialized add_identifier"))
let add_type: (string -> unit) ref =
ref (fun _ -> E.s (E.bug "You called an uninitialized add_type"))
let push_context: (unit -> unit) ref =
ref (fun _ -> E.s (E.bug "You called an uninitialized push_context"))
let pop_context: (unit -> unit) ref =
ref (fun _ -> E.s (E.bug "You called an uninitialized pop_context"))
(* Set to true while parsing a typedef declaration's declarator list, so that
declarator_no_init calls add_type (not add_identifier) for typedef names. *)
let is_typedef_decl : bool ref = ref false
(* Keep here the current pattern for formatparse *)
let currentPattern = ref ""