01: /* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com
02:
03: This file is part of the db4o open source object database.
04:
05: db4o is free software; you can redistribute it and/or modify it under
06: the terms of version 2 of the GNU General Public License as published
07: by the Free Software Foundation and as clarified by db4objects' GPL
08: interpretation policy, available at
09: http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10: Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11: Suite 350, San Mateo, CA 94403, USA.
12:
13: db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14: WARRANTY; without even the implied warranty of MERCHANTABILITY or
15: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16: for more details.
17:
18: You should have received a copy of the GNU General Public License along
19: with this program; if not, write to the Free Software Foundation, Inc.,
20: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21: package EDU.purdue.cs.bloat.tree;
22:
23: import EDU.purdue.cs.bloat.editor.*;
24:
25: /**
26: * <tt>CallExpr</tt> is a superclass of expressions that represent the
27: * invocation of a method. It consists of an array of <tt>Expr</tt> that
28: * represent the arguments to a method and a <tt>MemberRef</tt> that
29: * represents the method itself.
30: *
31: * @see CallMethodExpr
32: * @see CallStaticExpr
33: */
34: public abstract class CallExpr extends Expr {
35: Expr[] params; // The parameters to the method
36:
37: MemberRef method; // The method to be invoked
38:
39: public int voltaPos; // used for placing swaps and stuff
40:
41: /**
42: * Constructor.
43: *
44: * @param params
45: * Parameters to the method. Note that these parameters do not
46: * contain parameter 0, the "this" pointer.
47: * @param method
48: * The method that is to be invoked.
49: * @param type
50: * The type of this expression (i.e. the return type of the
51: * method being called).
52: */
53: public CallExpr(final Expr[] params, final MemberRef method,
54: final Type type) {
55: super (type);
56: this .params = params;
57: this .method = method;
58:
59: for (int i = 0; i < params.length; i++) {
60: params[i].setParent(this );
61: }
62: }
63:
64: public MemberRef method() {
65: return method;
66: }
67:
68: public Expr[] params() {
69: return params;
70: }
71: }
|