filter trigraphs in advance and simplify lexer code because of that
[cparser] / type.h
1 #ifndef TYPE_H
2 #define TYPE_H
3
4 #include <stdio.h>
5 #include <stdbool.h>
6 #include "symbol.h"
7
8 typedef struct type_t                   type_t;
9 typedef struct atomic_type_t            atomic_type_t;
10 typedef struct pointer_type_t           pointer_type_t;
11 typedef struct method_parameter_t       method_parameter_t;
12 typedef struct method_type_t            method_type_t;
13 typedef struct compound_type_t          compound_type_t;
14 typedef struct enum_type_t              enum_type_t;
15 typedef struct builtin_type_t           builtin_type_t;
16 typedef struct typeof_type_t            typeof_type_t;
17
18 void init_types(void);
19 void exit_types(void);
20
21 void print_type(const type_t *type);
22
23 /**
24  * prints a human readable form of @p type. prints an abstract typename
25  * if symbol is NULL
26  */
27 void print_type_ext(const type_t *type, const symbol_t *symbol,
28                     const context_t *context);
29
30 /**
31  * set output stream for the type printer
32  */
33 void type_set_output(FILE *out);
34
35 /**
36  * returns true if type contains integer numbers
37  */
38 bool is_type_integer(const type_t *type);
39
40 /**
41  * returns true if the type is valid. A type is valid if it contains no
42  * unresolved references anymore and is not of TYPE_INVALID.
43  */
44 bool type_valid(const type_t *type);
45
46 /**
47  * returns true if the type is an arithmetic type (6.2.18)
48  */
49 bool is_type_arithmetic(const type_t *type);
50
51 /**
52  * returns true if the type is a scalar type (6.2.21)
53  */
54 bool is_type_scalar(const type_t *type);
55
56 #endif