Getting error as unexpected identifier and error in class specification

Are you importing the uvm_pkg? Are you including the uvm_macros.svh?

Show the top level packages that you are generating to compile your code and we can provide some more help.