mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 05:47:31 +02:00
Implement class constructors.
Class constructors are the "new" method in a class description. Elaborate the constructor as an ordinary method, but the only way to access this method is to implicitly call it. The elaborator will take the constructor call and generate a naked "new" expression and implicit constructor method call with the object itself as the return value.
This commit is contained in:
@@ -97,6 +97,12 @@ static int eval_object_signal(ivl_expr_t ex)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int eval_object_ufunc(ivl_expr_t ex)
|
||||
{
|
||||
draw_ufunc_object(ex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int draw_eval_object(ivl_expr_t ex)
|
||||
{
|
||||
switch (ivl_expr_type(ex)) {
|
||||
@@ -122,6 +128,9 @@ int draw_eval_object(ivl_expr_t ex)
|
||||
case IVL_EX_SIGNAL:
|
||||
return eval_object_signal(ex);
|
||||
|
||||
case IVL_EX_UFUNC:
|
||||
return eval_object_ufunc(ex);
|
||||
|
||||
default:
|
||||
fprintf(vvp_out, "; ERROR: draw_eval_object: Invalid expression type %u\n", ivl_expr_type(ex));
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user