ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

escjava.translate
Class Purity

java.lang.Object
  extended byescjava.translate.Purity

public abstract class Purity
extends java.lang.Object


Field Summary
(package private) static ASTDecoration translateDecoration
          Decorates VarInit nodes with purity information.
 
Constructor Summary
Purity()
           
 
Method Summary
static void decorate(VarInit expr)
          Decorate expr and its subexpressions with purity information.
static boolean impure(VarInit expr)
          Return true iff expr or any of its subexpressions mutates the heap or local variables.
private static void makeImpure(VarInit expr)
          Set the decoration indicating the expr is impure.
static boolean pure(VarInit expr)
          Return true iff neither expr nor any of its subexpressions mutate the heap or local variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

translateDecoration

static ASTDecoration translateDecoration
Decorates VarInit nodes with purity information. Null means a VarInit is pure; non-null means it's impure. Also used by Translate class to decorate LocalVarDecls marked with "uninitialized" with the declaration of the corresponding boolean that keeps track of the variable's initialization state.

Constructor Detail

Purity

public Purity()
Method Detail

impure

public static boolean impure(VarInit expr)
Return true iff expr or any of its subexpressions mutates the heap or local variables. Requires that expr or an expression containing it has been decorated by a call to decorate.


pure

public static boolean pure(VarInit expr)
Return true iff neither expr nor any of its subexpressions mutate the heap or local variables. Requires that expr or an expression containing it has been decorated by a call to decorate.


makeImpure

private static void makeImpure(VarInit expr)
Set the decoration indicating the expr is impure.


decorate

public static void decorate(VarInit expr)
Decorate expr and its subexpressions with purity information.


ESC/Java2
© 2003,2004,2005 David Cok and Joseph Kiniry
© 2005 UCD Dublin
© 2003,2004 Radboud University Nijmegen
© 1999,2000 Compaq Computer Corporation
© 1997,1998,1999 Digital Equipment Corporation
All Rights Reserved

The ESC/Java2 Project Homepage