Renamed Compiler.LSL to Compiler.LSO

afrisby
Tedd Hansen 2007-08-10 16:22:20 +00:00
parent e7eeab90d6
commit 8b17e4da10
14 changed files with 40 additions and 32 deletions

View File

@ -30,7 +30,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
public static class Common public static class Common
{ {

View File

@ -32,7 +32,7 @@ using System.Reflection.Emit;
using System.Threading; using System.Threading;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
@ -86,7 +86,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
TypeBuilder typeBuilder = modBuilder.DefineType( TypeBuilder typeBuilder = modBuilder.DefineType(
"LSL_ScriptObject", "LSL_ScriptObject",
TypeAttributes.Public | TypeAttributes.BeforeFieldInit, TypeAttributes.Public | TypeAttributes.BeforeFieldInit,
typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass)); typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass));
//, //,
// typeof()); // typeof());
//, typeof(LSL_BuiltIn_Commands_Interface)); //, typeof(LSL_BuiltIn_Commands_Interface));

View File

@ -32,7 +32,7 @@ using System.Text;
using System.Reflection; using System.Reflection;
using System.Reflection.Emit; using System.Reflection.Emit;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
partial class LSO_Parser partial class LSO_Parser
{ {

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Text; using System.Text;
using System.IO; using System.IO;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
public partial class LSL_BaseClass public partial class LSL_BaseClass
{ {
@ -41,7 +41,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{ {
LSL_Builtins = LSLBuiltins; LSL_Builtins = LSLBuiltins;
Common.SendToLog("OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass.Start() called"); Common.SendToLog("OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass.Start() called");
//LSL_Builtins.llSay(0, "Test"); //LSL_Builtins.llSay(0, "Test");
return; return;
} }

View File

@ -2,7 +2,7 @@
//using System.Collections.Generic; //using System.Collections.Generic;
//using System.Text; //using System.Text;
//namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL //namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
//{ //{
// public partial class LSL_BaseClass // public partial class LSL_BaseClass
// { // {

View File

@ -2,11 +2,19 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
public partial class LSL_BaseClass public partial class LSL_BaseClass
{ {
/*
* OPCODES
*
* These are internal "assembly" commands,
* basic operators like "ADD", "PUSH" and "POP"
*
* It also contains managed stack and keeps track of internal variables, etc.
*
*/
public void StoreToLocal(UInt32 index) public void StoreToLocal(UInt32 index)

View File

@ -30,7 +30,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
public class LSL_CLRInterface public class LSL_CLRInterface
{ {

View File

@ -32,7 +32,7 @@ using System.Text;
using System.Reflection; using System.Reflection;
using System.Reflection.Emit; using System.Reflection.Emit;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
partial class LSO_Parser partial class LSO_Parser
{ {

View File

@ -30,7 +30,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
public static class LSO_Enums public static class LSO_Enums
{ {

View File

@ -33,7 +33,7 @@ using System.IO;
using System.Reflection; using System.Reflection;
using System.Reflection.Emit; using System.Reflection.Emit;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
partial class LSO_Parser partial class LSO_Parser
{ {

View File

@ -31,7 +31,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
static class LSO_Struct static class LSO_Struct
{ {

View File

@ -30,7 +30,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
public interface LSL_BuiltIn_Commands_Interface public interface LSL_BuiltIn_Commands_Interface
{ {

View File

@ -30,7 +30,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO
{ {
public class LSL_BuiltIn_Commands_TestImplementation : LSL_BuiltIn_Commands_Interface public class LSL_BuiltIn_Commands_TestImplementation : LSL_BuiltIn_Commands_Interface
{ {

View File

@ -46,46 +46,46 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// Object<string, Script<string, script>> // Object<string, Script<string, script>>
internal Dictionary<string, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>> Scripts = new Dictionary<string, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>>(); internal Dictionary<string, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass>> Scripts = new Dictionary<string, Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass>>();
internal Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>.KeyCollection GetScriptKeys(string ObjectID) internal Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass>.KeyCollection GetScriptKeys(string ObjectID)
{ {
if (Scripts.ContainsKey(ObjectID) == false) if (Scripts.ContainsKey(ObjectID) == false)
return null; return null;
Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass> Obj; Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass> Obj;
Scripts.TryGetValue(ObjectID, out Obj); Scripts.TryGetValue(ObjectID, out Obj);
return Obj.Keys; return Obj.Keys;
} }
internal OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass GetScript(string ObjectID, string ScriptID) internal OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass GetScript(string ObjectID, string ScriptID)
{ {
if (Scripts.ContainsKey(ObjectID) == false) if (Scripts.ContainsKey(ObjectID) == false)
return null; return null;
Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass> Obj; Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass> Obj;
Scripts.TryGetValue(ObjectID, out Obj); Scripts.TryGetValue(ObjectID, out Obj);
if (Obj.ContainsKey(ScriptID) == false) if (Obj.ContainsKey(ScriptID) == false)
return null; return null;
// Get script // Get script
OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script; OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script;
Obj.TryGetValue(ScriptID, out Script); Obj.TryGetValue(ScriptID, out Script);
return Script; return Script;
} }
internal void SetScript(string ObjectID, string ScriptID, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script) internal void SetScript(string ObjectID, string ScriptID, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script)
{ {
// Create object if it doesn't exist // Create object if it doesn't exist
if (Scripts.ContainsKey(ObjectID) == false) if (Scripts.ContainsKey(ObjectID) == false)
Scripts.Add(ObjectID, new Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass>()); Scripts.Add(ObjectID, new Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass>());
// Delete script if it exists // Delete script if it exists
Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass> Obj; Dictionary<string, OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass> Obj;
Scripts.TryGetValue(ObjectID, out Obj); Scripts.TryGetValue(ObjectID, out Obj);
if (Obj.ContainsKey(ScriptID) == true) if (Obj.ContainsKey(ScriptID) == true)
Obj.Remove(ScriptID); Obj.Remove(ScriptID);
@ -118,7 +118,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
{ {
Common.SendToDebug("ScriptManager Script is LSO, compiling to .Net Assembly"); Common.SendToDebug("ScriptManager Script is LSO, compiling to .Net Assembly");
// Create a new instance of the compiler (currently we don't want reuse) // Create a new instance of the compiler (currently we don't want reuse)
OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Engine LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.Engine(); OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.Engine LSLCompiler = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.Engine();
// Compile // Compile
FileName = LSLCompiler.Compile(FileName); FileName = LSLCompiler.Compile(FileName);
} }
@ -130,14 +130,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
AppDomain FreeAppDomain = GetFreeAppDomain(); AppDomain FreeAppDomain = GetFreeAppDomain();
// * Load and start script // * Load and start script
OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName);
string FullScriptID = ScriptID + "." + ObjectID; string FullScriptID = ScriptID + "." + ObjectID;
// Add it to our temporary active script keeper // Add it to our temporary active script keeper
//Scripts.Add(FullScriptID, Script); //Scripts.Add(FullScriptID, Script);
SetScript(ObjectID, ScriptID, Script); SetScript(ObjectID, ScriptID, Script);
// We need to give (untrusted) assembly a private instance of BuiltIns // We need to give (untrusted) assembly a private instance of BuiltIns
// this private copy will contain Read-Only FullScriptID so that it can bring that on to the server whenever needed. // this private copy will contain Read-Only FullScriptID so that it can bring that on to the server whenever needed.
OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BuiltIn_Commands_Interface LSLB = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BuiltIn_Commands_TestImplementation(FullScriptID); OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BuiltIn_Commands_Interface LSLB = new OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BuiltIn_Commands_TestImplementation(FullScriptID);
// Start the script - giving it BuiltIns // Start the script - giving it BuiltIns
Common.SendToDebug("ScriptManager initializing script, handing over private builtin command interface"); Common.SendToDebug("ScriptManager initializing script, handing over private builtin command interface");
Script.Start(LSLB); Script.Start(LSLB);
@ -162,7 +162,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
/// <param name="FreeAppDomain">AppDomain to load script into</param> /// <param name="FreeAppDomain">AppDomain to load script into</param>
/// <param name="FileName">FileName of script assembly (.dll)</param> /// <param name="FileName">FileName of script assembly (.dll)</param>
/// <returns></returns> /// <returns></returns>
private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName) private OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass LoadAndInitAssembly(AppDomain FreeAppDomain, string FileName)
{ {
Common.SendToDebug("ScriptManager Loading Assembly " + FileName); Common.SendToDebug("ScriptManager Loading Assembly " + FileName);
// Load .Net Assembly (.dll) // Load .Net Assembly (.dll)
@ -201,7 +201,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
//{ //{
//} //}
return (OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass)Activator.CreateInstance(t); return (OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass)Activator.CreateInstance(t);
} }
@ -209,13 +209,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
internal void ExecuteFunction(string ObjectID, string ScriptID, string FunctionName, object[] args) internal void ExecuteFunction(string ObjectID, string ScriptID, string FunctionName, object[] args)
{ {
Common.SendToDebug("Executing Function ObjectID: " + ObjectID + ", ScriptID: " + ScriptID + ", FunctionName: " + FunctionName); Common.SendToDebug("Executing Function ObjectID: " + ObjectID + ", ScriptID: " + ScriptID + ", FunctionName: " + FunctionName);
OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = myScriptEngine.myScriptManager.GetScript(ObjectID, ScriptID); OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = myScriptEngine.myScriptManager.GetScript(ObjectID, ScriptID);
Type type = Script.GetType(); Type type = Script.GetType();
//object o = (object)Script; //object o = (object)Script;
//System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>) //System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>)
//Type type = typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass); //Type type = typeof(OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass);
Common.SendToDebug("Invoke: \"" + Script.State + "_event_" + FunctionName + "\""); Common.SendToDebug("Invoke: \"" + Script.State + "_event_" + FunctionName + "\"");
type.InvokeMember(Script.State + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, Script, args); type.InvokeMember(Script.State + "_event_" + FunctionName, BindingFlags.InvokeMethod, null, Script, args);
//System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>)type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, Script, null); //System.Collections.Generic.List<string> Functions = (System.Collections.Generic.List<string>)type.InvokeMember("GetFunctions", BindingFlags.InvokeMethod, null, Script, null);