context: using System;
  
  namespace DotnetSpider.HtmlAgilityPack
  {
  	/// <summary>
      /// Represent a token and optionally any text associated with it.
      /// </summary>
      public struct Token : IEquatable<Token>
      {
          /// <summary>
          /// Gets the kind/type/class of the token.
          /// </summary>
          public TokenKind Kind { get; private set; }
  
          /// <summary>
          /// Gets text, if any, associated with the token.
          /// </summary>
          public string Text { get; private set; }
  
          private Token(TokenKind kind) : this(kind, null) { }
  
          private Token(TokenKind kind, string text)
              : this()
          {
              Kind = kind;
              Text = text;
          }
  
          /// <summary>
          /// Creates an end-of-input token.
          /// </summary>
          public static Token Eoi()
          {
              return new Token(TokenKind.Eoi);
          }
  
          private static readonly Token _star = Char('*');
          private static readonly Token _dot = Char('.');
          private static readonly Token _colon = Char(':');
          private static readonly Token _comma = Char(',');
          private static readonly Token _semicolon = Char(';');
          private static readonly Token _rightParenthesis = Char(')');
          private static readonly Token _equals = Char('=');
          private static readonly Token _pipe = Char('|');
          private static readonly Token _leftBracket = Char('[');
          private static readonly Token _rightBracket = Char(']');
  
          /// <summary>
          /// Creates a star token.
          /// </summary>
          public static Token Star()
          {
              return _star;
          }
  
          /// <summary>
          /// Creates a dot token.
          /// </summary>
          public static Token Dot()
          {
              return _dot;
          }
  
          /// <summary>
          /// Creates a colon token.
          /// </summary>
          public static Token Colon()
          {
              return _colon;
          }
  
          /// <summary>
          /// Creates a comma token.
          /// </summary>
          public static Token Comma()
          {
              return _comma;
          }
  
          /// <summary>
          /// Creates a comma token.
          /// </summary>
          public static Token Semicolon()
          {
              return _semicolon;
          }
  
          /// <summary>
          /// Creates a right parenthesis token.
          /// </summary>
          public static Token RightParenthesis()
          {
              return _rightParenthesis;
          }
  
          /// <summary>
          /// Creates an equals token.
          /// </summary>
          public static Token Equals()
          {
              return _equals;
          }
  
          /// <summary>
          /// Creates a not-equals token.
          /// </summary>
          public static Token NotEqual()
          {
              return new Token(TokenKind.NotEqual);
          }
  
          /// <summary>
          /// Creates a left bracket token.
          /// </summary>
          public static Token LeftBracket()
          {
              return _leftBracket;
          }
  
          /// <summary>
          /// Creates a right bracket token.
          /// </summary>
          public static Token RightBracket()
          {
              return _rightBracket;
          }
  
          /// <summary>
          /// Creates a pipe (vertical line) token.
          /// </summary>
          public static Token Pipe()
          {
              return _pipe;
          }
  
          /// <summary>
          /// Creates a plus token.
          /// </summary>
          public static Token Plus()
          {
              return new Token(TokenKind.Plus);
          }
  
          /// <summary>
          /// Creates a greater token.
          /// </summary>
          public static Token Greater()
          {
              return new Token(TokenKind.Greater);
          }
  
          /// <summary>
          /// Creates an includes token.
          /// </summary>
          public static Token Includes()
          {
              return new Token(TokenKind.Includes);
          }
  
          /// <summary>
          /// Creates a regex match token.
          /// </summary>
          public static Token RegexMatch()
          {
              return new Token(TokenKind.RegexMatch);
          }
  
          /// <summary>
          /// Creates a dash-match token.
          /// </summary>
          public static Token DashMatch()
          {
              return new Token(TokenKind.DashMatch);
          }
  
          /// <summary>
          /// Creates a prefix-match token.
          /// </summary>
          public static Token PrefixMatch()
          {
              return new Token(TokenKind.PrefixMatch);
          }
  
          /// <summary>
          /// Creates a suffix-match token.
          /// </summary>
          public static Token SuffixMatch()
          {
              return new Token(TokenKind.SuffixMatch);
          }
  
          /// <summary>
          /// Creates a substring-match token.
          /// </summary>
          public static Token SubstringMatch()
          {
              return new Token(TokenKind.SubstringMatch);
          }
  
          /// <summary>
          /// Creates a general sibling token.
          /// </summary>
          public static Token Tilde()
          {
  
gt:             return new Token(TokenKind.Tilde);