Subject: RE: [sv-ec] Errata for section 5
From: LaFlamme, Jamie (jamiel@Model.com)
Date: Mon Sep 08 2003 - 17:13:27 PDT
I agree with Brad's analysis - it would be nice to replace block_variable_declaration
with variable_declaration and replace list_of_variable_identifiers_or_assignments
with list_of_variable_decl_assignments.
Thanks for the careful examination.
-Jamie
-----Original Message-----
From: Brad Pierce [mailto:Brad.Pierce@synopsys.com]
Sent: Monday, September 08, 2003 4:31 PM
To: sv-ec@eda.org
Subject: Re: [sv-ec] Errata for section 5
Jamie,
I think that fixing block_variable_declaration also fixes the
problem about mixing initialized/noninitialized variable declarations
in a block statement.
Note that currently, "int a, b=0;" has a derivation from data_declaration --
data_declaration
variable_declaration
int list_of_variable_identifiers_or_assignments ;
int list_of_variable_decl_assignments ;
int variable_decl_assignment , variable_decl_assignment ;
int variable_identifier , variable_identifier = constant_expression ;
int a , b = 0 ;
The fix for block_variable_declaration is, I think, to simplify it to --
block_variable_declaration ::=
[lifetime] data_type list_of_variable_decl_assignments ;
which would enable the derivation
block_data_declaration
block_variable_declaration
int list_of_variable_decl_assignments ;
int variable_decl_assignment , variable_decl_assignment ;
int variable_identifier , variable_identifier = constant_expression ;
int a , b = 0 ;
Incidentally, it looks like list_of_variable_identifiers_or_assignments
is redundant and, for example, variable_declaration can be simplified to
variable_declaration ::=
[lifetime] data_type list_of_variable_decl_assignments
If so, then block_variable_declaration is also redundant and can be replaced
everywhere with simply variable_declaration.
-- Brad
Jamie LaFlamme writes:
----------------------------------------------------------------------------
o The BNF for block_variable_declaration in section 5.2
contains a required "lifetime" component that should be
optional.
o When multiple variables are declared within a single
statement, the BNF in 5.2 requires all variables in the
statement to be initialized or none of them. For example,
the following appears to be illegal:
int a, b=0;
Is there a reason to not allow initialized and non-
initialized variable declarations together? This is
true for block_variable_declaration and for
list_of_variable_identifiers_or_assignments.
----------------------------------------------------------------------------
-
This archive was generated by hypermail 2b28 : Mon Sep 08 2003 - 17:14:41 PDT