public Program() { reporter = new ToolErrorReporter(true); compilerEnv = new CompilerEnvirons(); compilerEnv.SetErrorReporter(reporter); compiler = new ClassCompiler(compilerEnv); }
/// <summary> /// Returns a /// <code>CompilerEnvirons</code> /// suitable for using Rhino /// in an IDE environment. Most features are enabled by default. /// The /// <see cref="ErrorReporter">ErrorReporter</see> /// is set to an /// <see cref="Rhino.Ast.ErrorCollector">Rhino.Ast.ErrorCollector</see> /// . /// </summary> public static Rhino.CompilerEnvirons IdeEnvirons() { Rhino.CompilerEnvirons env = new Rhino.CompilerEnvirons(); env.SetRecoverFromErrors(true); env.SetRecordingComments(true); env.SetStrictMode(true); env.SetWarnTrailingComma(true); env.SetLanguageVersion(170); env.SetReservedKeywordAsIdentifier(true); env.SetIdeMode(true); env.SetErrorReporter(new ErrorCollector()); return env; }