56 4 is Java whitespace 57 2 bits 0 this character has no numeric property 58 1 adding the digit offset to the character code and then 59 masking with 0x1F will produce the desired numeric value 60 2 this character has a "strange" numeric value 61 3 a Java supradecimal digit: adding the digit offset to the 62 character code, then masking with 0x1F, then adding 10 63 will produce the desired numeric value 64 5 bits digit offset 65 5 bits character type 66 67 The encoding of character properties is subject to change at any time. 68 */ 69 70 int getProperties(int ch) { 71 char offset = (char)ch; 72 int props = $$Lookup(offset); 73 return props; 74 } 75 76 int getType(int ch) { 77 int props = getProperties(ch); 78 return (props & $$maskType); 79 } 80 81 boolean isJavaIdentifierStart(int ch) { 82 int props = getProperties(ch); 83 return ((props & $$maskIdentifierInfo) >= $$lowJavaStart); 84 } 85 86 boolean isJavaIdentifierPart(int ch) { 87 int props = getProperties(ch); 88 return ((props & $$nonzeroJavaPart) != 0); 89 } 90 91 boolean isUnicodeIdentifierStart(int ch) { 92 int props = getProperties(ch); 93 return ((props & $$maskIdentifierInfo) == $$valueUnicodeStart); 94 } 95 96 boolean isUnicodeIdentifierPart(int ch) { 97 int props = getProperties(ch); 98 return ((props & $$maskUnicodePart) != 0); 99 } 100 | 56 4 is Java whitespace 57 2 bits 0 this character has no numeric property 58 1 adding the digit offset to the character code and then 59 masking with 0x1F will produce the desired numeric value 60 2 this character has a "strange" numeric value 61 3 a Java supradecimal digit: adding the digit offset to the 62 character code, then masking with 0x1F, then adding 10 63 will produce the desired numeric value 64 5 bits digit offset 65 5 bits character type 66 67 The encoding of character properties is subject to change at any time. 68 */ 69 70 int getProperties(int ch) { 71 char offset = (char)ch; 72 int props = $$Lookup(offset); 73 return props; 74 } 75 76 int getPropertiesEx(int ch) { 77 char offset = (char)ch; 78 int props = $$LookupEx(offset); 79 return props; 80 } 81 82 int getType(int ch) { 83 int props = getProperties(ch); 84 return (props & $$maskType); 85 } 86 87 boolean isOtherLowercase(int ch) { 88 int props = getPropertiesEx(ch); 89 return (props & $$maskOtherLowercase) != 0; 90 } 91 92 boolean isOtherUppercase(int ch) { 93 int props = getPropertiesEx(ch); 94 return (props & $$maskOtherUppercase) != 0; 95 } 96 97 boolean isOtherAlphabetic(int ch) { 98 int props = getPropertiesEx(ch); 99 return (props & $$maskOtherAlphabetic) != 0; 100 } 101 102 boolean isIdeographic(int ch) { 103 int props = getPropertiesEx(ch); 104 return (props & $$maskIdeographic) != 0; 105 } 106 107 boolean isJavaIdentifierStart(int ch) { 108 int props = getProperties(ch); 109 return ((props & $$maskIdentifierInfo) >= $$lowJavaStart); 110 } 111 112 boolean isJavaIdentifierPart(int ch) { 113 int props = getProperties(ch); 114 return ((props & $$nonzeroJavaPart) != 0); 115 } 116 117 boolean isUnicodeIdentifierStart(int ch) { 118 int props = getProperties(ch); 119 return ((props & $$maskIdentifierInfo) == $$valueUnicodeStart); 120 } 121 122 boolean isUnicodeIdentifierPart(int ch) { 123 int props = getProperties(ch); 124 return ((props & $$maskUnicodePart) != 0); 125 } 126 |