|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.grogra.pf.io.FilterBase de.grogra.rgg.model.XLFilter
public class XLFilter
An 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface de.grogra.pf.io.FilterSource |
---|
FilterSource.MetaDataKey<V> |
Nested classes/interfaces inherited from interface de.grogra.util.Map |
---|
Map.Chain |
Field Summary | |
---|---|
static boolean |
DUMP_TREE
|
Fields inherited from class de.grogra.pf.io.FilterBase |
---|
item, source |
Fields inherited from interface de.grogra.pf.io.FilterSource |
---|
AUTO_PROGRESS, DESTINATION_FILE, DESTINATION_URL |
Fields inherited from interface de.grogra.util.Map |
---|
DEFAULT_VALUE, EMPTY_MAP |
Constructor Summary | |
---|---|
XLFilter(FilterItem item,
ReaderSource source)
Constructs a new filter which transforms the input source
into an instance of CompilationUnit which can be compiled afterwards. |
Method Summary | |
---|---|
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()
|
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. |
Methods inherited from class de.grogra.pf.io.FilterBase |
---|
get, getFilter, getFlavor, getImpl, getMetaData, getRegistry, getSource, getSystemId, initProgressMonitor, setFlavor, setMetaData, setMetaData, setProgress, setSystemId, toString, toURL |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.grogra.pf.io.FilterSource |
---|
getFilter, getFlavor, getMetaData, getSystemId, initProgressMonitor, setMetaData, setProgress |
Methods inherited from interface de.grogra.pf.registry.RegistryContext |
---|
getRegistry |
Field Detail |
---|
public static boolean DUMP_TREE
Constructor Detail |
---|
public 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 null
source
- the source from which the input stream of characters will be readgetObject()
,
compile()
Method Detail |
---|
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 types
input
- 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 input
t
protected 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 interfaces
path
java.lang.ClassNotFoundException
getPackageImports()
,
getMemberTypeImports()
,
getSingleTypeImports()
,
getStaticTypeImports()
public static de.grogra.xl.compiler.ASMTypeLoader getLoaderForAll()
protected java.lang.Class[] getMemberTypeImports()
import java.awt.PageAttributes.*;
).
public de.grogra.xl.compiler.CompilationUnit getObject() throws java.io.IOException
ObjectSource
getObject
in interface ObjectSource
java.io.IOException
protected 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.ClassNotFoundException
protected java.lang.Class[] getStaticTypeImports() throws java.lang.ClassNotFoundException
import static java.lang.Math.*;
).
java.lang.ClassNotFoundException
protected boolean isD2FWidening()
double
to
float
should be considered as widening, i.e.,
should be done automatically if required.
double
to float
?
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |