X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=type.h;h=23d1019d6141a0ebdb0eb8ce2d5e5c110fb613d1;hb=4eade33d45008f90c8952a65a92cdda17d9598f9;hp=a3669a7e0abaca22621d7cf7e0957ec82963942b;hpb=b25e6207470812cdca4e99650505b1b5de9e3046;p=cparser diff --git a/type.h b/type.h index a3669a7..23d1019 100644 --- a/type.h +++ b/type.h @@ -2,6 +2,7 @@ #define TYPE_H #include +#include #include "symbol.h" typedef struct type_t type_t; @@ -12,6 +13,7 @@ typedef struct method_type_t method_type_t; typedef struct compound_type_t compound_type_t; typedef struct enum_type_t enum_type_t; typedef struct builtin_type_t builtin_type_t; +typedef struct array_type_t array_type_t; void init_types(void); void exit_types(void); @@ -31,14 +33,24 @@ void print_type_ext(const type_t *type, const symbol_t *symbol, void type_set_output(FILE *out); /** - * returns 1 if type contains integer numbers + * returns true if type contains integer numbers */ -int is_type_int(const type_t *type); +bool is_type_integer(const type_t *type); /** - * returns 1 if the type is valid. A type is valid if it contains no unresolved - * references anymore and is not of TYPE_INVALID. + * returns true if the type is valid. A type is valid if it contains no + * unresolved references anymore and is not of TYPE_INVALID. */ -int type_valid(const type_t *type); +bool type_valid(const type_t *type); + +/** + * returns true if the type is an arithmetic type (6.2.18) + */ +bool is_type_arithmetic(const type_t *type); + +/** + * returns true if the type is a scalar type (6.2.21) + */ +bool is_type_scalar(const type_t *type); #endif