Mercury library 1.0 Translation of CFG grammars into an object model (Bachelor's thesis).

- Main Page
- Packages
- Classes
- Files

- File List

All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
InterpretingExceptions.cs
Go to the documentation of this file.
1 using Mercury.Interpreting;
2 using System;
3 using System.Runtime.Serialization;
4
5 namespace Mercury.Exceptions
6 {
7 //==<< InterpretingException >>==============================================
8
10 [Serializable]
11 public class InterpretingException : MercuryException
12 {
13
17 public InterpretingException()
18 { }
19
25 public InterpretingException(string message)
26 : base(message)
27 { }
28
35 public InterpretingException(string message, Exception inner)
36 : base(message, inner)
37 { }
38
51 protected InterpretingException(SerializationInfo info, StreamingContext context)
52 : base(info, context)
53 { }
54
55 }
56
57 //==<< InvalidActionCallException >>=========================================
58
63 [Serializable]
64 public class InvalidActionCallException : InterpretingException
65 {
66
73 public InvalidActionCallException(string call, string reason, params object[] args)
74 : base("Invalid action call '" + call + "'"
75 + ": " + string.Format(reason, args) + "")
76 { }
77
78 }
79
80 //==<< InvalidElementException >>============================================
81
86 [Serializable]
87 public class InvalidElementException : InterpretingException
88 {
89
95 public InvalidElementException(IElement element, string reason = null)
96 : base("Invalid element '" + element.ToString() + "'"
97 + (reason != null ? ": " + reason : ""))
98 { }
99
100 }
101
102 //==<< InvalidActionException >>=============================================
103
108 [Serializable]
109 public class InvalidActionException : InterpretingException
110 {
111
118 public InvalidActionException(string action, string reason, params object[] args)
119 : base("Invalid action '" + action + "'"
120 + (reason != null ? ": " + reason : ""))
121 { }
122
123 }
124
125 //==<< InvalidActionArgumentException >>=============================================
126
131 [Serializable]
132 public class InvalidActionArgumentException : InterpretingException
133 {
134
143 public InvalidActionArgumentException(string rule, string call,
144 int argpos, string reason, params object[] args)
145 : base("Rule " + rule + ": invalid argument " + argpos.ToString()
146 + " of '" + call + "'" + (reason != null ? ": " + string.Format(reason, args) : ""))
147 { }
148
149 }
150
151 //==<< InvalidRewriteRuleException >>=============================================
152
157 [Serializable]
158 public class InvalidRewriteRuleException : InterpretingException
159 {
160
167 public InvalidRewriteRuleException(string rule, string reason, params object[] args)
168 : base("Invalid rewrite rule '" + rule + "'"
169 + (reason != null ? ": " + string.Format(reason, args) : ""))
170 { }
171
172 }
173
174 //==<< ErrorActionException >>===============================================
175
177 [Serializable]
178 public class ErrorActionException : InterpretingException
179 {
180
183 public ErrorActionException(string message)
184 : base(message)
185 { }
186
190 public ErrorActionException(string message, params object[] args)
191 : base(string.Format(message, args))
192 { }
193
194 }
195
196 }
Mercury.Exceptions.InterpretingException.InterpretingException
InterpretingException(string message)
Initializes a new instance of the InterpretingException class with a specified message.
Definition: InterpretingExceptions.cs:25
Mercury.Exceptions.ErrorActionException.ErrorActionException
ErrorActionException(string message, params object[] args)
Initializes a new instance of the ErrorActionException class.
Definition: InterpretingExceptions.cs:190
Mercury.Exceptions.InterpretingException
An exception thrown because of problems in the Interpreting namespace.
Definition: InterpretingExceptions.cs:11
Mercury.Exceptions.InvalidActionCallException.InvalidActionCallException
InvalidActionCallException(string call, string reason, params object[] args)
Initializes a new instance of the InvalidActionCallException class.
Definition: InterpretingExceptions.cs:73
Mercury.Exceptions.ErrorActionException.ErrorActionException
ErrorActionException(string message)
Initializes a new instance of the ErrorActionException class.
Definition: InterpretingExceptions.cs:183
Mercury.Exceptions.ErrorActionException
Exception thrown by basic actions when a problem was encountered.
Definition: InterpretingExceptions.cs:178
Mercury.Exceptions.InterpretingException.InterpretingException
InterpretingException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the InterpretingException class with serialization data.
Definition: InterpretingExceptions.cs:51
Mercury.Exceptions.InvalidActionException
An exception representing a problem with Mercury.Interpreting.InterpreterAction{T} class...
Definition: InterpretingExceptions.cs:109
Mercury.Exceptions.InvalidRewriteRuleException
An exception representing a problem with Mercury.Interpreting.RewriteRule{T}.
Definition: InterpretingExceptions.cs:158
Mercury.Exceptions.InvalidActionCallException
An exception representing a problem with Mercury.Interpreting.ActionCall{T}
Definition: InterpretingExceptions.cs:64
Mercury.Exceptions.InvalidActionArgumentException
An exception representing a problem while type checking the Mercury.Interpreting.RewriteRule{T}.
Definition: InterpretingExceptions.cs:132
Mercury.Exceptions.InterpretingException.InterpretingException
InterpretingException()
Initializes a new instance of the InterpretingException class.
Definition: InterpretingExceptions.cs:17
Mercury.Exceptions.MercuryException
An exception thrown by the Mercury library.
Definition: MercuryException.cs:10
Mercury.Exception
An exception has been thrown
Mercury.Exceptions.InvalidActionArgumentException.InvalidActionArgumentException
InvalidActionArgumentException(string rule, string call, int argpos, string reason, params object[] args)
Initializes a new instance of the InvalidActionArgumentException class.
Definition: InterpretingExceptions.cs:143
Mercury.Exceptions.InterpretingException.InterpretingException
InterpretingException(string message, Exception inner)
Initializes a new instance of the InterpretingException class wit a specified message and an exceptio...
Definition: InterpretingExceptions.cs:35
Mercury.Exceptions.InvalidRewriteRuleException.InvalidRewriteRuleException
InvalidRewriteRuleException(string rule, string reason, params object[] args)
Initializes a new instance of the InvalidRewriteRuleException class.
Definition: InterpretingExceptions.cs:167
Mercury.Interpreting.IElement
Element interface
Definition: Element.cs:32
Mercury.Exceptions.InvalidElementException
An exception representing a problem with Mercury.Interpreting.IElement descendants.
Definition: InterpretingExceptions.cs:87
Mercury.Exceptions.InvalidActionException.InvalidActionException
InvalidActionException(string action, string reason, params object[] args)
Initializes a new instance of the InvalidActionException class.
Definition: InterpretingExceptions.cs:118
Mercury.Exceptions.InvalidElementException.InvalidElementException
InvalidElementException(IElement element, string reason=null)
Initializes a new instance of the InvalidElementException class.
Definition: InterpretingExceptions.cs:95