&& reader.getLastChar() != 'L') {
int val;
try {
val = Integer.parseInt(str.toString());
} catch (NumberFormatException e) {
throw new FactParseError("malformed int:" + str,
reader.getPosition());
}
result = vf.integer(val);
} else if (reader.getLastChar() == 'l' || reader.getLastChar() == 'L') {
reader.read();
throw new FactParseError("No support for longs",
reader.getPosition());
} else {
if (reader.getLastChar() == '.') {
str.append('.');
reader.read();
if (!Character.isDigit(reader.getLastChar()))
throw new FactParseError("digit expected",
reader.getPosition());
do {
str.append((char) reader.getLastChar());
} while (Character.isDigit(reader.read()));
}
if (reader.getLastChar() == 'e' || reader.getLastChar() == 'E') {
str.append((char) reader.getLastChar());
reader.read();
if (reader.getLastChar() == '-' || reader.getLastChar() == '+') {
str.append((char) reader.getLastChar());
reader.read();
}
if (!Character.isDigit(reader.getLastChar()))
throw new FactParseError("digit expected!",
reader.getPosition());
do {
str.append((char) reader.getLastChar());
} while (Character.isDigit(reader.read()));
}
double val;
try {
val = Double.valueOf(str.toString()).doubleValue();
result = vf.real(val);
} catch (NumberFormatException e) {
throw new FactParseError("malformed real",
reader.getPosition(), e);
}
}
reader.skipWS();
return result;