X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast_t.h;h=1f678190c7d7b93e5093b035631ef36c84dc8e99;hb=81bf9bd0b206ce8211d4e9d79d7193f8a7cd3315;hp=6a61564ebf3422deb21fa75fe248234f78eca4ad;hpb=a740bffad852f75cbf9b81dc5e025e4b95d5fada;p=cparser diff --git a/ast_t.h b/ast_t.h index 6a61564..1f67819 100644 --- a/ast_t.h +++ b/ast_t.h @@ -18,6 +18,7 @@ typedef enum { EXPR_REFERENCE, EXPR_CONST, EXPR_STRING_LITERAL, + EXPR_WIDE_STRING_LITERAL, EXPR_CALL, EXPR_UNARY, EXPR_BINARY, @@ -58,6 +59,11 @@ struct string_literal_expression_t { const char *value; }; +struct wide_string_literal_expression_t { + expression_base_t expression; + wide_string_t value; +}; + struct builtin_symbol_expression_t { expression_base_t expression; symbol_t *symbol; @@ -92,7 +98,8 @@ typedef enum { UNEXPR_POSTFIX_DECREMENT, UNEXPR_PREFIX_INCREMENT, UNEXPR_PREFIX_DECREMENT, - UNEXPR_CAST + UNEXPR_CAST, + UNEXPR_CAST_IMPLICIT /* compiler generated cast */ } unary_expression_type_t; struct unary_expression_t { @@ -199,23 +206,24 @@ struct classify_type_expression_t { }; union expression_t { - expression_type_t type; - expression_base_t base; - const_expression_t conste; - string_literal_expression_t string; - builtin_symbol_expression_t builtin_symbol; - reference_expression_t reference; - call_expression_t call; - unary_expression_t unary; - binary_expression_t binary; - select_expression_t select; - array_access_expression_t array_access; - sizeof_expression_t sizeofe; - offsetof_expression_t offsetofe; - va_arg_expression_t va_arge; - conditional_expression_t conditional; - statement_expression_t statement; - classify_type_expression_t classify_type; + expression_type_t type; + expression_base_t base; + const_expression_t conste; + string_literal_expression_t string; + wide_string_literal_expression_t wide_string; + builtin_symbol_expression_t builtin_symbol; + reference_expression_t reference; + call_expression_t call; + unary_expression_t unary; + binary_expression_t binary; + select_expression_t select; + array_access_expression_t array_access; + sizeof_expression_t sizeofe; + offsetof_expression_t offsetofe; + va_arg_expression_t va_arge; + conditional_expression_t conditional; + statement_expression_t statement; + classify_type_expression_t classify_type; }; typedef enum { @@ -243,7 +251,7 @@ typedef enum { INITIALIZER_VALUE, INITIALIZER_LIST, INITIALIZER_STRING, - INITIALIZER_COUNT + INITIALIZER_WIDE_STRING } initializer_type_t; struct initializer_base_t { @@ -266,12 +274,18 @@ struct initializer_string_t { const char *string; }; +struct initializer_wide_string_t { + initializer_base_t initializer; + wide_string_t string; +}; + union initializer_t { - initializer_type_t type; - initializer_base_t base; - initializer_value_t value; - initializer_list_t list; - initializer_string_t string; + initializer_type_t type; + initializer_base_t base; + initializer_value_t value; + initializer_list_t list; + initializer_string_t string; + initializer_wide_string_t wide_string; }; struct declaration_t { @@ -320,7 +334,8 @@ typedef enum { STATEMENT_CASE_LABEL, STATEMENT_WHILE, STATEMENT_DO_WHILE, - STATEMENT_FOR + STATEMENT_FOR, + STATEMENT_ASM } statement_type_t; struct statement_base_t { @@ -402,6 +417,27 @@ struct for_statement_t { context_t context; }; +struct asm_constraint_t { + const char *constraints; + expression_t *expression; + symbol_t *symbol; + asm_constraint_t *next; +}; + +struct asm_clobber_t { + const char *clobber; + asm_clobber_t *next; +}; + +struct asm_statement_t { + statement_base_t statement; + const char *asm_text; + asm_constraint_t *inputs; + asm_constraint_t *outputs; + asm_clobber_t *clobbers; + bool is_volatile; +}; + union statement_t { statement_type_t type; statement_base_t base; @@ -417,6 +453,7 @@ union statement_t { while_statement_t whiles; do_while_statement_t do_while; for_statement_t fors; + asm_statement_t asms; }; struct translation_unit_t {