Compile() public method

public Compile ( string mainType, IScriptEngine engine ) : void
mainType string
engine IScriptEngine
return void
コード例 #1
0
ファイル: MslScriptEngine.cs プロジェクト: hapm/IrcShark
 /// <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;
 }
コード例 #2
0
ファイル: MslScriptEngine.cs プロジェクト: hapm/IrcShark
 /// <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;
 }