[sv-ec] rs_rule | rs_rule is ambiguous in randsequence

From: Ryan, Ray <Ray_Ryan@mentorg.com>
Date: Thu Apr 22 2004 - 10:41:59 PDT

Re: 12.16 Random sequence generation - randsequence

The randsequence grammar includes the following productions:

  production ::= [ function_data_type ] production_name [ ( tf_port_list
) ] : rs_rule { | rs_rule } ;

  rs_rule ::= rs_production_list [ := expression [ rs_code_block ] ]

There is an ambiguity between the '|' operator than can occur within
the weight 'expression', and the '|' operator used in the above
randsequence 'production' .

That is, in the following:
  randsequence
    main : first second third;
    first : add | sub;
    second : push := x | y | pop;
    ...
  endsequence

Does the production 'second' consists of 2 alternatives,
  a) push with weight (x|y)
  b) pop with weight 1
Or does it consists of 3 alternatives
  a) push with weight x
  b) y with weight 1
  b) pop with weight 1
Or does it consist of 1 alternative
  a) push with weight (x | y | pop)

A possible way to resovle this ambiguity is to enclose the weight
expression
within parenthesis (required).
IE.
  rs_rule ::= rs_production_list [ := ( expression ) [ rs_code_block ] ]

Yielding
  randsequence
    main : first second third;
    first : add | sub;
    second : push := (x | y) | pop;
    ...
  endsequence

- Ray
Received on Thu Apr 22 10:42:06 2004

This archive was generated by hypermail 2.1.8 : Thu Apr 22 2004 - 10:42:14 PDT