dk.brics.string.intermediate
Class Application

java.lang.Object
  extended by dk.brics.string.intermediate.Application

public class Application
extends Object

The root of an intermediate program. The application contains Method objects, which in turn contain Statement objects. The application is responsible for creating new variables and fields when requested, and must distribute unique keys to variables, methods, and statements.

A robust structure of an intermediate program is strictly enforced by these classes. The following invariants are enforced (some only when assertion are enabled):


Constructor Summary
Application()
          Constructs a new application from an array of methods.
 
Method Summary
 Field createField(VariableType type, boolean isStatic)
          Creates a new field.
 Variable createVariable(VariableType type)
          Creates a new local variable.
 Set<Field> getFields()
          Returns a read-only view of the fields in the entire application.
 Set<Method> getMethods()
          Returns a read-only view of the methods in this application.
 String toDot(ReachingDefinitions rd, AliasAnalysis aa, OperationAssertionAnalysis ass, Set<Statement> hotspots)
          Returns Graphviz representation of this application.
 String toDot(ReachingDefinitions rd, AliasAnalysis aa, Set<Statement> hotspots)
          Returns Graphviz representation of this application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Application

public Application()
Constructs a new application from an array of methods. This will iterate all statements to find all fields used by the applicaton.

Method Detail

createField

public Field createField(VariableType type,
                         boolean isStatic)
Creates a new field.

Parameters:
type - type of the field
isStatic - whether the field is static
Returns:
a new field

createVariable

public Variable createVariable(VariableType type)
Creates a new local variable.

Parameters:
type - type of the variable
Returns:
a new variable

getFields

public Set<Field> getFields()
Returns a read-only view of the fields in the entire application.

Returns:
a read-only set, backed by the application.

getMethods

public Set<Method> getMethods()
Returns a read-only view of the methods in this application.

Returns:
an unmodifiable set of methods, backed by the application.

toDot

public String toDot(ReachingDefinitions rd,
                    AliasAnalysis aa,
                    OperationAssertionAnalysis ass,
                    Set<Statement> hotspots)
Returns Graphviz representation of this application.


toDot

public String toDot(ReachingDefinitions rd,
                    AliasAnalysis aa,
                    Set<Statement> hotspots)
Returns Graphviz representation of this application.



Copyright © 2003-2009 Anders Møller, Aske Simon Christensen, Asger Feldthaus.