public String readNextIdentifier() { int i = idx; while (!isEOS() && ParseUtils.isIdentifierChar(str.charAt(idx))) ++idx; return str.substring(i, idx); }
/** * Assuming that idx points to the beginning of a CQL identifier in toParse, returns the index of * the first character after this identifier. * * @param toParse the string to skip an identifier from. * @param idx the index to start parsing an identifier from. * @return the index ending the CQL identifier starting at {@code idx}. * @throws IllegalArgumentException if idx doesn't point to the start of a valid CQL identifier. */ public static int skipCQLId(String toParse, int idx) { if (idx >= toParse.length()) throw new IllegalArgumentException(); char c = toParse.charAt(idx); if (isIdentifierChar(c)) { while (idx < toParse.length() && isIdentifierChar(toParse.charAt(idx))) idx++; return idx; } if (c != '"') throw new IllegalArgumentException(); while (++idx < toParse.length()) { c = toParse.charAt(idx); if (c != '"') continue; if (idx + 1 < toParse.length() && toParse.charAt(idx + 1) == '\"') ++idx; // this is an escaped double quote, skip it else return idx + 1; } throw new IllegalArgumentException(); }
private String readNextIdentifier() { int startIdx = idx; if (str.charAt(startIdx) == '"') { // case-sensitive name included in double quotes ++idx; // read until closing quote. while (!isEOS()) { boolean atQuote = str.charAt(idx) == '"'; ++idx; if (atQuote) { // if the next character is also a quote, this is an escaped // quote, continue reading, otherwise stop. if (!isEOS() && str.charAt(idx) == '"') ++idx; else break; } } } else if (str.charAt(startIdx) == '\'') { // custom type name included in single quotes ++idx; // read until closing quote. while (!isEOS() && str.charAt(idx++) != '\'') { /* loop */ } } else { while (!isEOS() && (isIdentifierChar(str.charAt(idx)) || str.charAt(idx) == '"')) ++idx; } return str.substring(startIdx, idx); }
} else if (isBlank(c) || !isIdentifierChar(c)) { if (cbrackets == 0 && sbrackets == 0 && parens == 0) return idx;
public String readNextIdentifier() { int i = idx; while (!isEOS() && ParseUtils.isIdentifierChar(str.charAt(idx))) ++idx; return str.substring(i, idx); }
public String readNextIdentifier() { int i = idx; while (!isEOS() && ParseUtils.isIdentifierChar(str.charAt(idx))) ++idx; return str.substring(i, idx); }
public String readNextIdentifier() { int i = idx; while (!isEOS() && ParseUtils.isIdentifierChar(str.charAt(idx))) ++idx; return str.substring(i, idx); }
if (isIdentifierChar(c)) { while (idx < toParse.length() && isIdentifierChar(toParse.charAt(idx))) idx++; return idx;
if (isIdentifierChar(c)) { while (idx < toParse.length() && isIdentifierChar(toParse.charAt(idx))) idx++; return idx;
if (isIdentifierChar(c)) { while (idx < toParse.length() && isIdentifierChar(toParse.charAt(idx))) idx++; return idx;
private String readNextIdentifier() { int startIdx = idx; if (str.charAt(startIdx) == '"') { // case-sensitive name included in double quotes ++idx; // read until closing quote. while (!isEOS()) { boolean atQuote = str.charAt(idx) == '"'; ++idx; if (atQuote) { // if the next character is also a quote, this is an escaped // quote, continue reading, otherwise stop. if (!isEOS() && str.charAt(idx) == '"') ++idx; else break; } } } else if (str.charAt(startIdx) == '\'') { // custom type name included in single quotes ++idx; // read until closing quote. while (!isEOS() && str.charAt(idx++) != '\'') { /* loop */ } } else { while (!isEOS() && (isIdentifierChar(str.charAt(idx)) || str.charAt(idx) == '"')) ++idx; } return str.substring(startIdx, idx); }
private String readNextIdentifier() { int startIdx = idx; if (str.charAt(startIdx) == '"') { // case-sensitive name included in double quotes ++idx; // read until closing quote. while (!isEOS()) { boolean atQuote = str.charAt(idx) == '"'; ++idx; if (atQuote) { // if the next character is also a quote, this is an escaped // quote, continue reading, otherwise stop. if (!isEOS() && str.charAt(idx) == '"') ++idx; else break; } } } else if (str.charAt(startIdx) == '\'') { // custom type name included in single quotes ++idx; // read until closing quote. while (!isEOS() && str.charAt(idx++) != '\'') { /* loop */ } } else { while (!isEOS() && (isIdentifierChar(str.charAt(idx)) || str.charAt(idx) == '"')) ++idx; } return str.substring(startIdx, idx); }
private String readNextIdentifier() { int startIdx = idx; if (str.charAt(startIdx) == '"') { // case-sensitive name included in double quotes ++idx; // read until closing quote. while (!isEOS()) { boolean atQuote = str.charAt(idx) == '"'; ++idx; if (atQuote) { // if the next character is also a quote, this is an escaped // quote, continue reading, otherwise stop. if (!isEOS() && str.charAt(idx) == '"') ++idx; else break; } } } else if (str.charAt(startIdx) == '\'') { // custom type name included in single quotes ++idx; // read until closing quote. while (!isEOS() && str.charAt(idx++) != '\'') { /* loop */ } } else { while (!isEOS() && (isIdentifierChar(str.charAt(idx)) || str.charAt(idx) == '"')) ++idx; } return str.substring(startIdx, idx); }
if (cbrackets == 0 && sbrackets == 0 && parens == 0) return idx + 1; } else if (isBlank(c) || !isIdentifierChar(c)) { if (cbrackets == 0 && sbrackets == 0 && parens == 0) return idx;
if (cbrackets == 0 && sbrackets == 0 && parens == 0) return idx + 1; } else if (isBlank(c) || !isIdentifierChar(c)) { if (cbrackets == 0 && sbrackets == 0 && parens == 0) return idx;
if (cbrackets == 0 && sbrackets == 0 && parens == 0) return idx + 1; } else if (isBlank(c) || !isIdentifierChar(c)) { if (cbrackets == 0 && sbrackets == 0 && parens == 0) return idx;