@Override
public void visit(LiteralExpression literalExpression) {
lastExpressionType = literalExpression.getType();
if (literalExpression.getType().getExisting().equals(Integer.TYPE)) {
int intValue = ((Integer)literalExpression.getValue()).intValue();
if (intValue >= -128 && intValue <= 127) {
methodByteCodeContext.push(BIPUSH, intValue, "int literal", literalExpression.getValue());
} else {
methodByteCodeContext.ldc((Integer)literalExpression.getValue(), "int literal", literalExpression.getValue());
}
} else if (literalExpression.getType().getExisting().equals(Long.TYPE)) {
methodByteCodeContext.ldc((Long)literalExpression.getValue(), "long literal", literalExpression.getValue());
} else if (literalExpression.getType().getExisting().equals(Float.TYPE)) {
methodByteCodeContext.ldc((Float)literalExpression.getValue(), "float literal", literalExpression.getValue());
} else if (literalExpression.getType().getExisting().equals(Double.TYPE)) {
methodByteCodeContext.ldc((Double)literalExpression.getValue(), "double literal", literalExpression.getValue());
} else if (literalExpression.getType().getExisting().equals(String.class)) {
methodByteCodeContext.ldc((String)literalExpression.getValue(), "String literal", literalExpression.getValue());
} else if (literalExpression.getType().getExisting().equals(Boolean.TYPE)) {
boolean b = (Boolean)literalExpression.getValue();
methodByteCodeContext.addBool(b, "bool literal");
} else {
throw new UnsupportedOperationException(literalExpression.toString());
}
}