X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast.h;h=2d361fdb6a2b08e2e8775f3fb7cd0659ea88f129;hb=22dabd638cc982416589af0073382fcb4197f72f;hp=9223ca2b68ffd71884ab7ed2b038f0efe2b61427;hpb=9634f9c53e95b6bdc7883228c5ec5147f3de4f8e;p=cparser diff --git a/ast.h b/ast.h index 9223ca2..2d361fd 100644 --- a/ast.h +++ b/ast.h @@ -32,7 +32,6 @@ typedef struct compound_literal_expression_t compound_literal_expression typedef struct reference_expression_t reference_expression_t; typedef struct cast_expression_t cast_expression_t; typedef struct call_argument_t call_argument_t; -typedef struct type_argument_t type_argument_t; typedef struct call_expression_t call_expression_t; typedef struct binary_expression_t binary_expression_t; typedef struct unary_expression_t unary_expression_t; @@ -51,7 +50,6 @@ typedef struct va_copy_expression_t va_copy_expression_t; typedef struct builtin_constant_expression_t builtin_constant_expression_t; typedef struct builtin_types_compatible_expression_t builtin_types_compatible_expression_t; typedef struct classify_type_expression_t classify_type_expression_t; -typedef struct bitfield_extract_expression_t bitfield_extract_expression_t; typedef struct label_address_expression_t label_address_expression_t; typedef union expression_t expression_t; @@ -72,6 +70,7 @@ typedef struct if_statement_t if_statement_t; typedef struct switch_statement_t switch_statement_t; typedef struct declaration_statement_t declaration_statement_t; typedef struct expression_statement_t expression_statement_t; +typedef struct computed_goto_statement_t computed_goto_statement_t; typedef struct goto_statement_t goto_statement_t; typedef struct label_statement_t label_statement_t; typedef struct case_label_statement_t case_label_statement_t; @@ -112,10 +111,8 @@ typedef enum expression_classification_t { } expression_classification_t; /** - * Returns true if a given expression is a compile time - * constant. §6.6 - * - * @param expression the expression to check + * Returns true when an initializer contains only constants/linker_constant + * values. */ expression_classification_t is_constant_initializer(const initializer_t *initializer); @@ -129,7 +126,7 @@ expression_classification_t is_constant_expression(const expression_t *expressio /** * Checks if an expression is a constant/known value to the linker. Examples: - * - all constant expression casted to a pointer type + * - all constant/linker constant expression casted to a pointer type * - "&x", with x being a global variable. * - "array" or "a.array" in case array is an array and array and a, * respectively is an object with link time constant address @@ -138,6 +135,7 @@ expression_classification_t is_linker_constant(const expression_t *expression); long fold_constant_to_int(const expression_t *expression); bool fold_constant_to_bool(const expression_t *expression); +bool constant_is_negative(const expression_t *constant); /** * the type of a literal is usually the biggest type that can hold the value.