From 2525810e2a1b23f9c5b17b3d075e02c0c6255e2c Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Tue, 27 Oct 2009 13:31:04 -0700 Subject: Removed the DotNetEngine scripting engine. You will need to create a fresh checkout or clean out all *DotNet*.dll assemblies from the bin/ directory to run OpenSim moving forward --- .../DotNetEngine/Compilers/CILCompiler.cs | 187 --------------------- .../DotNetEngine/Compilers/Compiler_CS.cs | 70 -------- .../DotNetEngine/Compilers/Compiler_JS.cs | 56 ------ .../DotNetEngine/Compilers/Compiler_LSL.cs | 57 ------- .../DotNetEngine/Compilers/Compiler_VB.cs | 56 ------ .../DotNetEngine/Compilers/Compiler_YP.cs | 55 ------ .../DotNetEngine/Compilers/LSL/LSL2CS.cs | 44 ----- .../Compilers/Properties/AssemblyInfo.cs | 63 ------- .../Components/DotNetEngine/Compilers/YP/YP2CS.cs | 54 ------ 9 files changed, 642 deletions(-) delete mode 100644 OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/CILCompiler.cs delete mode 100644 OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs delete mode 100644 OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_JS.cs delete mode 100644 OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_LSL.cs delete mode 100644 OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_VB.cs delete mode 100644 OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_YP.cs delete mode 100644 OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/LSL/LSL2CS.cs delete mode 100644 OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Properties/AssemblyInfo.cs delete mode 100644 OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/YP/YP2CS.cs (limited to 'OpenSim/ScriptEngine/Components/DotNetEngine/Compilers') diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/CILCompiler.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/CILCompiler.cs deleted file mode 100644 index 3d2d9d2..0000000 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/CILCompiler.cs +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.CodeDom.Compiler; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text.RegularExpressions; -using log4net; -using OpenSim.ScriptEngine.Shared; -using ScriptAssemblies; - -namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers -{ - public abstract class CILCompiler - { - internal static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private string ScriptEnginesPath = "ScriptEngines"; - private string Name { get { return "SECS.DotNetEngine.CILCompiler"; } } - private string m_scriptAssemblyName; - internal string ScriptAssemblyName { get { return m_scriptAssemblyName; } set { m_scriptAssemblyName = value; } } - - // Default inherit - protected string ScriptInheritFrom = typeof(ScriptAssemblies.ScriptBase).Name; - private readonly System.Security.Cryptography.MD5CryptoServiceProvider MD5Sum = new System.Security.Cryptography.MD5CryptoServiceProvider(); - protected CodeDomProvider CompileProvider; - - //private string[] AppDomainAssemblies = new string[] { "OpenSim.Region.ScriptEngine.Shared.dll", "OpenSim.Region.ScriptEngine.Shared.Script.dll", "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll" }; - private readonly string[] AppDomainAssemblies = new string[] { - Assembly.GetAssembly(typeof(Int32)).Location, - "OpenSim.ScriptEngine.Shared.dll", - "OpenSim.ScriptEngine.Shared.Script.dll", - Path.Combine("ScriptEngines", "OpenSim.Region.ScriptEngine.Shared.dll") - }; - - public abstract string PreProcessScript(ref string script); - - public CILCompiler() - { - } - - private static readonly Regex FileNameFixer = new Regex(@"[^a-zA-Z0-9\.\-]", RegexOptions.Compiled | RegexOptions.Singleline); - public string Compile(ScriptMetaData data, ref string _script) - { - // Add "using", "inherit", default constructor, etc around script. - string script = PreProcessScript(ref _script); - - // Get filename based on content - string md5Sum = System.Convert.ToBase64String( - MD5Sum.ComputeHash( - System.Text.Encoding.ASCII.GetBytes(script) - )); - // Unique name for this assembly - ScriptAssemblyName = "SECS_Script_" + FileNameFixer.Replace(md5Sum, "_"); - - string OutFile = Path.Combine(ScriptEnginesPath, ScriptAssemblyName + ".dll"); - - // Make sure target dir exist - if (!Directory.Exists(ScriptEnginesPath)) - try { Directory.CreateDirectory(ScriptEnginesPath); } - catch { } - - // Already exist? No point in recompiling - if (File.Exists(OutFile)) - return OutFile; - - // - // Dump source code - // - string dumpFile = OutFile + ".txt"; - try - { - if (File.Exists(dumpFile)) - File.Delete(dumpFile); - File.WriteAllText(dumpFile, script); - } - catch (Exception e) - { - m_log.DebugFormat("[{0}] Exception trying to dump script source code to file \"{1}\": {2}", Name, dumpFile, e.ToString()); - } - - // - // COMPILE - // - - CompilerParameters parameters = new CompilerParameters(); - parameters.IncludeDebugInformation = true; - //string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); - - foreach (string file in AppDomainAssemblies) - { - parameters.ReferencedAssemblies.Add(file); - m_log.DebugFormat("[{0}] Adding reference for compile: \"{1}\".", Name, file); - } - //lock (commandProvider) - //{ - // foreach (string key in commandProvider.Keys) - // { - // IScriptCommandProvider cp = commandProvider[key]; - // string - // file = cp.GetType().Assembly.Location; - // parameters.ReferencedAssemblies.Add(file); - // m_log.DebugFormat("[{0}] Loading command provider assembly \"{1}\" into AppDomain: \"{2}\".", Name, - // key, file); - // } - //} - - parameters.GenerateExecutable = false; - parameters.OutputAssembly = OutFile; - parameters.IncludeDebugInformation = true; - //parameters.WarningLevel = 1; // Should be 4? - parameters.TreatWarningsAsErrors = false; - - // Do compile - CompilerResults results = CompileProvider.CompileAssemblyFromSource(parameters, script); - - - // - // WARNINGS AND ERRORS - // - //TODO - int display = 5; - if (results.Errors.Count > 0) - { - string errtext = String.Empty; - foreach (CompilerError CompErr in results.Errors) - { - // Show 5 errors max - // - if (display <= 0) - break; - display--; - - string severity = "Error"; - if (CompErr.IsWarning) - severity = "Warning"; - - //TODO: Implement - KeyValuePair lslPos = new KeyValuePair(); - - //lslPos = "NOT IMPLEMENTED";// FindErrorPosition(CompErr.Line, CompErr.Column); - - string text = CompErr.ErrorText; - - // The Second Life viewer's script editor begins - // countingn lines and columns at 0, so we subtract 1. - errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", - lslPos.Key - 1, lslPos.Value - 1, - CompErr.ErrorNumber, text, severity); - } - - if (!File.Exists(OutFile)) - { - throw new Exception(errtext); - } - } - - // TODO: Process errors - return OutFile; - } - - } -} diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs deleted file mode 100644 index a8599bf..0000000 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_CS.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.CodeDom.Compiler; -using System.Collections.Generic; -using System.Text; -using Microsoft.CSharp; -using OpenSim.ScriptEngine.Shared; - -namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers -{ - public class Compiler_CS : CILCompiler, IScriptCompiler - { - private string[] ScriptUsing = new string[] - { - "System", - "OpenSim.ScriptEngine.Shared", - "OpenSim.Region.ScriptEngine.Shared", - "System.Collections.Generic" - }; - - public Compiler_CS() - { - CompileProvider = new CSharpCodeProvider(); - } - - public override string PreProcessScript(ref string script) - { - string s = ""; - foreach (string u in ScriptUsing) - { - s += "using " + u + ";"; - } - - s += "\r\n" - + String.Empty + "namespace ScriptAssemblies { " - + String.Empty + "public class UserScript" + " : " + ScriptInheritFrom + " { \r\n" + - @"public Script() { } " + - script + - "} }\r\n"; - - return s; - } - - } -} diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_JS.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_JS.cs deleted file mode 100644 index 4361ae2..0000000 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_JS.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.CodeDom.Compiler; -using System.Collections.Generic; -using System.Text; -using Microsoft.JScript; -using OpenSim.ScriptEngine.Shared; - -namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers -{ - public class Compiler_JS : CILCompiler, IScriptCompiler - { - - public Compiler_JS() - { - CompileProvider = new JScriptCodeProvider() as CodeDomProvider; - } - - public override string PreProcessScript(ref string script) - { - return - "import OpenSim.Region.ScriptEngine.Shared; import System.Collections.Generic;\r\n" + - "package SecondLife {\r\n" + - "class Script extends OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" + - script + - "} }\r\n"; - - } - - } -} diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_LSL.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_LSL.cs deleted file mode 100644 index 496afc9..0000000 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_LSL.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; -using OpenSim.ScriptEngine.Components.DotNetEngine.Compilers.LSL; -using OpenSim.ScriptEngine.Shared; - -namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers -{ - public class Compiler_LSL : IScriptCompiler - { - - - private readonly Compiler_CS m_Compiler_CS = new Compiler_CS(); - private readonly LSL2CS m_LSL2CS = new LSL2CS(); - - public string Compile(ScriptMetaData scriptMetaData, ref string script) - { - // Convert script to CS - string scriptCS = m_LSL2CS.Convert(ref script); - // Use CS compiler to compile it - return m_Compiler_CS.Compile(scriptMetaData, ref scriptCS); - } - - public string PreProcessScript(ref string script) - { - // This is handled by our converter - return script; - } - } -} diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_VB.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_VB.cs deleted file mode 100644 index 04597ba..0000000 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_VB.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.CodeDom.Compiler; -using System.Collections.Generic; -using System.Text; -using Microsoft.VisualBasic; -using OpenSim.ScriptEngine.Shared; - -namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers -{ - public class Compiler_VB : CILCompiler, IScriptCompiler - { - - public Compiler_VB() - { - CompileProvider = new VBCodeProvider() as CodeDomProvider; - } - - public override string PreProcessScript(ref string script) - { - return - "Imports OpenSim.Region.ScriptEngine.Shared: Imports System.Collections.Generic: " + - String.Empty + "NameSpace SecondLife:" + - String.Empty + "Public Class Script: Inherits OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass: " + - "\r\nPublic Sub New()\r\nEnd Sub: " + - script + - ":End Class :End Namespace\r\n"; - } - } -} - diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_YP.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_YP.cs deleted file mode 100644 index dce17ad..0000000 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Compiler_YP.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Reflection; -using System.Text; -using OpenSim.ScriptEngine.Components.DotNetEngine.Compilers.YP; -using OpenSim.ScriptEngine.Shared; - -namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers -{ - public class Compiler_YP: IScriptCompiler - { - - private readonly Compiler_CS m_Compiler_CS = new Compiler_CS(); - - public string Compile(ScriptMetaData scriptMetaData, ref string script) - { - // Convert script to CS - string scriptCS = YP2CS.Convert(ref script); - // Use CS compiler to compile it - return m_Compiler_CS.Compile(scriptMetaData, ref scriptCS); - } - - public string PreProcessScript(ref string script) - { - // This is handled by our converter - return script; - } - } -} diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/LSL/LSL2CS.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/LSL/LSL2CS.cs deleted file mode 100644 index d4af1c7..0000000 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/LSL/LSL2CS.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Text; -using OpenSim.Region.ScriptEngine.Shared.CodeTools; - -namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers.LSL -{ - public class LSL2CS - { - private ICodeConverter Converter = new CSCodeGenerator(); - - public string Convert(ref string script) - { - //m_positionMap = ((CSCodeGenerator) LSL_Converter).PositionMap; - return Converter.Convert(script); - } - } -} diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Properties/AssemblyInfo.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Properties/AssemblyInfo.cs deleted file mode 100644 index dedc48e..0000000 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OpenSim.ScriptEngine.Components.DotNetEngine.Compilers")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("http://opensimulator.org")] -[assembly: AssemblyProduct("OpenSim.ScriptEngine.Components.DotNetEngine.Compilers")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ea77002b-c967-4368-ace9-6533f8147d4b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("0.6.5.*")] -[assembly: AssemblyVersion("0.6.5.*")] -[assembly: AssemblyFileVersion("0.6.5.0")] diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/YP/YP2CS.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/YP/YP2CS.cs deleted file mode 100644 index 10b5715..0000000 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Compilers/YP/YP2CS.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.ScriptEngine.Components.DotNetEngine.Compilers.YP -{ - public class YP2CS - { - public static string Convert(ref string script) - { - return script; - } - - public string PreProcessScript(ref string script) - { - return - "using OpenSim.Region.ScriptEngine.Shared.YieldProlog; " + - "using OpenSim.Region.ScriptEngine.Shared; using System.Collections.Generic;\r\n" + - String.Empty + "namespace SecondLife { " + - String.Empty + "public class Script : OpenSim.Region.ScriptEngine.Shared.ScriptBase.ScriptBaseClass { \r\n" + - //@"public Script() { } " + - @"static OpenSim.Region.ScriptEngine.Shared.YieldProlog.YP YP=null; " + - @"public Script() { YP= new OpenSim.Region.ScriptEngine.Shared.YieldProlog.YP(); } " + - script + - "} }\r\n"; - } - } -} -- cgit v1.1