aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL
diff options
context:
space:
mode:
authorTedd Hansen2007-09-13 11:11:08 +0000
committerTedd Hansen2007-09-13 11:11:08 +0000
commitcef8c5e9d7ce49cc47e7ef1816465064d889d6d5 (patch)
treeeb50e06403d1270b5eb6ce1456e2c9d44b3c6488 /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL
parentBackup is now optional on classes (diff)
downloadopensim-SC_OLD-cef8c5e9d7ce49cc47e7ef1816465064d889d6d5.zip
opensim-SC_OLD-cef8c5e9d7ce49cc47e7ef1816465064d889d6d5.tar.gz
opensim-SC_OLD-cef8c5e9d7ce49cc47e7ef1816465064d889d6d5.tar.bz2
opensim-SC_OLD-cef8c5e9d7ce49cc47e7ef1816465064d889d6d5.tar.xz
Hiding evidence that I once was a VB coder (thanks to refactoring). Renamed member names to smallcapsy.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs32
2 files changed, 19 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index 0cce317..a488b91 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -13,7 +13,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
13 { 13 {
14 private LSL2CSConverter LSL_Converter = new LSL2CSConverter(); 14 private LSL2CSConverter LSL_Converter = new LSL2CSConverter();
15 private CSharpCodeProvider codeProvider = new CSharpCodeProvider(); 15 private CSharpCodeProvider codeProvider = new CSharpCodeProvider();
16 private static UInt64 ScriptCompileCounter = 0; 16 private static UInt64 scriptCompileCounter = 0;
17 //private ICodeCompiler icc = codeProvider.CreateCompiler(); 17 //private ICodeCompiler icc = codeProvider.CreateCompiler();
18 public string CompileFromFile(string LSOFileName) 18 public string CompileFromFile(string LSOFileName)
19 { 19 {
@@ -49,8 +49,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
49 49
50 50
51 // Output assembly name 51 // Output assembly name
52 ScriptCompileCounter++; 52 scriptCompileCounter++;
53 string OutFile = Path.Combine("ScriptEngines", "Script_" + ScriptCompileCounter + ".dll"); 53 string OutFile = Path.Combine("ScriptEngines", "Script_" + scriptCompileCounter + ".dll");
54 try 54 try
55 { 55 {
56 System.IO.File.Delete(OutFile); 56 System.IO.File.Delete(OutFile);
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
index 9495888..3adb7e2 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSConverter.cs
@@ -8,21 +8,21 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
8 public class LSL2CSConverter 8 public class LSL2CSConverter
9 { 9 {
10 //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled); 10 //private Regex rnw = new Regex(@"[a-zA-Z0-9_\-]", RegexOptions.Compiled);
11 private Dictionary<string, string> DataTypes = new Dictionary<string, string>(); 11 private Dictionary<string, string> dataTypes = new Dictionary<string, string>();
12 private Dictionary<string, string> QUOTES = new Dictionary<string, string>(); 12 private Dictionary<string, string> quotes = new Dictionary<string, string>();
13 13
14 public LSL2CSConverter() 14 public LSL2CSConverter()
15 { 15 {
16 // Only the types we need to convert 16 // Only the types we need to convert
17 DataTypes.Add("void", "void"); 17 dataTypes.Add("void", "void");
18 DataTypes.Add("integer", "int"); 18 dataTypes.Add("integer", "int");
19 DataTypes.Add("float", "double"); 19 dataTypes.Add("float", "double");
20 DataTypes.Add("string", "string"); 20 dataTypes.Add("string", "string");
21 DataTypes.Add("key", "string"); 21 dataTypes.Add("key", "string");
22 DataTypes.Add("vector", "LSL_Types.Vector3"); 22 dataTypes.Add("vector", "LSL_Types.Vector3");
23 DataTypes.Add("rotation", "LSL_Types.Quaternion"); 23 dataTypes.Add("rotation", "LSL_Types.Quaternion");
24 DataTypes.Add("list", "list"); 24 dataTypes.Add("list", "list");
25 DataTypes.Add("null", "null"); 25 dataTypes.Add("null", "null");
26 26
27 } 27 }
28 28
@@ -74,7 +74,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
74 _Script += quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]); 74 _Script += quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]);
75 } 75 }
76 // We just left a quote 76 // We just left a quote
77 QUOTES.Add(quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]), quote); 77 quotes.Add(quote_replacement_string + quote_replaced_count.ToString().PadLeft(5, "0".ToCharArray()[0]), quote);
78 quote = ""; 78 quote = "";
79 } 79 }
80 break; 80 break;
@@ -189,10 +189,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
189 189
190 190
191 191
192 foreach (string key in DataTypes.Keys) 192 foreach (string key in dataTypes.Keys)
193 { 193 {
194 string val; 194 string val;
195 DataTypes.TryGetValue(key, out val); 195 dataTypes.TryGetValue(key, out val);
196 196
197 // Replace CAST - (integer) with (int) 197 // Replace CAST - (integer) with (int)
198 Script = Regex.Replace(Script, @"\(" + key + @"\)", @"(" + val + ")", RegexOptions.Compiled | RegexOptions.Multiline); 198 Script = Regex.Replace(Script, @"\(" + key + @"\)", @"(" + val + ")", RegexOptions.Compiled | RegexOptions.Multiline);
@@ -217,10 +217,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
217 217
218 218
219 // REPLACE BACK QUOTES 219 // REPLACE BACK QUOTES
220 foreach (string key in QUOTES.Keys) 220 foreach (string key in quotes.Keys)
221 { 221 {
222 string val; 222 string val;
223 QUOTES.TryGetValue(key, out val); 223 quotes.TryGetValue(key, out val);
224 Script = Script.Replace(key, "\"" + val + "\""); 224 Script = Script.Replace(key, "\"" + val + "\"");
225 } 225 }
226 226