de.grogra.rgg.model
public class XLFilter extends FilterBase implements ObjectSource
XLFilter parses a character stream representing XL source
code into a CompilationUnit. The auxiliary method
compile() automatically compiles the resulting compilation unit
into the contained types.FilterSource.MetaDataKey<V>| Modifier and Type | Field and Description |
|---|---|
static boolean |
DUMP_TREE |
item, sourceAUTO_PROGRESS, DESTINATION_FILE, DESTINATION_URLDEFAULT_VALUE, EMPTY_MAP| Constructor and Description |
|---|
XLFilter(FilterItem item,
ReaderSource source)
Constructs a new filter which transforms the input
source
into an instance of CompilationUnit which can be compiled afterwards. |
| Modifier and Type | Method and Description |
|---|---|
Type[] |
compile()
Compiles the source of this filter into an array of the types
which are declared by the source.
|
static Type[] |
compile(java.io.Reader input,
java.lang.String systemId)
This auxiliary method compiles the source code of
input
to an array of types |
protected de.grogra.xl.parser.Parser |
createParser(Tokenizer t)
Creates the parser which will subsequently be used to parse the token stream
resulting from
t into an abstract syntax tree. |
protected Tokenizer |
createTokenizer()
Creates the tokenizer to be used for scanning of the source.
|
protected java.lang.String |
getClassName()
Derives a legal class name from the sytem id of the source.
|
protected ObjectList<Annotation> |
getEnclosingAnnotations() |
protected de.grogra.xl.compiler.scope.Scope |
getImports(de.grogra.xl.compiler.scope.ClassPath path)
Constructs the scope which includes all automatic imports.
|
static de.grogra.xl.compiler.ASMTypeLoader |
getLoaderForAll() |
static de.grogra.xl.compiler.ASMTypeLoader |
getLoaderForRegistry(RegistryContext ctx) |
protected java.lang.Class[] |
getMemberTypeImports()
Defines the automatic member type imports
(e.g.,
import java.awt.PageAttributes. |
de.grogra.xl.compiler.CompilationUnit |
getObject()
Returns the data as an object of a class which is compatible which
the flavor.
|
protected java.lang.String[] |
getPackageImports()
Defines the automatic package imports
(e.g.,
import java.lang. |
protected java.lang.Class[] |
getSingleTypeImports()
Defines the automatic single type imports
(e.g.,
import java.util.Map;). |
protected java.lang.Class[] |
getStaticTypeImports()
Defines the automatic static type imports
(e.g.,
import static java.lang.Math. |
protected boolean |
isD2FWidening()
Defines whether the conversion from
double to
float should be considered as widening, i.e.,
should be done automatically if required. |
get, getFilter, getFlavor, getImpl, getMetaData, getRegistry, getSource, getSystemId, initProgressMonitor, setFlavor, setMetaData, setMetaData, setProgress, setSystemId, toString, toURLclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFilter, getFlavor, getMetaData, getSystemId, initProgressMonitor, setMetaData, setProgressgetRegistrypublic XLFilter(FilterItem item, ReaderSource source)
source
into an instance of CompilationUnit which can be compiled afterwards.item - the defining item for this filter within the registry, may be nullsource - the source from which the input stream of characters will be readgetObject(),
compile()public Type[] compile() throws java.io.IOException
Class objects, i.e., they
represent true classes loaded by the Java virtual machine.java.io.IOException - if source cannot be read or if there is a
lexical, syntactic or semantic errorpublic static Type[] compile(java.io.Reader input, java.lang.String systemId) throws java.io.IOException
input
to an array of typesinput - systemId - java.io.IOException - if source cannot be read or if there is a
lexical, syntactic or semantic errorcompile()protected de.grogra.xl.parser.Parser createParser(Tokenizer t)
t into an abstract syntax tree.t - token stream inputtprotected Tokenizer createTokenizer()
protected java.lang.String getClassName()
protected ObjectList<Annotation> getEnclosingAnnotations()
protected de.grogra.xl.compiler.scope.Scope getImports(de.grogra.xl.compiler.scope.ClassPath path)
throws java.lang.ClassNotFoundException
path - class path which defines the existing classes and interfacespathjava.lang.ClassNotFoundExceptiongetPackageImports(),
getMemberTypeImports(),
getSingleTypeImports(),
getStaticTypeImports()public static de.grogra.xl.compiler.ASMTypeLoader getLoaderForAll()
public static de.grogra.xl.compiler.ASMTypeLoader getLoaderForRegistry(RegistryContext ctx)
protected java.lang.Class[] getMemberTypeImports()
import java.awt.PageAttributes.*;).public de.grogra.xl.compiler.CompilationUnit getObject()
throws java.io.IOException
ObjectSourcegetObject in interface ObjectSourcejava.io.IOExceptionprotected java.lang.String[] getPackageImports()
import java.lang.*;).
The implementation of
XLFilter returns {"java.lang"}.protected java.lang.Class[] getSingleTypeImports()
throws java.lang.ClassNotFoundException
import java.util.Map;).java.lang.ClassNotFoundExceptionprotected java.lang.Class[] getStaticTypeImports()
throws java.lang.ClassNotFoundException
import static java.lang.Math.*;).java.lang.ClassNotFoundExceptionprotected boolean isD2FWidening()
double to
float should be considered as widening, i.e.,
should be done automatically if required.double to float?