X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=type_t.h;h=b61ab777260d05d275f6fa4e3911721f4795bdd3;hb=d25522be2467160d61327fef47c4d564d59340e9;hp=eb072e6086f48c2ab6e2916754d96415bb97ea4b;hpb=2f487005db774b00459937cc8e2aec5d381557cd;p=cparser diff --git a/type_t.h b/type_t.h index eb072e6..b61ab77 100644 --- 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, @@ -58,10 +60,10 @@ typedef enum { } atomic_type_type_t; typedef enum { + TYPE_QUALIFIER_NONE = 0, TYPE_QUALIFIER_CONST = 1 << 0, TYPE_QUALIFIER_RESTRICT = 1 << 1, TYPE_QUALIFIER_VOLATILE = 1 << 2, - TYPE_QUALIFIER_INLINE = 1 << 3, } type_qualifier_t; struct type_t { @@ -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 {