Mercury library  1.0
Translation of CFG grammars into an object model (Bachelor's thesis).
 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]
12  {
13 
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]
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]
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]
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]
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]
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]
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 }
InterpretingException(string message)
Initializes a new instance of the InterpretingException class with a specified message.
ErrorActionException(string message, params object[] args)
Initializes a new instance of the ErrorActionException class.
An exception thrown because of problems in the Interpreting namespace.
InvalidActionCallException(string call, string reason, params object[] args)
Initializes a new instance of the InvalidActionCallException class.
ErrorActionException(string message)
Initializes a new instance of the ErrorActionException class.
Exception thrown by basic actions when a problem was encountered.
InterpretingException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the InterpretingException class with serialization data.
An exception representing a problem with Mercury.Interpreting.InterpreterAction{T} class...
An exception representing a problem with Mercury.Interpreting.RewriteRule{T}.
An exception representing a problem with Mercury.Interpreting.ActionCall{T}
An exception representing a problem while type checking the Mercury.Interpreting.RewriteRule{T}.
InterpretingException()
Initializes a new instance of the InterpretingException class.
An exception thrown by the Mercury library.
An exception has been thrown
InvalidActionArgumentException(string rule, string call, int argpos, string reason, params object[] args)
Initializes a new instance of the InvalidActionArgumentException class.
InterpretingException(string message, Exception inner)
Initializes a new instance of the InterpretingException class wit a specified message and an exceptio...
InvalidRewriteRuleException(string rule, string reason, params object[] args)
Initializes a new instance of the InvalidRewriteRuleException class.
Element interface
Definition: Element.cs:32
An exception representing a problem with Mercury.Interpreting.IElement descendants.
InvalidActionException(string action, string reason, params object[] args)
Initializes a new instance of the InvalidActionException class.
InvalidElementException(IElement element, string reason=null)
Initializes a new instance of the InvalidElementException class.