/// <summary> /// creates a new <see cref="ScriptCompiler"/> /// </summary> /// <param name="logger">access to logging</param> /// <param name="parser">parser used to parse scripts</param> /// <param name="cache">access to object cache</param> /// <param name="methodprovider">provides managed method hosts to scripts</param> /// <param name="scriptservice">used to load scripts if not found in cache</param> /// <param name="archive">archive used to load revisions</param> /// <param name="importservice">access to javascript imports</param> /// <param name="pythonservice">access to python script logic</param> /// <param name="luaservice">used to execute lua code</param> public ScriptCompiler(ILogger <ScriptCompiler> logger, IScriptParser parser, ICacheService cache, IMethodProviderService methodprovider, IScriptService scriptservice, IArchiveService archive, IScriptImportService importservice, IPythonService pythonservice, ILuaService luaservice) { this.parser = parser; this.cache = cache; this.scriptservice = scriptservice; this.archive = archive; this.importservice = importservice; this.pythonservice = pythonservice; this.luaservice = luaservice; this.logger = logger; if (parser != null) { parser.Extensions.AddExtensions(typeof(Math)); parser.Extensions.AddExtensions <ScriptEnumerations>(); parser.ImportProvider = methodprovider; } ReactInitializer.Initialize(); }
/// <summary> /// creates a new <see cref="PythonService"/> /// </summary> /// <param name="importservice">service used to import hosts</param> /// <param name="typecreator">service used to create custom types</param> public PythonService(IScriptImportService importservice, ITypeCreator typecreator) { this.importservice = importservice; this.typecreator = typecreator; }
/// <summary> /// creates a new <see cref="JavaScript"/> /// </summary> /// <param name="code">code to execute</param> /// <param name="importservice">access to imports in javascript</param> /// <param name="language">language to evaluate (optional, must be a javascript relative)</param> public JavaScript(string code, IScriptImportService importservice, ScriptLanguage language = ScriptLanguage.JavaScript) { this.code = code; this.importservice = importservice; this.language = language; }