improve ast printing
[cparser] / type_t.h
index 9d2b61e..64d5c5c 100644 (file)
--- a/type_t.h
+++ b/type_t.h
@@ -3,7 +3,8 @@
 
 #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;
@@ -15,7 +16,8 @@ typedef enum {
        TYPE_COMPOUND_UNION,
        TYPE_ENUM,
        TYPE_METHOD,
-       TYPE_POINTER
+       TYPE_POINTER,
+       TYPE_BUILTIN
 } type_type_t;
 
 typedef enum {
@@ -65,6 +67,18 @@ struct atomic_type_t {
        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;
@@ -72,6 +86,7 @@ struct pointer_type_t {
 
 struct method_parameter_type_t {
        type_t                  *type;
+       symbol_t                *symbol;
        method_parameter_type_t *next;
 };
 
@@ -79,26 +94,14 @@ struct method_type_t {
        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;
 };