polyglot.frontend
Interface Pass

All Known Implementing Classes:
AbstractPass, BarrierPass, EmptyPass, GlobalBarrierPass, OutputPass, ParserPass, PrettyPrintPass, SpawnPass, VisitorPass

public interface Pass

A Pass represents a compiler pass. A Job runs a series of passes over the AST. Each pass has an ID that is used to identify similar passes across several jobs. For example, most jobs contain a pass named PARSE that returns an AST for a source file and a pass TYPE_CHECK that performs type checking on the job's AST.


Nested Class Summary
static class Pass.ID
          Pass identifiers.
 
Field Summary
static Pass.ID ADD_MEMBERS
          ID of the add-members pass.
static Pass.ID ADD_MEMBERS_ALL
          ID of the barrier after add-members.
static Pass.ID BUILD_TYPES
          ID of the build-types pass.
static Pass.ID BUILD_TYPES_ALL
          ID of the barrier after build-types.
static Pass.ID CLEAN_SIGS
          ID of the clean-sigs pass.
static Pass.ID CLEAN_SUPER
          ID of the clean-super pass.
static Pass.ID CLEAN_SUPER_ALL
          ID of the barrier after clean-super.
static Pass.ID CONSTRUCTOR_CHECK
          ID of the constructor-check pass.
static Pass.ID DISAM
          ID of the disambiguate pass.
static Pass.ID DISAM_ALL
          ID of the barrier after disam.
static Pass.ID DUMP
          ID of the AST dumper pass.
static Pass.ID EXC_CHECK
          ID of the exception-check pass.
static Pass.ID EXIT_CHECK
          ID of the exit-check pass.
static Pass.ID FIRST_BARRIER
          ID of the first barrier pass.
static Pass.ID FOLD
          ID of the constant-fold pass.
static Pass.ID FWD_REF_CHECK
          ID of the forward-reference-check pass.
static Pass.ID INIT_CHECK
          ID of the initialization-check pass.
static Pass.ID OUTPUT
          ID of the output pass.
static Pass.ID PARSE
          ID of the parser pass.
static Pass.ID PRE_OUTPUT_ALL
          ID of the barrier before output.
static Pass.ID REACH_CHECK
          ID of the reachability-check pass.
static Pass.ID SERIALIZE
          ID of the class serialzation pass.
static Pass.ID SET_EXPECTED_TYPES
          ID of the set-expected-types pass.
static Pass.ID TYPE_CHECK
          ID of the type-check pass.
 
Method Summary
 long exclusiveTime()
          The total accumulated time in ms since the last timer reset that the pass was running, excluding spawned passes.
 Pass.ID id()
          Return the identifier for the pass.
 long inclusiveTime()
          The total accumulated time in ms since the last timer reset that the pass was running, including spawned passes.
 java.lang.String name()
          Return a user-readable name for the pass.
 void resetTimers()
          Reset the pass timers to 0.
 boolean run()
          Run the pass.
 void toggleTimers(boolean exclusive_only)
          Start/stop the pass timers.
 

Field Detail

PARSE

static final Pass.ID PARSE
ID of the parser pass. See Parser.


BUILD_TYPES

static final Pass.ID BUILD_TYPES
ID of the build-types pass. See TypeBuilder.


BUILD_TYPES_ALL

static final Pass.ID BUILD_TYPES_ALL
ID of the barrier after build-types.


CLEAN_SUPER

static final Pass.ID CLEAN_SUPER
ID of the clean-super pass. See AmbiguityRemover.


CLEAN_SUPER_ALL

static final Pass.ID CLEAN_SUPER_ALL
ID of the barrier after clean-super.


CLEAN_SIGS

static final Pass.ID CLEAN_SIGS
ID of the clean-sigs pass. See AmbiguityRemover.


ADD_MEMBERS

static final Pass.ID ADD_MEMBERS
ID of the add-members pass. See AddMemberVisitor.


ADD_MEMBERS_ALL

static final Pass.ID ADD_MEMBERS_ALL
ID of the barrier after add-members.


DISAM

static final Pass.ID DISAM
ID of the disambiguate pass. See AmbiguityRemover.


DISAM_ALL

static final Pass.ID DISAM_ALL
ID of the barrier after disam.


TYPE_CHECK

static final Pass.ID TYPE_CHECK
ID of the type-check pass. See TypeChecker.


SET_EXPECTED_TYPES

static final Pass.ID SET_EXPECTED_TYPES
ID of the set-expected-types pass. See AscriptionVisitor.


EXC_CHECK

static final Pass.ID EXC_CHECK
ID of the exception-check pass. See ExceptionChecker.


FOLD

static final Pass.ID FOLD
ID of the constant-fold pass. See ConstantFolder.


INIT_CHECK

static final Pass.ID INIT_CHECK
ID of the initialization-check pass. See InitChecker.


CONSTRUCTOR_CHECK

static final Pass.ID CONSTRUCTOR_CHECK
ID of the constructor-check pass. See ConstructorChecker.


FWD_REF_CHECK

static final Pass.ID FWD_REF_CHECK
ID of the forward-reference-check pass. See FwdReferenceChecker.


REACH_CHECK

static final Pass.ID REACH_CHECK
ID of the reachability-check pass. See ReachChecker.


EXIT_CHECK

static final Pass.ID EXIT_CHECK
ID of the exit-check pass. See ExitChecker.


DUMP

static final Pass.ID DUMP
ID of the AST dumper pass. See DumpAST.


PRE_OUTPUT_ALL

static final Pass.ID PRE_OUTPUT_ALL
ID of the barrier before output.


SERIALIZE

static final Pass.ID SERIALIZE
ID of the class serialzation pass. See ClassSerializer.


OUTPUT

static final Pass.ID OUTPUT
ID of the output pass. See OutputPass.


FIRST_BARRIER

static final Pass.ID FIRST_BARRIER
ID of the first barrier pass.

Method Detail

id

Pass.ID id()
Return the identifier for the pass. The identifier should be unique within the pass's Job.


name

java.lang.String name()
Return a user-readable name for the pass.


run

boolean run()
Run the pass.


resetTimers

void resetTimers()
Reset the pass timers to 0.


toggleTimers

void toggleTimers(boolean exclusive_only)
Start/stop the pass timers.


inclusiveTime

long inclusiveTime()
The total accumulated time in ms since the last timer reset that the pass was running, including spawned passes.


exclusiveTime

long exclusiveTime()
The total accumulated time in ms since the last timer reset that the pass was running, excluding spawned passes.