case '"':
case '\'':
this.exprIndex = this.expr.indexOf(c, this.exprIndex);
if (this.exprIndex < 0) {
this.exprIndex = this.currentTokenStartIndex + 1;
throw new PropertyException("missing quote");
}
this.currentTokenValue = this.expr.substring(
this.currentTokenStartIndex + 1, this.exprIndex++);
this.currentToken = PropertyTokenizer.TOK_LITERAL;
return;
case '*':
/*
* if (currentMaybeOperator) {
* recognizeOperator = false;
*/
this.currentToken = PropertyTokenizer.TOK_MULTIPLY;
/*
* }
* else
* throw new PropertyException("illegal operator *");
*/
return;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
scanDigits();
if (this.exprIndex < this.exprLength
&& this.expr.charAt(this.exprIndex) == '.') {
this.exprIndex++;
bSawDecimal = true;
if (this.exprIndex < this.exprLength
&& isDigit(this.expr.charAt(this.exprIndex))) {
this.exprIndex++;
scanDigits();
}
} else {
bSawDecimal = false;
}
if (this.exprIndex < this.exprLength
&& this.expr.charAt(this.exprIndex) == '%') {
this.exprIndex++;
this.currentToken = PropertyTokenizer.TOK_PERCENT;
} else {
// Check for possible unit name following number
this.currentUnitLength = this.exprIndex;
scanName();
this.currentUnitLength = this.exprIndex
- this.currentUnitLength;
if (this.currentUnitLength > 0) {
this.currentToken = PropertyTokenizer.TOK_NUMERIC;
} else {
if (bSawDecimal) {
this.currentToken = PropertyTokenizer.TOK_FLOAT;
} else {
this.currentToken = PropertyTokenizer.TOK_INTEGER;
}
}
}
this.currentTokenValue = this.expr.substring(
this.currentTokenStartIndex, this.exprIndex);
return;
case '.':
if (this.exprIndex < this.exprLength
&& isDigit(this.expr.charAt(this.exprIndex))) {
++this.exprIndex;
scanDigits();
if (this.exprIndex < this.exprLength
&& this.expr.charAt(this.exprIndex) == '%') {
this.exprIndex++;
this.currentToken = PropertyTokenizer.TOK_PERCENT;
} else {
// Check for possible unit name following number
this.currentUnitLength = this.exprIndex;
scanName();
this.currentUnitLength = this.exprIndex
- this.currentUnitLength;
if (this.currentUnitLength > 0) {
this.currentToken = PropertyTokenizer.TOK_NUMERIC;
} else {
this.currentToken = PropertyTokenizer.TOK_FLOAT;
}
}
this.currentTokenValue = this.expr.substring(
this.currentTokenStartIndex, this.exprIndex);
return;
}
throw new PropertyException("illegal character '.'");
case '#':
// Start of color value
if (this.exprIndex < this.exprLength
&& isHexDigit(this.expr.charAt(this.exprIndex))) {
++this.exprIndex;
scanHexDigits();
this.currentToken = PropertyTokenizer.TOK_COLORSPEC;
this.currentTokenValue = this.expr.substring(
this.currentTokenStartIndex, this.exprIndex);
// Probably should have some multiple of 3 for length!
return;
}
throw new PropertyException("illegal character '#'");
default:
--this.exprIndex;
scanName();
if (this.exprIndex == this.currentTokenStartIndex) {
throw new PropertyException("illegal character");
}
this.currentTokenValue = this.expr.substring(
this.currentTokenStartIndex, this.exprIndex);
// if (currentMaybeOperator) {
if (this.currentTokenValue.equals("mod")) {