Subject: [sv-ec] LRM syntax for calls to randomize.
From: Ryan, Ray (Ray_Ryan@mentorg.com)
Date: Mon Feb 02 2004 - 09:49:42 PST
In the LRM syntax, I believe a call to the randomize() method is defined by
two different rules, depending on whether there is a with-clause. The
two productions are:
A.6.2
blocking_assignment ::=
...
| class_variable_identifier . randomize [ ( ) ] with
constraint_block ;
A.8.2
method_call ::=
...
| method_call_root . method_identifier { attribute_instance } [ (
list_of_arguments ) ]
Why is a randomize call that includes a with-clause a blocking_assignment?
As
a result I believe that a randomize that does not include a with-clause is
an expression, while a randomize that includes a with-clause is a statement.
That is:
status = x.randomize() with { a<b; }; // This is NOT legal
status = x.randomize(); // This is legal.
Also, is it significant that "{ attribute_instance }" is only allowed if
there is not a with-clause?
Also, in the 'blocking_assignment' rule above, the constraint_block should
be
enclosed in braces '{' '}'. That is
| class_variable_identifier . randomize [ ( ) ] with {
constraint_block };
- Ray
This archive was generated by hypermail 2b28 : Mon Feb 02 2004 - 09:57:47 PST