Handle empty class item declarations in parser

The SystemVerilog grammar explicitly allows an empty class item
declaration. The empty class item declaration is just a semicolon and has
no effect.

E.g. the following is legal
```
class C
  int x;;;
endclass
```

Add support to the parser to accept empty class item declarations.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-03-11 21:24:17 +01:00
parent ede341410f
commit 3939126625
1 changed files with 3 additions and 0 deletions

View File

@ -979,6 +979,9 @@ class_item /* IEEE1800-2005: A.1.8 */
| parameter_declaration
/* Empty class item */
| ';'
| error ';'
{ yyerror(@2, "error: invalid class item.");
yyerrok;