class PropertyTokenizer {
static final int TOK_EOF = 0;
- static final int TOK_NCNAME = TOK_EOF + 1;
+ static final int TOK_NCNAME = 1;
static final int TOK_MULTIPLY = TOK_NCNAME + 1;
static final int TOK_LPAR = TOK_MULTIPLY + 1;
static final int TOK_RPAR = TOK_LPAR + 1;
private /* final */ String expr;
private int exprIndex = 0;
private int exprLength;
- private boolean recognizeOperator = false;
-
/**
* Construct a new PropertyTokenizer object to tokenize the passed
currentTokenValue = null;
currentTokenStartIndex = exprIndex;
boolean bSawDecimal;
- recognizeOperator = true;
while ( true ) {
if (exprIndex >= exprLength) {
currentToken = TOK_EOF;
currentTokenStartIndex = exprIndex;
break;
case ',':
- recognizeOperator = false;
currentToken = TOK_COMMA;
return;
case '+':
- recognizeOperator = false;
currentToken = TOK_PLUS;
return;
case '-':
- recognizeOperator = false;
currentToken = TOK_MINUS;
return;
case '(':
currentToken = TOK_LPAR;
- recognizeOperator = false;
return;
case ')':
currentToken = TOK_RPAR;
if (exprIndex == currentTokenStartIndex) {
throw new PropertyException("illegal character");
}
- currentTokenValue = expr.substring(currentTokenStartIndex,
- exprIndex);
- // if (currentMaybeOperator) {
+ currentTokenValue = expr.substring(currentTokenStartIndex, exprIndex);
if (currentTokenValue.equals("mod")) {
currentToken = TOK_MOD;
return;
currentToken = TOK_DIV;
return;
}
- /*
- * else
- * throw new PropertyException("unrecognized operator name");
- * recognizeOperator = false;
- * return;
- * }
- */
if (followingParen()) {
currentToken = TOK_FUNCTION_LPAR;
- recognizeOperator = false;
} else {
currentToken = TOK_NCNAME;
- recognizeOperator = false;
}
return;
}