[sv-bc] RE: [sv-ec] Pattern matching in if statements

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Thu Oct 19 2006 - 12:42:17 PDT
Shalom,

Yes, you're correct, the current BNF does not accept this example, even
as amended for Mantis item 1332, because a tagged clause in a
cond_pattern cannot be parenthesized.

Maybe in A.6.7.1 it should be 

  pattern ::=
  . variable_identifier
  | .*
  | constant_expression
  | tagged_pattern
  | ( tagged_pattern )
  | '{ pattern { , pattern } }
  | '{ member_identifier : pattern { , member_identifier : pattern } }

  tagged_pattern ::= tagged member_identifier [ pattern ]

Also, maybe there should be a footnote on cond_pattern saying that the
pattern shall not be a tagged_pattern, although it can be a
parenthesized tagged_pattern, and the pattern shall not be a
constant_expression unless it is also a constant_primary.
 
Some related issues are discussed in

   http://www.eda-stds.org/svdb/bug_view_page.php?bug_id=0000951

-- Brad


[This message is in reply to http://www.eda-stds.org/sv-bc/hm/5291.html
.]

-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Bresticker, Shalom
Sent: Monday, October 16, 2006 2:38 AM
To: Bresticker, Shalom; Moumita Das; sv-ec@eda.org; sv-bc@eda.org
Subject: RE: [sv-ec] Pattern matching in if statements

However, I don't see that "matches" can be followed by a left
parenthesis except as the beginning of a constant_expression.

Shalom

> -----Original Message-----
> From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org]
On
> Behalf Of Bresticker, Shalom
> Sent: Monday, October 16, 2006 11:32 AM
> To: Moumita Das; sv-ec@server.eda.org; sv-bc@server.eda.org
> Subject: RE: [sv-ec] Pattern matching in if statements
> 
> I don't see that example. I see the following:
> 
> if (e matches (tagged Jmp .j),
> j matches (tagged JmpC '{cc:.c,addr:.a})) ... // c and a can be used 
> here else
> 
> That is, no * characters.
> 
> Shalom
> 
> 
> > But in  Sec -10.4.1.2  of same LRM I have found an example -
> > if     ( e matches (tagged Jmp .j)* ,*   j matches (tagged JmpC
> > '{cc:.c,addr:.a}) )
> > ...
> > else
Received on Thu Oct 19 12:42:22 2006

This archive was generated by hypermail 2.1.8 : Thu Oct 19 2006 - 12:42:34 PDT