Improve error recovery in parse_parameters().
[cparser] / ast_t.h
diff --git a/ast_t.h b/ast_t.h
index 31904c2..4b94ca2 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -64,7 +64,7 @@ typedef enum precedence_t {
 typedef enum expression_kind_t {
        EXPR_ERROR = 1,
        EXPR_REFERENCE,
-       EXPR_REFERENCE_ENUM_VALUE,
+       EXPR_ENUM_CONSTANT,
        EXPR_LITERAL_BOOLEAN,
        EXPR_LITERAL_INTEGER,
        EXPR_LITERAL_INTEGER_OCTAL,
@@ -489,6 +489,7 @@ typedef enum statement_kind_t {
        STATEMENT_EXPRESSION,
        STATEMENT_CONTINUE,
        STATEMENT_BREAK,
+       STATEMENT_COMPUTED_GOTO,
        STATEMENT_GOTO,
        STATEMENT_LABEL,
        STATEMENT_CASE_LABEL,
@@ -534,6 +535,7 @@ struct declaration_statement_t {
 
 struct if_statement_t {
        statement_base_t  base;
+       scope_t           scope;
        expression_t     *condition;
        statement_t      *true_statement;
        statement_t      *false_statement;
@@ -541,6 +543,7 @@ struct if_statement_t {
 
 struct switch_statement_t {
        statement_base_t        base;
+       scope_t                 scope;
        expression_t           *expression;
        statement_t            *body;
        case_label_statement_t *first_case, *last_case; /**< List of all cases, including default. */
@@ -550,10 +553,14 @@ struct switch_statement_t {
 struct goto_statement_t {
        statement_base_t  base;
        label_t          *label;         /**< The destination label. */
-       expression_t     *expression;    /**< The expression for an assigned goto. */
        goto_statement_t *next;          /**< links all goto statements of a function */
 };
 
+struct computed_goto_statement_t {
+       statement_base_t  base;
+       expression_t     *expression; /**< The expression for the computed goto. */
+};
+
 struct case_label_statement_t {
        statement_base_t        base;
        expression_t           *expression;    /**< The case label expression, NULL for default label. */
@@ -581,23 +588,25 @@ struct expression_statement_t {
 
 struct while_statement_t {
        statement_base_t  base;
+       scope_t           scope;
        expression_t     *condition;
        statement_t      *body;
 };
 
 struct do_while_statement_t {
        statement_base_t  base;
+       scope_t           scope;
        expression_t     *condition;
        statement_t      *body;
 };
 
 struct for_statement_t {
        statement_base_t  base;
+       scope_t           scope;
        expression_t     *initialisation;
        expression_t     *condition;
        expression_t     *step;
        statement_t      *body;
-       scope_t           scope;
        bool              condition_reachable:1;
        bool              step_reachable:1;
 };
@@ -635,23 +644,24 @@ struct leave_statement_t {
 };
 
 union statement_t {
-       statement_kind_t         kind;
-       statement_base_t         base;
-       return_statement_t       returns;
-       compound_statement_t     compound;
-       declaration_statement_t  declaration;
-       if_statement_t           ifs;
-       switch_statement_t       switchs;
-       goto_statement_t         gotos;
-       case_label_statement_t   case_label;
-       label_statement_t        label;
-       expression_statement_t   expression;
-       while_statement_t        whiles;
-       do_while_statement_t     do_while;
-       for_statement_t          fors;
-       asm_statement_t          asms;
-       ms_try_statement_t       ms_try;
-       leave_statement_t        leave;
+       statement_kind_t          kind;
+       statement_base_t          base;
+       return_statement_t        returns;
+       compound_statement_t      compound;
+       declaration_statement_t   declaration;
+       if_statement_t            ifs;
+       switch_statement_t        switchs;
+       computed_goto_statement_t computed_goto;
+       goto_statement_t          gotos;
+       case_label_statement_t    case_label;
+       label_statement_t         label;
+       expression_statement_t    expression;
+       while_statement_t         whiles;
+       do_while_statement_t      do_while;
+       for_statement_t           fors;
+       asm_statement_t           asms;
+       ms_try_statement_t        ms_try;
+       leave_statement_t         leave;
 };
 
 struct translation_unit_t {