class_declaration ::=
[ virtual ] class [ lifetime ] class_identifier
[ parameter_port_list ]
[ extends class_identifier [ parameter_value_assignment ] ] [ ( list_of_arguments
) ] ];
[ extends class_type [ ( list_of_arguments ) ] ];
{ class_item }
endclass [ : class_identifier]
class_method ::=
{ method_qualifier } task_declaration
| { method_qualifier
} function_declaration
| extern { method_qualifier } method_prototype
| { method_qualifier } class_constructor_declaration
| extern {
method_qualifier } class_constructor_prototype
class_constructor_prototype ::=
function
new ( [ tf_port_list ] ) ;
extern_method_declaration ::=
function [ lifetime ] class_identifier
:: function_body_declaration
| task [ lifetime ] class_identifier
:: task_body_declaration
class_constructor_declaration ::=
function [ class_scope ] new [ ( [ tf_port_list ] ) ] ;
{ block_item_declaration }
[ super . new [ ( list_of_arguments ) ] ; ]
{ function_statement_or_null }
endfunction [ : new ]
Note: When using the super within new, super.new
must shall be the first executable
statement executed in the constructor. This is
because the superclass must be initialized before the
current class and if the user code doesn’t provide an initialization, the compiler
shall insert a call to super.new
automatically.