public void compile(ByteCompiler context, int operation)
{
Code code = context.getCode();
ConstantPool pool = code.getPool();
final Node child = _child;
switch(child.typeOf()) {
case Node.EXPR_VARIABLE:
{
final int tmp = code.addLocal();
child.compile(context, GET);
code.astore(tmp);
child.compile(context, new Node() {
public void compile(ByteCompiler context, int operation)
{
Code code = context.getCode();
code.aload(tmp);
code.invokevirtual(code.getPool().addMethodRef(context.TYPE_ANY, "increase", "()Lanvil/core/Any;"));
}
});
code.pop();
code.aload(tmp);
code.endLocal(tmp);
}
break;
case Node.EXPR_ATTRIBUTE:
{
AttributeNode attr = (AttributeNode)child;
attr.getChild().compile(context, GET);
code.astring(attr.getAttribute());
code.aload_first();
code.invokestatic(pool.addMethodRef(context.TYPE_CONTEXT, "postinc",
"(Lanvil/core/Any;Ljava/lang/String;Lanvil/script/Context;)Lanvil/core/Any;"));
}
break;
case Node.EXPR_REFERENCE:
{
ReferenceNode ref = (ReferenceNode)child;
ref.getLeft().compile(context, GET);
ref.getRight().compile(context, GET);
code.aload_first();
code.invokestatic(pool.addMethodRef(context.TYPE_CONTEXT, "postinc",
"(Lanvil/core/Any;Lanvil/core/Any;Lanvil/script/Context;)Lanvil/core/Any;"));
}
break;
default: