make/tools/GenerateCharacter/CharacterDataLatin1.java.template

Print this page




  55                    4 is Java whitespace
  56         2 bits  0  this character has no numeric property
  57                 1  adding the digit offset to the character code and then
  58                    masking with 0x1F will produce the desired numeric value
  59                 2  this character has a "strange" numeric value
  60                 3  a Java supradecimal digit: adding the digit offset to the
  61                    character code, then masking with 0x1F, then adding 10
  62                    will produce the desired numeric value
  63         5 bits  digit offset
  64         5 bits  character type
  65 
  66         The encoding of character properties is subject to change at any time.
  67      */
  68 
  69     int getProperties(int ch) {
  70                 char offset = (char)ch;
  71         int props = $$Lookup(offset);
  72         return props;
  73     }
  74 


























  75     int getType(int ch) {
  76         int props = getProperties(ch);
  77         return (props & $$maskType);
  78     }
  79 
  80     boolean isJavaIdentifierStart(int ch) {
  81         int props = getProperties(ch);
  82         return ((props & $$maskIdentifierInfo) >= $$lowJavaStart);
  83     }
  84 
  85     boolean isJavaIdentifierPart(int ch) {
  86         int props = getProperties(ch);
  87         return ((props & $$nonzeroJavaPart) != 0);
  88     }
  89 
  90     boolean isUnicodeIdentifierStart(int ch) {
  91         int props = getProperties(ch);
  92         return ((props & $$maskIdentifierInfo) == $$valueUnicodeStart);
  93     }
  94 




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