Re: ( i++ += ++i++ )


Subject: Re: ( i++ += ++i++ )
From: Steven Sharp (sharp@cadence.com)
Date: Thu Nov 21 2002 - 16:37:58 PST


>According to the BNF, the following is a legal SystemVerilog expression --
>
> ( i++ += ++i++ )
>
>Doesn't this seem kind of weird? (This goes way beyond what's allowed in
>C.)

In C, i is an lvalue, but i++ is not. It is an rvalue. You can only
increment or otherwise assign to an lvalue.

Assuming that this weird example is not supposed to be allowed in SV,
the error is presumably the production that allows "variable_lvalue"
to expand to "variable_lvalue_item inc_or_dec_operator".

Can someone tell me what the second production for variable_lvalue
of a variable identifier followed by a parenthesized list of constants
is intended for? There is a similar one for net_lvalue.

Steven Sharp
sharp@cadence.com



This archive was generated by hypermail 2b28 : Thu Nov 21 2002 - 16:38:27 PST