improved union/struct parsing
[cparser] / type.h
1 #ifndef TYPE_H
2 #define TYPE_H
3
4 #include <stdio.h>
5 #include "symbol.h"
6
7 typedef struct type_t                   type_t;
8 typedef struct atomic_type_t            atomic_type_t;
9 typedef struct pointer_type_t           pointer_type_t;
10 typedef struct method_parameter_t       method_parameter_t;
11 typedef struct method_type_t            method_type_t;
12 typedef struct compound_type_t          compound_type_t;
13 typedef struct enum_entry_t             enum_entry_t;
14 typedef struct enum_type_t              enum_type_t;
15 typedef struct builtin_type_t           builtin_type_t;
16
17 void init_types(void);
18 void exit_types(void);
19
20 /**
21  * prints a human readable form of @p type. prints an abstract typename
22  * if symbol is NULL
23  */
24 void print_type(const type_t *type, const symbol_t *symbol);
25
26 /**
27  * set output stream for the type printer
28  */
29 void type_set_output(FILE *out);
30
31 /**
32  * returns 1 if type contains integer numbers
33  */
34 int is_type_int(const type_t *type);
35
36 /**
37  * returns 1 if the type is valid. A type is valid if it contains no unresolved
38  * references anymore and is not of TYPE_INVALID.
39  */
40 int type_valid(const type_t *type);
41
42 #endif