|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExtensionInfo
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 |
ClassFile |
createClassFile(java.io.File classFileSource,
byte[] code)
Create class file |
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 |
---|
java.lang.String compilerName()
Version version()
Options getOptions()
Stats getStats()
void initCompiler(Compiler compiler)
Compiler compiler()
java.lang.String[] fileExtensions()
java.lang.String[] defaultFileExtensions()
java.lang.String defaultFileExtension()
TypeSystem typeSystem()
NodeFactory nodeFactory()
SourceLoader sourceLoader()
void addDependencyToCurrentJob(Source s)
SourceJob addJob(Source source)
Source source
has already been processed,
and its job discarded to release resources, then null
will be returned.
SourceJob addJob(Source source, Node ast)
Source source
has already been processed,
and its job discarded to release resources, then null
will be returned.
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()
.boolean runToCompletion()
boolean runToPass(Job job, Pass.ID goal) throws CyclicDependencyException
CyclicDependencyException
boolean runAllPasses(Job job)
boolean readSource(FileSource source)
TargetFactory targetFactory()
Parser parser(java.io.Reader reader, FileSource source, ErrorQueue eq)
java.util.List passes(Job job)
java.util.List passes(Job job, Pass.ID begin, Pass.ID end)
void beforePass(java.util.List passes, Pass.ID oldPass, Pass newPass)
void beforePass(java.util.List passes, Pass.ID oldPass, java.util.List newPasses)
void afterPass(java.util.List passes, Pass.ID oldPass, Pass newPass)
void afterPass(java.util.List passes, Pass.ID oldPass, java.util.List newPasses)
void replacePass(java.util.List passes, Pass.ID oldPass, Pass newPass)
void replacePass(java.util.List passes, Pass.ID oldPass, java.util.List newPasses)
void removePass(java.util.List passes, Pass.ID oldPass)
ClassFile createClassFile(java.io.File classFileSource, byte[] code)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |