Re: [sv-ec] Class constructor BNF issues


Subject: Re: [sv-ec] Class constructor BNF issues
From: Brad Pierce (Brad.Pierce@synopsys.com)
Date: Wed Feb 04 2004 - 10:11:22 PST


Yes, I agree that it would be more consistent with other function
declarations to say

      function new [ ( [ tf_port_list ] ) ] ;

For super.new, I was just implementing the Note at the end
of 11.14. A begin-end is an executable statement. (Should
this really be a "Note", since it is apparently normative,
not informative?)

-- Brad

-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org]On Behalf Of
LaFlamme, Jamie
Sent: Wednesday, February 04, 2004 9:50 AM
To: 'sv-ec@eda.org'
Subject: [sv-ec] Class constructor BNF issues

The BNF for class_constructor_declaration in draft 4 looks like:

    class_constructor_declaration ::=
        function new ( tf_port_list ) ;
            { block_item_declaration }
            [ super . new [ ( list_of_arguments ) ] ; ]
            { function_statement_or_null }
        endfunction [ : new ]

This definition seems to require at least one argument to the constructor
which I believe is incorrect.

In addition, it seems like the constructor has other differences from
regular methods such as:
        - The '(' and ')' tokens are required in the declaration.
        - Constructors cannot be declared "extern" and defined
        out of block.
        - Constructors cannot be declared as "protected", "local"
        or "static" (although I can understand why "static" may
        not be allowed).
        - If the "super.new" call is included in the function body
        then it cannot be included inside of a begin..end block.

Does anyone know if there is a reason for these differences to exist?

Thanks,
-Jamie



This archive was generated by hypermail 2b28 : Wed Feb 04 2004 - 10:19:43 PST