source: Deliverables/D2.3/8051/cparser/Env.mli @ 453

Last change on this file since 453 was 453, checked in by ayache, 9 years ago

Import of the Paris's sources.

File size: 2.9 KB
Line 
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
16type error =
17    Unbound_identifier of string
18  | Unbound_tag of string * string
19  | Tag_mismatch of string * string * string
20  | Unbound_typedef of string
21  | No_member of string * string * string
22val error_message : error -> string
23exception Error of error
24
25val fresh_ident : string -> C.ident
26
27type composite_info = {
28  ci_kind: C.struct_or_union;
29  ci_members: C.field list;             (* members, in order *)
30  ci_alignof: int option;               (* alignment; None if incomplete *)
31  ci_sizeof: int option;                (* size; None if incomplete *)
32}
33
34type ident_info = II_ident of C.storage * C.typ | II_enum of int64
35
36type typedef_info = C.typ
37
38type t
39
40val empty : t
41
42val new_scope : t -> t
43val in_current_scope : t -> C.ident -> bool
44
45val lookup_ident : t -> string -> C.ident * ident_info
46val lookup_tag : t -> string -> C.ident * composite_info
47val lookup_struct : t -> string -> C.ident * composite_info
48val lookup_union : t -> string -> C.ident * composite_info
49val lookup_composite : t -> string -> (C.ident * composite_info) option
50val lookup_typedef : t -> string -> C.ident * typedef_info
51
52val ident_is_bound : t -> string -> bool
53
54val find_ident : t -> C.ident -> ident_info
55val find_tag : t -> C.ident -> composite_info
56val find_struct : t -> C.ident -> composite_info
57val find_union : t -> C.ident -> composite_info
58val find_member : C.field list -> string -> C.field
59val find_struct_member : t -> C.ident * string -> C.field
60val find_union_member : t -> C.ident * string -> C.field
61val find_typedef : t -> C.ident -> typedef_info
62
63val enter_ident : t -> string -> C.storage -> C.typ -> C.ident * t
64val enter_composite : t -> string -> composite_info -> C.ident * t
65val enter_enum_item : t -> string -> int64 -> C.ident * t
66val enter_typedef : t -> string -> typedef_info -> C.ident * t
67
68val add_ident : t -> C.ident -> C.storage -> C.typ -> t
69val add_composite : t -> C.ident -> composite_info -> t
70val add_typedef : t -> C.ident -> typedef_info -> t
Note: See TracBrowser for help on using the repository browser.