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.Modifier and Type | Method and Description |
---|---|
ClassFileLoader |
classFileLoader()
Produce a class factory for this language extension.
|
void |
cleanup()
Delete cached types and source files to reduce memory footprint.
|
Compiler |
compiler() |
java.lang.String |
compilerName()
The name of the compiler for usage messages
|
void |
configureFileManagerForPostCompiler()
Configure the filemanger for the post-compilation phase.
|
ClassFile |
createClassFile(javax.tools.FileObject f,
byte[] code)
Create class file for a file object.
|
FileSource |
createFileSource(javax.tools.FileObject fo,
boolean userSpecified)
Deprecated.
Use
#createFileSource(FileObject, Kind) instead. |
FileSource |
createFileSource(javax.tools.FileObject fo,
Source.Kind kind)
Create file source for a file object.
|
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.util.List<javax.tools.JavaFileManager.Location> |
defaultLocations()
The set of locations to search for packages and class files when
otherwise unspecified.
|
FileManager |
extFileManager()
Get the extension file mananger used by this extension.
|
java.lang.String[] |
fileExtensions()
Get the file name extension of source files.
|
Goal |
getCompileGoal(Job job)
Return the goal for compiling a particular compilation unit.
|
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.
|
ToExt |
getToExt(ExtensionInfo to_ext,
Node n)
Get the ToExt extension object used for translating AST nodes to the
to_ext language.
|
void |
initCompiler(Compiler compiler)
Initialize the extension with a particular compiler.
|
JobExt |
jobExt()
Get the job extension for this language extension.
|
NodeFactory |
nodeFactory()
Produce a node factory for this language extension.
|
ExtensionInfo |
outputExtensionInfo()
Produce an extension info object for the output language this extension
translates to.
|
Parser |
parser(java.io.Reader reader,
FileSource source,
ErrorQueue eq)
Get a parser for this language extension.
|
Scheduler |
scheduler()
Returns the pass scheduler.
|
SourceLoader |
sourceLoader()
Get the source file loader for this extension.
|
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.
|
java.lang.String compilerName()
Version version()
Scheduler scheduler()
Goal getCompileGoal(Job job)
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()
JobExt jobExt()
Job
class without subtyping.TargetFactory targetFactory()
Parser parser(java.io.Reader reader, FileSource source, ErrorQueue eq)
ToExt getToExt(ExtensionInfo to_ext, Node n)
FileManager extFileManager()
void configureFileManagerForPostCompiler() throws java.io.IOException
java.io.IOException
ClassFile createClassFile(javax.tools.FileObject f, byte[] code) throws java.io.IOException
java.io.IOException
@Deprecated FileSource createFileSource(javax.tools.FileObject fo, boolean userSpecified) throws java.io.IOException
#createFileSource(FileObject, Kind)
instead.java.io.IOException
FileSource createFileSource(javax.tools.FileObject fo, Source.Kind kind) throws java.io.IOException
java.io.IOException
ClassFileLoader classFileLoader()
ExtensionInfo outputExtensionInfo()
void cleanup()
java.util.List<javax.tools.JavaFileManager.Location> defaultLocations()