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

SafeBlocks.java

00001 package gov.nasa.arc.ase.jpf;
00002 
00003 import java.util.*;
00004 import java.io.*;
00005 import gov.nasa.arc.ase.util.Debug;
00006 
00007 public class SafeBlocks {
00008   private Vector safeList = new Vector();
00009 
00010   public SafeBlocks (BufferedReader in) {  
00011     boolean fin = false;
00012     BitSet unSafeLines = new BitSet();
00013     int beginline;
00014     int endline;
00015     char space;
00016     while (!fin) {
00017       try {
00018     String str = in.readLine();
00019     if (str == null)
00020       fin = true;
00021     else {
00022       // line has format: NUM SPACE NUM
00023       StringTokenizer str_tok = new StringTokenizer(str," ");
00024       beginline = Integer.parseInt(str_tok.nextToken());
00025       endline =   Integer.parseInt(str_tok.nextToken());
00026       //if (beginline == endline) {
00027       //  unSafeLines.set(beginline);
00028       //}
00029       //else 
00030       safeList.add(new SafeBlock(beginline,endline));
00031     }
00032       } catch (IOException e1) {}
00033     }
00034     // purge unsafe lines
00035     /*
00036        for(int i = 0; i < safeList.size(); i++) {
00037        SafeBlock sb = (SafeBlock)safeList.get(i);
00038        if (unSafeLines.get(sb.endLine)) {
00039        safeList.add(new SafeBlock(sb.beginLine,sb.endLine-1));
00040        safeList.removeElement(sb);
00041        }
00042        }
00043      */
00044   }  
00045   public boolean isSafe(int line) {
00046     for(int i = 0; i < safeList.size(); i++) {
00047       if (((SafeBlock)safeList.get(i)).isSafe(line)) {
00048 // ifdef DEBUG
00049 
00050 //#endif DEBUG
00051     return true;
00052       }
00053     }
00054 // ifdef DEBUG
00055 
00056 //#endif DEBUG
00057     return false;    
00058   }  
00059 }

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