01: /*
02: * $Id: SuperInvokeNode.java,v 1.15 2002/09/16 08:05:05 jkl Exp $
03: *
04: * Copyright (c) 2002 Njet Communications Ltd. All Rights Reserved.
05: *
06: * Use is subject to license terms, as defined in
07: * Anvil Sofware License, Version 1.1. See LICENSE
08: * file, or http://njet.org/license-1.1.txt
09: */
10: package anvil.script.expression;
11:
12: import anvil.core.Any;
13: import anvil.core.AnyClass;
14: import anvil.core.Register;
15: import anvil.ErrorListener;
16: import anvil.script.ClassType;
17: import anvil.codec.Code;
18: import anvil.codec.ConstantPool;
19: import anvil.script.compiler.ByteCompiler;
20: import anvil.script.Context;
21: import anvil.script.Type;
22: import anvil.script.MethodType;
23: import java.io.IOException;
24:
25: /**
26: * class SuperInvokeNode
27: *
28: * @author: Jani Lehtimäki
29: */
30: public class SuperInvokeNode extends MultiParent {
31:
32: private MethodType _method = null;
33:
34: public SuperInvokeNode(MethodType method, Parent parameters) {
35: super (parameters);
36: _method = method;
37: }
38:
39: public int typeOf() {
40: return Node.EXPR_INVOKE;
41: }
42:
43: public boolean isConstant() {
44: return false;
45: }
46:
47: public void compile(ByteCompiler context, int operation) {
48: Code code = context.getCode();
49: ConstantPool pool = code.getPool();
50: /*if (hasSplices()) {
51: int field = pool.addFieldRef(_method.getParent().getTypeRef(pool),
52: "m_" + _method.getName(), "Lanvil/script/Function;");
53: code.getstatic(field);
54: code.aload_first();
55: code.self();
56: context.compileArgumentList(getChilds(0));
57: code.invokeinterface(pool.addInterfaceMethodRef("anvil/script/Function",
58: "execute", "(Lanvil/script/Context;Lanvil/core/Any;[Lanvil/core/Any;)Lanvil/core/Any;"));
59: } else {*/
60: code.self();
61: context.compileArgumentList(_method, getChilds(0));
62: code.invokespecial(_method.getTypeRef(pool));
63: //}
64: if (operation == GET_BOOLEAN) {
65: context.any2boolean();
66: }
67: }
68:
69: }
|