Mercury library  1.0
Translation of CFG grammars into an object model (Bachelor's thesis).
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
SyntaxExceptions.cs
Go to the documentation of this file.
1 using Mercury.Syntax;
2 using System;
3 using System.Runtime.Serialization;
4 
5 namespace Mercury.Exceptions
6 {
7 
8 //==<< SyntaxException >>====================================================
9 
13  [Serializable]
15  {
16 
20  public SyntaxException()
21  { }
22 
28  public SyntaxException(string message)
29  : base(message)
30  { }
31 
37  public SyntaxException(string message, Exception inner)
38  : base(message, inner)
39  { }
40 
51  protected SyntaxException(SerializationInfo info, StreamingContext context)
52  : base(info, context)
53  { }
54  }
55 
56 //==<< InvalidSymbolException >>=============================================
57 
62  [Serializable]
64  {
65 
71  : base("Invalid symbol '" + symbol.ToString() + "'")
72  { }
73 
74  }
75 
76 //==<< InvalidRuleException >>===============================================
77 
82  [Serializable]
84  {
85 
91  public InvalidRuleException(Rule rule, string reason = null)
92  : base("Invalid rule '" + rule.ToString() + "'"
93  + (reason != null ? ": " + reason : ""))
94  { }
95 
96  }
97 
98 //==<< InvalidEdgeExcetion >>================================================
99 
104  [Serializable]
106  {
107 
113  : base("Invalid edge '" + edge.ToString() + "'")
114  { }
115 
116  }
117 
118 }
InvalidRuleException(Rule rule, string reason=null)
Initializes a new instance of the InvalidRuleException class.
InvalidEdgeException(Edge edge)
Initializes a new instance of the InvalidEdgeException class.
SyntaxException(string message)
Initializes a new instance of the SyntaxException class with a message that describes the error...
InvalidSymbolException(Symbol symbol)
Initializes a new instance of the InvalidSymbolException class.
Represents an edge in the chart created by the ChartParser. This is an immutable class. The Edge contains four values:
Definition: Edge.cs:37
SyntaxException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the SyntaxException class.
An exception thrown by the Mercury library.
An exception has been thrown
An exception thrown when attempting to create an invalid Mercury.Syntax.Rule instance.
An exception thrown when attempting to create an invalid Mercury.Syntax.Symbol instance.
An exception thrown when attempting to create an invalid Mercury.Parser.Edge instance.
Represents a Context-Free Grammar rule. This is an immutable class.
Definition: Rule.cs:23
SyntaxException(string message, Exception inner)
Initializes a new instance of the SyntaxException class.
SyntaxException()
Initializes a new instance of the SyntaxException class.
Represents a single symbol of the grammar. This is an immutable class. For a symbol name to be val...
Definition: Symbol.cs:51
An exception thrown when something wrong happens in the Mercury.Syntax