use of com.oracle.truffle.sl.nodes.expression.SLLongLiteralNode in project graal by oracle.
the class SLNodeFactory method createNumericLiteral.
public SLExpressionNode createNumericLiteral(Token literalToken) {
SLExpressionNode result;
try {
/* Try if the literal is small enough to fit into a long value. */
result = new SLLongLiteralNode(Long.parseLong(literalToken.val));
} catch (NumberFormatException ex) {
/* Overflow of long value, so fall back to BigInteger. */
result = new SLBigIntegerLiteralNode(new BigInteger(literalToken.val));
}
srcFromToken(result, literalToken);
return result;
}
Aggregations