Commit | Line | Data |
---|---|---|
9f8e26f4 C |
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 | ||
34e49164 C |
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 | ||
faf9a90c | 27 | type typeC = |
34e49164 | 28 | ConstVol of const_vol * typeC |
faf9a90c C |
29 | | BaseType of baseType |
30 | | SignedT of sign * typeC option | |
34e49164 C |
31 | | Pointer of typeC |
32 | | FunctionPointer of typeC (* only return type *) | |
33 | | Array of typeC (* drop size info *) | |
faf9a90c | 34 | | EnumName of bool (* true if a metaId *) * string |
34e49164 C |
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 | |
faf9a90c | 41 | |
34e49164 | 42 | and baseType = VoidType | CharType | ShortType | IntType | DoubleType |
faf9a90c | 43 | | FloatType | LongType | LongLongType | BoolType |
34e49164 C |
44 | |
45 | and structUnion = Struct | Union | |
46 | ||
47 | and sign = Signed | Unsigned | |
48 | ||
49 | and const_vol = Const | Volatile | |
50 | ||
faf9a90c | 51 | val type2c : typeC -> string |
34e49164 C |
52 | val typeC : typeC -> unit |
53 | ||
54 | val compatible : typeC -> typeC option -> bool |