public class MyCompiler extends java.lang.Object implements MyCompilerAPI
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
inferencelog |
private Menge<SourceFile> |
m_AbstractSyntaxTree
Der abstrake Syntaxbaum
Autor: J�rg B�uerle |
static int |
NO_LINENUMBER |
protected java.lang.String |
OutputDir |
Menge<Pair> |
testPair |
| Modifier | Constructor and Description |
|---|---|
private |
MyCompiler()
Author: J�rg B�uerle
Der private Konstruktor. |
| Modifier and Type | Method and Description |
|---|---|
static MyCompilerAPI |
getAPI(LoggerConfiguration loggerConfig)
Author: Jörg Bäuerle
Stellt eine neue Instanz der CompilerAPI zur Verf�gung. |
java.lang.String |
getOutputDir()
Author: Juergen Schmiing
Gibt das Ausgabeverzeichnis fuer die class-Files zurueck. |
void |
init()
Author: J�rg B�uerle
Initialisiert den Compiler |
static void |
main(java.lang.String[] args)
Die Main-Funktion, �ber die der Compiler auch per Konsole gestartet
werden kann.
|
private TypeAssumptions |
makeFunNAssumptions()
Erstellt die FunN-Assumptions
Fun0-FunN (momentan für N = 6)
|
static Type |
makeGenericTypeVars2TypePlaceHolders(Type T) |
private void |
parse_backup(java.io.Reader reader)
Parst den Quellcode und baut den abstrakten Syntaxbaum auf.
|
SourceFile |
parse(java.io.File file)
Author: J�rg B�uerle
Ruft die Parse-Methode. |
void |
parse(Menge<java.lang.String> filenames)
Diese Funktion nimmt einen Menge von Dateinamen.
|
SourceFile |
parse(java.lang.String sourceCode)
Parst den SourceCode einer Datei.
|
private SourceFile |
parse2SyntaxTree(java.io.Reader fileContent)
Parst den Inhalt einer Datei zu einem Syntaxbaum.
|
void |
setOutputDir(java.lang.String dir)
Author: Juergen Schmiing
Legt das Ausgabeverzeichnis fuer die class-Files fest. |
Menge<TypeinferenceResultSet> |
typeReconstruction()
Author: J�rg B�uerle
Ruft den Typrekonstruktionsalgorithmus auf. |
public static final int NO_LINENUMBER
protected static Logger inferencelog
protected java.lang.String OutputDir
private Menge<SourceFile> m_AbstractSyntaxTree
private MyCompiler()
logger - Konfiguration für Debug Ausgabe TODOpublic static MyCompilerAPI getAPI(LoggerConfiguration loggerConfig)
private void parse_backup(java.io.Reader reader)
throws java.io.IOException,
JavaParser.yyException
NewTVar(jclass) (siehe Algorithmus 5.17 TRProg, Martin Pl�micke)
aufgerufen.
reader - java.io.IOExceptionJavaParser.yyExceptionpublic void init()
init in interface MyCompilerAPIpublic SourceFile parse(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException, JavaParser.yyException
parse in interface MyCompilerAPIfile - Die Quellcode-Dateijava.io.FileNotFoundException - Wenn die Quellcode-Datei nicht existiert.java.io.IOException - Wenn was schief l�uft.JavaParser.yyException - Wenn ein Fehler beim Parsen auftritt.public Menge<TypeinferenceResultSet> typeReconstruction() throws java.lang.NullPointerException, CTypeReconstructionException
typeReconstruction in interface MyCompilerAPIjava.lang.NullPointerException - Wenn noch kein abstrakter Syntaxbaum vorhanden
ist. @throws CTypeReconstructionException Wenn ein Fehler bei der
Typrekonstruktion auftritt.CTypeReconstructionExceptionprivate TypeAssumptions makeFunNAssumptions()
public static void main(java.lang.String[] args)
args - Klassendateipublic void setOutputDir(java.lang.String dir)
MyCompilerAPIsetOutputDir in interface MyCompilerAPIpublic java.lang.String getOutputDir()
MyCompilerAPIgetOutputDir in interface MyCompilerAPIpublic static Type makeGenericTypeVars2TypePlaceHolders(Type T)
T - - Typ, bei welchem die GTVs ersetzt werden sollen.private SourceFile parse2SyntaxTree(java.io.Reader fileContent) throws ParserError
ParserErrorpublic void parse(Menge<java.lang.String> filenames) throws ParserError
parse in interface MyCompilerAPIfilenames - - Eine Liste von Quellcodedateien, welche gseparst werden sollenParserErrorpublic SourceFile parse(java.lang.String sourceCode)
MyCompilerAPIparse in interface MyCompilerAPIsourceCode - - SourceCode einer Java-Quellcodedatei