public static SymbolVariant symbolVariant(CharSequence symbol){
  int length=symbol.length();
  if (length == 0) {
    throw new EmptySymbolException();
  }
  if (isIdentifierKeyword(symbol)) {
    return SymbolVariant.QUOTED;
  }
  char c=symbol.charAt(0);
  if (isIdentifierStart(c)) {
    for (int ii=0; ii < length; ii++) {
      c=symbol.charAt(ii);
      if ((c == '\'' || c < 32 || c > 126) || !isIdentifierPart(c)) {
        return SymbolVariant.QUOTED;
      }
    }
    return SymbolVariant.IDENTIFIER;
  }
  if (isOperatorPart(c)) {
    for (int ii=0; ii < length; ii++) {
      c=symbol.charAt(ii);
      if (!isOperatorPart(c)) {
        return SymbolVariant.QUOTED;
      }
    }
    return SymbolVariant.OPERATOR;
  }
  return SymbolVariant.QUOTED;
}

public static SymbolVariant symbolVariant ( CharSequence symbol ) { int length = symbol . length ( ) ; if ( length == 0 ) { throw new EmptySymbolException ( ) ; } if ( isIdentifierKeyword ( symbol ) ) { return SymbolVariant . QUOTED ; } char c = symbol . charAt ( 0 ) ; if ( isIdentifierStart ( c ) ) { for ( int ii = 0 ; ii < length ; ii ++ ) { c = symbol . charAt ( ii ) ; if ( ( c == '\'' || c < 32 || c > 126 ) || ! isIdentifierPart ( c ) ) { return SymbolVariant . QUOTED ; } } return SymbolVariant . IDENTIFIER ; } if ( isOperatorPart ( c ) ) { for ( int ii = 0 ; ii < length ; ii ++ ) { c = symbol . charAt ( ii ) ; if ( ! isOperatorPart ( c ) ) { return SymbolVariant . QUOTED ; } } return SymbolVariant . OPERATOR ; } return SymbolVariant . QUOTED ; }
determines whether the text of a symbol represents an identifier , an operator , or a symbol that always requires ( single ) quotes .
