Re: [sv-ec] Errata for section 5


Subject: Re: [sv-ec] Errata for section 5
From: Brad Pierce (Brad.Pierce@synopsys.com)
Date: Mon Sep 08 2003 - 16:30:37 PDT


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 - 16:31:54 PDT