/*
* $Id: SuperInvokeNode.java,v 1.15 2002/09/16 08:05:05 jkl Exp $
*
* Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
*
* Use is subject to license terms, as defined in
* Anvil Sofware License, Version 1.1. See LICENSE
* file, or http://njet.org/license-1.1.txt
*/
package anvil.script.expression;
import anvil.core.Any;
import anvil.core.AnyClass;
import anvil.core.Register;
import anvil.ErrorListener;
import anvil.script.ClassType;
import anvil.codec.Code;
import anvil.codec.ConstantPool;
import anvil.script.compiler.ByteCompiler;
import anvil.script.Context;
import anvil.script.Type;
import anvil.script.MethodType;
import java.io.IOException;
/**
* class SuperInvokeNode
*
* @author: Jani Lehtim�ki
*/
public class SuperInvokeNode extends MultiParent
{
private MethodType _method = null;
public SuperInvokeNode(MethodType method, Parent parameters)
{
super(parameters);
_method = method;
}
public int typeOf()
{
return Node.EXPR_INVOKE;
}
public boolean isConstant()
{
return false;
}
public void compile(ByteCompiler context, int operation)
{
Code code = context.getCode();
ConstantPool pool = code.getPool();
/*if (hasSplices()) {
int field = pool.addFieldRef(_method.getParent().getTypeRef(pool),
"m_" + _method.getName(), "Lanvil/script/Function;");
code.getstatic(field);
code.aload_first();
code.self();
context.compileArgumentList(getChilds(0));
code.invokeinterface(pool.addInterfaceMethodRef("anvil/script/Function",
"execute", "(Lanvil/script/Context;Lanvil/core/Any;[Lanvil/core/Any;)Lanvil/core/Any;"));
} else {*/
code.self();
context.compileArgumentList(_method, getChilds(0));
code.invokespecial(_method.getTypeRef(pool));
//}
if (operation == GET_BOOLEAN) {
context.any2boolean();
}
}
}