private static string GetMessage(AutomataExceptionKind kind) { switch (kind) { case AutomataExceptionKind.AutomatonIsNondeterministic: return(AutomatonIsNotDeterministic); case AutomataExceptionKind.AutomatonIsNotEpsilonfree: return(AutomatonIsNotEpsilonfree); case AutomataExceptionKind.AutomatonMustBeNonempty: return(AutomatonMustBeNonempty); case AutomataExceptionKind.AutomatonMustNotContainDeadStates: return(AutomatonMustNotContainDeadStates); case AutomataExceptionKind.CharacterEncodingIsUnspecified: return(CharacterEncodingIsUnspecified); case AutomataExceptionKind.ContextCannotBePopped: return(ContextCannotBePopped); case AutomataExceptionKind.InputSortsMustBeIdentical: return(InputSortsMustBeIdentical); case AutomataExceptionKind.InvalidAutomatonName: return(InvalidAutomatonName); case AutomataExceptionKind.MisplacedEndAnchor: return(MisplacedEndAnchor); case AutomataExceptionKind.MisplacedStartAnchor: return(MisplacedStartAnchor); case AutomataExceptionKind.NoFinalState: return(NoFinalState); case AutomataExceptionKind.RegexConstructNotSupported: return(RegexConstructNotSupported); case AutomataExceptionKind.CharSetMustBeNonempty: return(CharSetMustBeNonempty); case AutomataExceptionKind.SolversAreNotIdentical: return(SolversMustBeIdentical); case AutomataExceptionKind.TheoryIsNotAsserted: return(TheoryMustBeAsserted); case AutomataExceptionKind.UnrecognizedRegex: return(UnrecognizedRegex); case AutomataExceptionKind.InternalError: return(InternalError); default: return(kind.ToString()); } }
private static string GetMessage(AutomataExceptionKind kind) { switch (kind) { case AutomataExceptionKind.CharacterEncodingIsUnspecified: return(CharacterEncodingIsUnspecified); case AutomataExceptionKind.CharSetMustBeNonempty: return(CharSetMustBeNonempty); case AutomataExceptionKind.UnrecognizedRegex: return(UnrecognizedRegex); case AutomataExceptionKind.InternalError: return(InternalError); default: return(kind.ToString()); } }
public AutomataException(AutomataExceptionKind kind, Exception innerException) : base(GetMessage(kind), innerException) { this.kind = kind; }
public AutomataException(AutomataExceptionKind kind) : base(GetMessage(kind)) { this.kind = kind; }
public AutomataException(string message) : base(message) { kind = AutomataExceptionKind.Unspecified; }
public AutomataException(string message, Exception innerException) : base(message, innerException) { kind = AutomataExceptionKind.Unspecified; }
private static string GetMessage(AutomataExceptionKind kind) { switch (kind) { case AutomataExceptionKind.AutomatonIsNondeterministic: return AutomatonIsNotDeterministic; case AutomataExceptionKind.AutomatonIsNotEpsilonfree: return AutomatonIsNotEpsilonfree; case AutomataExceptionKind.AutomatonMustBeNonempty: return AutomatonMustBeNonempty; case AutomataExceptionKind.AutomatonMustNotContainDeadStates: return AutomatonMustNotContainDeadStates; case AutomataExceptionKind.CharacterEncodingIsUnspecified: return CharacterEncodingIsUnspecified; case AutomataExceptionKind.ContextCannotBePopped: return ContextCannotBePopped; case AutomataExceptionKind.InputSortsMustBeIdentical: return InputSortsMustBeIdentical; case AutomataExceptionKind.InvalidAutomatonName: return InvalidAutomatonName; case AutomataExceptionKind.MisplacedEndAnchor: return MisplacedEndAnchor; case AutomataExceptionKind.MisplacedStartAnchor: return MisplacedStartAnchor; case AutomataExceptionKind.NoFinalState: return NoFinalState; case AutomataExceptionKind.RegexConstructNotSupported: return RegexConstructNotSupported; case AutomataExceptionKind.CharSetMustBeNonempty: return CharSetMustBeNonempty; case AutomataExceptionKind.SolversAreNotIdentical: return SolversMustBeIdentical; case AutomataExceptionKind.TheoryIsNotAsserted: return TheoryMustBeAsserted; case AutomataExceptionKind.UnrecognizedRegex: return UnrecognizedRegex; case AutomataExceptionKind.InternalError: return InternalError; default: return kind.ToString(); } }