1 cananian 1.2.2.3 // OpLocalVariable.java, created Sun Sep 13 22:49:23 1998 by cananian 2 cananian 1.2 // Copyright (C) 1998 C. Scott Ananian <cananian@alumni.princeton.edu> 3 cananian 1.2 // Licensed under the terms of the GNU GPL; see COPYING for details. 4 cananian 1.1 package harpoon.IR.Bytecode; 5 cananian 1.1 6 cananian 1.1 /** 7 cananian 1.1 * <code>OpLocalVariable</code> represents an operand of a java bytecode 8 cananian 1.1 * instruction which indicates a local variable index. 9 cananian 1.1 * 10 cananian 1.1 * @author C. Scott Ananian <cananian@alumni.princeton.edu> 11 cananian 1.3 * @version $Id: OpLocalVariable.java,v 1.3 2002/02/25 21:04:17 cananian Exp $ 12 cananian 1.1 */ 13 cananian 1.2.2.1 public final class OpLocalVariable extends Operand { 14 cananian 1.2.2.1 final int index; 15 cananian 1.1 /** Create an <code>OpLocalVariable</code> given the index of the 16 cananian 1.1 * local variable referenced. */ 17 cananian 1.1 public OpLocalVariable(int local_variable_index) { 18 cananian 1.1 this.index = local_variable_index; 19 cananian 1.1 } 20 cananian 1.1 /** Get the local variable index */ 21 cananian 1.1 public int getIndex() { return index; } 22 cananian 1.1 /** Return a human-readable representation of this Operand. */ 23 cananian 1.1 public String toString() { return "lv_"+index; } 24 cananian 1.1 }