aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
diff options
context:
space:
mode:
authorTedd Hansen2007-08-18 20:53:13 +0000
committerTedd Hansen2007-08-18 20:53:13 +0000
commit551f2af39f2bc003bef9ba388ccb4a6d87f2f36b (patch)
tree6338597d88a959f5d9391439fb2bb4978b897df5 /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
parentWorking on AppDomains. Scripting is now officially broken. :] (diff)
downloadopensim-SC-551f2af39f2bc003bef9ba388ccb4a6d87f2f36b.zip
opensim-SC-551f2af39f2bc003bef9ba388ccb4a6d87f2f36b.tar.gz
opensim-SC-551f2af39f2bc003bef9ba388ccb4a6d87f2f36b.tar.bz2
opensim-SC-551f2af39f2bc003bef9ba388ccb4a6d87f2f36b.tar.xz
LSL Compiler now only referring required assemblies (DotNetEngine and Common). Changed Vector and Rotation to custom types (stored in Common) that needs to be changed later. No longer using Axiom. Script support still broken.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
index 81f8e2d..f41cd59 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
@@ -18,8 +18,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
18 DataTypes.Add("float", "double"); 18 DataTypes.Add("float", "double");
19 DataTypes.Add("string", "string"); 19 DataTypes.Add("string", "string");
20 DataTypes.Add("key", "string"); 20 DataTypes.Add("key", "string");
21 DataTypes.Add("vector", "Axiom.Math.Vector3"); 21 DataTypes.Add("vector", "LSL_Types.Vector3");
22 DataTypes.Add("rotation", "Axiom.Math.Quaternion"); 22 DataTypes.Add("rotation", "LSL_Types.Quaternion");
23 DataTypes.Add("list", "list"); 23 DataTypes.Add("list", "list");
24 DataTypes.Add("null", "null"); 24 DataTypes.Add("null", "null");
25 } 25 }
@@ -205,8 +205,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
205 Script = Regex.Replace(Script, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1void $2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); 205 Script = Regex.Replace(Script, @"^(\s*)((?!(if|switch|for)[^a-zA-Z0-9_])[a-zA-Z0-9_]*\s*\([^\)]*\)[^;]*\{)", @"$1void $2", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
206 206
207 // Replace <x,y,z> and <x,y,z,r> 207 // Replace <x,y,z> and <x,y,z,r>
208 Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new Axiom.Math.Quaternion($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); 208 Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Quaternion($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
209 Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*)>", @"new Axiom.Math.Vector3($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); 209 Script = Regex.Replace(Script, @"<([^,>]*,[^,>]*,[^,>]*)>", @"new LSL_Types.Vector3($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
210 210
211 // Replace List []'s 211 // Replace List []'s
212 Script = Regex.Replace(Script, @"\[([^\]]*)\]", @"List.Parse($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline); 212 Script = Regex.Replace(Script, @"\[([^\]]*)\]", @"List.Parse($1)", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.Singleline);
@@ -227,7 +227,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
227 227
228 228
229 // Add namespace, class name and inheritance 229 // Add namespace, class name and inheritance
230 Return = "namespace SecondLife {\r\n"; 230 Return = "" +
231 "using System;\r\n" +
232 "using System.Collections.Generic;\r\n" +
233 "using System.Text;\r\n" +
234 "using OpenSim.Region.ScriptEngine.Common;\r\n" +
235 "namespace SecondLife {\r\n";
231 Return += "[Serializable] public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass {\r\n"; 236 Return += "[Serializable] public class Script : OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass {\r\n";
232 Return += @"public Script() { }"+"\r\n"; 237 Return += @"public Script() { }"+"\r\n";
233 Return += Script; 238 Return += Script;