parser: Parse and reject GCC range initializers "[0 ... 9]".
[cparser] / ast_t.h
diff --git a/ast_t.h b/ast_t.h
index e1c365a..e0371e7 100644 (file)
--- a/ast_t.h
+++ b/ast_t.h
@@ -93,7 +93,7 @@ typedef enum expression_kind_t {
        EXPR_UNARY_FIRST,
        EXPR_UNARY_NEGATE = EXPR_UNARY_FIRST,
        EXPR_UNARY_PLUS,
-       EXPR_UNARY_BITWISE_NEGATE,
+       EXPR_UNARY_COMPLEMENT,
        EXPR_UNARY_NOT,
        EXPR_UNARY_DEREFERENCE,
        EXPR_UNARY_TAKE_ADDRESS,
@@ -106,7 +106,9 @@ typedef enum expression_kind_t {
        EXPR_UNARY_DELETE,
        EXPR_UNARY_DELETE_ARRAY,
        EXPR_UNARY_THROW,
-       EXPR_UNARY_LAST = EXPR_UNARY_THROW,
+       EXPR_UNARY_REAL,
+       EXPR_UNARY_IMAG,
+       EXPR_UNARY_LAST = EXPR_UNARY_IMAG,
 
        EXPR_BINARY_FIRST,
        EXPR_BINARY_ADD = EXPR_BINARY_FIRST,
@@ -201,7 +203,7 @@ typedef enum funcname_kind_t {
 #define EXPR_UNARY_CASES_MANDATORY   \
             EXPR_UNARY_NEGATE:            \
        case EXPR_UNARY_PLUS:              \
-       case EXPR_UNARY_BITWISE_NEGATE:    \
+       case EXPR_UNARY_COMPLEMENT:        \
        case EXPR_UNARY_NOT:               \
        case EXPR_UNARY_DEREFERENCE:       \
        case EXPR_UNARY_TAKE_ADDRESS:      \
@@ -212,7 +214,9 @@ typedef enum funcname_kind_t {
        case EXPR_UNARY_CAST:              \
        case EXPR_UNARY_ASSUME:            \
        case EXPR_UNARY_DELETE:            \
-       case EXPR_UNARY_DELETE_ARRAY
+       case EXPR_UNARY_DELETE_ARRAY:      \
+       case EXPR_UNARY_IMAG:              \
+       case EXPR_UNARY_REAL
 
 /**
  * unary expression with optional operand
@@ -234,18 +238,16 @@ typedef enum funcname_kind_t {
  * The base class of every expression.
  */
 struct expression_base_t {
-       expression_kind_t   kind;            /**< The expression kind. */
-       type_t             *type;            /**< The type of the expression. */
-       source_position_t   source_position; /**< The source position of this expression. */
-       bool                parenthesized : 1;
+       expression_kind_t kind;     /**< The expression kind. */
+       type_t           *type;     /**< The type of the expression. */
+       position_t        pos;      /**< The source position of this expression. */
+       bool              parenthesized : 1;
 #ifndef NDEBUG
-       bool                transformed : 1;     /**< Set if this expression was transformed. */
+       bool              transformed : 1; /**< Set if this expression was transformed. */
 #endif
-       bool                implicit : 1;    /**< compiler generated expression.
-                                                 Examples:
-                                                    select into anonymous structs
-                                                    implicit casts
-                                             */
+       bool              implicit : 1;  /**< compiler generated expression.
+                                           Examples: select into anonymous structs,
+                                           implicit casts */
 };
 
 /**
@@ -343,10 +345,11 @@ struct typeprop_expression_t {
 };
 
 struct designator_t {
-       source_position_t  source_position;
-       symbol_t          *symbol;      /**< the symbol if any */
-       expression_t      *array_index; /**< the array index if any */
-       designator_t      *next;
+       position_t    pos;
+       symbol_t     *symbol;      /**< the symbol if any */
+       expression_t *array_index; /**< the array index if any */
+       expression_t *range_last;  /**< last index of a range initializer, if any */
+       designator_t *next;
 };
 
 struct offsetof_expression_t {
@@ -491,13 +494,13 @@ typedef enum statement_kind_t {
  * The base class of every statement.
  */
 struct statement_base_t {
-       statement_kind_t   kind;
-       statement_t       *next;         /**< Point to the next statement in a compound statement. */
-       source_position_t  source_position;
-       statement_t       *parent;       /**< The Parent statement that controls the execution. */
-       bool               reachable;    /**< True, if this statement is reachable. */
+       statement_kind_t kind;
+       statement_t     *next;      /**< Point to the next statement in a compound statement. */
+       position_t       pos;
+       statement_t     *parent;    /**< The Parent statement that controls the execution. */
+       bool             reachable; /**< True, if this statement is reachable. */
 #ifndef NDEBUG
-       bool               transformed;
+       bool             transformed;
 #endif
 };