Re: errata/123: Fwd: identifier and indexing syntax

From: Shalom.Bresticker@motorola.com
Date: Fri Jan 10 2003 - 02:40:06 PST

  • Next message: Shalom.Bresticker@motorola.com: "errata/176: PROPOSAL - 12.1.3.2, Example 5: wrong generate name"

    Precedence: bulk

    The following reply was made to PR errata/123; it has been noted by GNATS.

    From: Shalom.Bresticker@motorola.com
    To: etf-bugs@boyd.com
    Cc: dan.jacobi@intel.com
    Subject: Re: errata/123: Fwd: identifier and indexing syntax
    Date: Fri, 10 Jan 2003 12:31:01 +0200 (IST)

     Would the following help for 'primary'?
     
     Replace the existing alternatives of hierarchical_identifier
     with the following:
     
     hierarchical_identifier [ { '[' expression ']' } '[' range_expression ']' ]
     
     In the case of a.b[1], you would still not know, without checking the
     declaration of b, whether it refers to word 1 of the array b or bit 1 of the
     vector b, but there is no way to get around that.
     
     But I think it makes the sequence unambiguous.
     
     Shalom
     
     
    > >The issue I tried to raise during discussion of Issue 31 has to do with
    > >the syntax rules for "primary" and "hierarchical_identifier".
    > >
    > >The rule for "primary" in section A.8.4 includes 4 alternatives that
    > >reference the rule "hierarchical_identifier". In 3 of these alternatives,
    > >the syntax for the various indexing operations are defined.
    > >
    > >However, the syntax rules for "hierarchical_identifier" also contain
    > >syntax for indexing operations.
    > >
    > >Presumably, the indexing syntax in "primary" is describing array-indexing,
    > >bit-selects and part-select syntax, while the indexing syntax in
    > >hierarchical_identifier is describing scope indexing.
    > >
    > >The issue I'm trying to point out is, this set of BNF rules are
    > >ambiguous.
    > >
    > >Consider the following expression:
    > >
    > > a.b[1]
    > >
    > >Is this expression derived (top-down) by the following sequence:
    > >
    > > expression
    > >-> primary
    > >-> hierarchical_identifier "[" expression "]"
    > >-> hierarchical_identifier "[" "1" "]"
    > >-> simple_hierarchical_identifier "[" "1" "]"
    > >-> simple_hierarchical_branch "[" "1" "]"
    > >-> simple_identifier "." simple_identifier "[" "1" "]"
    > >-> "a" "." "b" "[" "1" "]"
    > >
    > >or by the following sequence:
    > >
    > > expression
    > >-> primary
    > >-> hierarchical_identifier
    > >-> simple_hierarchical_identifier
    > >-> simple_hierarchical_branch
    > >-> simple_identifier "." simple_identifier "[" unsigned_number "]"
    > >-> "a" "." "b" "[" "1" "]"
    > >
    > >Both sequences are possible by the rules as defined. There is at
    > >least one other possible sequence:
    > >
    > > expression
    > >-> primary
    > >-> hierarchical_identifier "[" range_expression "]"
    > >-> hierarchical_identifier "[" expression "]"
    > >-> hierarchical_identifier "[" "1" "]"
    > >-> simple_hierarchical_identifier "[" "1" "]"
    > >-> simple_hierarchical_branch "[" "1" "]"
    > >-> simple_identifier "." simple_identifier "[" "1" "]"
    > >-> "a" "." "b" "[" "1" "]"
    > >
    > >Deciding which sequence to apply requires knowing the exact type of
    > >"a" and "b", which, in general, is not known until elaboration time.
    > >
    > >Dennis Marsa
     



    This archive was generated by hypermail 2.1.4 : Fri Jan 10 2003 - 02:40:42 PST and
    sponsored by Boyd Technology, Inc.