/// <summary> /// Compiles the given msl script string to a Script instance. /// </summary> /// <param name="script">The string to interpret as a msl script.</param> /// <returns></returns> public ScriptContainer Compile(string name, string source, string binPathes) { ScriptContainer result = new ScriptContainer(binPathes, name); Parser mslParser = new Parser(); mslParser.ScriptName = name; StringReader reader = new StringReader(source); CodeCompileUnit unit = mslParser.Parse(reader); reader.Close(); result.ScriptDom = unit; result.Compile(name, this); return result; }
/// <summary> /// Compiles the given msl script file to a Script instance. /// </summary> /// <param name="file">The file to compile.</param> /// <returns>The compiled script.</returns> public ScriptContainer Compile(System.IO.FileInfo file, string binPathes) { ScriptContainer result = new ScriptContainer(binPathes, file.Name); Parser mslParser = new Parser(); StreamReader reader = new StreamReader(file.OpenRead(), System.Text.Encoding.Default, false); CodeCompileUnit unit = mslParser.Parse(reader); reader.Close(); result.ScriptDom = unit; result.Compile(file.Name, this); return result; }