X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast_t.h;h=66cddcc3060acec11950b73559c8f1c2438ec135;hb=1b9d9f8ee4d67f894e472d5a9a82bf1ebbf1a590;hp=ee011742773c87062f03ef650d8b83e06c2add73;hpb=1c030e37ec4ee92e8ec7786dac4d41124099efbc;p=cparser diff --git a/ast_t.h b/ast_t.h index ee01174..66cddcc 100644 --- a/ast_t.h +++ b/ast_t.h @@ -1,6 +1,8 @@ #ifndef AST_T_H #define AST_T_H +#include + #include "ast.h" #include "symbol.h" #include "token_t.h" @@ -71,7 +73,7 @@ struct call_argument_t { struct call_expression_t { expression_t expression; - expression_t *method; + expression_t *function; call_argument_t *arguments; }; @@ -201,7 +203,8 @@ typedef enum { NAMESPACE_NORMAL, NAMESPACE_STRUCT, NAMESPACE_UNION, - NAMESPACE_ENUM + NAMESPACE_ENUM, + NAMESPACE_LABEL } namespace_t; typedef enum { @@ -220,8 +223,9 @@ struct initializer_t { }; struct declaration_t { - unsigned short namespace; - unsigned short storage_class; + unsigned char namespace; + unsigned char storage_class; + unsigned int address_taken : 1; type_t *type; symbol_t *symbol; source_position_t source_position; @@ -234,9 +238,16 @@ struct declaration_t { context_t *parent_context; /** next declaration in a context */ - declaration_t *context_next; - /** next declaration with same symbol */ declaration_t *next; + /** next declaration with same symbol */ + declaration_t *symbol_next; + + unsigned char declaration_type; /* used in ast2firm module */ + union { + unsigned int value_number; /* used in ast2firm module */ + ir_entity *entity; /* used in ast2firm module */ + ir_node *block; /* used in ast2firm module */ + } v; }; typedef enum { @@ -278,9 +289,6 @@ struct declaration_statement_t { statement_t statement; declaration_t *declarations_begin; declaration_t *declarations_end; - - int value_number; /**< filled in by semantic phase */ - int refs; }; struct if_statement_t { @@ -297,9 +305,8 @@ struct switch_statement_t { }; struct goto_statement_t { - statement_t statement; - symbol_t *label_symbol; - label_statement_t *label; + statement_t statement; + declaration_t *label; }; struct case_label_statement_t { @@ -308,8 +315,9 @@ struct case_label_statement_t { }; struct label_statement_t { - statement_t statement; - symbol_t *symbol; + statement_t statement; + declaration_t *label; + statement_t *label_statement; }; struct expression_statement_t {