value = value + tokens.consume() + tokens.consume(); // +/-EXP
}
try {
// Convert to a double and then back to a string to get canonical form ...
String canonical = typeSystem.getDoubleFactory().asString(value);
return new Literal(canonical);
} catch (ValueFormatException e) {
String msg = GraphI18n.expectingLiteralAndUnableToParseAsDouble.text(value, pos.getLine(), pos.getColumn());
throw new ParsingException(pos, msg);
}
}
// try to parse an a long ...
String value = sign + number;
try {
// Convert to a long and then back to a string to get canonical form ...
String canonical = typeSystem.getLongFactory().asString(value);
return new Literal(canonical);
} catch (ValueFormatException e) {
String msg = GraphI18n.expectingLiteralAndUnableToParseAsLong.text(value, pos.getLine(), pos.getColumn());
throw new ParsingException(pos, msg);
}
}