protected CompilerException(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     ErrorMessage      = info.GetString(nameof(ErrorMessage));
     Filename          = info.GetString(nameof(Filename));
     CharacterPosition = (CharacterPosition)info.GetValue(nameof(CharacterPosition), typeof(CharacterPosition));
 }
 public bool Equals(CharacterPosition other) => Character == other.Character && Line == other.Line;
 public CompilerException(string errorMessage, string filename, CharacterPosition characterPosition, Exception innerException) : base($"{filename}:{characterPosition.Line}:{characterPosition.Character} : {errorMessage}", innerException)
 {
     ErrorMessage      = errorMessage;
     Filename          = filename;
     CharacterPosition = characterPosition;
 }
 public TParser CreateSubParser(string substring, CharacterPosition startingPosition)
 {
     var reader = new StringReader(substring);
     return (TParser)Activator.CreateInstance(typeof(TParser), Filename, reader, startingPosition);
 }