Subject: [sv-ec] Clarification of INSIDE operator
From: Ryan, Ray (Ray_Ryan@mentorg.com)
Date: Tue Nov 18 2003 - 14:45:17 PST
The description for the new 'inside' operator (LRM-16) defines
'range_list_or_array' as below:
inside_expression ::= expression inside range_list_or_array
range_list_or_array ::=
variable_identifier
| { value_range { , value_range } }
range_list_or_array is a comma-separated list of integral expressions
and ranges. Value ranges are specified in ascending order with a low and
high bound, enclosed by square braces [ ], and separated by a colon ( :
), as in [low_bound:high_bound]. Ranges include all of the integer
elements between the bounds. If the bound to the left of the colon is
greater than the bound to the right the range is empty and contains no
values.
The text only covers the range_list part and not the array part. It
should be something like:
The set membership (range_list_or_array) is defined by a comma-separated
list of integral expressions and ranges or an array of integral elements
(variable_identifier). Value ranges are specified in ascending order
with a low and high bound, enclosed by square braces [ ], and separated
by a colon ( : ), as in [low_bound:high_bound]. Ranges include all of
the integer elements between the bounds. If the bound to the left of the
colon is greater than the bound to the right the range is empty and
contains no values. Each element of an array is included in the set."
Is the array restricted to be a single dimensioned array?
Also:
Why can't the array reference be a hierarchical reference, or a slice?
Why not allow the membership
set to be defined by an array and a range, or multiple arrays? It would
be more general to define the
set membership as below:
Change:
inside_expression ::= expression inside range_list_or_array
range_list_or_array ::=
variable_identifier
| { value_range { , value_range } }
value_range ::=
expression
| [ expression : expression ]
To:
inside_expression ::= expression inside set_membership
set_membership ::=
expression_or_range
| { expression_or_range { , expression_or_range} }
expression_or_range ::=
expression
| [ expression : expression ]
Notes: a) if an expression references an array, each element of the
array in included in the set.
b) the { } syntax is not needed - set membership could be
a simple list.
Regards
Ray Ryan
This archive was generated by hypermail 2b28 : Tue Nov 18 2003 - 14:47:18 PST