// Path: src/main/java/org/idpf/epubcheck/util/css/CssScanner.java
// static final CharMatcher HEXCHAR = CharMatcher.anyOf(
//     "AaBbCcDdEeFf0123456789").precomputed();
// 
// Path: src/main/java/org/idpf/epubcheck/util/css/CssScanner.java
// static final CharMatcher WHITESPACE = CharMatcher.anyOf(" \t\n\r\f")
//     .precomputed();
// 
// Path: src/main/java/org/idpf/epubcheck/util/css/CssScanner.java
// static int isNewLine(int[] chars)
// {
//   checkArgument(chars.length > 1);
//   // nl \n|\r\n|\r|\f
//   if (chars[0] == '\r' && chars[1] == '\n')
//   {
//     return 2;
//   }
//   else if (chars[0] == '\n' || chars[0] == '\r' || chars[0] == '\f')
//   {
//     return 1;
//   }
//   return 0;
// }
// 
// Path: src/main/java/org/idpf/epubcheck/util/css/CssExceptions.java
// public static abstract class CssException extends Exception
// {
//   final CssErrorCode errorCode;
//   final CssLocation location;
//   final Optional<CssToken> token;
// 
//   CssException(final CssToken token, final CssErrorCode errorCode, final CssLocation location,
//       final Locale locale, final Object... arguments)
//   {
//     super(Messages.getInstance(locale, CssExceptions.class).get(errorCode.value, arguments));
//     this.errorCode = checkNotNull(errorCode);
//     this.location = checkNotNull(location);
//     this.token = token == null ? absent : Optional.of(token);
//   }
// 
//   CssException(final CssErrorCode errorCode, final CssLocation location, final Locale locale,
//       final Object... arguments)
//   {
//     this(null, errorCode, location, locale, arguments);
//   }
// 
//   public CssErrorCode getErrorCode()
//   {
//     return errorCode;
//   }
// 
//   public CssLocation getLocation()
//   {
//     return location;
//   }
// 
//   @Override
//   public String toString()
//   {
//     return MoreObjects.toStringHelper(this.getClass()).add("errorCode", errorCode)
//         .add("location", location.toString()).toString();
//   }
// 
//   @Override
//   public boolean equals(Object obj)
//   {
//     if (obj instanceof CssException)
//     {
//       CssException exc = (CssException) obj;
//       if (exc.errorCode.equals(this.errorCode) && exc.location.equals(this.location))
//       {
//         return true;
//       }
//     }
//     return false;
//   }
// 
//   private static final long serialVersionUID = -4635263495562931206L;
// }


import org.idpf.epubcheck.util.css.CssToken.TokenBuilder;
import com.google.common.base.CharMatcher;
import com.google.common.base.MoreObjects;
import com.google.common.base.Optional;
import static com.google.common.base.Preconditions.checkArgument;
import static org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode.SCANNER_PREMATURE_EOF;
import static org.idpf.epubcheck.util.css.CssScanner.HEXCHAR;
import static org.idpf.epubcheck.util.css.CssScanner.WHITESPACE;
import static org.idpf.epubcheck.util.css.CssScanner.isNewLine;
import java.io.IOException;
import org.idpf.epubcheck.util.css.CssExceptions.CssException;
        boolean isSpace = WHITESPACE.matches(ch);
        if (!isHexChar && !isSpace)
        {
          break;
        }

        if (HEXCHAR.matches(ch) && !seenSpace && sb.length() < 6)
        {
          sb.append((char) cur);
        }

        if (isSpace)
        {
          if (!seenSpace)
          {
            sb.append((char) cur);
            if (cur == '\r')
            {
              seenSpace = true;
            }
            else
            {
              break;
            }
          }
          else
          {
            //we have a prev space which is \r
            if (cur == '\f')
            {
// Path: src/main/java/org/idpf/epubcheck/util/css/CssScanner.java
// static final CharMatcher HEXCHAR = CharMatcher.anyOf(
//     "AaBbCcDdEeFf0123456789").precomputed();
// 
// Path: src/main/java/org/idpf/epubcheck/util/css/CssScanner.java
// static final CharMatcher WHITESPACE = CharMatcher.anyOf(" \t\n\r\f")
//     .precomputed();
// 
// Path: src/main/java/org/idpf/epubcheck/util/css/CssScanner.java
// static int isNewLine(int[] chars)
// {
//   checkArgument(chars.length > 1);
//   // nl \n|\r\n|\r|\f
//   if (chars[0] == '\r' && chars[1] == '\n')
//   {
//     return 2;
//   }
//   else if (chars[0] == '\n' || chars[0] == '\r' || chars[0] == '\f')
//   {
//     return 1;
//   }
//   return 0;
// }
// 
// Path: src/main/java/org/idpf/epubcheck/util/css/CssExceptions.java
// public static abstract class CssException extends Exception
// {
//   final CssErrorCode errorCode;
//   final CssLocation location;
//   final Optional<CssToken> token;
// 
//   CssException(final CssToken token, final CssErrorCode errorCode, final CssLocation location,
//       final Locale locale, final Object... arguments)
//   {
//     super(Messages.getInstance(locale, CssExceptions.class).get(errorCode.value, arguments));
//     this.errorCode = checkNotNull(errorCode);
//     this.location = checkNotNull(location);
//     this.token = token == null ? absent : Optional.of(token);
//   }
// 
//   CssException(final CssErrorCode errorCode, final CssLocation location, final Locale locale,
//       final Object... arguments)
//   {
//     this(null, errorCode, location, locale, arguments);
//   }
// 
//   public CssErrorCode getErrorCode()
//   {
//     return errorCode;
//   }
// 
//   public CssLocation getLocation()
//   {
//     return location;
//   }
// 
//   @Override
//   public String toString()
//   {
//     return MoreObjects.toStringHelper(this.getClass()).add("errorCode", errorCode)
//         .add("location", location.toString()).toString();
//   }
// 
//   @Override
//   public boolean equals(Object obj)
//   {
//     if (obj instanceof CssException)
//     {
//       CssException exc = (CssException) obj;
//       if (exc.errorCode.equals(this.errorCode) && exc.location.equals(this.location))
//       {
//         return true;
//       }
//     }
//     return false;
//   }
// 
//   private static final long serialVersionUID = -4635263495562931206L;
// }


// Path: src/main/java/org/idpf/epubcheck/util/css/CssEscape.java
import org.idpf.epubcheck.util.css.CssToken.TokenBuilder;
import com.google.common.base.CharMatcher;
import com.google.common.base.MoreObjects;
import com.google.common.base.Optional;
import static com.google.common.base.Preconditions.checkArgument;
import static org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode.SCANNER_PREMATURE_EOF;
import static org.idpf.epubcheck.util.css.CssScanner.HEXCHAR;
import static org.idpf.epubcheck.util.css.CssScanner.WHITESPACE;
import static org.idpf.epubcheck.util.css.CssScanner.isNewLine;
import java.io.IOException;
import org.idpf.epubcheck.util.css.CssExceptions.CssException;

        boolean isSpace = WHITESPACE.matches(ch);
        if (!isHexChar && !isSpace)
        {
          break;
        }

        if (HEXCHAR.matches(ch) && !seenSpace && sb.length() < 6)
        {
          sb.append((char) cur);
        }

        if (isSpace)
        {
          if (!seenSpace)
          {
            sb.append((char) cur);
            if (cur == '\r')
            {
              seenSpace = true;
            }
            else
            {
              break;
            }
          }
          else
          {
            //we have a prev space which is \r
            if (cur == '\f')
            {
              sb.append((char) cur);