01: /* OuterLocalOperator 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: OuterLocalOperator.java,v 1.3.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 OuterLocalOperator extends Operator {
30: LocalInfo local;
31:
32: public OuterLocalOperator(LocalInfo local) {
33: super (local.getType());
34: this .local = local;
35: initOperands(0);
36: }
37:
38: public boolean isConstant() {
39: return true;
40: }
41:
42: public int getPriority() {
43: return 1000;
44: }
45:
46: public LocalInfo getLocalInfo() {
47: return local.getLocalInfo();
48: }
49:
50: public void updateSubTypes() {
51: if ((GlobalOptions.debuggingFlags & GlobalOptions.DEBUG_TYPES) != 0)
52: GlobalOptions.err.println("setType of " + local.getName()
53: + ": " + local.getType());
54: local.setType(type);
55: }
56:
57: public void updateType() {
58: }
59:
60: public boolean opEquals(Operator o) {
61: return (o instanceof OuterLocalOperator && ((OuterLocalOperator) o).local
62: .getSlot() == local.getSlot());
63: }
64:
65: public Expression simplify() {
66: return super .simplify();
67: }
68:
69: public void dumpExpression(TabbedPrintWriter writer)
70: throws java.io.IOException {
71: writer.print(local.getName());
72: }
73: }
|