polyglot.frontend
Class Job

java.lang.Object
  extended by polyglot.frontend.Job

public class Job
extends java.lang.Object

A Job encapsulates work done by the compiler for a single compilation unit. A Job contains all information for a particular compilation unit carried between phases of the compiler. Only one pass should be run over a job at a time. TODO: The class should probably be renamed to, say, CompilationUnit.


Field Summary
protected  Node ast
          The AST constructed from the source file.
protected  JobExt ext
          Field used for storing extension-specific information.
protected  int initialErrorCount
          Initial count of errors before running the current pass over the job.
protected  ExtensionInfo lang
          The language extension used for this job.
protected  boolean reportedErrors
          True if the the job has reported an error.
protected  Pass runningPass
          The pass currently running over the job, or null.
protected  Source source
          The Source that this Job represents.
protected  boolean status
          True if all passes run so far have been successful.
 
Constructor Summary
Job(ExtensionInfo lang, JobExt ext, Source source, Node ast)
           
 
Method Summary
 Node ast()
          Get the state's AST.
 void ast(Node ast)
          Set the state's AST.
 Compiler compiler()
           
 void dump(CodeWriter cw)
           
 boolean equals(java.lang.Object o)
           
 JobExt ext()
           
 ExtensionInfo extensionInfo()
           
 int hashCode()
           
 boolean isRunning()
           
 boolean reportedErrors()
          True if some pass reported an error.
 Pass runningPass()
           
 void setRunningPass(Pass pass)
           
 Source source()
          Return the Source associated with the SourceJob returned by sourceJob.
 boolean status()
           
 java.lang.String toString()
           
 void updateStatus(boolean status)
           
 boolean userSpecified()
          Returns whether the source for this job was explicitly specified by the user, or if it was drawn into the compilation process due to some dependency.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ext

protected JobExt ext
Field used for storing extension-specific information.


lang

protected ExtensionInfo lang
The language extension used for this job.


ast

protected Node ast
The AST constructed from the source file.


runningPass

protected Pass runningPass
The pass currently running over the job, or null.


status

protected boolean status
True if all passes run so far have been successful.


initialErrorCount

protected int initialErrorCount
Initial count of errors before running the current pass over the job.


reportedErrors

protected boolean reportedErrors
True if the the job has reported an error.


source

protected Source source
The Source that this Job represents.

Constructor Detail

Job

public Job(ExtensionInfo lang,
           JobExt ext,
           Source source,
           Node ast)
Method Detail

ext

public JobExt ext()

setRunningPass

public void setRunningPass(Pass pass)

isRunning

public boolean isRunning()

runningPass

public Pass runningPass()

ast

public Node ast()
Get the state's AST.


ast

public void ast(Node ast)
Set the state's AST.


reportedErrors

public boolean reportedErrors()
True if some pass reported an error.


dump

public void dump(CodeWriter cw)

source

public Source source()
Return the Source associated with the SourceJob returned by sourceJob.


userSpecified

public boolean userSpecified()
Returns whether the source for this job was explicitly specified by the user, or if it was drawn into the compilation process due to some dependency.


updateStatus

public void updateStatus(boolean status)

status

public boolean status()

extensionInfo

public ExtensionInfo extensionInfo()

compiler

public Compiler compiler()

toString

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object