1 18 19 package org.apache.batik.css.parser; 20 21 27 public class ScannerUtilities { 28 29 32 protected final static int[] IDENTIFIER_START = { 0, 0, 134217726, 134217726 }; 33 34 37 protected final static int[] NAME = { 0, 67051520, 134217726, 134217726 }; 38 39 42 protected final static int[] HEXADECIMAL = { 0, 67043328, 126, 126 }; 43 44 47 protected final static int[] STRING = { 512, -133, -1, 2147483647 }; 48 49 52 protected final static int[] URI = { 0, -902, -1, 2147483647 }; 53 54 57 protected ScannerUtilities() { 58 } 59 60 63 public static boolean isCSSSpace(char c) { 64 return (c <= 0x0020) && 65 (((((1L << '\t') | 66 (1L << '\n') | 67 (1L << '\r') | 68 (1L << '\f') | 69 (1L << 0x0020)) >> c) & 1L) != 0); 70 } 71 72 75 public static boolean isCSSIdentifierStartCharacter(char c) { 76 return c >= 128 || ((IDENTIFIER_START[c / 32] & (1 << (c % 32))) != 0); 77 } 78 79 82 public static boolean isCSSNameCharacter(char c) { 83 return c >= 128 || ((NAME[c / 32] & (1 << (c % 32))) != 0); 84 } 85 86 89 public static boolean isCSSHexadecimalCharacter(char c) { 90 return c < 128 && ((HEXADECIMAL[c / 32] & (1 << (c % 32))) != 0); 91 } 92 93 96 public static boolean isCSSStringCharacter(char c) { 97 return c >= 128 || ((STRING[c / 32] & (1 << (c % 32))) != 0); 98 } 99 100 103 public static boolean isCSSURICharacter(char c) { 104 return c >= 128 || ((URI[c / 32] & (1 << (c % 32))) != 0); 105 } 106 } 107 | Popular Tags |