default:
throw getSyntaxError("Illegal operation: -" + currentValue);
}
}
if (currentTokenType == VALUE) {
LiteralImpl literal = getUncastLiteral(currentValue);
read();
return literal;
} else if (currentTokenType == PARAMETER) {
read();
String name = readName();
if (readIf(":")) {
name = name + ':' + readName();
}
BindVariableValueImpl var = bindVariables.get(name);
if (var == null) {
var = factory.bindVariable(name);
bindVariables.put(name, var);
}
return var;
} else if (readIf("TRUE")) {
LiteralImpl literal = getUncastLiteral(PropertyValues.newBoolean(true));
return literal;
} else if (readIf("FALSE")) {
LiteralImpl literal = getUncastLiteral(PropertyValues.newBoolean(false));
return literal;
} else if (readIf("CAST")) {
read("(");
StaticOperandImpl op = parseStaticOperand();
if (!(op instanceof LiteralImpl)) {
throw getSyntaxError("literal");
}
LiteralImpl literal = (LiteralImpl) op;
PropertyValue value = literal.getLiteralValue();
read("AS");
value = parseCastAs(value);
read(")");
// CastLiteral
literal = factory.literal(value);
return literal;
} else {
if (supportSQL1) {
if (readIf("TIMESTAMP")) {
StaticOperandImpl op = parseStaticOperand();
if (!(op instanceof LiteralImpl)) {
throw getSyntaxError("literal");
}
LiteralImpl literal = (LiteralImpl) op;
PropertyValue value = literal.getLiteralValue();
value = PropertyValues.newDate(value.getValue(Type.STRING));
literal = factory.literal(value);
return literal;
}
}