RE: [sv-bc] structure literal example in standard

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Thu Jan 05 2006 - 02:31:54 PST
No.

You can see it described in 8.13.1, paragraph 2:

A syntax resembling multiple concatenations can be used in array
assignment patterns as well. Each replication
represents a single dimension.

unpackedbits = '{2 {y}} ; // same as '{y, y}
int n[1:2][1:3] = '{2{'{3{y}}}}; // same as'{'{y,y,y},'{y,y,y}}

==

You can also see it in assignment_pattern syntax (Syntax 8-2):

assignment_pattern ::=
  '{ expression { , expression } }
...
| '{ constant_expression { expression { , expression } } }


Shalom

> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On
> Behalf Of Krishanu Debnath
> Sent: Thursday, January 05, 2006 12:16 PM
> To: sv-bc@eda.org
> Subject: [sv-bc] structure literal example in standard
> 
> Hello,
> 
> I am not sure about the correctness of the following example,
> taken from
> Sec 3.8 _Structure literals_.
> 
> struct {int X,Y,Z;} XYZ = '{3{1}};
> typedef struct {int a,b[4];} ab_t;
> int a,b,c;
> ab_t v1[1:0] [2:0];
> v1 = '{2{'{3{a,'{2{b,c}}}}}};
> /* expands to '{'{3{'{a,{2{b,c}}}}}, '{3{{a,'{2{b,c}}}}}} */
> <rest snipped>
> 
> Here the array literal assign to v1 is incorrect. I think
> example
> missed the "'" after struct literal. So it should be
> '{2{'{3{'{a,'{2{b,c}}}}}}}. Similarly example missed the "'" in
> second element of expansion.
> 
> Can anyone please confirm?
> 
> Thanks,
> Krishanu
> 
Received on Thu Jan 5 02:32:08 2006

This archive was generated by hypermail 2.1.8 : Thu Jan 05 2006 - 02:33:43 PST