@@ -0,0 +1,2171 @@
+package net.folab.fo.ast;%0A%0Aimport org.objectweb.asm.MethodVisitor;%0Aimport org.objectweb.asm.Opcodes;%0A%0Aimport net.folab.fo.bytecode.JavaType;%0Aimport net.folab.fo.bytecode.StatementContext;%0A%0Apublic class JavaValue implements Expression %7B%0A%0A    private final Object value;%0A%0A    private JavaType type;%0A%0A    private JavaValue(Object value, JavaType type) %7B%0A        this.value = value;%0A        this.type = type;%0A    %7D%0A%0A    public static JavaValue of(boolean value) %7B%0A        return new JavaValue(Boolean.valueOf(value), JavaType.BOOLEAN);%0A    %7D%0A%0A    public static JavaValue of(byte value) %7B%0A        return new JavaValue(Byte.valueOf(value), JavaType.BYTE);%0A    %7D%0A%0A    public static JavaValue of(char value) %7B%0A        return new JavaValue(Character.valueOf(value), JavaType.CHAR);%0A    %7D%0A%0A    public static JavaValue of(short value) %7B%0A        return new JavaValue(Short.valueOf(value), JavaType.SHORT);%0A    %7D%0A%0A    public static JavaValue of(int value) %7B%0A        return new JavaValue(Integer.valueOf(value), JavaType.INT);%0A    %7D%0A%0A    public static JavaValue of(long value) %7B%0A        return new JavaValue(Long.valueOf(value), JavaType.LONG);%0A    %7D%0A%0A    public static JavaValue of(float value) %7B%0A        return new JavaValue(Float.valueOf(value), JavaType.FLOAT);%0A    %7D%0A%0A    public static JavaValue of(double value) %7B%0A        return new JavaValue(Double.valueOf(value), JavaType.DOUBLE);%0A    %7D%0A%0A    public static JavaValue nullValue() %7B%0A        return new JavaValue(null, JavaType.NULL) %7B%0A            @Override%0A            public void generate(MethodVisitor mv, StatementContext context) %7B%0A                context.incStack();%0A                mv.visitInsn(Opcodes.ACONST_NULL);%0A            %7D%0A        %7D;%0A    %7D%0A%0A    public void generate(MethodVisitor mv, StatementContext context) %7B%0A        switch (type.getSize()) %7B%0A        case 0:%0A%0A            break;%0A        case 1:%0A            context.incStack();%0A            mv.visitLdcInsn(value);%0A            break;%0A        case 2:%0A            context.incStack().incStack();%0A            mv.visitLdcInsn(value);%0A            break;%0A%0A        default:%0A            break;%0A        %7D%0A    %7D%0A%0A    public JavaType getType() %7B%0A        return type;%0A    %7D%0A%0A%7D%0A

Add JavaValue to represent constants