001: /* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com
002:
003: This file is part of the db4o open source object database.
004:
005: db4o is free software; you can redistribute it and/or modify it under
006: the terms of version 2 of the GNU General Public License as published
007: by the Free Software Foundation and as clarified by db4objects' GPL
008: interpretation policy, available at
009: http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
010: Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
011: Suite 350, San Mateo, CA 94403, USA.
012:
013: db4o is distributed in the hope that it will be useful, but WITHOUT ANY
014: WARRANTY; without even the implied warranty of MERCHANTABILITY or
015: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
016: for more details.
017:
018: You should have received a copy of the GNU General Public License along
019: with this program; if not, write to the Free Software Foundation, Inc.,
020: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
021: package EDU.purdue.cs.bloat.editor;
022:
023: /**
024: * The visitor pattern allows functionality to be added to a number of classes
025: * (or in this case one class, <tt>Instruction</tt>, that can vary in
026: * behavior) without modifying the classes themselves. Additionally, the visitor
027: * pattern simulates double dispatching. For instance <tt>visit</tt> method of
028: * <tt>Instruction</tt> calls a particular method of
029: * <tt>InstructionVisitor</tt> based on the <tt>Instruction</tt>'s opcode.
030: * <p>
031: * <tt>InstructionVisitor</tt> provides an interface for performing actions
032: * based on the instruction type. Classes implementing this interface should not
033: * be able to miss any of the instruction types. This interface was created as
034: * an alternative to having 138 different subtypes of Instruction.
035: *
036: * @see Instruction#visit
037: * @see EDU.purdue.cs.bloat.tree.Tree
038: *
039: * @author Nate Nystrom (<a
040: * href="mailto:nystrom@cs.purdue.edu">nystrom@cs.purdue.edu</a>)
041: */
042: public interface InstructionVisitor {
043: public void visit_nop(Instruction inst);
044:
045: public void visit_ldc(Instruction inst);
046:
047: public void visit_iload(Instruction inst);
048:
049: public void visit_lload(Instruction inst);
050:
051: public void visit_fload(Instruction inst);
052:
053: public void visit_dload(Instruction inst);
054:
055: public void visit_aload(Instruction inst);
056:
057: public void visit_iaload(Instruction inst);
058:
059: public void visit_laload(Instruction inst);
060:
061: public void visit_faload(Instruction inst);
062:
063: public void visit_daload(Instruction inst);
064:
065: public void visit_aaload(Instruction inst);
066:
067: public void visit_baload(Instruction inst);
068:
069: public void visit_caload(Instruction inst);
070:
071: public void visit_saload(Instruction inst);
072:
073: public void visit_istore(Instruction inst);
074:
075: public void visit_lstore(Instruction inst);
076:
077: public void visit_fstore(Instruction inst);
078:
079: public void visit_dstore(Instruction inst);
080:
081: public void visit_astore(Instruction inst);
082:
083: public void visit_iastore(Instruction inst);
084:
085: public void visit_lastore(Instruction inst);
086:
087: public void visit_fastore(Instruction inst);
088:
089: public void visit_dastore(Instruction inst);
090:
091: public void visit_aastore(Instruction inst);
092:
093: public void visit_bastore(Instruction inst);
094:
095: public void visit_castore(Instruction inst);
096:
097: public void visit_sastore(Instruction inst);
098:
099: public void visit_pop(Instruction inst);
100:
101: public void visit_pop2(Instruction inst);
102:
103: public void visit_dup(Instruction inst);
104:
105: public void visit_dup_x1(Instruction inst);
106:
107: public void visit_dup_x2(Instruction inst);
108:
109: public void visit_dup2(Instruction inst);
110:
111: public void visit_dup2_x1(Instruction inst);
112:
113: public void visit_dup2_x2(Instruction inst);
114:
115: public void visit_swap(Instruction inst);
116:
117: public void visit_iadd(Instruction inst);
118:
119: public void visit_ladd(Instruction inst);
120:
121: public void visit_fadd(Instruction inst);
122:
123: public void visit_dadd(Instruction inst);
124:
125: public void visit_isub(Instruction inst);
126:
127: public void visit_lsub(Instruction inst);
128:
129: public void visit_fsub(Instruction inst);
130:
131: public void visit_dsub(Instruction inst);
132:
133: public void visit_imul(Instruction inst);
134:
135: public void visit_lmul(Instruction inst);
136:
137: public void visit_fmul(Instruction inst);
138:
139: public void visit_dmul(Instruction inst);
140:
141: public void visit_idiv(Instruction inst);
142:
143: public void visit_ldiv(Instruction inst);
144:
145: public void visit_fdiv(Instruction inst);
146:
147: public void visit_ddiv(Instruction inst);
148:
149: public void visit_irem(Instruction inst);
150:
151: public void visit_lrem(Instruction inst);
152:
153: public void visit_frem(Instruction inst);
154:
155: public void visit_drem(Instruction inst);
156:
157: public void visit_ineg(Instruction inst);
158:
159: public void visit_lneg(Instruction inst);
160:
161: public void visit_fneg(Instruction inst);
162:
163: public void visit_dneg(Instruction inst);
164:
165: public void visit_ishl(Instruction inst);
166:
167: public void visit_lshl(Instruction inst);
168:
169: public void visit_ishr(Instruction inst);
170:
171: public void visit_lshr(Instruction inst);
172:
173: public void visit_iushr(Instruction inst);
174:
175: public void visit_lushr(Instruction inst);
176:
177: public void visit_iand(Instruction inst);
178:
179: public void visit_land(Instruction inst);
180:
181: public void visit_ior(Instruction inst);
182:
183: public void visit_lor(Instruction inst);
184:
185: public void visit_ixor(Instruction inst);
186:
187: public void visit_lxor(Instruction inst);
188:
189: public void visit_iinc(Instruction inst);
190:
191: public void visit_i2l(Instruction inst);
192:
193: public void visit_i2f(Instruction inst);
194:
195: public void visit_i2d(Instruction inst);
196:
197: public void visit_l2i(Instruction inst);
198:
199: public void visit_l2f(Instruction inst);
200:
201: public void visit_l2d(Instruction inst);
202:
203: public void visit_f2i(Instruction inst);
204:
205: public void visit_f2l(Instruction inst);
206:
207: public void visit_f2d(Instruction inst);
208:
209: public void visit_d2i(Instruction inst);
210:
211: public void visit_d2l(Instruction inst);
212:
213: public void visit_d2f(Instruction inst);
214:
215: public void visit_i2b(Instruction inst);
216:
217: public void visit_i2c(Instruction inst);
218:
219: public void visit_i2s(Instruction inst);
220:
221: public void visit_lcmp(Instruction inst);
222:
223: public void visit_fcmpl(Instruction inst);
224:
225: public void visit_fcmpg(Instruction inst);
226:
227: public void visit_dcmpl(Instruction inst);
228:
229: public void visit_dcmpg(Instruction inst);
230:
231: public void visit_ifeq(Instruction inst);
232:
233: public void visit_ifne(Instruction inst);
234:
235: public void visit_iflt(Instruction inst);
236:
237: public void visit_ifge(Instruction inst);
238:
239: public void visit_ifgt(Instruction inst);
240:
241: public void visit_ifle(Instruction inst);
242:
243: public void visit_if_icmpeq(Instruction inst);
244:
245: public void visit_if_icmpne(Instruction inst);
246:
247: public void visit_if_icmplt(Instruction inst);
248:
249: public void visit_if_icmpge(Instruction inst);
250:
251: public void visit_if_icmpgt(Instruction inst);
252:
253: public void visit_if_icmple(Instruction inst);
254:
255: public void visit_if_acmpeq(Instruction inst);
256:
257: public void visit_if_acmpne(Instruction inst);
258:
259: public void visit_goto(Instruction inst);
260:
261: public void visit_jsr(Instruction inst);
262:
263: public void visit_ret(Instruction inst);
264:
265: public void visit_switch(Instruction inst);
266:
267: public void visit_ireturn(Instruction inst);
268:
269: public void visit_lreturn(Instruction inst);
270:
271: public void visit_freturn(Instruction inst);
272:
273: public void visit_dreturn(Instruction inst);
274:
275: public void visit_areturn(Instruction inst);
276:
277: public void visit_return(Instruction inst);
278:
279: public void visit_getstatic(Instruction inst);
280:
281: public void visit_putstatic(Instruction inst);
282:
283: public void visit_putstatic_nowb(Instruction inst);
284:
285: public void visit_getfield(Instruction inst);
286:
287: public void visit_putfield(Instruction inst);
288:
289: public void visit_putfield_nowb(Instruction inst);
290:
291: public void visit_invokevirtual(Instruction inst);
292:
293: public void visit_invokespecial(Instruction inst);
294:
295: public void visit_invokestatic(Instruction inst);
296:
297: public void visit_invokeinterface(Instruction inst);
298:
299: public void visit_new(Instruction inst);
300:
301: public void visit_newarray(Instruction inst);
302:
303: public void visit_arraylength(Instruction inst);
304:
305: public void visit_athrow(Instruction inst);
306:
307: public void visit_checkcast(Instruction inst);
308:
309: public void visit_instanceof (Instruction inst);
310:
311: public void visit_monitorenter(Instruction inst);
312:
313: public void visit_monitorexit(Instruction inst);
314:
315: public void visit_multianewarray(Instruction inst);
316:
317: public void visit_ifnull(Instruction inst);
318:
319: public void visit_ifnonnull(Instruction inst);
320:
321: public void visit_rc(Instruction inst);
322:
323: public void visit_aupdate(Instruction inst);
324:
325: public void visit_supdate(Instruction inst);
326:
327: public void visit_aswizzle(Instruction inst);
328:
329: public void visit_aswrange(Instruction inst);
330: }
|