示例#1
0
        /// <summary>
        /// A method to check whether two tokens are equal.
        /// </summary>
        /// <param name="obj"></param>
        public virtual bool Equals(Token other)
        {
            if (other == null) return false;
            if (ReferenceEquals(this, other)) return true;

            if (!Spelling.Equals(other.Spelling))
                return false;

            if (Kind != other.Kind)
                return false;

            return true;
        }
 /// <summary>
 /// A constructor for the MalformedTokenException.
 /// </summary>
 /// <param name="received">The token encountered causing the exception.</param>
 /// <param name="message">A message describing the exception</param>
 /// <param name="innerException">An inner exception associated with this exception.</param>
 public MalformedTokenException(Token received, string message, Exception innerException)
     : base(message, innerException)
 {
     Received = received;
 }
 /// <summary>
 /// A constructor for the MalformedTokenException.
 /// </summary>
 /// <param name="received">The token encountered causing the exception.</param>
 /// <param name="message">A message describing the exception</param>
 public MalformedTokenException(Token received, string message)
     : base(message)
 {
     Received = received;
 }
 /// <summary>
 /// A constructor for the illegal token exception.
 /// </summary>
 /// <param name="received">The token encountered causing the exception.</param>
 public MalformedTokenException(Token received)
     : base()
 {
     Received = received;
 }