01: /* LocalLoadOperator Copyright (C) 1998-2002 Jochen Hoenicke.
02: *
03: * This program is free software; you can redistribute it and/or modify
04: * it under the terms of the GNU Lesser General Public License as published by
05: * the Free Software Foundation; either version 2, or (at your option)
06: * any later version.
07: *
08: * This program is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public License
14: * along with this program; see the file COPYING.LESSER. If not, write to
15: * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
16: *
17: * $Id: LocalLoadOperator.java,v 4.17.2.1 2002/05/28 17:34:06 hoenicke Exp $
18: */
19:
20: package jode.expr;
21:
22: import jode.GlobalOptions;
23: import jode.type.Type;
24: import jode.decompiler.MethodAnalyzer;
25: import jode.decompiler.ClassAnalyzer;
26: import jode.decompiler.LocalInfo;
27: import jode.decompiler.TabbedPrintWriter;
28:
29: public class LocalLoadOperator extends LocalVarOperator {
30:
31: MethodAnalyzer methodAnalyzer;
32:
33: public LocalLoadOperator(Type type, MethodAnalyzer methodAnalyzer,
34: LocalInfo local) {
35: super (type, local);
36: this .methodAnalyzer = methodAnalyzer;
37: }
38:
39: public boolean isRead() {
40: return true;
41: }
42:
43: public boolean isWrite() {
44: return false;
45: }
46:
47: public boolean isConstant() {
48: return false;
49: }
50:
51: public void setMethodAnalyzer(MethodAnalyzer ma) {
52: methodAnalyzer = ma;
53: }
54:
55: public boolean opEquals(Operator o) {
56: return (o instanceof LocalLoadOperator && ((LocalLoadOperator) o).local
57: .getSlot() == local.getSlot());
58: }
59:
60: public Expression simplify() {
61: if (local.getExpression() != null)
62: return local.getExpression().simplify();
63: return super.simplify();
64: }
65: }
|