public void compile(String javaSource) throws CompileException, ParseException, ScanException, ClassNotFoundException, InstantiationException, IllegalAccessException {
        SimpleCompiler compiler = new SimpleCompiler();
        try {
            compiler.cook(new StringReader(javaSource));
            Class<?> cl = compiler.getClassLoader().loadClass(Global.petriNet.getLabel());
            Global.petriNet = (PetriNet) cl.newInstance();
        } catch (IOException ex) {
            Logger.getLogger(NetClass.class.getName()).log(Level.SEVERE, null, ex);
        }
    }