forked from JavaTX/JavaCompilerCore
Umstellung auf Intellij IDEA
This commit is contained in:
parent
f88d58d548
commit
e19dee4c99
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/JavaCompilerCore.iml" filepath="$PROJECT_DIR$/JavaCompilerCore.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
75
JavaCompilerCore.iml
Normal file
75
JavaCompilerCore.iml
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="EclipseModuleManager">
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/junit-4.0.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/cloning.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/guava-10.0.1.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/commons-bcel6-6.0-SNAPSHOT.jar!/" />
|
||||||
|
<libelement value="jar://$MODULE_DIR$/lib/bcel-6.0-SNAPSHOT.jar!/" />
|
||||||
|
<src_description expected_position="0">
|
||||||
|
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
|
||||||
|
<src_folder value="file://$MODULE_DIR$/BCEL" expected_position="1" />
|
||||||
|
<src_folder value="file://$MODULE_DIR$/" expected_position="2" />
|
||||||
|
<src_folder value="file://$MODULE_DIR$/test" expected_position="3" />
|
||||||
|
</src_description>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||||
|
<output url="file://$MODULE_DIR$/bin" />
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="false" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="junit-4.0.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/junit-4.0.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES>
|
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.0/junit-4.0-sources.jar!/" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="cloning.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/cloning.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="guava-10.0.1.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/guava-10.0.1.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="commons-bcel6-6.0-SNAPSHOT.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/commons-bcel6-6.0-SNAPSHOT.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES>
|
||||||
|
<root url="file://$USER_HOME$/Development/intellijworkspace/bcel/src/main/java" />
|
||||||
|
</SOURCES>
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library name="bcel-6.0-SNAPSHOT.jar">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/bcel-6.0-SNAPSHOT.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
</component>
|
||||||
|
</module>
|
Binary file not shown.
@ -71,6 +71,7 @@ public class MethodGenerator extends MethodGen{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
method.getInstructionList().setPositions();
|
||||||
method.stripAttributes(true);
|
method.stripAttributes(true);
|
||||||
method.setMaxStack(); //Die Stack Größe automatisch berechnen lassen (erst nach dem alle Instructions angehängt wurden)
|
method.setMaxStack(); //Die Stack Größe automatisch berechnen lassen (erst nach dem alle Instructions angehängt wurden)
|
||||||
method.setMaxLocals();
|
method.setMaxLocals();
|
||||||
|
@ -2,6 +2,7 @@ package KomplexeMenge;
|
|||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -36,7 +37,7 @@ class TestKlasseOderMenge extends OderMenge<TestKlasse>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void addItem(TestKlasse string) {
|
public void addItem(TestKlasse string) {
|
||||||
TestUndMenge toAdd = new TestKlasseUndMenge();
|
TestKlasseUndMenge toAdd = new TestKlasseUndMenge();
|
||||||
toAdd.addItem(string);
|
toAdd.addItem(string);
|
||||||
set.add(toAdd);
|
set.add(toAdd);
|
||||||
}
|
}
|
||||||
@ -61,24 +62,28 @@ class TestKlasseUndMenge extends UndMenge<TestKlasse>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Depreciated
|
||||||
|
* Tests möglicherweise obsolet
|
||||||
|
*/
|
||||||
public class KeineDoppeltenVerweise {
|
public class KeineDoppeltenVerweise {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test() {
|
public void test() {
|
||||||
OderMenge<TestKlasse> oM1 = new TestOderMenge();
|
TestKlasseOderMenge oM1 = new TestKlasseOderMenge();
|
||||||
OderMenge<TestKlasse> oM2 = new OderMenge<>();
|
TestKlasseOderMenge oM2 = new TestKlasseOderMenge();
|
||||||
UndMenge<TestKlasse> oM3 = new UndMenge<>();
|
TestKlasseUndMenge oM3 = new TestKlasseUndMenge();
|
||||||
oM1.addItem(new TestKlasse("Menge 1, Item 1"));
|
oM1.addItem(new TestKlasse("Menge 1, Item 1"));
|
||||||
oM1.addItem(new TestKlasse("Menge 1, Item 2"));
|
oM1.addItem(new TestKlasse("Menge 1, Item 2"));
|
||||||
oM2.addItem(new TestKlasse("Menge 2, Item 1"));
|
oM2.addItem(new TestKlasse("Menge 2, Item 1"));
|
||||||
oM2.addItem(new TestKlasse("Menge 2, Item 2"));
|
oM2.addItem(new TestKlasse("Menge 2, Item 2"));
|
||||||
oM3.addItems(oM1);
|
oM3.addItems(oM1);
|
||||||
oM3.addItems(oM2);
|
oM3.addItems(oM2);
|
||||||
Menge<Menge<TestKlasse>> cP = oM3.cartesianProduct();
|
Set<Set<TestKlasse>> cP = oM3.cartesianProduct();
|
||||||
System.out.println(cP);
|
System.out.println(cP);
|
||||||
cP.firstElement().firstElement().name="neu";
|
cP.iterator().next().iterator().next().name="neu";
|
||||||
System.out.println(cP);
|
System.out.println(cP);
|
||||||
check(cP);
|
//check(cP); //TODO Muss neu implementiert werden
|
||||||
}
|
}
|
||||||
|
|
||||||
private <A> void check(Menge<Menge<A>> cP){
|
private <A> void check(Menge<Menge<A>> cP){
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
class IfTest{
|
|
||||||
|
|
||||||
public static void main(String[] args){
|
|
||||||
|
|
||||||
System.out.println(new IfElseStatement().method(true));
|
|
||||||
System.out.println(new IfElseStatement().method(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -21,6 +21,7 @@ public abstract class SourceFileBytecodeTest extends TestCase{
|
|||||||
protected String testName;
|
protected String testName;
|
||||||
|
|
||||||
public SourceFileBytecodeTest(){
|
public SourceFileBytecodeTest(){
|
||||||
|
super("Bytecode Test");
|
||||||
init();
|
init();
|
||||||
|
|
||||||
if(testName != null){
|
if(testName != null){
|
||||||
@ -29,6 +30,7 @@ public abstract class SourceFileBytecodeTest extends TestCase{
|
|||||||
outputDirectory = "";
|
outputDirectory = "";
|
||||||
|
|
||||||
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputDirectory);
|
SingleClassTester.compileToBytecode(rootDirectory+testFile, rootDirectory+outputDirectory);
|
||||||
|
System.out.println("Test");
|
||||||
}else{
|
}else{
|
||||||
throw new RuntimeException("rootDirectory, testFile or outputFile is null.");
|
throw new RuntimeException("rootDirectory, testFile or outputFile is null.");
|
||||||
}
|
}
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
/**
|
|
||||||
* Diese Klasse testet die generierte EmptyClass.class-Datei
|
|
||||||
*/
|
|
||||||
class Test{
|
|
||||||
public static void main(String[] args){
|
|
||||||
new EmptyClass();
|
|
||||||
new Assign();
|
|
||||||
System.out.println(new Return().method());
|
|
||||||
new MethodCall().method();
|
|
||||||
System.out.println(new FieldDeclaration().field);
|
|
||||||
System.out.println(new Runnable().method().apply());
|
|
||||||
Runnable r = new Runnable().method().apply();
|
|
||||||
Test t = new Identity<Test,Test>().op.apply(new Test());
|
|
||||||
System.out.println(t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Test2<X>{
|
|
||||||
Fun1<? extends X,? super X> m() {
|
|
||||||
Fun1<? extends X,? super X> f = new Identity<X,X>().op;
|
|
||||||
return f;
|
|
||||||
}
|
|
||||||
public static void main(String[] args){
|
|
||||||
Matrix2<Integer,Integer> m2 = new Matrix2<>();
|
|
||||||
System.out.println(m2.op.apply((Integer x) -> x));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
class Test2{
|
|
||||||
|
|
||||||
public static void main(java.lang.String[] args){
|
|
||||||
new NewStatement(1).method();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
class Test3{
|
|
||||||
|
|
||||||
public static void main(String[] args){
|
|
||||||
System.out.println(new LambdaExpr2Test().op.apply());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
class TestStackMap{
|
|
||||||
|
|
||||||
public static void main(String[] args){
|
|
||||||
IfElseStatement test = new IfElseStatement();
|
|
||||||
System.out.println(test.method(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,8 +1,14 @@
|
|||||||
package bytecode;
|
package bytecode;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.junit.runners.Suite;
|
||||||
|
|
||||||
public class WhileTest extends SourceFileBytecodeTest{
|
public class WhileTest extends SourceFileBytecodeTest{
|
||||||
|
|
||||||
|
public WhileTest(){
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void init() {
|
protected void init() {
|
||||||
testName = "WhileTest";
|
testName = "WhileTest";
|
||||||
|
@ -7,6 +7,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||||
import de.dhbwstuttgart.typeinference.Menge;
|
import de.dhbwstuttgart.typeinference.Menge;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -43,8 +44,9 @@ public class InsertSingleTypeTest {
|
|||||||
String inferedSource = "";
|
String inferedSource = "";
|
||||||
MyCompilerAPI compiler = MyCompiler.getAPI(new LoggerConfiguration().setOutput(Section.TYPEINFERENCE, System.out));
|
MyCompilerAPI compiler = MyCompiler.getAPI(new LoggerConfiguration().setOutput(Section.TYPEINFERENCE, System.out));
|
||||||
try {
|
try {
|
||||||
compiler.parse(new File(rootDirectory + sourceFileToInfere));
|
SourceFile parsed = compiler.parse(new File(rootDirectory + sourceFileToInfere));Menge<SourceFile> sourceFiles = new Menge<>();
|
||||||
Menge<TypeinferenceResultSet> results = compiler.typeReconstruction();
|
sourceFiles.add(parsed);
|
||||||
|
Menge<TypeinferenceResultSet> results = compiler.typeReconstruction(sourceFiles);
|
||||||
TestCase.assertTrue("Es darf nicht mehr als eine L�sungsm�glichkeit geben und nicht "+results.size(), results.size()==1);
|
TestCase.assertTrue("Es darf nicht mehr als eine L�sungsm�glichkeit geben und nicht "+results.size(), results.size()==1);
|
||||||
return results.firstElement();
|
return results.firstElement();
|
||||||
} catch (IOException | yyException e) {
|
} catch (IOException | yyException e) {
|
||||||
|
@ -3,6 +3,7 @@ package plugindevelopment.MartinTestCases;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||||
import de.dhbwstuttgart.typeinference.Menge;
|
import de.dhbwstuttgart.typeinference.Menge;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
@ -27,8 +28,10 @@ public class Tester extends TypeInsertTester{
|
|||||||
String inferedSource = "";
|
String inferedSource = "";
|
||||||
MyCompilerAPI compiler = MyCompiler.getAPI(new LoggerConfiguration().setOutput(Section.TYPEINFERENCE, System.out));
|
MyCompilerAPI compiler = MyCompiler.getAPI(new LoggerConfiguration().setOutput(Section.TYPEINFERENCE, System.out));
|
||||||
try {
|
try {
|
||||||
compiler.parse(new File(rootDirectory + sourceFileToInfere));
|
SourceFile parsed = compiler.parse(new File(rootDirectory + sourceFileToInfere));
|
||||||
Menge<TypeinferenceResultSet> results = compiler.typeReconstruction();
|
Menge<SourceFile> sourceFiles = new Menge<>();
|
||||||
|
sourceFiles.add(parsed);
|
||||||
|
Menge<TypeinferenceResultSet> results = compiler.typeReconstruction(sourceFiles);
|
||||||
//TestCase.assertTrue("Es darf nicht mehr als eine L�sungsm�glichkeit geben und nicht "+results.size(), results.size()==1);
|
//TestCase.assertTrue("Es darf nicht mehr als eine L�sungsm�glichkeit geben und nicht "+results.size(), results.size()==1);
|
||||||
for(TypeinferenceResultSet result : results){
|
for(TypeinferenceResultSet result : results){
|
||||||
TypeInsertSet point = result.getTypeInsertionPoints();
|
TypeInsertSet point = result.getTypeInsertionPoints();
|
||||||
|
@ -8,6 +8,8 @@ import java.nio.ByteBuffer;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
|
import de.dhbwstuttgart.syntaxtree.SourceFile;
|
||||||
import de.dhbwstuttgart.typeinference.Menge;
|
import de.dhbwstuttgart.typeinference.Menge;
|
||||||
|
|
||||||
import de.dhbwstuttgart.logger.Logger;
|
import de.dhbwstuttgart.logger.Logger;
|
||||||
@ -44,8 +46,10 @@ public class TypeInsertTester{
|
|||||||
String inferedSource = "";
|
String inferedSource = "";
|
||||||
MyCompilerAPI compiler = MyCompiler.getAPI(logConfig);
|
MyCompilerAPI compiler = MyCompiler.getAPI(logConfig);
|
||||||
try {
|
try {
|
||||||
compiler.parse(new File(rootDirectory + sourceFileToInfere));
|
SourceFile parsed = compiler.parse(new File(rootDirectory + sourceFileToInfere));
|
||||||
Menge<TypeinferenceResultSet> results = compiler.typeReconstruction();
|
Menge<SourceFile> sourceFiles = new Menge<>();
|
||||||
|
sourceFiles.add(parsed);
|
||||||
|
Menge<TypeinferenceResultSet> results = compiler.typeReconstruction(sourceFiles);
|
||||||
TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1);
|
TestCase.assertTrue("Es darf nicht mehr als eine Lösungsmöglichkeit geben und nicht "+results.size(), results.size()==1);
|
||||||
for(TypeinferenceResultSet result : results){
|
for(TypeinferenceResultSet result : results){
|
||||||
TypeInsertSet point = result.getTypeInsertionPoints();
|
TypeInsertSet point = result.getTypeInsertionPoints();
|
||||||
|
Loading…
Reference in New Issue
Block a user