static boolean isType(int ch, int type) { return (getType(ch) & type) != 0; }
static int toUpper(int ch) { return isLower(ch) ? (ch - 0x20) : ch; }
/** * Parses and returns the name of a "named capturing group", the trailing * ">" is consumed after parsing. */ private String groupname(int ch) { StringBuilder sb = new StringBuilder(); sb.append(Character.toChars(ch)); while (ASCII.isLower(ch=read()) || ASCII.isUpper(ch) || ASCII.isDigit(ch)) { sb.append(Character.toChars(ch)); } if (sb.length() == 0) throw error("named capturing group has 0 length name"); if (ch != '>') throw error("named capturing group is missing trailing '>'"); return sb.toString(); }
boolean isSatisfiedBy(int ch) { return ch < 128 && ASCII.isType(ch, ctype); } }
private int uxxxx() { int n = 0; for (int i = 0; i < 4; i++) { int ch = read(); if (!ASCII.isHexDigit(ch)) { throw error("Illegal Unicode escape sequence"); } n = n * 16 + ASCII.toDigit(ch); } return n; }
static int toLower(int ch) { return isUpper(ch) ? (ch + 0x20) : ch; }
/** * Parses and returns the name of a "named capturing group", the trailing * ">" is consumed after parsing. */ private String groupname(int ch) { StringBuilder sb = new StringBuilder(); sb.append(Character.toChars(ch)); while (ASCII.isLower(ch=read()) || ASCII.isUpper(ch) || ASCII.isDigit(ch)) { sb.append(Character.toChars(ch)); } if (sb.length() == 0) throw error("named capturing group has 0 length name"); if (ch != '>') throw error("named capturing group is missing trailing '>'"); return sb.toString(); }
static boolean isGraph(int ch) { return isType(ch, GRAPH); }
private int uxxxx() { int n = 0; for (int i = 0; i < 4; i++) { int ch = read(); if (!ASCII.isHexDigit(ch)) { throw error("Illegal Unicode escape sequence"); } n = n * 16 + ASCII.toDigit(ch); } return n; }
static int toLower(int ch) { return isUpper(ch) ? (ch + 0x20) : ch; }