jltools.ext.jl
Class ExtensionInfo

java.lang.Object
  |
  +--jltools.ext.jl.ExtensionInfo
All Implemented Interfaces:
ExtensionInfo
Direct Known Subclasses:
ExtensionInfo

public class ExtensionInfo
extends java.lang.Object
implements ExtensionInfo

This is the default ExtensionInfo for the Java language. Compilation passes and visitors:

  1. parse
  2. build types (TypeBuilder)
  3. disambiguate types (TypeAmbiguityRemover)
  4. disambiguate (AmbiguityRemover)
  5. constant folding (ConstantFolder)
    BARRIER

  6. type checking (TypeChecker)
  7. exception checking (ExceptionChecker)
    BARRIER

  8. serialization (ClassSerializer), optional
  9. translation (Translator)


Inner Class Summary
protected static class ExtensionInfo.JLJob
          An implementation of the Job class.
 
Field Summary
protected  Compiler compiler
           
protected  NodeFactory nf
           
protected  Options options
           
protected  TypeSystem ts
           
 
Constructor Summary
ExtensionInfo()
           
 
Method Summary
 java.lang.String compilerName()
          The name of the compiler for usage messages
 Job createJob(Source s)
          Produce a job used to compile the given source.
protected  NodeFactory createNodeFactory()
          Create the node factory for this extension.
protected  TypeSystem createTypeSystem()
          Create the type system for this extension.
 java.lang.String fileExtension()
          The default extension that source files are expected to have
 void initCompiler(Compiler compiler)
          Initialize the extension with a particular compiler.
 NodeFactory nodeFactory()
          Produce a node factory for this language extension.
 java.lang.String options()
          Report the options accepted by the extension.
 int parseCommandLine(java.lang.String[] args, int index, Options options)
          By default, don't parse anything
 Parser parser(java.io.Reader reader, Job job)
          Get a parser for this language extension.
 void setOptions(Options options)
          Initialize the extension with the command-line options.
 SourceLoader sourceLoader()
          Produce a source factory for this language 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compiler

protected Compiler compiler

options

protected Options options

ts

protected TypeSystem ts

nf

protected NodeFactory nf
Constructor Detail

ExtensionInfo

public ExtensionInfo()
Method Detail

setOptions

public void setOptions(Options options)
                throws UsageError
Description copied from interface: ExtensionInfo
Initialize the extension with the command-line options. This must be called before any other method of the extension except the command-line parsing methods: compilerName() options() parseCommandLine()
Specified by:
setOptions in interface ExtensionInfo

initCompiler

public void initCompiler(Compiler compiler)
Description copied from interface: ExtensionInfo
Initialize the extension with a particular compiler. This must be called after the compiler is initialized, but before the compiler starts work.
Specified by:
initCompiler in interface ExtensionInfo

fileExtension

public java.lang.String fileExtension()
Description copied from interface: ExtensionInfo
The default extension that source files are expected to have
Specified by:
fileExtension in interface ExtensionInfo

compilerName

public java.lang.String compilerName()
Description copied from interface: ExtensionInfo
The name of the compiler for usage messages
Specified by:
compilerName in interface ExtensionInfo

options

public java.lang.String options()
Description copied from interface: ExtensionInfo
Report the options accepted by the extension. Output is newline-terminated if non-empty.
Specified by:
options in interface ExtensionInfo

version

public Version version()
Description copied from interface: ExtensionInfo
Report the version of the extension.
Specified by:
version in interface ExtensionInfo

parseCommandLine

public int parseCommandLine(java.lang.String[] args,
                            int index,
                            Options options)
                     throws UsageError
By default, don't parse anything
Specified by:
parseCommandLine in interface ExtensionInfo

createTypeSystem

protected TypeSystem createTypeSystem()
Create the type system for this extension.

typeSystem

public TypeSystem typeSystem()
Description copied from interface: ExtensionInfo
Produce a type system for this language extension.
Specified by:
typeSystem in interface ExtensionInfo

sourceLoader

public SourceLoader sourceLoader()
Description copied from interface: ExtensionInfo
Produce a source factory for this language extension.
Specified by:
sourceLoader in interface ExtensionInfo

createJob

public Job createJob(Source s)
Description copied from interface: ExtensionInfo
Produce a job used to compile the given source.
Specified by:
createJob in interface ExtensionInfo

targetFactory

public TargetFactory targetFactory()
Description copied from interface: ExtensionInfo
Produce a target factory for this language extension.
Specified by:
targetFactory in interface ExtensionInfo

createNodeFactory

protected NodeFactory createNodeFactory()
Create the node factory for this extension.

nodeFactory

public NodeFactory nodeFactory()
Description copied from interface: ExtensionInfo
Produce a node factory for this language extension.
Specified by:
nodeFactory in interface ExtensionInfo

parser

public Parser parser(java.io.Reader reader,
                     Job job)
Description copied from interface: ExtensionInfo
Get a parser for this language extension.
Specified by:
parser in interface ExtensionInfo