diff options
Update svn properties.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs index ffb8ddc..63b304a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/PrologException.cs | |||
@@ -1,71 +1,71 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2007-2008, Jeff Thompson | 2 | * Copyright (C) 2007-2008, Jeff Thompson |
3 | * | 3 | * |
4 | * All rights reserved. | 4 | * All rights reserved. |
5 | * | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions are met: | 7 | * modification, are permitted provided that the following conditions are met: |
8 | * | 8 | * |
9 | * * Redistributions of source code must retain the above copyright | 9 | * * Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * * Redistributions in binary form must reproduce the above copyright | 11 | * * Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. |
14 | * * Neither the name of the copyright holder nor the names of its contributors | 14 | * * Neither the name of the copyright holder nor the names of its contributors |
15 | * may be used to endorse or promote products derived from this software | 15 | * may be used to endorse or promote products derived from this software |
16 | * without specific prior written permission. | 16 | * without specific prior written permission. |
17 | * | 17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
22 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 22 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
23 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 23 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
24 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 24 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
25 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | 25 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
26 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | 26 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
27 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 27 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | using System; | 31 | using System; |
32 | 32 | ||
33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | 33 | namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog |
34 | { | 34 | { |
35 | /// <summary> | 35 | /// <summary> |
36 | /// A PrologException is used as the exception thrown by YP.throw(Term). | 36 | /// A PrologException is used as the exception thrown by YP.throw(Term). |
37 | /// </summary> | 37 | /// </summary> |
38 | public class PrologException : Exception | 38 | public class PrologException : Exception |
39 | { | 39 | { |
40 | public readonly object _term; | 40 | public readonly object _term; |
41 | 41 | ||
42 | /// <summary> | 42 | /// <summary> |
43 | /// Create a PrologException with the given Term. The printable exception message is the full Term. | 43 | /// Create a PrologException with the given Term. The printable exception message is the full Term. |
44 | /// </summary> | 44 | /// </summary> |
45 | /// <param name="Term">the term of the exception</param> | 45 | /// <param name="Term">the term of the exception</param> |
46 | /// </param> | 46 | /// </param> |
47 | public PrologException(object Term) | 47 | public PrologException(object Term) |
48 | : base(YP.getValue(Term).ToString()) | 48 | : base(YP.getValue(Term).ToString()) |
49 | { | 49 | { |
50 | _term = YP.makeCopy(Term, new Variable.CopyStore()); | 50 | _term = YP.makeCopy(Term, new Variable.CopyStore()); |
51 | } | 51 | } |
52 | 52 | ||
53 | /// <summary> | 53 | /// <summary> |
54 | /// Create a PrologException where the Term is error(ErrorTerm, Message). | 54 | /// Create a PrologException where the Term is error(ErrorTerm, Message). |
55 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. | 55 | /// This uses YP.makeCopy to copy the ErrorTerm and Message so that they are valid after unbinding. |
56 | /// </summary> | 56 | /// </summary> |
57 | /// <param name="ErrorTerm">the term of the exception</param> | 57 | /// <param name="ErrorTerm">the term of the exception</param> |
58 | /// <param name="Messsage">the message, converted to a string, to use as the printable exception message | 58 | /// <param name="Messsage">the message, converted to a string, to use as the printable exception message |
59 | /// </param> | 59 | /// </param> |
60 | public PrologException(object ErrorTerm, object Message) | 60 | public PrologException(object ErrorTerm, object Message) |
61 | : base(YP.getValue(Message).ToString()) | 61 | : base(YP.getValue(Message).ToString()) |
62 | { | 62 | { |
63 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); | 63 | _term = YP.makeCopy(new Functor2(Atom.a("error"), ErrorTerm, Message), new Variable.CopyStore()); |
64 | } | 64 | } |
65 | 65 | ||
66 | public object Term | 66 | public object Term |
67 | { | 67 | { |
68 | get { return _term; } | 68 | get { return _term; } |
69 | } | 69 | } |
70 | } | 70 | } |
71 | } | 71 | } |