public void Visitline(string args) { CommonTokenStream str = new CommonTokenStream(); //We need the syntax for the core object Test_Core myprog = new Test_Core(str, ""); myprog.error += new Test_Core.errorreport(Onerror); myprog.VisitLine(args); }