polyglot.frontend
Class AbstractPass

java.lang.Object
  extended by polyglot.frontend.AbstractPass
All Implemented Interfaces:
Pass
Direct Known Subclasses:
BarrierPass, EmptyPass, OutputPass, ParserPass, PrettyPrintPass, SpawnPass, VisitorPass

public abstract class AbstractPass
extends java.lang.Object
implements Pass

The base class for most passes.


Nested Class Summary
 
Nested classes/interfaces inherited from interface polyglot.frontend.Pass
Pass.ID
 
Field Summary
protected  long exclusive_time
          If the pass is running, the time that the pass started.
protected  Pass.ID id
          The id of the pass.
protected  long inclusive_time
          If the pass is running, the time that the pass started.
 
Fields inherited from interface polyglot.frontend.Pass
ADD_MEMBERS, ADD_MEMBERS_ALL, BUILD_TYPES, BUILD_TYPES_ALL, CLEAN_SIGS, CLEAN_SUPER, CLEAN_SUPER_ALL, CONSTRUCTOR_CHECK, DISAM, DISAM_ALL, DUMP, EXC_CHECK, EXIT_CHECK, FIRST_BARRIER, FOLD, FWD_REF_CHECK, INIT_CHECK, OUTPUT, PARSE, PRE_OUTPUT_ALL, REACH_CHECK, SERIALIZE, SET_EXPECTED_TYPES, TYPE_CHECK
 
Constructor Summary
AbstractPass(Pass.ID id)
           
 
Method Summary
 long exclusiveTime()
          Return the time in ms taken to run the pass, excluding the time in spawned passes
 Pass.ID id()
          The id of the pass.
 long inclusiveTime()
          Return the time in ms taken to run the pass, including the time in spawned passes
 java.lang.String name()
          The human-readable name of the pass.
 void resetTimers()
          Reset the pass timer.
abstract  boolean run()
          Run the pass, returning true on success.
 void toggleTimers(boolean exclusive_only)
          Start or stop the pass timer.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected Pass.ID id
The id of the pass.


exclusive_time

protected long exclusive_time
If the pass is running, the time that the pass started. If the pass has completed, the time in ms the pass took to run, excluding spawned passes.


inclusive_time

protected long inclusive_time
If the pass is running, the time that the pass started. If the pass has completed, the time in ms the pass took to run, including spawned passes.

Constructor Detail

AbstractPass

public AbstractPass(Pass.ID id)
Method Detail

id

public Pass.ID id()
The id of the pass.

Specified by:
id in interface Pass

name

public java.lang.String name()
The human-readable name of the pass.

Specified by:
name in interface Pass

run

public abstract boolean run()
Run the pass, returning true on success.

Specified by:
run in interface Pass

toggleTimers

public void toggleTimers(boolean exclusive_only)
Start or stop the pass timer.

Specified by:
toggleTimers in interface Pass

resetTimers

public void resetTimers()
Reset the pass timer.

Specified by:
resetTimers in interface Pass

exclusiveTime

public long exclusiveTime()
Return the time in ms taken to run the pass, excluding the time in spawned passes

Specified by:
exclusiveTime in interface Pass

inclusiveTime

public long inclusiveTime()
Return the time in ms taken to run the pass, including the time in spawned passes

Specified by:
inclusiveTime in interface Pass

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object