Branch: Tag:

2013-12-11

2013-12-11 12:45:22 by Per Hedbor <ph@opera.com>

Merged the "ph/bits" branch.

This allows one more syntax for int-ranges in types:

(Xbit): This reprensents the range (0..(1<<X)-1).

So, string(8bit) is identical to string(0..255) and string(16bit) is
string(0..65535).

The same is true for integers, int(3bit) is int(0..7).

This does not conflict with any existing code because identifiers can
not start with a number.

98:   %token TOK_OPTIONAL   %token TOK_SAFE_INDEX   %token TOK_SAFE_START_INDEX + %token TOK_BITS         %right '='
290:   %type <n> string   %type <n> TOK_STRING   %type <n> TOK_NUMBER + %type <n> TOK_BITS   %type <n> optional_attributes   %type <n> optional_rename_inherit   %type <n> optional_identifier
1499:    {    push_int_type(MIN_INT_TYPE, MAX_INT_TYPE);    } +  | '(' TOK_BITS ')' +  { +  push_int_type( 0, (1<<$2->u.sval.u.integer)-1 ); +  free_node( $2 ); +  }    | '(' number_or_minint expected_dot_dot number_or_maxint ')'    {    INT_TYPE min = MIN_INT_TYPE;