Promblem in instantiation

Like for example I have a generator class like:-
class generator;



endclass: generator
Now I want to instantiate it in environment class and I did it in following way:-
`include “generator.sv”
class environment;
generator gen;


endclass: environment
Then it shows errors that " generator gen;" has unexpected token error
Please tell what I am doing wrong.Although from my point of view I think it is correct way of instantiation.

In reply to SidRaj:

You should learn about SystemVerilog packages and how to use them.

In reply to cgales:

But in above example , I just want to use one class inside another class and I have implemented in above mentioned way and its show the unexpected token error

In reply to SidRaj:

You need to show the exact code that is causing the error. The generic code you provided should work, although using a package makes things significantly easier.