@Override public void endVisit(FloatLiteral x, BlockScope scope) { try { push(JFloatLiteral.get(x.constant.floatValue())); } catch (Throwable e) { throw translateException(x, e); } }
+ ((Enum<?>) value).name(); } else if (value instanceof Float) { return JFloatLiteral.get(((Float) value).floatValue()).toSource(); } else if (value instanceof Integer) { return JIntLiteral.get(((Integer) value).intValue()).toSource();
+ ((Enum<?>) value).name(); } else if (value instanceof Float) { return JFloatLiteral.get(((Float) value).floatValue()).toSource(); } else if (value instanceof Integer) { return JIntLiteral.get(((Integer) value).intValue()).toSource();
return value.getClass().getCanonicalName() + "." + ((Enum<?>) value).name(); } else if (value instanceof Float) { return JFloatLiteral.get(((Float) value).floatValue()).toSource(); } else if (value instanceof Integer) { return JIntLiteral.get(((Integer) value).intValue()).toSource();
private JExpression getConstant(SourceInfo info, Constant constant) { switch (constant.typeID()) { case TypeIds.T_int: return JIntLiteral.get(constant.intValue()); case TypeIds.T_byte: return JIntLiteral.get(constant.byteValue()); case TypeIds.T_short: return JIntLiteral.get(constant.shortValue()); case TypeIds.T_char: return JCharLiteral.get(constant.charValue()); case TypeIds.T_float: return JFloatLiteral.get(constant.floatValue()); case TypeIds.T_double: return JDoubleLiteral.get(constant.doubleValue()); case Constant.T_boolean: return JBooleanLiteral.get(constant.booleanValue()); case Constant.T_long: return JLongLiteral.get(constant.longValue()); case Constant.T_JavaLangString: return getStringLiteral(info, constant.stringValue()); case Constant.T_null: return JNullLiteral.INSTANCE; default: throw new InternalCompilerException("Unknown Constant type: " + constant.typeID()); } }