Re: [sv-ec] Conflict in the sequence_expr BNF


Subject: Re: [sv-ec] Conflict in the sequence_expr BNF
From: Brad Pierce (Brad.Pierce@synopsys.com)
Date: Sun Nov 02 2003 - 11:34:54 PST


The following productions from A.2.10 and Syntax 17-2 --
 
   sequence_expr ::= cycle_delay_range sequence_expr
                               { cycle_delay_range sequence_expr }
                   | sequence_expr cycle_delay_range sequence_expr
                               { cycle_delay_range sequence_expr }
                   | ....
 
can be simplified to
 
   sequence_expr ::= [ sequence_expr ] cycle_delay_range sequence_expr
                   | ....
 
Either version is ambiguous. An analogy is the following grammar for the
language of binary numbers that have no consecutive 1's and end in 1.
 
   e ::= [ e ] 0 e
         | 1
  
What is the intended derivation for 0001000100010001?

Concatenation is easier with delimiters. For example, the extent of
a Verilog concatenation is delimited by left and right curly braces.

However, it's possible to handle concatenation without delimiters.
For example, here's a BNF for regular expressions --

       e ::= t { OR e }
       t ::= f { f } <---- concatenation
       f ::= g [ * ]
       g ::= h | ( h )
       h ::= e | token

The regular expression "( tok1 tok2 tok3 OR tok4* tok5 )*" could be
generated by

       e --> t --> f --> g* --> (h)* --> (e)*
         --> (t OR e)* --> ( f f f OR t)* --> ( f f f OR f f )*
         --> ( g g g OR g* g)* --> (h h h OR h* h)*
         --> ( token token token OR token* token)*
         --> ( tok1 tok2 tok3 OR tok4* tok5 )*

-- Brad

-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org]On Behalf Of
Kausik Datta
Sent: Tuesday, September 09, 2003 4:44 AM
To: sv-ac@eda.org; sv-ec
Subject: [sv-ec] Conflict in the sequence_expr BNF

Hi,
Here is another scenario of conflict in the BNF of sequence_expr

sequence_expr ::= cycle_delay_range sequence_expr
                | sequence_expr cycle_delay_range sequence_expr
                | ....

lets consider the following 2 examples -

let f be a parameter, and a is an input.

##f (a) ##2

Now if, f is a constant function identifier, which takes one input as
argument,
then we can write the sequence expression as

##f (a) ##2

But, interpretation of the above 2 cases are different and different
rule is present
to parse this which leads to conflict.

Thanks
Kausik



This archive was generated by hypermail 2b28 : Sun Nov 02 2003 - 11:41:16 PST