|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ExtensionInfo
is the main interface for defining language
extensions. The frontend will load the ExtensionInfo
specified on the command-line. It defines the type system, AST node
factory, parser, and other parameters of a language extension.
Method Summary | |
void |
addDependencyToCurrentJob(Source s)
Adds a dependency from the current job to the given Source. |
SourceJob |
addJob(Source source)
Produce a job for the given source. |
SourceJob |
addJob(Source source,
Node ast)
Produce a job for a given source using the given AST. |
void |
afterPass(java.util.List passes,
Pass.ID oldPass,
java.util.List newPasses)
Add a list of passes after an existing pass. |
void |
afterPass(java.util.List passes,
Pass.ID oldPass,
Pass newPass)
Add a pass after an existing pass. |
void |
beforePass(java.util.List passes,
Pass.ID oldPass,
java.util.List newPasses)
Add a list of passes before an existing pass. |
void |
beforePass(java.util.List passes,
Pass.ID oldPass,
Pass newPass)
Add a pass before an existing pass. |
Compiler |
compiler()
|
java.lang.String |
compilerName()
The name of the compiler for usage messages |
java.lang.String |
defaultFileExtension()
The default extension that source files are expected to have. |
java.lang.String[] |
defaultFileExtensions()
The default extensions that source files are expected to have. |
java.lang.String[] |
fileExtensions()
The extensions that source files are expected to have. |
Options |
getOptions()
Return an Options object, which will be given the command line to parse. |
Stats |
getStats()
Return a Stats object to accumulate and report statistics. |
void |
initCompiler(Compiler compiler)
Initialize the extension with a particular compiler. |
NodeFactory |
nodeFactory()
Produce a node factory for this language extension. |
Parser |
parser(java.io.Reader reader,
FileSource source,
ErrorQueue eq)
Get a parser for this language extension. |
java.util.List |
passes(Job job)
Get the list of passes for a given source job. |
java.util.List |
passes(Job job,
Pass.ID begin,
Pass.ID end)
Get the sublist of passes for a given job. |
boolean |
readSource(FileSource source)
Read a source file and compile up to the current job's barrier. |
void |
removePass(java.util.List passes,
Pass.ID oldPass)
Remove a pass. |
void |
replacePass(java.util.List passes,
Pass.ID oldPass,
java.util.List newPasses)
Replace an existing pass with a list of new passes. |
void |
replacePass(java.util.List passes,
Pass.ID oldPass,
Pass newPass)
Replace an existing pass with a new pass. |
boolean |
runAllPasses(Job job)
Run the given job to completion. |
boolean |
runToCompletion()
Run all jobs to completion. |
boolean |
runToPass(Job job,
Pass.ID goal)
Run the given job up to a given pass. |
SourceLoader |
sourceLoader()
Produce a source factory for this language extension. |
Job |
spawnJob(Context c,
Node ast,
Job outerJob,
Pass.ID begin,
Pass.ID end)
Spawn a new job. |
TargetFactory |
targetFactory()
Produce a target factory for this language extension. |
TypeSystem |
typeSystem()
Produce a type system for this language extension. |
Version |
version()
Report the version of the extension. |
Method Detail |
public java.lang.String compilerName()
public Version version()
public Options getOptions()
public Stats getStats()
public void initCompiler(Compiler compiler)
public Compiler compiler()
public java.lang.String[] fileExtensions()
public java.lang.String[] defaultFileExtensions()
public java.lang.String defaultFileExtension()
public TypeSystem typeSystem()
public NodeFactory nodeFactory()
public SourceLoader sourceLoader()
public void addDependencyToCurrentJob(Source s)
public SourceJob addJob(Source source)
Source source
has already been processed,
and its job discarded to release resources, then null
will be returned.
public SourceJob addJob(Source source, Node ast)
Source source
has already been processed,
and its job discarded to release resources, then null
will be returned.
public Job spawnJob(Context c, Node ast, Job outerJob, Pass.ID begin, Pass.ID end)
begin
and end
inclusive will be performed immediately on
the AST ast
.
c
- the context that the AST occurs inast
- the AST the new Job is for.outerJob
- the Job
that spawned this job.begin
- the first pass to perform for this job.end
- the last pass to perform for this job.
j.status()
and get the ast with j.ast()
.public boolean runToCompletion()
public boolean runToPass(Job job, Pass.ID goal)
public boolean runAllPasses(Job job)
public boolean readSource(FileSource source)
public TargetFactory targetFactory()
public Parser parser(java.io.Reader reader, FileSource source, ErrorQueue eq)
public java.util.List passes(Job job)
public java.util.List passes(Job job, Pass.ID begin, Pass.ID end)
public void beforePass(java.util.List passes, Pass.ID oldPass, Pass newPass)
public void beforePass(java.util.List passes, Pass.ID oldPass, java.util.List newPasses)
public void afterPass(java.util.List passes, Pass.ID oldPass, Pass newPass)
public void afterPass(java.util.List passes, Pass.ID oldPass, java.util.List newPasses)
public void replacePass(java.util.List passes, Pass.ID oldPass, Pass newPass)
public void replacePass(java.util.List passes, Pass.ID oldPass, java.util.List newPasses)
public void removePass(java.util.List passes, Pass.ID oldPass)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |