public abstract class AbstractExtensionInfo extends java.lang.Object implements ExtensionInfo
ExtensionInfo
.Modifier and Type | Field and Description |
---|---|
protected ClassFileLoader |
classFileLoader |
protected Compiler |
compiler |
protected java.util.List<javax.tools.JavaFileManager.Location> |
default_locations |
protected FileManager |
extFM |
protected NodeFactory |
nf |
protected Scheduler |
scheduler |
protected Stats |
stats |
protected TargetFactory |
target_factory |
protected TypeSystem |
ts |
Constructor and Description |
---|
AbstractExtensionInfo() |
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() |
abstract java.lang.String |
compilerName()
The name of the compiler for usage messages
|
protected void |
configureFileManager() |
void |
configureFileManagerForPostCompiler()
Configure the file manager for the post-compiler.
|
ClassFile |
createClassFile(javax.tools.FileObject f,
byte[] code)
Create class file for a file object.
|
protected FileManager |
createFileManager() |
FileSource |
createFileSource(javax.tools.FileObject f,
boolean user)
Deprecated.
|
FileSource |
createFileSource(javax.tools.FileObject fo,
Source.Kind kind)
Create file source for a file object.
|
protected abstract NodeFactory |
createNodeFactory()
Create the node factory for this extension.
|
protected Options |
createOptions() |
protected abstract Scheduler |
createScheduler()
Create the scheduler for this extension.
|
protected abstract TypeSystem |
createTypeSystem()
Create the type system for this extension.
|
abstract 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.
|
abstract 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.
|
protected abstract void |
initTypeSystem()
Initialize the type system of this extension.
|
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.
|
abstract 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.
|
java.lang.String |
toString() |
TypeSystem |
typeSystem()
Produce a type system for this language extension.
|
abstract Version |
version()
Report the version of the extension.
|
protected Compiler compiler
protected TypeSystem ts
protected NodeFactory nf
protected TargetFactory target_factory
protected Stats stats
protected Scheduler scheduler
protected FileManager extFM
protected ClassFileLoader classFileLoader
protected java.util.List<javax.tools.JavaFileManager.Location> default_locations
public abstract Goal getCompileGoal(Job job)
ExtensionInfo
getCompileGoal
in interface ExtensionInfo
public abstract java.lang.String compilerName()
ExtensionInfo
compilerName
in interface ExtensionInfo
public abstract java.lang.String defaultFileExtension()
ExtensionInfo
defaultFileExtension
in interface ExtensionInfo
public abstract Version version()
ExtensionInfo
version
in interface ExtensionInfo
public Options getOptions()
ExtensionInfo
getOptions
in interface ExtensionInfo
protected Options createOptions()
public Stats getStats()
getStats
in interface ExtensionInfo
public Compiler compiler()
compiler
in interface ExtensionInfo
public void initCompiler(Compiler compiler)
ExtensionInfo
initCompiler
in interface ExtensionInfo
protected abstract void initTypeSystem()
public java.lang.String[] fileExtensions()
ExtensionInfo
fileExtensions
in interface ExtensionInfo
public java.lang.String[] defaultFileExtensions()
ExtensionInfo
defaultFileExtensions
in interface ExtensionInfo
public SourceLoader sourceLoader()
ExtensionInfo
sourceLoader
in interface ExtensionInfo
public TargetFactory targetFactory()
ExtensionInfo
targetFactory
in interface ExtensionInfo
protected abstract Scheduler createScheduler()
public Scheduler scheduler()
ExtensionInfo
scheduler
in interface ExtensionInfo
protected abstract TypeSystem createTypeSystem()
public TypeSystem typeSystem()
ExtensionInfo
typeSystem
in interface ExtensionInfo
protected abstract NodeFactory createNodeFactory()
public NodeFactory nodeFactory()
ExtensionInfo
nodeFactory
in interface ExtensionInfo
public JobExt jobExt()
ExtensionInfo
Job
class without subtyping.jobExt
in interface ExtensionInfo
public abstract Parser parser(java.io.Reader reader, FileSource source, ErrorQueue eq)
ExtensionInfo
parser
in interface ExtensionInfo
public java.lang.String toString()
toString
in class java.lang.Object
public ClassFile createClassFile(javax.tools.FileObject f, byte[] code) throws java.io.IOException
ExtensionInfo
createClassFile
in interface ExtensionInfo
java.io.IOException
@Deprecated public FileSource createFileSource(javax.tools.FileObject f, boolean user) throws java.io.IOException
ExtensionInfo
createFileSource
in interface ExtensionInfo
java.io.IOException
public FileSource createFileSource(javax.tools.FileObject fo, Source.Kind kind) throws java.io.IOException
ExtensionInfo
createFileSource
in interface ExtensionInfo
java.io.IOException
public FileManager extFileManager()
ExtensionInfo
extFileManager
in interface ExtensionInfo
protected FileManager createFileManager()
protected void configureFileManager() throws java.io.IOException
java.io.IOException
public void configureFileManagerForPostCompiler() throws java.io.IOException
configureFileManagerForPostCompiler
in interface ExtensionInfo
java.io.IOException
public ClassFileLoader classFileLoader()
ExtensionInfo
classFileLoader
in interface ExtensionInfo
public ToExt getToExt(ExtensionInfo to_ext, Node n)
ExtensionInfo
getToExt
in interface ExtensionInfo
public ExtensionInfo outputExtensionInfo()
ExtensionInfo
outputExtensionInfo
in interface ExtensionInfo
public void cleanup()
ExtensionInfo
cleanup
in interface ExtensionInfo
public java.util.List<javax.tools.JavaFileManager.Location> defaultLocations()
ExtensionInfo
defaultLocations
in interface ExtensionInfo