Subject: [sv-ec] Forward of email from Kausik Datta: BNF problem: Sec 3.10.2
From: David W. Smith (David.Smith@synopsys.com)
Date: Wed Nov 26 2003 - 10:18:01 PST
Hi,
The following text is being quoted from section 3.10.2 Enumerated type
ranges of SystemVerilog 3.1 LRM. Note that the draft SystemVerilog 3.1a does
not add anything on this issue.
LRM Section : 3.10.2
Sub-Topic : Enumerated type range
Text :
A range of enumeration elements can be specified automatically, via the
following syntax:
Table 3-3: Enumeration element ranges
name Associates the next consecutive number with name.
name = N Assigns the constant N to name
name[N] Generates N names in the sequence: name0, name1, ...,
nameN-1N must be an integral constant
name[N:M] Creates a sequence of names starting with nameN and
incrementing or decrementing until reaching name nameM.
For example:
enum { add=10, sub[5], jmp[6:8] } ;
This example assigns the number 10 to the enumerated type add. It also
creates the enumerated types sub0, sub1, sub2, sub3, and sub4, and assigns
them the values 11..15, respectively. Finally, the example creates the
enumerated types jmp6, jmp7, and jmp8, and assigns them the values 16-18,
respectively. name[N] Generates N names in the sequence: name0, name1, ...,
nameN-1N must be an integral constant name[N:M] Creates a sequence of names
starting with nameN and incrementing or decrementing until reaching name
nameM.
The corresponding BNF for the enum declaration does not include grammar to
support the constructs
provided in the above paragraph.
If this problem has been already reported please send me a ref. of that.
Thanks
Kausik
This archive was generated by hypermail 2b28 : Wed Nov 26 2003 - 10:19:51 PST