forked from JavaTX/JavaCompilerCore
Beginn mit Werksvertrag: Package Support
This commit is contained in:
parent
802d7726d4
commit
766e71bb3a
34
src/test/java/packages/ParsePackageName.java
Normal file
34
src/test/java/packages/ParsePackageName.java
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package packages;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.core.JavaTXCompiler;
|
||||||
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||||
|
import de.dhbwstuttgart.syntaxtree.visual.ASTPrinter;
|
||||||
|
import de.dhbwstuttgart.syntaxtree.visual.ASTTypePrinter;
|
||||||
|
import de.dhbwstuttgart.typedeployment.TypeInsert;
|
||||||
|
import de.dhbwstuttgart.typedeployment.TypeInsertFactory;
|
||||||
|
import de.dhbwstuttgart.typeinference.result.ResultSet;
|
||||||
|
import org.junit.Test;
|
||||||
|
import typeinference.JavaTXCompilerTest;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class ParsePackageName {
|
||||||
|
|
||||||
|
public static final String rootDirectory = System.getProperty("user.dir")+"/src/test/resources/javFiles/";
|
||||||
|
@Test
|
||||||
|
public void parsePackage() throws IOException, ClassNotFoundException {
|
||||||
|
JavaTXCompiler compiler = new JavaTXCompiler(new File(rootDirectory+"packageNameTest.jav"));
|
||||||
|
for(File f : compiler.sourceFiles.keySet()){
|
||||||
|
SourceFile sf = compiler.sourceFiles.get(f);
|
||||||
|
System.out.println(ASTTypePrinter.print(sf));
|
||||||
|
System.out.println(ASTPrinter.print(sf));
|
||||||
|
}
|
||||||
|
List<ResultSet> results = compiler.typeInference();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
3
src/test/resources/javFiles/packageNameTest.jav
Normal file
3
src/test/resources/javFiles/packageNameTest.jav
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
package Test;
|
||||||
|
|
||||||
|
class TestClass{}
|
11
vorgehen.md
Normal file
11
vorgehen.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
* Parser um Packages erweitern
|
||||||
|
* Schätzung: 0 h
|
||||||
|
* Parser kann Java 8 und daher auch packages
|
||||||
|
* Convertierung zu AST
|
||||||
|
* AST kann schon Packages im Namen
|
||||||
|
* Es muss geprüft werden, ob geparste Datei im richtigen Ordner ist
|
||||||
|
*
|
||||||
|
* Constraints erstellen
|
||||||
|
* macht es hier einen Unterschied?
|
||||||
|
* es ändert sich nur der Namen der Typen
|
||||||
|
* das ist schon in JavaClassName enthalten
|
Loading…
Reference in New Issue
Block a user