Subject: Re: [sv-ec] Class constructor BNF issues
From: Neil Korpusik (Neil.Korpusik@Sun.com)
Date: Thu Feb 05 2004 - 17:54:47 PST
Hi Brad,
> - Constructors cannot be declared "extern" and defined
> out of block.
It was my understanding that it should be possible for the
constructor to be declared out of block, just like any other
class method can. It looks like the class_method production
needs to be updated to reflect this. Somewhere between draft
1 and draft 4 an update to the BNF created this problem.
Neil
Brad Pierce wrote:
>
> 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
-- --------------------------------------------------------------------- Neil Korpusik Tel: 408-720-4852 Member of Technical Staff Fax: 408-720-4850 Frontend Technologies - ASICs & Processors (FTAP) Sun Microsystems email: neil.korpusik@sun.com ---------------------------------------------------------------------
This archive was generated by hypermail 2b28 : Thu Feb 05 2004 - 18:03:36 PST