daikon.chicory
Class DeclReader

Object
  extended by DeclReader
Direct Known Subclasses:
DTraceReader

public class DeclReader
extends Object

Reads declaration files and provides methods to access the information within them. A declaration file consists of a number of program points and the variables for each program point.


Nested Class Summary
static class DeclReader.DeclPpt
          Information about the program point that is contained in the decl file.
static class DeclReader.DeclVarInfo
          Information about variables within a program point
 
Field Summary
static boolean avg_size
          Prints only the average set size for each specified file
static String comparability
           
static boolean declaration_type_comparability
          Reads in a decl file with arbitrary comparability and writes out a file with comparability based on declaration types.
static boolean dump_dtrace
           
 HashMap<String,DeclReader.DeclPpt> ppts
           
static boolean primitive_declaration_type_comparability
          Reads in a decl file with arbitrary comparability and writes out a file with comparability based on the primitive declaration types.
static boolean rep_type_comparability
          Reads in a decl file with arbitrary comparability and writes out a file with comparability based on the rep types (ie, there are comparability sets for int, boolean, string, and hashcode) Two filenames are required: input-filename output-filename.
 
Constructor Summary
DeclReader()
           
 
Method Summary
 void declaration_types()
          Sets the comparability to match declaration types.
 void dump_decl()
           
 DeclReader.DeclPpt find_ppt(String ppt_name)
           
 List<DeclReader.DeclPpt> get_all_ppts()
          Returns a list of all of the program points
static void main(String[] args)
          Reads a decl file and dumps statistics
 void primitive_declaration_types()
          Sets the comparability to match primitive declaration types.
protected  DeclReader.DeclPpt read_decl(EntryReader decl_file)
          Reads a single declaration from decl_file.
 void read(File pathname)
          Read declarations from the specified pathname
 void rep_types()
          Sets the comparability to match the rep types.
 void write_decl(String filename, String comparability)
          Writes the declaration to the specified file.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

avg_size

public static boolean avg_size
Prints only the average set size for each specified file


primitive_declaration_type_comparability

public static boolean primitive_declaration_type_comparability
Reads in a decl file with arbitrary comparability and writes out a file with comparability based on the primitive declaration types. All hashcodes are left in a single set. Each named primitive type has a distinct set.


declaration_type_comparability

public static boolean declaration_type_comparability
Reads in a decl file with arbitrary comparability and writes out a file with comparability based on declaration types. Each variable with a different typename will be in a different set. For example, java.util.List, java.util.ArrayList, float, short, double, and int are each in a distinct set.


rep_type_comparability

public static boolean rep_type_comparability
Reads in a decl file with arbitrary comparability and writes out a file with comparability based on the rep types (ie, there are comparability sets for int, boolean, string, and hashcode) Two filenames are required: input-filename output-filename.


dump_dtrace

public static boolean dump_dtrace

comparability

public static String comparability

ppts

public HashMap<String,DeclReader.DeclPpt> ppts
Constructor Detail

DeclReader

public DeclReader()
Method Detail

read

public void read(File pathname)
Read declarations from the specified pathname


read_decl

protected DeclReader.DeclPpt read_decl(EntryReader decl_file)
                                throws IOException
Reads a single declaration from decl_file. The opening "DECLARE" line should have already been read. Returns the ppt.

Throws:
IOException

dump_decl

public void dump_decl()

find_ppt

public DeclReader.DeclPpt find_ppt(String ppt_name)

main

public static void main(String[] args)
                 throws IOException
Reads a decl file and dumps statistics

Throws:
IOException

declaration_types

public void declaration_types()
Sets the comparability to match declaration types. The comparability for each variable is set so that each declaration type is in a separate set. Each hashcode with a different type name will be in a different set. Primitives with different type names will be in different sets.


primitive_declaration_types

public void primitive_declaration_types()
Sets the comparability to match primitive declaration types. The comparability for each non-hashcode is set so that each declaration type is in a separate set. Hashcodes are all set to a single comparability regardless of their declared type


rep_types

public void rep_types()
Sets the comparability to match the rep types.


write_decl

public void write_decl(String filename,
                       String comparability)
                throws IOException
Writes the declaration to the specified file. If the filename is -, writes to stdout.

Throws:
IOException

get_all_ppts

public List<DeclReader.DeclPpt> get_all_ppts()
Returns a list of all of the program points