diff --git a/src/verilog.y b/src/verilog.y index 54ce11424..2e804a72f 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -5876,18 +5876,17 @@ class_typeExtImpOne: // part of IEEE: class_type, where we either get a p idAny /*mid*/ { /* no nextId as not refing it above this*/ } /*cont*/ parameter_value_assignmentE - { $$ = new AstParseRef($1, VParseRefExp::PX_TEXT, *$1, NULL, NULL); - $$ = $1; - if ($3) BBUNSUP($3->fileline(), "Unsupported: Parameterized classes"); } + { $$ = new AstClassOrPackageRef($1, *$1, $1, $3); + $$ = $1; } // // // package_sopeIdFollows expanded | yD_UNIT yP_COLONCOLON - { $$ = new AstParseRef($1, VParseRefExp::PX_TEXT, "$unit", NULL, NULL); + { $$ = new AstClassOrPackageRef($1, "$unit", NULL, NULL); $$ = NULL; // No purpose otherwise, every symtab can see root SYMP->nextId(PARSEP->rootp()); } // | yLOCAL__COLONCOLON yP_COLONCOLON - { $$ = new AstParseRef($1, VParseRefExp::PX_TEXT, "local", NULL, NULL); + { $$ = new AstClassOrPackageRef($1, "local::", NULL, NULL); $$ = NULL; // UNSUP SYMP->nextId(PARSEP->rootp()); BBUNSUP($1, "Unsupported: Randomize 'local::'"); } diff --git a/test_regress/t/t_class_extends.out b/test_regress/t/t_class_extends.out index c839d805a..8cd0d95fd 100644 --- a/test_regress/t/t_class_extends.out +++ b/test_regress/t/t_class_extends.out @@ -1,28 +1,16 @@ %Error-UNSUPPORTED: t/t_class_extends.v:13:21: Unsupported: class extends 13 | class Base1 extends Base0; | ^~~~~ -%Error: t/t_class_extends.v:13:21: Found definition of 'Base0' as a CLASS but expected a variable - 13 | class Base1 extends Base0; - | ^~~~~ %Error-UNSUPPORTED: t/t_class_extends.v:18:21: Unsupported: class extends 18 | class Base2 extends Base1; | ^~~~~ -%Error: t/t_class_extends.v:18:21: Found definition of 'Base1' as a CLASS but expected a variable - 18 | class Base2 extends Base1; - | ^~~~~ %Error-UNSUPPORTED: t/t_class_extends.v:22:19: Unsupported: class extends 22 | class Cls extends Base2; | ^~~~~ -%Error: t/t_class_extends.v:22:19: Found definition of 'Base2' as a CLASS but expected a variable - 22 | class Cls extends Base2; - | ^~~~~ %Error: t/t_class_extends.v:25:4: Can't find typedef: 'T' 25 | T imemberc; | ^ %Error-UNSUPPORTED: t/t_class_extends.v:33:43: Unsupported: class extends 33 | class uvm__registry #(type T=int) extends uvm_object_wrapper; | ^~~~~~~~~~~~~~~~~~ -%Error: t/t_class_extends.v:33:43: Found definition of 'uvm_object_wrapper' as a CLASS but expected a variable - 33 | class uvm__registry #(type T=int) extends uvm_object_wrapper; - | ^~~~~~~~~~~~~~~~~~ %Error: Exiting due to diff --git a/test_regress/t/t_class_extends_this.out b/test_regress/t/t_class_extends_this.out index 020f115a4..6f0456393 100644 --- a/test_regress/t/t_class_extends_this.out +++ b/test_regress/t/t_class_extends_this.out @@ -7,9 +7,6 @@ %Error-UNSUPPORTED: t/t_class_extends_this.v:17:19: Unsupported: class extends 17 | class Cls extends Base; | ^~~~ -%Error: t/t_class_extends_this.v:17:19: Found definition of 'Base' as a CLASS but expected a variable - 17 | class Cls extends Base; - | ^~~~ %Error-UNSUPPORTED: t/t_class_extends_this.v:21:11: Unsupported: this 21 | if (this.value != 2) $stop; | ^~~~ diff --git a/test_regress/t/t_class_member_bad.out b/test_regress/t/t_class_member_bad.out index eb6537580..1251ff9af 100644 --- a/test_regress/t/t_class_member_bad.out +++ b/test_regress/t/t_class_member_bad.out @@ -1,7 +1,4 @@ %Error-UNSUPPORTED: t/t_class_member_bad.v:11:20: Unsupported: class extends 11 | class Cls2 extends Base1; | ^~~~~ -%Error: t/t_class_member_bad.v:11:20: Found definition of 'Base1' as a CLASS but expected a variable - 11 | class Cls2 extends Base1; - | ^~~~~ %Error: Exiting due to diff --git a/test_regress/t/t_class_method_bad.out b/test_regress/t/t_class_method_bad.out index 88dcdf4f4..bb2dbc0f6 100644 --- a/test_regress/t/t_class_method_bad.out +++ b/test_regress/t/t_class_method_bad.out @@ -1,7 +1,4 @@ %Error-UNSUPPORTED: t/t_class_method_bad.v:11:20: Unsupported: class extends 11 | class Cls2 extends Base1; | ^~~~~ -%Error: t/t_class_method_bad.v:11:20: Found definition of 'Base1' as a CLASS but expected a variable - 11 | class Cls2 extends Base1; - | ^~~~~ %Error: Exiting due to