public class Job
extends java.lang.Object
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.Modifier and Type | Field and Description |
---|---|
protected Node |
ast
The AST constructed from the source file.
|
static Job |
COMPLETED
Global constant representing a job that has been completed.
|
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 and Description |
---|
Job(ExtensionInfo lang,
JobExt ext,
Source source,
Node ast) |
Modifier and Type | Method and Description |
---|---|
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.
|
protected JobExt ext
protected ExtensionInfo lang
protected Node ast
protected Pass runningPass
protected boolean status
protected int initialErrorCount
protected boolean reportedErrors
protected Source source
Source
that this Job
represents.public static final Job COMPLETED
public Job(ExtensionInfo lang, JobExt ext, Source source, Node ast)
public JobExt ext()
public void setRunningPass(Pass pass)
public boolean isRunning()
public Pass runningPass()
public Node ast()
public void ast(Node ast)
public boolean reportedErrors()
public void dump(CodeWriter cw)
public Source source()
Source
associated with the
SourceJob
returned by sourceJob
.public boolean userSpecified()
public void updateStatus(boolean status)
public boolean status()
public ExtensionInfo extensionInfo()
public Compiler compiler()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object