#include "type.h"
#include "symbol.h"
-#include "lexer_t.h"
+#include "token_t.h"
+#include "ast_t.h"
#include "adt/obst.h"
struct obstack *type_obst;
TYPE_COMPOUND_UNION,
TYPE_ENUM,
TYPE_METHOD,
- TYPE_POINTER
+ TYPE_POINTER,
+ TYPE_BUILTIN
} type_type_t;
typedef enum {
atomic_type_type_t atype;
};
+struct builtin_type_t {
+ type_t type;
+ symbol_t *symbol;
+};
+
+struct enum_type_t {
+ type_t type;
+ symbol_t *symbol;
+ /* TODO: list of enum members */
+ source_position_t source_position;
+};
+
struct pointer_type_t {
type_t type;
type_t *points_to;
struct method_parameter_type_t {
type_t *type;
+ symbol_t *symbol;
method_parameter_type_t *next;
};
type_t type;
type_t *result_type;
method_parameter_type_t *parameter_types;
- const char *abi_style;
-};
-
-struct compound_entry_t {
- type_t *type;
- symbol_t *symbol;
- compound_entry_t *next;
- source_position_t source_position;
+ int variadic;
+ int unspecified_parameters;
};
struct compound_type_t {
type_t type;
- compound_entry_t *entries;
- symbol_t *symbol;
- source_position_t source_position;
-};
-
-struct enum_type_t {
- /* todo */
symbol_t *symbol;
+ context_t context;
source_position_t source_position;
};