Release coccinelle-0.2.0
[bpt/coccinelle.git] / parsing_cocci / type_cocci.mli
1 (*
2 * Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
3 * Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
4 * This file is part of Coccinelle.
5 *
6 * Coccinelle is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, according to version 2 of the License.
9 *
10 * Coccinelle is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * The authors reserve the right to distribute this or future versions of
19 * Coccinelle under other licenses.
20 *)
21
22
23 type inherited = bool (* true if inherited *)
24 type keep_binding = Unitary (* need no info *)
25 | Nonunitary (* need an env entry *) | Saved (* need a witness *)
26
27 type typeC =
28 ConstVol of const_vol * typeC
29 | BaseType of baseType
30 | SignedT of sign * typeC option
31 | Pointer of typeC
32 | FunctionPointer of typeC (* only return type *)
33 | Array of typeC (* drop size info *)
34 | EnumName of bool (* true if a metaId *) * string
35 | StructUnionName of structUnion * bool (* true if type metavar *) * string
36 | TypeName of string
37 | MetaType of (string * string) * keep_binding * inherited
38 | Unknown (* for metavariables of type expression *^* *)
39
40 and tagged_string = string
41
42 and baseType = VoidType | CharType | ShortType | IntType | DoubleType
43 | FloatType | LongType | LongLongType | BoolType
44
45 and structUnion = Struct | Union
46
47 and sign = Signed | Unsigned
48
49 and const_vol = Const | Volatile
50
51 val type2c : typeC -> string
52 val typeC : typeC -> unit
53
54 val compatible : typeC -> typeC option -> bool