(untested) support for global variables
[cparser] / type_t.h
index eb072e6..de76857 100644 (file)
--- a/type_t.h
+++ b/type_t.h
@@ -19,7 +19,7 @@ typedef enum {
        TYPE_COMPOUND_STRUCT,
        TYPE_COMPOUND_UNION,
        TYPE_ENUM,
-       TYPE_METHOD,
+       TYPE_FUNCTION,
        TYPE_POINTER,
        TYPE_ARRAY,
        TYPE_BUILTIN,
@@ -27,8 +27,10 @@ typedef enum {
        TYPE_TYPEOF
 } type_type_t;
 
+/* note that the constant values represent the rank of the types as defined
+ * in ยง 6.3.1 */
 typedef enum {
-       ATOMIC_TYPE_INVALID,
+       ATOMIC_TYPE_INVALID = 0,
        ATOMIC_TYPE_VOID,
        ATOMIC_TYPE_CHAR,
        ATOMIC_TYPE_SCHAR,
@@ -95,17 +97,17 @@ struct array_type_t {
        expression_t *size;
 };
 
-struct method_parameter_t {
-       type_t             *type;
-       method_parameter_t *next;
+struct function_parameter_t {
+       type_t               *type;
+       function_parameter_t *next;
 };
 
-struct method_type_t {
-       type_t              type;
-       type_t             *result_type;
-       method_parameter_t *parameters;
-       bool                variadic;
-       bool                unspecified_parameters;
+struct function_type_t {
+       type_t               type;
+       type_t              *result_type;
+       function_parameter_t *parameters;
+       bool                 variadic;
+       bool                 unspecified_parameters;
 };
 
 struct compound_type_t {