KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jode > expr > LocalStoreOperator


1 /* LocalStoreOperator Copyright (C) 1998-2002 Jochen Hoenicke.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as published by
5  * the Free Software Foundation; either version 2, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * 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: LocalStoreOperator.java,v 4.14.2.1 2002/05/28 17:34:06 hoenicke Exp $
18  */

19
20 package jode.expr;
21 import jode.GlobalOptions;
22 import jode.type.Type;
23 import jode.decompiler.LocalInfo;
24 import jode.decompiler.TabbedPrintWriter;
25
26 public class LocalStoreOperator extends LocalVarOperator
27     implements LValueExpression {
28
29     public LocalStoreOperator(Type lvalueType, LocalInfo local) {
30         super(lvalueType, local);
31     }
32
33     public boolean isRead() {
34     /* if it is part of a += operator, this is a read. */
35         return parent != null && parent.getOperatorIndex() != ASSIGN_OP;
36     }
37
38     public boolean isWrite() {
39         return true;
40     }
41
42     public boolean matches(Operator loadop) {
43         return loadop instanceof LocalLoadOperator &&
44             ((LocalLoadOperator)loadop).getLocalInfo().getSlot()
45             == local.getSlot();
46     }
47 }
48
49
Popular Tags