polyglot.frontend.goals
Interface Goal

All Known Subinterfaces:
EndGoal
All Known Implementing Classes:
AbstractGoal, Barrier, ClassTypeGoal, CodeGenerated, ConstantsChecked, ConstantsCheckedForFile, ConstructorCallsChecked, Disambiguated, ExceptionsChecked, ExitPathsChecked, FieldConstantsChecked, ForwardReferencesChecked, ImportTableInitialized, InitializationsChecked, MembersAdded, Parsed, ReachabilityChecked, Scheduler.TheEndGoal, Serialized, SignaturesDisambiguated, SignaturesResolved, SourceFileGoal, SupertypesDisambiguated, SupertypesResolved, TypeChecked, TypeExists, TypesInitialized, TypesInitializedForCommandLine, VisitorGoal

public interface Goal

Comment for Goal

Author:
nystrom

Field Summary
static int ATTEMPTED
           
static int REACHED
           
static int RUNNING
           
static int UNREACHABLE
           
static int UNREACHABLE_THIS_RUN
           
static int UNREACHED
           
 
Method Summary
 void addCorequisiteGoal(Goal g, Scheduler scheduler)
          Add a new corequisite subgoal g.
 void addPrerequisiteGoal(Goal g, Scheduler scheduler)
          Add a new subgoal g.
 boolean conflictsWith(Goal goal)
          Return true if this goal conflicts with the other; that is passes running over both goals could access the same data.
 java.util.Collection corequisiteGoals(Scheduler scheduler)
          Goals on which this goal may mutually depend.
 Pass createPass(ExtensionInfo extInfo)
          Create a pass that will attempt to reach the goal.
 boolean hasBeenReached()
          Return true if this goal has been reached.
 boolean isReachable()
          Return true if this goal is reachable.
 Job job()
          Get the job associated with this goal, or null.
 java.lang.String name()
          Get the name of the goal for debugging.
 java.util.Collection prerequisiteGoals(Scheduler scheduler)
          Goals that must be completed before attempting this goal.
 void setState(int state)
           
 void setUnreachable()
          Set a flag indicating that this rule is unreachable.
 void setUnreachableThisRun()
          Mark the goal as reached or not reached.
 int state()
           
 

Field Detail

UNREACHABLE

static final int UNREACHABLE
See Also:
Constant Field Values

UNREACHABLE_THIS_RUN

static final int UNREACHABLE_THIS_RUN
See Also:
Constant Field Values

UNREACHED

static final int UNREACHED
See Also:
Constant Field Values

ATTEMPTED

static final int ATTEMPTED
See Also:
Constant Field Values

REACHED

static final int REACHED
See Also:
Constant Field Values

RUNNING

static final int RUNNING
See Also:
Constant Field Values
Method Detail

conflictsWith

boolean conflictsWith(Goal goal)
Return true if this goal conflicts with the other; that is passes running over both goals could access the same data.


createPass

Pass createPass(ExtensionInfo extInfo)
Create a pass that will attempt to reach the goal. Note that the goal may not be reached even if the pass succeeds. In this case, the scheduler will create another pass and try again.


corequisiteGoals

java.util.Collection corequisiteGoals(Scheduler scheduler)
Goals on which this goal may mutually depend. If the passes for all corequisite goals are run (possibly more than once) they should all eventually be reached.


prerequisiteGoals

java.util.Collection prerequisiteGoals(Scheduler scheduler)
Goals that must be completed before attempting this goal. The graph of dependencies between prerequisite goals should be acyclic.


addCorequisiteGoal

void addCorequisiteGoal(Goal g,
                        Scheduler scheduler)
Add a new corequisite subgoal g. g is a goal on which this goal mutually depends. The caller must be careful to ensure that all corequisite goals can be eventually reached. g should be interned.


addPrerequisiteGoal

void addPrerequisiteGoal(Goal g,
                         Scheduler scheduler)
                         throws CyclicDependencyException
Add a new subgoal g. g must be completed before this goal is attempted. g should be interned.

Throws:
CyclicDependencyException - if a prerequisite of g is this

isReachable

boolean isReachable()
Return true if this goal is reachable.


setUnreachable

void setUnreachable()
Set a flag indicating that this rule is unreachable.


setUnreachableThisRun

void setUnreachableThisRun()
Mark the goal as reached or not reached.


setState

void setState(int state)

state

int state()

hasBeenReached

boolean hasBeenReached()
Return true if this goal has been reached.


job

Job job()
Get the job associated with this goal, or null.


name

java.lang.String name()
Get the name of the goal for debugging.