Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

LineNumberGen.java

00001 package de.fub.bytecode.generic;
00002 
00003 import de.fub.bytecode.Constants;
00004 import de.fub.bytecode.classfile.*;
00005 
00006 /** 
00007  * This class represents a line number within a method, i.e., give an instruction
00008  * a line number corresponding to the source code line.
00009  *
00010  * @version $Id: LineNumberGen.java,v 1.1.1.1 2002/01/24 03:41:41 pserver Exp $
00011  * @author  <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
00012  * @see     LineNumber
00013  * @see     MethodGen
00014  */
00015 public class LineNumberGen {
00016   private InstructionHandle ih;
00017   private int               src_line;
00018 
00019   /**
00020    * Create a line number.
00021    *
00022    * @param ih instruction to tag
00023    * @return new line number object
00024    */
00025   public LineNumberGen(InstructionHandle ih, int src_line) {
00026     this.ih       = ih;
00027     this.src_line = src_line;
00028   }  
00029   public InstructionHandle getInstruction()                     { return ih; }  
00030   /**
00031    * Get LineNumber object.
00032    *
00033    * This relies on that the instruction list has already been dumped to byte code or
00034    * or that the `setPositions' methods has been called for the instruction list.
00035    *
00036    * @param cp constant pool
00037    */
00038   public LineNumber getLineNumber(ConstantPoolGen cp) {
00039     return new LineNumber(ih.getPosition(), src_line);
00040   }  
00041   public int               getSourceLine()                { return src_line; }  
00042   public void              setInstruction(InstructionHandle ih) { this.ih = ih; }  
00043   public void              setSourceLine(int src_line)    { this.src_line = src_line; }  
00044 }

Generated at Thu Feb 7 06:49:36 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001