Re: Lvalues cannot be in/decremented


Subject: Re: Lvalues cannot be in/decremented
From: Dave Rich (David.Rich@synopsys.com)
Date: Tue Nov 26 2002 - 00:44:28 PST


C says that the result of inc/dec operation cannot be a lvalue. I think
that is what you meant.

I suggest correcting Sec 8.5 of the BNF
OLD:
variable_lvalue ::=
variable_lvalue_item [ inc_or_dec_operator ]
| hierarchical_variable_identifier ( [ constant_expression { ,
constant_expression } ] )

NEW:
variable_lvalue ::=
variable_lvalue_item
| hierarchical_variable_identifier ( [ constant_expression { ,
constant_expression } ] )

Dave

Brad Pierce wrote:

>I've confirmed with Peter Flake that the following
>are illegal --
>
> 1) i++ = ...
>
> 2) ++i++
>
>and are rejected by Systemsim, because an lvalue cannot
>be incremented or decremented. Hence, the BNF which
>accepts these is incorrect and needs to be fixed.
>
>-- Brad
>
>
>
>
>
>
>
>
>

-- 
--
Dave Rich
Principal Engineer, CAE, VTG
Tel:  650-584-4026
Cell: 510-589-2625
DaveR@Synopsys.com



This archive was generated by hypermail 2b28 : Tue Nov 26 2002 - 00:44:53 PST