Compare commits

..

2296 Commits

Author SHA1 Message Date
NoName11234 f8efe361e9 changed unifyTest to use UnifyResultModelParallel 2024-02-19 19:49:01 +01:00
NoName11234 63f854d4ee changed UnifyResultModel to UnifyResultModelParallel 2024-02-19 19:48:15 +01:00
NoName11234 532018241c implemented class UnifyResultModelParallel 2024-02-19 19:38:19 +01:00
NoName11234 9e7085bcce added class UnifyResultModelParallel 2024-02-19 19:37:33 +01:00
NoName11234 e4af54a2bf added unifyTest 2024-02-11 14:38:15 +01:00
NoName11234 d7b693204e changed java version to 21 2024-02-11 14:37:59 +01:00
NoName11234 697cfcc2af changed Writer to NullWriter 2024-02-11 14:37:05 +01:00
NoName11234 73f996991e added unifyTest 2024-02-11 14:35:05 +01:00
pl@gohorb.ba-horb.de 61653c5d88 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2023-05-25 10:05:10 +02:00
pl@gohorb.ba-horb.de 3cd608a4ac modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2023-05-15 16:56:04 +02:00
pl@gohorb.ba-horb.de deec0ae706 Start branch unif23NoOptParallel
modified:   Makefile
	modified:   src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2023-04-24 17:18:45 +02:00
pl@gohorb.ba-horb.de d6a79ea3a1 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2023-04-11 22:45:15 +02:00
pl@gohorb.ba-horb.de 1f909f13ee modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2023-04-11 18:01:44 +02:00
pl@gohorb.ba-horb.de be6f4bd578 Merge remote-tracking branch 'origin/targetBytecode' into unif23 2023-04-11 15:52:26 +02:00
pl@gohorb.ba-horb.de 478efd5649 Merge branch 'unif23' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unif23 2023-04-11 15:40:27 +02:00
pl@gohorb.ba-horb.de c73e57cf2b new file: resources/bytecode/javFiles/Scalar.jav 2023-04-11 15:35:15 +02:00
pl@gohorb.ba-horb.de ce29f4bcf1 Merge branch 'unif23' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into Unif23
Conflicts:
	src/test/java/targetast/TestComplete.java
2023-04-10 22:14:46 +02:00
pl@gohorb.ba-horb.de 42821f3215 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   src/test/java/targetast/TestComplete.java
2023-04-10 22:07:47 +02:00
pl@gohorb.ba-horb.de f68afc88a6 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2023-04-06 17:58:32 +02:00
pl@gohorb.ba-horb.de ed671aeb97 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java

<. weider eingefuegt bei Return typen von Methodcalls und Return-Statements
Vergleich dementsprechend angepasst.
2023-04-05 17:48:15 +02:00
pl@gohorb.ba-horb.de 82061474b2 modified: resources/bytecode/javFiles/Scalar.jav
modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
2023-04-04 17:26:13 +02:00
pl@gohorb.ba-horb.de d849bc127f Merge remote-tracking branch 'origin/targetBytecode' into unif23 2023-04-04 16:47:19 +02:00
pl@gohorb.ba-horb.de f6a4fe8142 modified: resources/bytecode/javFiles/Scalar.jav 2023-04-04 16:00:54 +02:00
pl@gohorb.ba-horb.de f6fe3a68aa new file: resources/bytecode/javFiles/Scalar.jav 2023-04-04 15:54:41 +02:00
pl@gohorb.ba-horb.de 86d229cac9 modified: resources/bytecode/javFiles/Matrix.jav
modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/test/java/targetast/TestComplete.java
2023-04-04 15:54:03 +02:00
pl@gohorb.ba-horb.de 02c8dd9804 Merge branch 'targetBytecode' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-04-04 13:16:41 +02:00
pl@gohorb.ba-horb.de 0908d512d9 modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java 2023-04-04 13:16:25 +02:00
Victorious3 e231cf722b Fix type variable being declared twice 2023-04-04 13:09:28 +02:00
Victorious3 aa9782edd7 Fix test case 2023-04-04 13:09:05 +02:00
pl@gohorb.ba-horb.de e55b9938dc modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Returntyp: Equaldot durch SMALLERDOT ersetzt
2023-04-04 10:30:38 +02:00
pl@gohorb.ba-horb.de 6815d8fc0a modified: Makefile
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2023-03-31 17:58:02 +02:00
pl@gohorb.ba-horb.de 317f8b1aad new file: Makefile
deleted:    Test.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2023-03-31 15:54:17 +02:00
Victorious3 f7b60214fa Change tests 2023-03-28 16:40:06 +02:00
Victorious3 1ad5540500 Fix wrong class generics being used 2023-03-28 13:28:05 +02:00
Victorious3 3963baa9ce Fix equality 2023-03-28 12:02:08 +02:00
Victorious3 b9f19cc105 Write tx signature to constant pool 2023-03-24 15:14:17 +01:00
Victorious3 cf2d612870 Fix TX Signature by adding additional prameters to every method and constructor 2023-03-24 14:51:57 +01:00
Victorious3 b55fc71811 Let generateClassFiles accept multiple arguments 2023-03-24 13:27:29 +01:00
pl@gohorb.ba-horb.de 79335449d0 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Statistics fertig (Version 1)
2023-03-23 12:00:04 +01:00
pl@gohorb.ba-horb.de 14606a846e modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2023-03-22 19:01:36 +01:00
stan 2b67230a15 Consider public and standard constructors ones 2023-03-21 16:31:45 +01:00
pl@gohorb.ba-horb.de 29b05b56cc Merge branch 'targetBytecode' into unif23 2023-03-21 16:29:14 +01:00
pl@gohorb.ba-horb.de 08b9fc0ea3 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
statistics eingefuegt
2023-03-21 16:23:18 +01:00
Victorious3 6b767bc09b Fix using the wrong constructor 2023-03-21 15:06:17 +01:00
Victorious3 2dff7909ed Remove test file 2023-03-21 14:00:58 +01:00
Victorious3 d93836d110 Fix incorrect generics for derived FunN 2023-03-21 12:12:42 +01:00
Victorious3 b5af3a42a8 Fix wrong generic parameter on FunN3336 base class 2023-03-21 10:34:34 +01:00
pl@gohorb.ba-horb.de 070dd16999 modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java 2023-03-21 10:30:13 +01:00
pl@gohorb.ba-horb.de 9d7e46925d modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java 2023-03-21 10:26:55 +01:00
pl@gohorb.ba-horb.de d780d322f0 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
2023-03-20 18:33:58 +01:00
pl@gohorb.ba-horb.de 867f3d39e8 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/test/java/targetast/TestComplete.java
2023-03-20 16:05:28 +01:00
pl@gohorb.ba-horb.de 303246adce modified: README_aktuelle_Branches 2023-03-17 16:16:28 +01:00
pl@gohorb.ba-horb.de 48daa9731f modified: resources/AllgemeinTest/Pair.jav 2023-03-17 16:05:47 +01:00
pl@gohorb.ba-horb.de 9d03080667 Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode
resources/AllgemeinTest/Pair.jav
2023-03-08 16:54:00 +01:00
pl@gohorb.ba-horb.de 02e596ce7e modified: ../../AllgemeinTest/Pair.jav
modified:   ../../../src/test/java/AllgemeinTest.java
2023-03-08 16:51:48 +01:00
Victorious3 acf4569908 Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-03-08 16:28:50 +01:00
Victorious3 a77c64cea2 Add new type placeholder to referenced set 2023-03-08 16:28:34 +01:00
pl@gohorb.ba-horb.de 034faf1f66 Merge branch 'targetBytecode' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-03-08 16:02:50 +01:00
pl@gohorb.ba-horb.de 88db5016bf modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
logFile auf false gesetzt
2023-03-08 16:02:24 +01:00
Victorious3 3a05912dfe Whoops 2023-03-08 15:05:53 +01:00
Victorious3 40b04a4877 Remove print statement 2023-03-08 15:03:59 +01:00
Victorious3 04b509613f Add test and fix constructors return value being used 2023-03-08 14:59:40 +01:00
pl@gohorb.ba-horb.de cdd4cd9968 modified: ../src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
Tenaeren Operator fuer log-File eingefuegt
2023-03-08 14:26:08 +01:00
pl@gohorb.ba-horb.de 62e022c2f7 modified: ../../../src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java 2023-03-07 16:36:29 +01:00
pl@gohorb.ba-horb.de 506fd0dc0e new file: ../../AllgemeinTest/Assign.jav
modified:   ../../AllgemeinTest/Pair.jav
	modified:   ../../AllgemeinTest/UseWildcardPair.jav
	modified:   ../../../src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java
? extends Object nochmals angepasst

	modified:   ../../../src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../../../src/test/java/AllgemeinTest.java
2023-03-07 16:34:34 +01:00
pl@gohorb.ba-horb.de 1c31b6d769 new file: ../../AllgemeinTest/Pair.jav
new file:   ../../AllgemeinTest/UseWildcardPair.jav
	modified:   ../../../src/test/java/AllgemeinTest.java
2023-03-07 08:51:31 +01:00
pl@gohorb.ba-horb.de 2d82dc1ae4 modified: src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java
Object -> java.lang.Object
2023-03-01 23:31:07 +01:00
pl@gohorb.ba-horb.de 9606dc7b26 new file: resources/AllgemeinTest/CaptureConversion.jav
modified:   src/test/java/AllgemeinTest.java
Campture Conversion Test in Allgemeintest eingefuegt
2023-03-01 18:41:46 +01:00
Victorious3 d79d2d28b1 Ignore Box test 2023-03-01 16:33:59 +01:00
Victorious3 3eebfdc9d9 Fix POP2 not being called for double and long! 2023-03-01 16:33:03 +01:00
pl@gohorb.ba-horb.de ba66f29fba modified: ../../../../resources/bytecode/javFiles/OLFun.jav 2023-03-01 16:08:42 +01:00
Victorious3 ffdedd4f99 Add OL tests 2023-03-01 15:55:15 +01:00
Victorious3 9500deaf3d Remove debug printout 2023-03-01 15:30:20 +01:00
Victorious3 11eb03cdf0 Split up equality 2023-03-01 14:55:13 +01:00
Victorious3 3de89a5cfa Object as default bound 2023-03-01 12:02:01 +01:00
Victorious3 c0348ed304 txGenerics 2023-03-01 11:23:00 +01:00
Victorious3 1ad4cfcb21 Let lambda functions use Object instead of generic parameters 2023-03-01 10:49:03 +01:00
Victorious3 374d2e811b Generate attribute for JavaTX 2023-03-01 10:27:19 +01:00
Victorious3 68034ed434 Fix FunNGenerator 2023-02-23 18:52:29 +01:00
Victorious3 a92172c9da Start working on a JavaTX signature attribute 2023-02-21 14:05:21 +01:00
Victorious3 24bbce8265 Fix test cases for new inputs 2023-02-21 14:04:53 +01:00
Victorious3 84a5ed2cc3 Fix inner type variables 2023-02-21 11:31:28 +01:00
Victorious3 b58b6c2288 Fixes for TPH4 2023-02-21 10:28:00 +01:00
Victorious3 99c46bf37f Fix console interface 2023-02-14 11:36:08 +01:00
pl@gohorb.ba-horb.de 5058315a1b modified: ../../../../../resources/insertGenericsJav/TestTwoArgs.jav
Typen korrigiert
2023-02-13 21:20:40 +01:00
pl@gohorb.ba-horb.de 60d5da6f24 modified: ../../../../../resources/insertGenericsJav/TestTwoArgs.jav
Ergebnisse als Kommentare eingefuegt.
2023-02-13 18:39:16 +01:00
Vic Nightfall 29f654279b Fix codegen a bit, and add missing constraints 2023-02-10 14:54:44 +01:00
pl@gohorb.ba-horb.de 239698c8d6 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
etwas aufgeraeumt
2023-02-08 17:39:45 +01:00
pl@gohorb.ba-horb.de 4074273ecb Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-02-08 16:53:30 +01:00
pl@gohorb.ba-horb.de 2d117e24cf modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
methodsignature so eingerichtet, dass die Constraints erst am Ende hinzugefuegt werden.
2023-02-08 16:52:23 +01:00
Victorious3 1c2e868589 Fix removing inner type variables 2023-02-07 12:22:37 +01:00
pl@gohorb.ba-horb.de d39fd64f0f Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-02-02 14:50:18 +01:00
pl@gohorb.ba-horb.de e699fc36ae modified: src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
modified:   src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/constraints/Pair.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2023-02-02 14:49:30 +01:00
Victorious3 64ec7989b4 Continue with eliminating inner type variables 2023-01-31 15:39:12 +01:00
Victorious3 5243b160f5 Didn't want to remove this 2023-01-31 15:00:09 +01:00
Victorious3 62fad15b6f We actually need the signature of the class 2023-01-31 14:53:02 +01:00
Victorious3 21fb477ee1 These are the defaults, actually 2023-01-31 14:25:37 +01:00
Victorious3 baec9999db Don't append new class files, overwrite them 2023-01-31 14:21:16 +01:00
Victorious3 a7720fbf20 Don't append new class files, overwrite them 2023-01-31 13:49:19 +01:00
pl@gohorb.ba-horb.de 0c9612a2ea modified: ../../../main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java 2023-01-31 11:18:52 +01:00
Victorious3 dabe7f269c Consider nested type variables for signature (usage) 2023-01-24 16:24:24 +01:00
Victorious3 a9f69ead5c Use signature in methodcall 2023-01-24 15:11:31 +01:00
pl@gohorb.ba-horb.de 04508a85f1 Bei NewClass ReturnType hinzuefuegt
modified:   src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
2023-01-24 14:35:51 +01:00
Victorious3 9dca8ccdaa Fix parameter types in super call 2023-01-24 12:27:30 +01:00
Victorious3 8250f0cb51 Didn't mean to remove that 2023-01-24 12:17:21 +01:00
Victorious3 a26f466471 Fix 2023-01-24 12:16:34 +01:00
pl@gohorb.ba-horb.de dc4b1c7b4f Merge branch 'targetBytecode' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-01-24 12:06:16 +01:00
pl@gohorb.ba-horb.de 2448969426 In MethodCall argTypes durch signature ersetzt und ReturnType eingefuegt.
modified:   src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
2023-01-24 12:05:26 +01:00
Victorious3 5e89ceeee8 Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-01-24 11:55:55 +01:00
Victorious3 1ce180ce74 Change tests to umatch updated generics 2023-01-24 11:55:40 +01:00
pl@gohorb.ba-horb.de 2ab3becf44 Merge branch 'targetBytecode' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-01-24 11:32:05 +01:00
pl@gohorb.ba-horb.de 3b77a1271b modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java 2023-01-24 11:31:55 +01:00
Victorious3 9d20c0564c Get rid of inner type variables for methods 2023-01-23 16:04:19 +01:00
pl@gohorb.ba-horb.de 8be7f3d790 modified: ../../../src/main/java/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java 2023-01-23 15:14:39 +01:00
pl@gohorb.ba-horb.de 9e6b2e9ced modified: ../../../src/main/java/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java
modified:   ../../../src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
2023-01-23 15:13:51 +01:00
Victorious3 69bdb4aa5b Consider environment of type variables in method call 2023-01-23 13:56:21 +01:00
pl@gohorb.ba-horb.de 8aa67594d9 modified: ../../../src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
argTypes in MethodCall werden gesetzt
2023-01-23 13:49:11 +01:00
pl@gohorb.ba-horb.de 8dfce15850 new file: ../../AllgemeinTest/VectorNotObject.jav
new file:   ../../AllgemeinTest/WildcardCaptureConversionTest.jav
	modified:   ../../../src/test/java/AllgemeinTest.java
2023-01-23 11:51:05 +01:00
pl@gohorb.ba-horb.de d1fd65fad7 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
Loeschungen angezeigt

	modified:   src/main/java/de/dhbwstuttgart/target/generate/ASTToTargetAST.java
Ansatz fuer Veraenderung des Algorithmus bei Generated Generics eingefuegt.

	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
Loeschungen angezeigt

	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Loeschungen angezeigt

	modified:   src/test/java/targetast/TestComplete.java
tphTest eingfuegt
2023-01-18 18:11:45 +01:00
JanUlrich 752faaca86 Add jar-building to pom-file. Fix ConsoleInterface 2023-01-17 19:31:15 +01:00
pl@gohorb.ba-horb.de a2d8ab35ae Merge branch 'targetBytecode' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-01-17 17:22:46 +01:00
pl@gohorb.ba-horb.de 0944cf59fb modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	new file:   src/main/java/de/dhbwstuttgart/util/BiRelation.java
	renamed:    src/main/java/de/dhbwstuttgart/typeinference/unify/model/Pair.java -> src/main/java/de/dhbwstuttgart/util/Pair.java
2023-01-17 17:22:22 +01:00
Victorious3 db089bea60 Forgot x here 2023-01-17 16:05:15 +01:00
Victorious3 abe7553c37 Add missing object bounds 2023-01-17 15:57:41 +01:00
Victorious3 43e8837308 Simplify tests by adding BoundsChain 2023-01-17 12:42:20 +01:00
Victorious3 268f2b72eb Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-01-17 11:59:19 +01:00
Victorious3 d9bb0037b8 Improve genericcs tests 2023-01-17 11:58:59 +01:00
pl@gohorb.ba-horb.de e8eaa3ac6e Merge branch 'targetBytecode' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-01-12 12:06:03 +01:00
pl@gohorb.ba-horb.de f0f3a91e27 Constraints fuer Generated Generics erzeugt und schreibt diese als Attribute methCallargTypesRetType in den Klassen TYPE, TypeStmt und JavaTXCompiler
modified:   src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
2023-01-11 18:51:55 +01:00
pl@gohorb.ba-horb.de b9c7b888c1 Changes to be committed:
deleted:    src/test/java/targetast/Fun1$$.java
2023-01-11 11:14:49 +01:00
pl@gohorb.ba-horb.de 55a6f3e434 Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-01-11 11:13:19 +01:00
pl@gohorb.ba-horb.de 41d76533c0 modified: src/test/java/targetast/TestCodegen.java
modified:   src/test/java/targetast/TestGenerics.java
2023-01-11 11:13:04 +01:00
pl@gohorb.ba-horb.de 7220829d80 Merge branch 'targetBytecode' of gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into targetBytecode 2023-01-10 16:44:34 +01:00
pl@gohorb.ba-horb.de a9ca1eb5b9 deleted: src/test/java/targetast/Fun1$$.java 2023-01-10 16:43:04 +01:00
Victorious3 7aa7f94110 Add user defined generics to methods 2023-01-10 16:06:57 +01:00
Victorious3 229c6c523d Change file path to make the tests happy 2023-01-10 13:48:21 +01:00
Vic Nightfall 96ffc12ebc Merge with bigRefactoring 2023-01-04 16:07:48 +01:00
Vic Nightfall f714589728 Remove unused imports 2023-01-04 15:47:04 +01:00
Vic Nightfall f3e7fc0dc3 Test generics 2023-01-04 15:46:25 +01:00
Vic Nightfall 9f27d0d0fa Work on the generics tests 2022-12-06 17:44:39 +01:00
pl@gohorb.ba-horb.de 7d50ddab51 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2022-12-05 17:23:06 +01:00
pl@gohorb.ba-horb.de 9310882a28 modified: resources/bytecode/javFiles/VectorAdd.jav 2022-12-05 17:22:35 +01:00
stan b41680dc84 Merge with targetBytecode, Set language level to Java 19 + preview-features 2022-11-28 13:38:31 +01:00
Vic Nightfall b63d1bcf73 Fix FunNGenerator 2022-11-27 13:22:47 +01:00
Vic Nightfall 8806d1462c Fix FunNGenerator using the wrong string 2022-11-27 12:57:47 +01:00
Vic Nightfall dbd5311d93 Fix the build by reinstating old classes 2022-11-23 21:35:33 +01:00
pl@gohorb.ba-horb.de 291fee12db new file: ../../AllgemeinTest/VectorConstAdd.jav
modified:   ../../bytecode/javFiles/VectorAdd.jav
	new file:   ../../../src/test/java/AllgemeinTest.java
wieder hergestellt.
2022-11-21 23:51:06 +01:00
JanUlrich f8c8e2c805 Move Tests 2022-11-18 09:50:35 +01:00
pl@gohorb.ba-horb.de 462d791712 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2022-11-15 16:59:32 +01:00
pl@gohorb.ba-horb.de 3df7df9802 modified: src/test/resources/bytecode/javFiles/VectorAdd.jav 2022-11-15 16:50:43 +01:00
stan 00c8f41671 Change pom.xml: Clean up, Set java version to 17, Antlr4 plugin uses standard source directory. Project changes: move /test/resources to /resources 2022-11-15 16:21:09 +01:00
Vic Nightfall 84cb7d871b Move package 2022-11-14 15:55:40 +01:00
Vic Nightfall 83b735716f Convert FunNGenerator to class with static methods instead of using a singleton 2022-11-14 15:44:31 +01:00
Vic Nightfall 15e94111d4 Rework FunNGenerator to use target types 2022-11-14 15:28:00 +01:00
Vic Nightfall 9d942a7014 Start replacing the code generator 2022-11-13 19:03:54 +01:00
Vic Nightfall aa156b793f Generate proper FunN types 2022-11-13 17:05:14 +01:00
Vic Nightfall be1c356a9f Don't drop wildcards 2022-11-13 14:38:21 +01:00
Victorious3 4307371dee Box test 2022-11-13 13:47:24 +01:00
pl@gohorb.ba-horb.de 26bb3c9579 modified: ../../java/AllgemeinTest.java
modified:   Box_Main.jav
2022-10-10 18:11:57 +02:00
stan 8f7becd62d Fix for Bug 230 2022-10-03 10:08:50 +02:00
Victorious3 c40fbd9399 Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2022-10-02 18:28:00 +02:00
Victorious3 b4e1be0fb7 Fix some type conversions 2022-10-02 18:27:41 +02:00
pl@gohorb.ba-horb.de 469feb6349 modified: src/test/resources/bytecode/javFiles/Inf.jav
zwei weitere Variablen eingefuegt
2022-09-27 18:18:13 +02:00
pl@gohorb.ba-horb.de 82f5146abb Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2022-09-27 15:19:20 +02:00
pl@gohorb.ba-horb.de f119bff0b6 modified: ../bytecode/javFiles/Inf.jav
modified:   ../bytecode/javFiles/SimpleCycle.jav
2022-09-27 15:19:10 +02:00
Victorious3 a660d7a295 Remove bounds with Object when more concrete bounds are added 2022-09-22 22:01:28 +02:00
Victorious3 247eb0ef79 Add tests for generic parameters 2022-09-22 18:48:50 +02:00
Victorious3 04b9af8c7b Add Box test 2022-09-22 16:50:19 +02:00
pl@gohorb.ba-horb.de 33e9b87562 Der Returntyp des Konstruktors wurde mit TypePlaceholders als Parameter bestimmt.
Korrigiert: TypePlaceholders durch GenericRefType ersetzt

	modified:   ../../../../main/java/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java
Methode generateTypeOfThisClass eingefuegt. Macht aus der atuellen Klasse den zugehoerigen RefType

In getConstructors in new MethodAssumption den ofType-Parameter (Typeplaceholders) durch cl.generateTypeOfThisClass()
ersetzt. Dadurch werden GenericRefType in den Typ eingefuegt.
2022-09-18 00:19:20 +02:00
Victorious3 5503f3723c Fix Tph2 2022-08-26 17:21:23 +02:00
Victorious3 b0c1d5d96d Remove duplicate type variables 2022-08-26 16:05:59 +02:00
Victorious3 6fb329ae1a Initialize local variables to null 2022-08-26 15:13:48 +02:00
Victorious3 45b80bb6c5 Don't change the constraints anymore 2022-08-26 14:55:03 +02:00
pl@gohorb.ba-horb.de 5d5f3ee627 Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode
Conflicts:
	src/test/java/targetast/TestComplete.java
2022-08-09 17:14:09 +02:00
Victorious3 edf85dca7f Fix Tph4-6 2022-08-09 12:59:23 +02:00
pl@gohorb.ba-horb.de bca1bd622f modified: ../bytecode/javFiles/SimpleCycle.jav
Simple cycle aktiviert
2022-08-09 09:50:47 +02:00
pl@gohorb.ba-horb.de 6fc70db481 Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2022-08-08 15:25:23 +02:00
pl@gohorb.ba-horb.de c933160dcb modified: ../../java/targetast/TestComplete.java
Test Tph7.jav in integriert.
2022-08-08 15:24:46 +02:00
Victorious3 2af59d1e1f Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2022-08-08 14:51:08 +02:00
Victorious3 f36f981ca8 Lambda captures 2022-08-08 14:50:43 +02:00
pl@gohorb.ba-horb.de d54cd5e20a modified: ../../../../pom.xml
wieder auf Java-18 umgestellt

	modified:   ../../java/targetast/TestComplete.java
Test Tph4Test eingefuegt
2022-08-08 14:45:58 +02:00
pl@gohorb.ba-horb.de 975f2cefe3 Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2022-08-08 11:50:07 +02:00
pl@gohorb.ba-horb.de 56f68e84e4 modified: ../../java/targetast/TestComplete.java
Test Tph2Test eingefue=gt

	modified:   ../bytecode/javFiles/Tph2.jav
Zeilen auskommentiert, die bereits in anderen Tests enthalten
2022-08-08 11:09:19 +02:00
Victorious3 d87ea005b1 Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2022-08-07 20:10:18 +02:00
Victorious3 bca02137a6 Fix method calls in matrixOp 2022-08-07 20:09:57 +02:00
pl@gohorb.ba-horb.de 092d066774 modified: ../../java/targetast/TphTest.java
Test fuer Tph7 so angepasst, dass ueberprueft wird ob die richtigen Typvariablen generiert werden
2022-08-06 22:17:49 +02:00
pl@gohorb.ba-horb.de 6d12102fbf Merge branch 'targetBytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into targetBytecode 2022-08-06 14:12:41 +02:00
pl@gohorb.ba-horb.de fa5a29c682 modified: src/test/resources/bytecode/javFiles/Inf.jav
Kommentare erweitert
2022-08-06 14:10:25 +02:00
Victorious3 4e15bd4ae2 Merge remote-tracking branch 'origin/targetBytecode' into targetBytecode
# Conflicts:
#	src/test/resources/bytecode/javFiles/Tph7.jav
2022-08-05 16:21:10 +02:00
Victorious3 4e6e8c5cc7 Add Tph7 test. 2022-08-05 16:20:30 +02:00
pl@gohorb.ba-horb.de bfc5c55e90 modified: ../../../../pom.xml
modified:   ../../java/targetast/TphTest.java
	modified:   ../bytecode/javFiles/Tph.jav
	new file:   ../bytecode/javFiles/Tph7.jav
2022-08-03 15:18:55 +02:00
Victorious3 c21104f646 Find functions in class files and primitive types 2022-08-02 18:10:52 +02:00
pl@gohorb.ba-horb.de 9fc558c21a modified: src/test/java/AllgemeinTest.java
new file:   src/test/resources/AllgemeinTest/M.jav
	new file:   src/test/resources/AllgemeinTest/Put.jav
	new file:   src/test/resources/AllgemeinTest/Test.jav
	new file:   src/test/resources/AllgemeinTest/TestSubTypless.jav
	new file:   src/test/resources/AllgemeinTest/Twice.jav
	new file:   src/test/resources/AllgemeinTest/Var.jav
	new file:   src/test/resources/AllgemeinTest/Wildcard_Andi.jav
	new file:   src/test/resources/AllgemeinTest/addList.jav
2022-07-28 09:04:25 +02:00
Victorious3 6e1786ec7c Test cases and some fixes 2022-07-13 14:38:17 +02:00
pl@gohorb.ba-horb.de 2f3d3e1bb9 new file: S2021_Etienne_Zink.pdf 2022-07-08 12:30:55 +02:00
Victorious3 699155e21a Equalize type variables in covariant and contravariant position 2022-07-03 19:24:54 +02:00
Victorious3 de417d3ee6 Remove inner type variables 2022-07-03 18:10:40 +02:00
Victorious3 ef06a8de38 Actually replace instead of removing pairs 2022-07-03 15:25:35 +02:00
Victorious3 560f0c5a6f Filter out cycles and infima 2022-07-03 15:17:12 +02:00
Victorious3 d7380c6cb7 Remove duplicate testcase 2022-07-02 16:14:46 +02:00
Victorious3 b43afd40ee Decouple Sigma from Target 2022-07-02 15:57:33 +02:00
Victorious3 a8be387dd9 Add generics to the generated class file 2022-06-23 20:39:34 +02:00
Victorious3 7e259e2597 Mostly finish up populating generics 2022-06-23 18:52:30 +02:00
Victorious3 f00ee2598f Start implementing family of generics 2022-06-22 17:06:49 +02:00
Victorious3 3b439a49cd IDEA wants it that way 2022-06-17 15:16:56 +02:00
Victorious3 29112e7bd7 First implementation for overloaded functions and test case 2022-06-17 15:15:08 +02:00
Victorious3 0a1a596bb9 Add Field transform 2022-05-31 14:02:39 +02:00
Victorious3 372182aa8b Convert the AST 2022-05-29 20:06:08 +02:00
JanUlrich 1ef3f22c18 Add AST To Target AST emptyClass testcase 2022-05-24 15:42:41 +02:00
Victorious3 20f11a5bef Changes 2022-05-24 14:35:30 +02:00
Victorious3 6c584f92e9 More tests 2022-05-16 14:18:58 +02:00
Victorious3 8666bfdf17 Start testing 2022-05-15 18:45:49 +02:00
Victorious3 590a4f04ae Implement target t AST 2022-05-03 21:37:14 +02:00
Victorious3 e8cc6ade11 Start working on the code generator 2022-04-27 13:05:01 +02:00
stan 8e80cc2985 Add TargetExpression 2022-03-30 03:17:55 +02:00
stan f03d3f5e64 Merge branch 'refactorToAPIs' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactorToAPIs 2022-03-29 19:25:13 +02:00
stan dfd12422a6 Set language level to Java 17. Add target AST as records 2022-03-29 19:25:01 +02:00
Etienne Zink eebb07ec8b Verbesserung FunNGenerator:
Generics werden nicht mehr mehrfach hinzugefügt.
TPHS werden im Klassenname als LTPH angegeben, so entsteht keine Uneindeutigkeit zu Klassen mit Object (ohne TPH) im Klassenname.
2022-03-29 19:19:31 +02:00
Etienne Zink c65102d89a Hinzufügen von OLFun2 und Änderung der Spezialisierungen von FunN, dass diese statt des TPH im Namen Object haben.
Ansonsten werden diese nicht wieder gefunden.
2022-03-29 17:00:06 +02:00
Etienne Zink ed00aeb056 Fixed bug mit der korrekten Signatur im Bytecode der FunN Typen.
Verbesserung der BytecodeGenMethod -> Nun werden die korrekt resolveten Typen verwendet.
2022-03-29 16:20:14 +02:00
Etienne Zink 7012010462 Korrektur in TypeToDescriptor und TypeToSignature -> Ohne Angabe im Deskriptor wird automatisch angenommen es soll eine spezialisierte Signatur erstellt werden. 2022-03-29 15:58:10 +02:00
Etienne Zink 9444ee38d6 Änderung generateSuperBytecode() sodass dies nun korrekten Bytecode generiert. 2022-03-29 15:43:43 +02:00
Etienne Zink 4ed30f11f7 Änderung: Spezialisierte FunN beinhaltet TPH im Namen und dieser wird FunN als Generic hinzugefügt. 2022-03-29 15:00:52 +02:00
Etienne Zink fcedec60e7 Hinzufügen OLFunTest. 2022-03-29 09:02:32 +02:00
Etienne Zink d8bdcf854c Refactoring der Bytecodegenerierung und Anpassung von Kommentaren. 2022-03-29 08:56:38 +02:00
Etienne Zink 0e363cfae3 Löchen des Intermediate-Packages und Erstellung einer Utility-Klasse zur FunN Bytecodegenerierung.
Übertragung der Funktionalität zur Generierung von FunN auf FunNGenerator.
2022-03-28 22:34:07 +02:00
Etienne Zink fedf33a006 Alle Tests der Bytecode-Generierung sind nun auf grün mit den Spezialisierungen der FunN Typen.
Bytecode muss noch manuell überprüft werden, ob überall korrekt!
2022-03-28 11:56:14 +02:00
Etienne Zink 4522aeff36 Verbesserung der Bytecodegenerierung für FunN Typen.
Immernoch in drei Tests fehlerhaft.
2022-03-28 10:47:49 +02:00
Etienne Zink bcf56e6bdd Verbesserung der Generierung von FunN-Typen.
Lambda Expressions noch fehlerhaft.
2022-03-24 10:38:12 +01:00
Etienne Zink 15c05e5cba Verbesserung der Konvertierung und der Bytecodegenerierung für FunN Typen.
Beinhaltet noch Fehler!
2022-03-23 16:12:25 +01:00
Etienne Zink dc9a54be3b Hinzufügen der ersten Einbeziehung der API zur Generierung der spezialisierten FunN Typen, ohne Tests. 2022-03-22 20:42:16 +01:00
Etienne Zink 21adeb7f26 Implementierung der von convert(..) in ASTToIntermediate. 2022-03-21 17:15:03 +01:00
Etienne Zink 6381d09174 Implementierung von getBytecode() in FunN und Hinzufügen entsprechender Tests. 2022-03-21 11:29:37 +01:00
Etienne Zink 918a2cc04d Implementierung in FunN von getSuperBytecode() und Hinzufügen entsprechender Test.
Umbenennung in IntermediateRefType: getTypParameter() -> getTypArgument() und getTypParameterSize() -> getTypArgumentSize().
2022-03-21 08:42:50 +01:00
Etienne Zink ac1e0340c3 Hinzufügen von FunN zur Generierung von echten Funktionstypen.
FunN ist Subtyp von IntermediateRefType.
Hinzufügen erster FunNTests.
2022-03-20 22:25:55 +01:00
Etienne Zink 0d84e8361f Hinzufügen von IntermediateWildcard und dessen Tests.
Hinzufügen der Tests für IntermediateSuperWildcard und IntermediateExtendsWildcard.
Verbesserung von IntermediateRefType: typParameter können IntermediateType sein und nicht nur IntermediateInnerType.
2022-03-20 20:38:54 +01:00
Etienne Zink 0207c7d1b0 Verbesserung typParameter von IntermediateRefType: Können IntermediateInnerType sein! Nicht nur IntermediateRefType wie zuvor.
Hizufügen entsprechender Tests.
2022-03-20 16:59:24 +01:00
Etienne Zink f1f028f0b9 Hinzufügen von equals() und hashCode() Tests zu IntermediateRefTypeTest und IntermediateGenericTypeTest. 2022-03-20 16:42:12 +01:00
Etienne Zink 8b58259fe0 Hinzufügen von Test zu IntermediateRefTypeTest und IntermediateGenericTypeTest. 2022-03-20 16:34:01 +01:00
Etienne Zink 55a75b04a0 Refactoring für innere Typen, welche ausschließlich einen Descriptor besitzen.
Innere Typen sind dabei IntermediateRefType und IntermediateGenericType.
Implementierung der IntermediateWildcard Typen und Hinzufügen leerer Tests.
2022-03-20 16:08:38 +01:00
Etienne Zink 06b27dabd2 Änderung von hashCode() und equals() zurück zur Benutzung von getFullyQualifiedName(), da dies eindeutig ist im Gegensatz zu getSignature(). 2022-03-20 15:07:02 +01:00
Etienne Zink 9baf89acc2 Änderung von hashCode() und equals(), in IntermediateGenericType und IntermediateRefType, auf Basis von getSignature() und nicht mehr getFullyQualifiedName(). 2022-03-19 18:32:12 +01:00
Etienne Zink be307e95a6 Hizufügen von isParametrized zu IntermediateRefType. 2022-03-19 18:19:42 +01:00
Etienne Zink df4faebd92 Hinzufügen der extends-Beziehung von IntermediateExtendsWildcard und IntermediateSuperWildcard zu IntermediateType, ohne Implementierungen. 2022-03-19 18:16:50 +01:00
Etienne Zink 36ef1e124a Änderung von toSting(): gibt nun getSignature() statt getFullyQualifiedName() zurück. 2022-03-19 18:12:46 +01:00
Etienne Zink 2706c31beb Kleine Anpassung von Kommentaren. 2022-03-19 18:07:24 +01:00
Etienne Zink c32a0cc222 Refactoring access-Modifier von IntermediateType (Klassen-Name Methoden).
Refactoring Signature- und Descriptor-Methoden und caching des Descriptors.
2022-03-19 18:03:54 +01:00
Etienne Zink eaec7f613a Hinzufügen von abstract getClassDescriptor in IntermediateType und Implementierung von IntermediateGenericType. 2022-03-19 17:22:23 +01:00
Etienne Zink c681396061 Implementierung und Tests von IntermediateRefType. 2022-03-19 16:33:13 +01:00
Etienne Zink 3d19d8d729 Hinzufügen der Klassenbeschreibung im JavaDoc für IntermediateType. 2022-03-18 12:53:06 +01:00
Etienne Zink f457e7e4d0 Erste Implementierung des IntermediateType und unvollständige Implementierung von IntermediateRefType. 2022-03-18 09:09:33 +01:00
Etienne Zink c22d12f6b0 Hinzufügen des Grundkonstrukts der Intermediate-Typen. 2022-03-17 17:36:34 +01:00
pl@gohorb.ba-horb.de 0aab2d9f53 modified: ../../../../main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
this wird nicht als Field betrachtet

	new file:   ../../javFiles/packageTest/Pair2.jav
	new file:   ../../javFiles/packageTest/de/test/Pair.jav
2021-06-04 00:52:50 +02:00
JanUlrich 33d6adf899 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2021-05-27 12:10:15 +02:00
JanUlrich 00add07132 Fix Object has null Constructor 2021-05-27 12:10:05 +02:00
pl@gohorb.ba-horb.de 48964d57ad 2
new file:   README_aktuelle_Branches
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/type/GenericRefType.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2021-05-25 15:32:11 +02:00
pl@gohorb.ba-horb.de 18d9edfeea modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
new file:   src/test/java/insertGenerics/TestVectorArg.java
	modified:   src/test/resources/bytecode/javFiles/Fac.jav
	new file:   src/test/resources/insertGenericsJav/TestVectorArg.jav
2021-05-21 09:52:22 +02:00
pl@gohorb.ba-horb.de 1b9e824b86 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2021-04-19 16:18:31 +02:00
pl@gohorb.ba-horb.de b40cb49b9f In PairTPHsmallerTPH origPair eingefuegt, was das OriginalPair darstellt,
entweder vor oder waehrend der Unikation

	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
	new file:   src/main/java/de/dhbwstuttgart/typeinference/result/PairNoResult.java
noetig da als oriPairs auch Paare nicht solved form vorkommen koennen

	modified:   src/main/java/de/dhbwstuttgart/typeinference/result/PairTPHsmallerTPH.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/result/ResultPairVisitor.java
2021-04-19 14:22:40 +02:00
pl@gohorb.ba-horb.de be9ee49878 modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
	modified:   src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/statement/Statement.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/test/java/insertGenerics/TestLocalVarLambda.java
2021-04-13 10:03:48 +02:00
pl@gohorb.ba-horb.de 3363037854 modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
Neue Methode addTph

	modified:   src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
Methodcall-Steatements mit Void als Returntyp
2021-04-09 09:15:10 +02:00
pl@gohorb.ba-horb.de c8d4301e5e modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
Alis Ansatz zur Bytecodeerzeugung eingesetzt

	modified:   src/main/java/de/dhbwstuttgart/bytecode/genericsGeneratorTypes/MethodAndConstraints.java
ToString ausprogramnmiert

	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
Einige bytecode-Usecases laufen noch nicht (z.B. Put.jav) Erste Ansaetze versucht.
Muss noch erweitert werden.
2021-04-08 09:56:49 +02:00
pl@gohorb.ba-horb.de b46415e45a modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
reset Typevars-Namen wieder rausgenommen

	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/factory/NameGenerator.java

	modified:   src/test/java/insertGenerics/TestAny.java
	modified:   src/test/java/insertGenerics/TestClassField.java
	modified:   src/test/java/insertGenerics/TestContraVariant.java
	modified:   src/test/java/insertGenerics/TestGGFinder.java
	modified:   src/test/java/insertGenerics/TestLocalVarLambda.java
	modified:   src/test/java/insertGenerics/TestMutualRecursion.java
	modified:   src/test/java/insertGenerics/TestReturnVar.java
	modified:   src/test/java/insertGenerics/TestSecondLineOfClassConstraints.java
	modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
	modified:   src/test/java/insertGenerics/TestTPHsAndGenerics2.java
	modified:   src/test/java/insertGenerics/TestThreeArgs.java
	modified:   src/test/java/insertGenerics/TestTwoArgs.java
	modified:   src/test/java/insertGenerics/TestTwoArgs2.java
	modified:   src/test/java/insertGenerics/TestTwoCalls.java
	modified:   src/test/java/insertGenerics/TestVector.java
	modified:   src/test/java/insertGenerics/TestVoidMeth.java
Reset Typevar-Namen in @BeforeClass eingefuegt
2021-04-01 19:16:57 +02:00
pl@gohorb.ba-horb.de bbfd8aa203 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-04-01 17:13:06 +02:00
pl@gohorb.ba-horb.de 0cb1f244bc modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
Tests insertGenerics funtionieren
	modified:   src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/factory/NameGenerator.java
reset-Funktion eingefuegt, damit bei jedem Test die Namen der TypepLaceholdert von vorne beginnen

	modified:   src/test/java/insertGenerics/TestContraVariant.java
	modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
	modified:   src/test/java/insertGenerics/TestThreeArgs.java
2021-04-01 16:59:14 +02:00
pl@gohorb.ba-horb.de 9be64e4905 modified: src/main/java/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
	modified:   src/test/java/insertGenerics/TestContraVariant.java
	modified:   src/test/java/insertGenerics/TestLocalVarLambda.java
	modified:   src/test/java/insertGenerics/TestTransitiveClosure.java
Transitiv Closure auf new umgestellt
2021-03-31 18:18:16 +02:00
pl@gohorb.ba-horb.de d1ad6e218a modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/TestTwoArgs.java
2021-03-29 10:45:21 +02:00
pl@gohorb.ba-horb.de bf8d4fe647 new file: src/test/resources/insertGenericsJav/TestContraVariant.jav
new file:   src/test/resources/insertGenericsJav/TestMutualRecursionWithField2.jav
	new file:   src/test/resources/insertGenericsJav/TestMutualRecursionWithField3.jav
2021-03-29 10:00:04 +02:00
pl@gohorb.ba-horb.de e229093017 new file: src/test/java/insertGenerics/TestContraVariant.java
modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
	new file:   src/test/java/insertGenerics/TestThreeArgs.java
2021-03-29 09:57:45 +02:00
pl@gohorb.ba-horb.de 66a25a56c0 Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-03-26 20:55:25 +01:00
AluAli af223a4d8a modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-26 20:53:24 +01:00
pl@gohorb.ba-horb.de 14cb2c8909 Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-03-26 20:19:16 +01:00
AluAli 080eb2f6f3 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-26 20:18:45 +01:00
pl@gohorb.ba-horb.de d8876457db Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-03-26 20:07:48 +01:00
AluAli 32e9ce92a6 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/TestTwoArgs.java
2021-03-26 19:58:38 +01:00
pl@gohorb.ba-horb.de 3ad9007336 Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-03-26 19:27:33 +01:00
AluAli da2a17c794 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
2021-03-26 18:33:36 +01:00
pl@gohorb.ba-horb.de 345b03b775 modified: src/test/java/insertGenerics/TestTPHsAndGenerics.java 2021-03-26 17:27:27 +01:00
pl@gohorb.ba-horb.de ff93b0967e 2
modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
2021-03-26 16:27:24 +01:00
pl@gohorb.ba-horb.de db149eb588 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
klein Korrekturen

	modified:   src/test/java/insertGenerics/TestTwoArgs2.java
List -> Set
2021-03-26 16:15:18 +01:00
AluAli f5f639c0f7 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-26 15:24:15 +01:00
AluAli a4c38b2bb0 Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-03-26 12:30:13 +01:00
AluAli e3625cb306 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/TestTwoCalls.java
2021-03-26 12:29:40 +01:00
pl@gohorb.ba-horb.de 86603ae343 modified: src/main/java/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java
equals korrigiert

	modified:   src/test/java/insertGenerics/TestGGFinder.java
	modified:   src/test/java/insertGenerics/TestLocalVarLambda.java
	modified:   src/test/java/insertGenerics/TestMutualRecursion.java
	modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
	modified:   src/test/java/insertGenerics/TestTwoArgs.java
	modified:   src/test/java/insertGenerics/TestTwoCalls.java
	modified:   src/test/java/insertGenerics/TestVector.java
List -> Set vollendet
2021-03-26 10:51:59 +01:00
pl@gohorb.ba-horb.de d276c7c044 modified: src/main/java/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/ClassConstraint.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
toString wieder korrigiert

	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/MethodConstraint.java
	modified:   src/test/java/insertGenerics/TestAny.java
List -> Set
Bei allen anderen Tests fehlt es noch
2021-03-25 19:55:16 +01:00
pl@gohorb.ba-horb.de 91c075829b Merge branch 'generateTestConstraints' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-03-25 18:59:34 +01:00
pl@gohorb.ba-horb.de 705d0b6a73 renamed: src/test/java/insertGenerics/AllTests.java -> src/test/java/insertGenerics/TestMutualRecursion.java
modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
	modified:   src/test/java/insertGenerics/TestVector.java
Tests angepasst an die GeneratedGenerics
2021-03-25 18:56:38 +01:00
pl@gohorb.ba-horb.de bc378f2fe9 modified: src/test/java/insertGenerics/AllTests.java
modified:   src/test/java/insertGenerics/TestTwoCalls.java
	modified:   src/test/java/insertGenerics/TestVector.java
2021-03-25 00:41:03 +01:00
pl@gohorb.ba-horb.de e5816bac22 modified: src/test/java/insertGenerics/TestAny.java
modified:   src/test/java/insertGenerics/TestGGFinder.java
	modified:   src/test/java/insertGenerics/TestLocalVarLambda.java
	modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
	modified:   src/test/java/insertGenerics/TestTwoArgs.java
	modified:   src/test/java/insertGenerics/TestTwoArgs2.java
Tests fuer GeneratedGenerics eingefuegt
2021-03-24 11:35:15 +01:00
pl@gohorb.ba-horb.de 8c6027645f modified: src/test/java/insertGenerics/TestLocalVarLambda.java
Alternative Typvarnamen eingefuegt.
2021-03-24 10:22:57 +01:00
pl@gohorb.ba-horb.de e147a8ce85 toString geaendert, um Tests generieren zu koennen:
modified:   src/main/java/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/ClassConstraint.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/MethodConstraint.java

geaendert, um GenerateGenerics direkt teste zu koennen, sollte ggf. wieder rueckgaenig gemacht werden
	modified:   src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java

angepasset Tests:
	modified:   src/test/java/insertGenerics/TestLocalVarLambda.java
	modified:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
	modified:   src/test/java/insertGenerics/TestTwoArgs.java
2021-03-23 12:02:58 +01:00
AluAli d08e598649 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-19 22:02:23 +01:00
AluAli ba8df8b376 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-19 18:27:50 +01:00
AluAli b147430fb6 kommentierte neue Regeln 2021-03-19 15:05:40 +01:00
AluAli 661fa53937 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-19 14:42:22 +01:00
AluAli 13144d0ac9 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-19 14:23:07 +01:00
AluAli 539cacef86 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-19 08:50:04 +01:00
pl@gohorb.ba-horb.de 6e0e575524 new file: src/test/java/insertGenerics/TestLocalVarLambda.java 2021-03-15 11:27:31 +01:00
AluAli 55e44d62de modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-13 14:52:38 +01:00
AluAli 54de28c3f0 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-13 13:16:47 +01:00
AluAli 8e89c9b5e8 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-13 01:26:20 +01:00
AluAli bb5692da8e modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-12 18:35:29 +01:00
pl@gohorb.ba-horb.de f69554c6a1 equals in in Type eingefuegt 2021-03-12 18:29:51 +01:00
pl@gohorb.ba-horb.de fbb7d82ef4 Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-03-12 18:22:03 +01:00
pl@gohorb.ba-horb.de 4f1aadef60 modified: src/main/java/de/dhbwstuttgart/syntaxtree/type/RefTypeOrTPHOrWildcardOrGeneric.java 2021-03-12 18:21:46 +01:00
AluAli 4acb820202 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-12 17:08:40 +01:00
pl@gohorb.ba-horb.de 6862c91b73 modified: src/main/java/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java 2021-03-12 12:30:41 +01:00
AluAli 55ee8ab61a modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-12 11:43:55 +01:00
AluAli af9943be28 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-03-05 21:47:22 +01:00
AluAli f208432c54 modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2021-03-05 20:18:48 +01:00
pl@gohorb.ba-horb.de 2ca4aad07d modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
2021-03-05 10:57:42 +01:00
AluAli b99c022b50 modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2021-03-05 09:12:19 +01:00
AluAli d1a796f37b Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-03-05 00:32:33 +01:00
AluAli 31d7856afa modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2021-03-05 00:31:36 +01:00
pl@gohorb.ba-horb.de b711dc72e0 new file: src/test/java/insertGenerics/AllTests.java 2021-03-04 18:58:33 +01:00
AluAli d14f1d92c9 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-02-26 11:42:31 +01:00
pl@gohorb.ba-horb.de ebb0803a38 new file: ../../../java/insertGenerics/TestTwoCalls.java
new file:   ../../../java/insertGenerics/TestVector.java
	new file:   ../../insertGenericsJav/TestLocalVarLambda.jav
	new file:   ../../insertGenericsJav/TestMutualRecursion.jav
	new file:   ../../insertGenericsJav/TestMutualRecursionWithField.jav
	new file:   ../../insertGenericsJav/TestThreeArgs.jav
	new file:   ../../insertGenericsJav/TestTwoCalls.jav
	new file:   ../../insertGenericsJav/TestVector.jav
2021-02-25 15:59:24 +01:00
pl@gohorb.ba-horb.de 60f2e3def4 modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java
2021-02-25 00:13:29 +01:00
pl@gohorb.ba-horb.de 7e35e09c47 modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/Method.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/SourceFile.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
AndConstraints einer Methode in Methode.java und iin MethodAndTPH.java eingefuegt
	modified:   src/test/resources/insertGenericsJav/TestAny.jav
2021-02-19 13:58:48 +01:00
pl@gohorb.ba-horb.de ab99889c3c modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Bei Return SMALLERDOT durch EQUALSDOT ersetzt
2021-02-16 16:52:53 +01:00
pl@gohorb.ba-horb.de bbdf220324 modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/Method.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/SourceFile.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
Pairs sammeln rueckgaengig gemacht
2021-02-16 16:27:17 +01:00
pl@gohorb.ba-horb.de f2d6dae4c7 Letzer Stand mit Pair Bildug waehrend des Typvars sammeln 2021-02-16 15:29:24 +01:00
pl@gohorb.ba-horb.de 905dfd8a27 modified: ../../../../main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   ../../../../main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2021-02-08 00:15:25 +01:00
pl@gohorb.ba-horb.de 5fb2d57d3b modified: ../../../../main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java 2021-02-07 09:47:25 +01:00
pl@gohorb.ba-horb.de 5b7fec660d modified: ../../../../main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java 2021-02-06 09:51:42 +01:00
pl@gohorb.ba-horb.de 5980f1c7b8 modified: ../../../../main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   ../../../../main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
	modified:   ../../../../main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
	modified:   ../../../../main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
	modified:   ../../../java/constraintSimplify/FamilyOfGenerics.java
	modified:   ../../../java/insertGenerics/TestTPHsAndGenerics.java
2021-02-05 22:37:39 +01:00
pl@gohorb.ba-horb.de f270686b3c modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/utilities/MethodAndTPH.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java
	modified:   src/test/java/constraintSimplify/FamilyOfGenerics.java
2021-02-04 23:58:49 +01:00
pl@gohorb.ba-horb.de 92bc3d626c modified: ../../../../main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
SourceFile und nameToMeth ergaenzt

	modified:   ../../../../main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
	modified:   ../../../../main/java/de/dhbwstuttgart/syntaxtree/SourceFile.java
	  List<Method> getAllMethods() ergaenzty

	modified:   ../../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
           variance wird uebernommen

	modified:   ../../../../main/java/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java
	   setVariance gefuegt.

	modified:   ../../../java/insertGenerics/TestTwoArgs.java
	modified:   ../../../java/insertGenerics/TestTwoArgs2.java
	modified:   ../../insertGenericsJav/TestTwoArgs.jav
	modified:   ../../insertGenericsJav/TestTwoArgs2.jav
2021-02-03 16:55:12 +01:00
pl@gohorb.ba-horb.de ef723e4103 modified: ../../../../main/java/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java
Zusaetzliche Typvariablen weider entfernt
2021-02-01 16:56:33 +01:00
AluAli 9f06118138 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2021-01-31 20:54:03 +01:00
AluAli a0c92c2d9d Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-01-31 20:34:18 +01:00
pl@gohorb.ba-horb.de c6d896fa3b modified: ../../../main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
modified:   ../../java/insertGenerics/TestGGFinder.java
	modified:   TestGGFinder.jav
2021-01-30 22:06:27 +01:00
pl@gohorb.ba-horb.de b942e508fc Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-01-29 22:49:07 +01:00
pl@gohorb.ba-horb.de f33002e998 new file: src/test/java/insertGenerics/TestTwoArgs.java
new file:   src/test/resources/insertGenericsJav/TestTwoArgs.jav
2021-01-29 22:48:20 +01:00
AluAli 2dc4331afb modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-29 20:45:54 +01:00
AluAli ebf6f0bbe3 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-29 20:41:43 +01:00
AluAli dc62b72f7f modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2021-01-29 19:36:17 +01:00
AluAli 42bb787195 Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-01-29 18:22:39 +01:00
AluAli cd135c3962 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-29 18:22:04 +01:00
pl@gohorb.ba-horb.de 59adfd6c59 Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-01-29 18:13:09 +01:00
pl@gohorb.ba-horb.de 604300a07e modified: src/main/java/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java
new file:   src/test/java/insertGenerics/TestTwoArgs.java
	new file:   src/test/java/insertGenerics/TestTwoArgs2.java
	new file:   src/test/resources/insertGenericsJav/TestTwoArgs.jav
	new file:   src/test/resources/insertGenericsJav/TestTwoArgs2.jav
2021-01-29 18:12:44 +01:00
AluAli 0bc0e4c722 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
deleted:    src/test/java/insertGenerics/MethodsTest.java
	deleted:    src/test/java/insertGenerics/TryTest.java
2021-01-29 18:03:43 +01:00
pl@gohorb.ba-horb.de ebfc3dedbe Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-01-29 12:29:24 +01:00
pl@gohorb.ba-horb.de e07e5e9b42 modified: src/main/java/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java 2021-01-29 12:29:08 +01:00
AluAli 8fb7a23279 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
	modified:   src/test/java/insertGenerics/TestExample42.java
	modified:   src/test/java/insertGenerics/TestExample42_allInOneMethod.java
2021-01-29 12:24:16 +01:00
pl@gohorb.ba-horb.de 8706882388 modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
new file:   src/test/java/insertGenerics/TestGGFinder.java
2021-01-29 10:55:04 +01:00
pl@gohorb.ba-horb.de 918d0db799 modified: src/main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java 2021-01-29 09:25:10 +01:00
pl@gohorb.ba-horb.de 4b99b38b47 Merge branch 'bigRefactoringUnifyComment' into bytecodeGenericsSecond 2021-01-28 16:18:42 +01:00
pl@gohorb.ba-horb.de 1236ca2953 modified: src/main/java/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java
modified:   src/test/resources/insertGenericsJav/TestGGFinder.jav
2021-01-28 16:12:17 +01:00
AluAli 1348a7a4b6 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-01-23 00:07:05 +01:00
AluAli 3f4aa7bbd5 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
	modified:   src/test/java/insertGenerics/TestExample42.java
	modified:   src/test/java/insertGenerics/TestExample42_allInOneMethod.java
2021-01-22 23:49:25 +01:00
AluAli bb900af6bf modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-01-22 15:52:14 +01:00
AluAli cfacc6235c modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-01-22 15:13:03 +01:00
AluAli 1a135ebe5c modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2021-01-22 15:07:03 +01:00
AluAli c15953bbac modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-18 19:15:36 +01:00
AluAli 404bbbf746 Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-01-18 19:11:33 +01:00
AluAli a8f04a25cd modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-18 19:10:04 +01:00
pl@gohorb.ba-horb.de 1242252cde modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-18 13:46:06 +01:00
pl@gohorb.ba-horb.de 5e9e774d1e Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-01-18 13:41:44 +01:00
pl@gohorb.ba-horb.de bd6d74c74d modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-18 13:40:20 +01:00
AluAli 3d8275c676 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-16 16:34:31 +01:00
pl@gohorb.ba-horb.de 3ef15d814d Merge branch 'bytecodeGenericsSecond' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenericsSecond 2021-01-16 09:16:25 +01:00
pl@gohorb.ba-horb.de 842b85cfd7 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-16 09:12:34 +01:00
AluAli fc8f11ebb1 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
new file:   src/test/java/insertGenerics/TestAny.java
	new file:   src/test/java/insertGenerics/TestTPHsAndGenerics2.java
	new file:   src/test/resources/insertGenericsJav/TestAny.jav
	modified:   src/test/resources/insertGenericsJav/TestReturnVar.jav
	modified:   src/test/resources/insertGenericsJav/TestSecondLineOfClassConstraints.jav
	new file:   src/test/resources/insertGenericsJav/TestTPHsAndGenerics2.jav
2021-01-16 00:35:12 +01:00
AluAli eb97dd810f modified: src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
new file:   src/test/java/insertGenerics/TestClassField.java
	new file:   src/test/java/insertGenerics/TestReturnVar.java
	new file:   src/test/java/insertGenerics/TestSecondLineOfClassConstraints.java
	new file:   src/test/java/insertGenerics/TestTPHsAndGenerics.java
	new file:   src/test/java/insertGenerics/TestVoidMeth.java
	new file:   src/test/resources/insertGenericsJav/TestClassField.jav
	new file:   src/test/resources/insertGenericsJav/TestReturnVar.jav
	new file:   src/test/resources/insertGenericsJav/TestSecondLineOfClassConstraints.jav
	new file:   src/test/resources/insertGenericsJav/TestTPHsAndGenerics.jav
	new file:   src/test/resources/insertGenericsJav/TestVoidMeth.jav
2021-01-15 13:18:09 +01:00
AluAli ab850edae8 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2021-01-15 01:12:13 +01:00
pl@gohorb.ba-horb.de 95f48ffcb7 modified: ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
ckeckA druch checkNoContradiction ersetzt
2021-01-14 15:29:06 +01:00
pl@gohorb.ba-horb.de 163f0f3047 modified: ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
vor Loeschung von checkA
2021-01-14 14:59:20 +01:00
pl@gohorb.ba-horb.de 1cf22d2602 modified: ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
remaingSet entfernt
fstElems in oneElems umbenannt
2021-01-14 11:27:19 +01:00
pl@gohorb.ba-horb.de d8ac25234f modified: ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
vor entfernung von Remaining
2021-01-14 10:38:32 +01:00
pl@gohorb.ba-horb.de e00d76ce3b Occurs-Check mit Abbruch eingebaut
finalResult zum Attribut der Klasse gemacht
2021-01-13 19:39:01 +01:00
pl@gohorb.ba-horb.de fec83c3a62 modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Fuer den Receiver wieder = eingefuegt.

	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Kommentierung begonnen
2021-01-12 21:27:44 +01:00
AluAli 3f5f51df5b modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2021-01-08 22:05:09 +01:00
AluAli dce7ac8262 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
new file:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/PairMethodAndConstraint.java
	modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2021-01-08 21:43:06 +01:00
AluAli 2f37bb7313 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2020-12-29 01:03:55 +01:00
AluAli a04316f629 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
	modified:   src/test/java/insertGenerics/TestExample42.java
	modified:   src/test/java/insertGenerics/TestExample42_allInOneMethod.java
2020-12-29 00:22:36 +01:00
AluAli 3b062de612 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
	modified:   src/test/java/insertGenerics/TestExample42.java
	modified:   src/test/java/insertGenerics/TestExample42_allInOneMethod.java
2020-12-28 15:37:45 +01:00
AluAli c32ef1e31f modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/TestExample42.java
	new file:   src/test/java/insertGenerics/TestExample42_allInOneMethod.java
2020-12-28 00:29:08 +01:00
AluAli 5ed6a4617a modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2020-12-22 16:11:24 +01:00
AluAli 7139a1709e modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2020-12-22 16:08:01 +01:00
AluAli e9bcea4b9e modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2020-12-21 14:06:47 +01:00
AluAli d671e74fcf modified: src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java 2020-12-04 16:44:46 +01:00
AluAli c2f0368d2e modified: src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java 2020-12-04 14:59:09 +01:00
AluAli d06c6abb5a modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/PositionFinder.java
	modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
	modified:   src/test/java/insertGenerics/TestExample42.java
2020-12-04 14:25:37 +01:00
AluAli f7101da621 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
new file:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/PairTphMethod.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/PositionFinder.java
	modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2020-12-04 13:17:31 +01:00
AluAli c0c24eed3b modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2020-12-04 11:00:12 +01:00
AluAli af36b43786 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2020-11-30 12:32:35 +01:00
AluAli 997d3b9bea modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2020-11-27 15:52:31 +01:00
AluAli ed7cc55139 modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
2020-11-27 15:29:07 +01:00
AluAli 29a7f2e7fb modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2020-11-27 14:10:31 +01:00
AluAli 4ac67120a4 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2020-11-13 17:24:41 +01:00
AluAli f0db6cb901 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java 2020-11-13 16:22:23 +01:00
AluAli 2e5581ab6e modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2020-11-13 15:29:01 +01:00
AluAli e8ac8e3c5a modified: src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java 2020-11-13 13:50:36 +01:00
AluAli a4bc49f5c4 modified: src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
2020-11-13 00:43:49 +01:00
AluAli 9cf7cec37b modified: src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
renamed:    src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/ClassConstraint.java -> src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/ClassConstraint.java
	renamed:    src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java -> src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/FamilyOfGeneratedGenerics.java
	renamed:    src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/GGenerics.java -> src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/GGenerics.java
	renamed:    src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/MethodConstraint.java -> src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/MethodConstraint.java
	renamed:    src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/PositionFinder.java -> src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/PositionFinder.java
	renamed:    src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/preGGenerics.java -> src/main/java/de/dhbwstuttgart/bytecode/insertGenerics/preGGenerics.java
	modified:   src/test/java/constraintSimplify/FamilyOfGenerics.java
	modified:   src/test/java/insertGenerics/FamilyOfGeneratedGenericsTest.java
	modified:   src/test/java/insertGenerics/TestExample42.java
	modified:   src/test/java/insertGenerics/TestTransitiveClosure.java
2020-11-06 18:13:21 +01:00
JanUlrich 531b1ccd22 Merge branch 'bytecodeGenerics' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenerics 2020-11-06 16:34:42 +01:00
JanUlrich 7ced6338cb Add Test case for FamilyOfGenerics 2020-11-06 16:34:32 +01:00
AluAli 0550f73ef7 modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java 2020-11-06 16:33:05 +01:00
JanUlrich b91aadf24a Merge branch 'bytecodeGenerics' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenerics 2020-11-06 15:26:25 +01:00
AluAli 70b6c35731 modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
modified:   src/test/java/insertGenerics/TestExample42.java
	new file:   src/test/java/insertGenerics/TestTransitiveClosure.java
2020-11-06 15:22:36 +01:00
AluAli e617a0911a modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/ClassConstraint.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
2020-11-06 11:51:04 +01:00
AluAli 7cf46b02b7 modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java 2020-11-06 11:24:21 +01:00
JanUlrich 8cf57ba35b Merge branch 'bytecodeGenerics' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenerics 2020-11-06 10:45:50 +01:00
AluAli 486d7d9011 modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java 2020-11-06 00:58:04 +01:00
AluAli 8402d18f83 modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
new file:   src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/PositionFinder.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
	modified:   src/test/java/constraintSimplify/FamilyOfGenerics.java
	new file:   src/test/java/insertGenerics/TestExample42.java
2020-11-01 14:09:27 +01:00
JanUlrich 8d25920a87 Add Hashcode methods 2020-10-30 15:44:46 +01:00
AluAli ab9e9e16bd Merge branch 'bytecodeGenerics' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenerics 2020-10-30 10:52:39 +01:00
JanUlrich b45964ed5f Template für FamilyOfGenerics Test 2020-10-30 10:52:03 +01:00
AluAli 0ecd3916f8 modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/ClassConstraint.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
2020-10-30 09:41:09 +01:00
AluAli c86fe95da5 modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java 2020-10-29 19:43:50 +01:00
AluAli d677d053d6 modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
2020-10-29 19:40:46 +01:00
AluAli 5060cca6db modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/ClassConstraint.java
modified:   src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/MethodConstraint.java
	modified:   src/main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
	new file:   src/test/java/insertGenerics/MethodsTest.java
	new file:   src/test/java/insertGenerics/TryTest.java
	new file:   src/test/resources/insertGenericsJav/TestGGFinder.jav
2020-10-23 10:42:24 +02:00
AluAli 7900449897 modified: src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java 2020-10-23 00:11:54 +02:00
AluAli f6154b8f2c deleted: src/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
new file:   src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/ClassConstraint.java
	new file:   src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
	renamed:    src/de/dhbwstuttgart/bytecode/gGenericsAli/GGenerics.java -> src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/GGenerics.java
	new file:   src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/MethodConstraint.java
	renamed:    src/de/dhbwstuttgart/bytecode/gGenericsAli/preGGenerics.java -> src/main/java/de/dhbwstuttgart/bytecode/gGenericsAli/preGGenerics.java
2020-10-22 22:13:05 +02:00
pl@gohorb.ba-horb.de 1d7c894f39 modified: ../../../../main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java 2020-10-16 15:55:22 +02:00
AluAli 61f35f8f8b Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecodeGenerics 2020-10-16 15:37:53 +02:00
AluAli 1e7c25805e new file: src/de/dhbwstuttgart/bytecode/gGenericsAli/FamilyOfGeneratedGenerics.java
new file:   src/de/dhbwstuttgart/bytecode/gGenericsAli/GGenerics.java
	new file:   src/de/dhbwstuttgart/bytecode/gGenericsAli/preGGenerics.java
2020-10-16 15:13:50 +02:00
pl@gohorb.ba-horb.de 5a00b70ea8 modified: ../../../../main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
modified:   ../../../../main/java/de/dhbwstuttgart/bytecode/genericsGenerator/GeneratedGenericsFinder.java
	modified:   ../../../java/AllgemeinTest.java
	modified:   ../../bytecode/javFiles/FieldTphConsMeth.jav
2020-10-16 14:54:36 +02:00
JanUlrich 6e91e5c683 Merge addPackages, simplifyRes und bigRefactoring 2020-10-01 10:11:20 +02:00
JanUlrich e4908557f4 Merge addPackages and simplifyRes and clear project 2020-09-30 03:45:01 +02:00
JanUlrich ed550b1097 Aufräumen 2020-09-30 03:32:57 +02:00
JanUlrich 5fa1cf11ef Merge branch 'simplifyRes' into bigRefactoring 2020-09-25 18:48:28 +02:00
JanUlrich 941a3bed66 Add ANTLR parser generator output to gitignore 2020-09-17 10:58:44 +02:00
pl@gohorb.ba-horb.de 653901ef32 modified: ../../../../main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
alten Code geloescht
2020-05-13 14:07:22 +02:00
pl@gohorb.ba-horb.de 2e03b5b10c modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
auskommentierten Code geloescht
2020-05-12 17:35:28 +02:00
pl@gohorb.ba-horb.de 670e3ed99f modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
nextSetasListRest = oup.minElements(nextSetasListRest);
	nextSetasListRest = oup.maxElements(nextSetasListRest);

eingefuegt
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
2020-05-12 17:25:04 +02:00
pl@gohorb.ba-horb.de c8ece0a010 new file: ../../../java/bytecode/InheritTest2.java
modified:   AA.jav
	modified:   CC.jav
	new file:   Inherit2.jav
2020-05-12 10:02:41 +02:00
pl@gohorb.ba-horb.de c27e1fa4e1 modified: ../../../java/bytecode/InheritTest.java
modified:   Inherit.jav
Funktioniert soweit
2020-05-11 17:54:37 +02:00
pl@gohorb.ba-horb.de b3b25b7869 Merge branch 'addPackages' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into addPackages 2020-05-11 13:47:16 +02:00
pl@gohorb.ba-horb.de 9240b0d163 Changes to be committed:
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/test/java/bytecode/InheritTest.java
	modified:   src/test/resources/bytecode/javFiles/Inherit.jav
2020-05-11 13:45:19 +02:00
JanUlrich a0a813f87c Inherit Test update 2020-05-08 11:35:21 +02:00
JanUlrich 60b182b9b1 Kleiner Hack für Inherit test 2020-05-08 11:26:07 +02:00
pl@gohorb.ba-horb.de 8e2d4e1c70 modified: ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
new file:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingExtend.java
2020-05-08 11:04:05 +02:00
pl@gohorb.ba-horb.de 907ab2fcec modified: ../../../java/bytecode/InheritTest.java
modified:   ../../bytecode/javFiles/Inherit.jav
2020-05-08 10:19:00 +02:00
pl@gohorb.ba-horb.de eb27003515 modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/Node.java
Fehler in der Transitivaet der Finit Closure gefixt

	modified:   ../../../java/bytecode/InheritTest.java
	modified:   ../../bytecode/javFiles/AA.jav
	modified:   ../../bytecode/javFiles/CC.jav
	modified:   ../../bytecode/javFiles/Inherit.jav
Noch Probl;em in der Reflections
2020-05-07 16:29:00 +02:00
pl@gohorb.ba-horb.de 71c801c19c modified: ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2020-05-06 19:25:19 +02:00
pl@gohorb.ba-horb.de ba750187ba modified: ../src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../src/main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java
	modified:   ../src/test/java/bytecode/InheritTest.java
	new file:   ../src/test/resources/bytecode/javFiles/AA.jav
	new file:   ../src/test/resources/bytecode/javFiles/BB.jav
	new file:   ../src/test/resources/bytecode/javFiles/CC.jav
	new file:   ../src/test/resources/bytecode/javFiles/DD.jav
	modified:   ../src/test/resources/bytecode/javFiles/Inherit.jav
Inherit funktioniert noch nicht ganz
2020-05-06 19:22:08 +02:00
pl@gohorb.ba-horb.de ccf5df1f1e new file: ../../../java/bytecode/InheritTest.java
modified:   ../../../java/bytecode/PutTest.java
	new file:   ../../bytecode/javFiles/Inherit.jav
2020-05-05 18:43:39 +02:00
pl@gohorb.ba-horb.de 3de735ebe3 modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
new file:   ../../../java/bytecode/PutTest.java
	new file:   ../../bytecode/javFiles/Put.jav
2020-05-05 18:06:05 +02:00
pl@gohorb.ba-horb.de fd3d4e97a1 modified: ../../../../main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
isInherited für ? extends wieder mit gleich gesetzt

	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Variance = -1 und Oderconstraints Vererbung eingebaut
Variance = 0 min/max eingebaut
2020-05-05 17:14:52 +02:00
pl@gohorb.ba-horb.de 6deeb4105f modified: ../../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
Fuer Variance = 1 neue Version korrekt, konnte aber noch Fehler entbhalten
2020-05-04 17:02:15 +02:00
pl@gohorb.ba-horb.de 9d4980d9a1 modified: ../src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../src/main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
2020-05-01 22:55:25 +02:00
pl@gohorb.ba-horb.de b83e2c10e3 modified: ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Call-graph weiter umgesetzt, aber noch Fehler in MatrixOP
2020-04-27 22:17:37 +02:00
pl@gohorb.ba-horb.de 4f10e789d4 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/Method.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java
	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java
	modified:   src/test/java/AllgemeinTest.java
 Erster Ansatz Call-Graph zu beruecksichtigen
2020-04-24 23:05:42 +02:00
pl@gohorb.ba-horb.de 8b9f0d6376 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
log-Files abgeschaltet
	modified:   src/test/java/AllgemeinTest.java
File ergaenzt
2020-04-20 14:29:15 +02:00
pl@gohorb.ba-horb.de 723eca8658 modified: src/test/java/typeinference/JavaTXCompilerTest.java
modified:   src/test/resources/javFiles/IfTest.jav
	modified:   src/test/resources/javFiles/ListenerOverload.jav
	modified:   src/test/resources/javFiles/fc.jav
2020-04-14 18:28:16 +02:00
pl@gohorb.ba-horb.de 071f4cd9ca modified: src/test/java/typeinference/JavaTXCompilerTest.java
modified:   src/test/java/typeinference/Meth_GenTest.java
	modified:   src/test/java/typeinference/UnifyTest.java
Tests angepasst
2020-04-14 16:47:25 +02:00
pl@gohorb.ba-horb.de cdc6a3f2dd Merge branch 'simplifyRes' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into simplifyRes 2020-04-13 16:23:09 +02:00
pl@gohorb.ba-horb.de cc6156695d modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
INSTANCE auf sich selber geloescht
2020-04-13 16:22:10 +02:00
pl@gohorb.ba-horb.de 1b6af9ab7e modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java
	modified:   src/main/java/de/dhbwstuttgart/typedeployment/TypeInsertPlacer.java
Bug 180 - Andere Einsetzung als im Bytecode geloest
2020-04-13 16:08:42 +02:00
michael 0861f74ce7 Bug 171: Beim Typeinsert werden Marker jetzt richtig verschoben. 2020-04-02 22:20:31 +02:00
pl@gohorb.ba-horb.de 3f919be1bf new file: ../../../java/AllgemeinTest.java
new file:   ../../../java/bytecode/mathStrucMatrixOPTest.java.txt
	new file:   ../../../java/bytecode/mathStrucVectorAddTest.java.txt
	new file:   ../../../java/packages/mathStrucMatrixOPTest.java.txt
	new file:   ../../AllgemeinTest/FCTest1.jav
	new file:   ../../AllgemeinTest/FCTest2.jav
	new file:   ../../AllgemeinTest/FCTest3.jav
	new file:   ../../AllgemeinTest/GenTest.jav
	new file:   ../../AllgemeinTest/Generics.jav
	new file:   ../../AllgemeinTest/OverloadingMain.jav
	new file:   ../../AllgemeinTest/Overloading_Generics.jav
	new file:   ../../AllgemeinTest/OverrideMain.jav
	new file:   ../../AllgemeinTest/OverrideMainRet.jav
	new file:   ../../AllgemeinTest/Pair.java
2020-03-30 16:17:52 +02:00
pl@gohorb.ba-horb.de 97bdfe1d3a modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
wenn nicht wildcardable dann receiver ? extends geloescht
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
kleiner Fehler in compare
2020-03-30 13:28:13 +02:00
pl@gohorb.ba-horb.de 7c7dbf3769 modified: ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Das fehlerveruraschende Paar wird auch zu abhSubst hingefuegt.
2020-03-29 11:05:52 +02:00
pl@gohorb.ba-horb.de 577faa88af modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Reihenfolge geaendert, so dass bei Variance 1 (x <. theta) vorne und bei Variance -1 (theta <. x) vorne
2020-03-28 00:16:43 +01:00
pl@gohorb.ba-horb.de 8bdb7e7b13 modified: ../src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
noch Fehler bei mathStruc<Integer> und Matrix laeuft sehr lange vll. terminiert es nicht.
2020-03-26 17:23:56 +01:00
pl@gohorb.ba-horb.de eca187da79 modified: src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
2020-03-26 12:44:56 +01:00
michael a11dc1ab22 Newer version of antlr. 2020-03-21 16:56:34 +01:00
pl@gohorb.ba-horb.de 850af6a6ae modified: ../src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../src/main/java/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Vererbung korrigiert
2020-03-19 18:36:20 +01:00
pl@gohorb.ba-horb.de ed1bb44089 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java

variance = 2 umgesetzt auf variance = 1, variance = -1, variance = 0
2020-03-19 17:03:54 +01:00
pl@gohorb.ba-horb.de 592de5310e modified: ../src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../src/main/java/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java
	modified:   ../src/main/java/de/dhbwstuttgart/syntaxtree/SourceFile.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
2020-03-18 17:36:10 +01:00
pl@gohorb.ba-horb.de e4e3704c7b modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
Umbau TYPEStmt Methods begonnen
2020-03-17 14:06:21 +01:00
pl@gohorb.ba-horb.de 21bc3e5193 modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Reigenfolge der der nextSets angepasst
2020-03-13 15:57:27 +01:00
pl@gohorb.ba-horb.de 44368f2a2a modified: ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
weitere Logausgaben bei a <. theta'
2020-03-13 14:04:57 +01:00
pl@gohorb.ba-horb.de aa94ce8ad9 modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
Fehler korrigiert in compare
2020-03-12 10:18:48 +01:00
pl@gohorb.ba-horb.de d63c27579c modified: ../../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
Typen der Methoden der Oder-Constraiunts benutzen wieder rueckgaenig gemacht

	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
wieder alle grArg im a <. theta' benutzen
	modified:   ../../bytecode/javFiles/MatrixOP.jav
2020-03-09 18:30:36 +01:00
pl@gohorb.ba-horb.de b38340fc60 modified: ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java
toString veraendert
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/Match.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Fall A <. theta' veraendert.

	modified:   ../../bytecode/javFiles/MatrixOP.jav
2020-03-09 14:06:41 +01:00
pl@gohorb.ba-horb.de df0d02cdea Revert " modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java"
This reverts commit 47ec1dca5a.
2020-03-06 13:57:01 +01:00
pl@gohorb.ba-horb.de 6afee86066 new file: PluginBau.docx 2020-03-03 15:42:07 +01:00
pl@gohorb.ba-horb.de 900a487d8a modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Aufruf von isCanceled an verschiedenen Stellen ergaenzt, so dass jetzt alle Prozesse angehalten werden sollten
2020-03-03 14:52:11 +01:00
michael e07df035ea Check for null list. Crash fix. 2020-03-03 10:27:13 +01:00
pl@gohorb.ba-horb.de 47ec1dca5a modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/UnifyTaskModel.java
	new file:   src/main/java/de/dhbwstuttgart/typeinference/unify/controlCancel.java

controlCancel.java kann durch IProgressMonitor aus Eclipse implementiert werden.
So lässt sich das Cancel-Problem des Eclipse-Plugins loesen.
2020-02-29 22:22:37 +01:00
pl@gohorb.ba-horb.de e913bfa768 modified: ../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Im Bytecode werden MethpdCaltypen bereits beim TYPEen angelegt.
2020-02-07 18:17:58 +01:00
pl@gohorb.ba-horb.de 98997d686f modified: ../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
Lokale Variablen eingefuegt

Wildcards korrigiert

logFiule off

	modified:   ../../../main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
	modified:   ../../../main/java/de/dhbwstuttgart/syntaxtree/Constructor.java
	modified:   ../../../main/java/de/dhbwstuttgart/syntaxtree/statement/MethodCall.java
	modified:   ../../../main/java/de/dhbwstuttgart/syntaxtree/statement/NewClass.java
	modified:   ../../../main/java/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java
	modified:   ../../../main/java/de/dhbwstuttgart/syntaxtree/statement/ThisCall.java
Typeargumente von Receiver und Argumenten in Methodcall eingefuegt.
2020-02-07 17:46:11 +01:00
pl@gohorb.ba-horb.de 5c97d80eb0 modified: src/main/java/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
2020-02-06 18:35:33 +01:00
pl@gohorb.ba-horb.de 23384f413d modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
variance von Pairs geloescht.
2020-02-06 15:27:51 +01:00
pl@gohorb.ba-horb.de a5662cdd9a modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
Nachtraegliches Einfuegen von Variance in OderConstraints auskommentiert.

	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
Variance im konvertieren eingefuegt

	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/type/TypePlaceholder.java
Variace eingefuegt

	modified:   src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
In OderConstraints Variance bei der Erstellung eingefuegt
2020-02-06 11:39:27 +01:00
pl@gohorb.ba-horb.de 28400c8bde modified: ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
Variance aller Argumente in Oderconstraints auf 1 gesetzt muss nochmals ueberarbeitet werden

	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Returntypen von Operatoren sind \doteq gestezt

	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Bei Variance = 2 parallel abgearbeitet geloescht, dass nicht nochmals bearbeitet werden.
2020-02-06 08:51:30 +01:00
pl@gohorb.ba-horb.de b68004a214 modified: ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
Weiter Ausgave der abstrakten Syntax auf die Console
Fehler bei der Auswahl der Varianz behoben.
2020-01-31 10:03:33 +01:00
pl@gohorb.ba-horb.de 8d72b58fcc modified: ../../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
Methode unbenannt in unbox
2020-01-21 19:48:31 +01:00
pl@gohorb.ba-horb.de e581050a61 modified: ../../../java/packages/LoadDefaultPackageClassesTest.java
modified:   ../../../java/packages/OLOneFileTest.java
2020-01-21 18:22:40 +01:00
pl@gohorb.ba-horb.de 1ec7a78b14 modified: ../../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
basetype und RefType Fehler korrigiert
Methode basetypeComp eingefuegt.
2020-01-21 18:04:56 +01:00
pl@gohorb.ba-horb.de 8ec1c5148b new file: OLTest.txt
new file:   UseOLMain.java
Test für die ComandLine-Version
2020-01-21 14:34:09 +01:00
pl@gohorb.ba-horb.de bf80361c1f new file: ../../../java/packages/OLOneFileTest.java
new file:   OLOneFile.jav
2020-01-21 14:12:48 +01:00
pl@gohorb.ba-horb.de a9d6e08a20 modified: ../../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java 2020-01-21 14:10:38 +01:00
pl@gohorb.ba-horb.de d55e6b3b75 modified: ../../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
fehlerhafter Aufruf getMethod korrigiert.

	modified:   ../../../java/packages/OLTest.java
	modified:   OLMain.jav
	new file:   OLextends.jav
	renamed:    OL.jav -> de/test/OL.jav
OL-Beispiel mit doppelter Vererbung eingefuegt.
2020-01-21 12:27:41 +01:00
JanUlrich a6287b1551 Work with File instead of Strings when specifying output als classpath 2020-01-17 16:06:51 +01:00
pl@gohorb.ba-horb.de 5500180c6b modified: ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2020-01-15 20:47:39 +01:00
JanUlrich 0c1ca3d200 Fehler beheben und DirecotryClassLoader anfügen 2020-01-12 22:49:51 +01:00
JanUlrich f3d6fcb417 add -classpath to ConsoleInterface. Fix bug 2020-01-11 20:19:23 +01:00
JanUlrich d1138540de Make jar with dependencies executable 2020-01-10 16:53:14 +01:00
pl@gohorb.ba-horb.de 647c9e6c21 modified: ../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
.replace("/", ".")); anegfuegt, damit auch bei packages superklassen gefunden erden.
2020-01-08 14:47:03 +01:00
pl@gohorb.ba-horb.de 6779f10b08 modified: ../../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
Bug "." wird in replaceAll nicht ersetzt, deshalb "/" durch "." und nicht "." durch "/" ersetzt.

	modified:   ../../../java/packages/OLTest.java
	modified:   ../../../java/packages/mathStrucVectorTest.java
	renamed:    de/test/OL.jav -> OL.jav
	renamed:    de/test/OLMain.jav -> OLMain.jav
OL ins default-Package verschoben
2020-01-07 18:37:43 +01:00
pl@gohorb.ba-horb.de ac3f8ece0e Merge branch 'addPackages' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into addPackages 2020-01-07 11:20:31 +01:00
JanUlrich f63346649b Fix loading packages from same package 2020-01-06 22:04:29 +01:00
JanUlrich abdff6c8d2 Fixed bug #184 2020-01-03 01:12:58 +01:00
JanUlrich 691d31df5e Die getRegistry Methode der CompilationEnvironment Klasse beachtet jetzt auch alle .class Files, welche sich im gleichen Ordner befinden 2020-01-03 01:08:00 +01:00
JanUlrich 2e421cccaa Merge branch 'addPackages' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into addPackages 2019-12-30 19:20:46 +01:00
pl@gohorb.ba-horb.de bd0b2e6058 new file: ../../../../../../../../java/packages/OLTest.java
new file:   ../../../OL.jav
	new file:   ../../../OLMain.jav
2019-12-30 10:45:32 +01:00
pl@gohorb.ba-horb.de 0c9c8ef321 modified: ../../../../../../../../../main/java/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java
Bug 182 fixed

	modified:   ../../../mathStrucVector.jav
	modified:   ../../../vectorAdd.jav
	kleine Aenderungen
2019-12-29 19:42:40 +01:00
JanUlrich 4b4087ae24 Trying to add Names that are not imported to availableClasses (unfinished) 2019-12-27 18:51:04 +01:00
JanUlrich 19989bfe11 Add Console Interface parameters, output directory and classpath 2019-12-26 19:43:00 +01:00
JanUlrich f59a7d221e Fix bug #181 2019-12-26 15:22:40 +01:00
pl@gohorb.ba-horb.de c1c12fa33c new file: mathStrucVectorTest.java
new file:   ../../resources/javFiles/packageTest/de/test/mathStruc.jav
	new file:   ../../resources/javFiles/packageTest/de/test/mathStrucVector.jav
	new file:   ../../resources/javFiles/packageTest/de/test/vectorAdd.jav
2019-12-23 16:34:07 +01:00
pl@gohorb.ba-horb.de 7fd03d505e Merge branch 'addPackages' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into addPackages 2019-12-23 11:25:36 +01:00
pl@gohorb.ba-horb.de 4391adfb0f modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
modified:   src/test/resources/bytecode/javFiles/OL.jav
2019-12-23 11:25:07 +01:00
JanUlrich d0b6dbcd30 Tests anfügen und Bugs fixen 2019-12-22 23:23:10 +01:00
JanUlrich 306af907c5 Nicht mit mehreren Eingabedateien testen 2019-12-22 22:32:40 +01:00
JanUlrich 75eaee6644 Abgabeprotokoll 2019-12-22 17:59:40 +01:00
JanUlrich 0378c17e7d ClassLoader austauschen gegen den Classloader, welcher in JavaCompilerCore erstellt wird 2019-12-22 14:27:54 +01:00
JanUlrich 3e67da6e34 merge 2019-12-16 00:56:54 +01:00
JanUlrich 1d16b9f2b9 Documentation 2019-12-16 00:55:04 +01:00
JanUlrich afd2c21ca8 Add classPath option to JavaTXCompiler and parse with URLClassLoader 2019-12-16 00:54:00 +01:00
JanUlrich 74622550c2 Add Logfiles Directory, but ignore all files inside it 2019-12-15 21:58:29 +01:00
JanUlrich bb75fca0d7 Add ImportTest 2019-12-15 14:57:12 +01:00
JanUlrich c82abcaae5 Generate Package names in .class files 2019-12-15 14:55:49 +01:00
JanUlrich a3b4ea9b1c [Bytecde] Generate new directory if given output path doesnt exist yet 2019-12-14 17:50:23 +01:00
JanUlrich af5b23e31a Use JavaClassName instead of Strings 2019-12-14 16:30:14 +01:00
pl@gohorb.ba-horb.de 084b54d295 modified: ../src/main/java/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java
modified:   ../src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
einige Korrekturen
2019-12-09 15:54:22 +01:00
michael e305c3cb55 [MINOR]: Optimized imports. 2019-12-09 13:52:37 +01:00
michael 835f0755da Merge branch 'simplifyRes' of uhl@gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into simplifyRes 2019-12-06 20:22:52 +01:00
michael 14b127390e [MINOR]: Umlaute in Kommentaren korrigiert. 2019-12-06 20:22:33 +01:00
pl@gohorb.ba-horb.de 0c1337f84b Merge branch 'simplifyRes' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into simplifyRes 2019-12-06 13:09:55 +01:00
pl@gohorb.ba-horb.de 5c1015b51e modified: src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
-      fieldType = TypePlaceholder.fresh(fieldDeclarationContext.getStart());
+      fieldType = TypePlaceholder.fresh(fieldDeclarationContext.variableDeclaratorList().getStart()); //PL 2019-12-06: variableDeclaratorList() eingefuegt, um als Token nicht die Modifier zu bekommen
2019-12-06 12:57:07 +01:00
michael c52da7951a Bug 176 - Argumente mit Typvariabelen werden die Generics einschließlich
Bounds immer bei den Argumenten eingefügt
2019-12-05 21:51:53 +01:00
michael 6dc15acba4 Build for JDK 1.8 2019-12-05 21:50:11 +01:00
michael 6cbabee65a Merge remote-tracking branch 'origin/bigRefactoring' into simplifyRes 2019-12-02 20:15:33 +01:00
michael c18daad047 Korrektur der Ersetzung. 2019-12-02 15:32:18 +01:00
Michael Uhl 1eaeca1db5 Refactoring in pom.xml 2019-11-27 21:40:35 +01:00
JanUlrich 09a6aec65d Erste Tests und die Möglichkeit generateBytecode null als Pfad zu übergeben 2019-11-24 17:52:02 +01:00
JanUlrich 766e71bb3a Beginn mit Werksvertrag: Package Support 2019-11-19 21:53:53 +01:00
JanUlrich 802d7726d4 Merge branch 'bigRefactoring' into addPackages 2019-11-19 21:51:14 +01:00
pl@gohorb.ba-horb.de c68d773486 modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Threadsteuerung veranendert, so dass möglichst veile Threads gleichzeitig laufen.
Müsste noch verbessert werden können.
2019-11-18 14:37:59 +01:00
Michael Uhl c0f5fd1e0a Merge branch 'simplifyRes' of uhl@gohorb.ba-horb.de:/bahome/projekt/git/JavaCompilerCore into simplifyRes 2019-11-14 14:07:04 +01:00
Michael Uhl 52b3498dfb Vor Fertigstellung Ersetzung Generics. 2019-11-14 14:04:09 +01:00
Michael Uhl 7343ea1701 Vor Fertigstellung Ersetzung Generics. 2019-11-13 10:14:07 +01:00
pl@gohorb.ba-horb.de 00bbd5279f modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
log-File-Ausgabe etwas ergaenzt

	modified:   src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
Fehler korrigiert, dass alle Fieldinitializer bei mehreren Klassen additiv hinzugefuegt werden

	modified:   src/main/java/de/dhbwstuttgart/syntaxtree/statement/This.java
toString veranedert

	modified:   src/test/resources/bytecode/javFiles/mathStruc.jav
leichte Korrektur

	new file:   src/test/java/bytecode/mathStrucIntegerTest.java
	new file:   src/test/resources/bytecode/javFiles/mathStrucInteger.jav
mathStruc auf Integer angewandt

	new file:   src/test/resources/bytecode/javFiles/mathStrucMatrixOP.jav
mathStruc auf MatrixOP angewandt, laeuft noch nicht durch, des halb Test noch nicht eingecheckt
2019-10-24 17:47:51 +02:00
pl@gohorb.ba-horb.de 6c783a18c7 new file: ../../../../../PlugInBau.txt
modified:   ../../bytecode/javFiles/Faculty.jav
	modified:   ../../bytecode/javFiles/OL.jav
	modified:   ../../bytecode/javFiles/Y.jav
	modified:   ../../bytecode/javFiles/mathStruc.jav
2019-10-22 16:44:38 +02:00
Fayez Abu Alia 8c195601d5 Fixed signature problem for FunN 2019-10-12 11:32:56 +02:00
pl@gohorb.ba-horb.de 37f8f2e1e0 modified: ../../bytecode/javFiles/Y.jav
Anwendung von Y eingefuegt.
2019-09-19 13:57:49 +02:00
Fayez Abu Alia 0903efda0d Fixed bug 115 2019-09-19 13:00:35 +02:00
Michael Uhl 6e9eae38ca Compile fix. 2019-09-17 09:46:47 +02:00
Michael Uhl 0138e4fe2d Merge branch 'bytecode2' into simplifyRes 2019-09-17 09:41:08 +02:00
Michael Uhl 9741b5e14e Merge remote-tracking branch 'origin/bytecode2' into simplifyRes
Conflicts:
	src/main/java/de/dhbwstuttgart/bytecode/simplifyRes/GenericGenratorResultForSourceFile.java
	src/main/java/de/dhbwstuttgart/bytecode/simplifyRes/GenericsGeneratorResultForClass.java
2019-09-17 09:36:56 +02:00
Fayez Abu Alia c2030123d5 Fixed bugs 163 and 169 2019-09-17 09:33:18 +02:00
Michael Uhl 25fb7a2e28 Plugin: Additional generic insert points. 2019-09-16 11:52:34 +02:00
Fayez Abu Alia d1637b8eb9 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-08-29 11:50:23 +02:00
Fayez Abu Alia 9abda637a1 Generic generator algorithm - fixed bug 2019-08-29 10:49:18 +02:00
pl@gohorb.ba-horb.de 82c0837d1f mathStruc.jav hinzugefügt 2019-08-23 15:06:54 +02:00
Fayez Abu Alia a41e9804a0 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-07-31 13:18:07 +02:00
Fayez Abu Alia 25c685c705 Merged with simplifyRes and cleaned up code 2019-07-31 13:16:14 +02:00
Fayez Abu Alia 3ecb202a90 Generic generator algorithm v1 2019-07-31 11:55:24 +02:00
Fayez Abu Alia efdb58e67c Added throw Exception to method getSimplifyResultsByName 2019-07-31 10:33:43 +02:00
Fayez Abu Alia eed8f32cb7 Merge branch 'simplifyRes' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into simplifyRes 2019-07-31 10:27:43 +02:00
Fayez Abu Alia 87d0a46ba5 Generic generator algorithm v0.1 2019-07-31 10:24:58 +02:00
Michael Uhl 5b75250fcf Merge branch 'bigRefactoring' into simplifyRes
# Conflicts:
#	src/main/java/de/dhbwstuttgart/bytecode/utilities/SimplifyResult.java
#	src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
2019-07-29 16:21:25 +02:00
Michael Uhl 7f29b39195 Generic Method inserts. 2019-07-26 10:12:53 +02:00
Fayez Abu Alia 7a4bc32974 Generic generator algorithm v0.1 2019-07-25 22:24:06 +02:00
Fayez Abu Alia dfddc44f29 Separated the algorithm into two parts. Part 1 is the simplification of
the constraints and part 2 is generation of generics.
2019-07-12 19:50:46 +02:00
Fayez Abu Alia 347d86a379 Genericsgenerator step 2 and 3 2019-07-11 15:52:38 +02:00
Fayez Abu Alia d77f2176f2 Generics generator step 1 2019-07-10 15:26:16 +02:00
Fayez Abu Alia 4f39eccecb Removed an old getter method 2019-07-05 13:45:24 +02:00
Fayez Abu Alia 669e7f111f Separated the generation of bytecode and the calculation of simplify
results from each other
2019-07-05 13:29:34 +02:00
pl@gohorb.ba-horb.de 32d12677bf Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-06-28 11:41:47 +02:00
pl@gohorb.ba-horb.de 92b2f5c9cc modified: src/test/resources/bytecode/javFiles/Faculty.jav
} eingefuegt
2019-06-28 11:41:19 +02:00
Fayez Abu Alia c1e6526b43 Removed unnecessary tests 2019-06-26 12:18:49 +02:00
Fayez Abu Alia 0194e30206 Fixed Bug 150. 2019-06-26 12:16:47 +02:00
Fayez Abu Alia 3c36c61077 Fixed Bugs 159, 162 and 163 2019-06-13 14:01:32 +02:00
Fayez Abu Alia 857d63322e Fixed Bug 152 Faculty Probleme 2019-06-07 10:28:48 +02:00
Fayez Abu Alia b801e144c3 Merged with bigRefactoring. Added method to generate signature to
FunN-Interfaces. Adapted jav-Files.
2019-06-06 12:15:51 +02:00
Martin Plümicke f6669f8c13 new file: ../../../java/bytecode/VectorAddTest.java 2019-06-05 10:28:51 +02:00
Martin Plümicke 2b7aef5e87 modified: ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Pfad fuer logFile nach JavaCompilerCore/logFiles verlegt.

	modified:   ../../bytecode/javFiles/OL.jav
	modified:   ../../bytecode/javFiles/VectorAdd.jav
2019-06-05 10:21:25 +02:00
Michael Uhl 0233426979 Merge remote-tracking branch 'origin/bigRefactoring' into bigRefactoring 2019-05-14 21:54:41 +02:00
Michael Uhl 3d0d11adb7 Code aufgeräumt. 2019-05-14 21:43:32 +02:00
Martin Plümicke 212144db86 renamed: test/java/bytecode/FunOLTest.java -> test/java/bytecode/OLFunTest.java
new file:   test/resources/bytecode/javFiles/OLFun.jav
2019-05-14 20:30:32 +02:00
Martin Plümicke bd0517ae29 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
log-File in anderen Pfad

	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
substitutions gekapselt
2019-05-14 19:54:51 +02:00
Martin Plümicke f210dd3c25 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
try der Nullpointer-Exception erweitert.
2019-05-13 11:11:47 +02:00
Martin Plümicke 4602e95f09 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2019-05-12 20:00:03 +02:00
Martin Plümicke 1ef228a045 modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
public volatile UnifyTaskModel usedTasks = new UnifyTaskModel();
auf publich gesetzt
2019-05-12 19:54:30 +02:00
Martin Plümicke c3c0a11572 Debugabfrage entfernt, die Exception ausgeloest hat
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/UnifyTaskModel.java
Methoden synchronized gemacht
2019-05-12 19:15:26 +02:00
Martin Plümicke d14406e474 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../resources/bytecode/javFiles/MatrixOP.jav
2019-05-10 21:23:28 +02:00
Martin Plümicke a149b0c391 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/UnifyTaskModel.java

Eigenen Cancel-Mechanismus implementiert
2019-05-10 21:02:24 +02:00
pl@gohorb.ba-horb.de bfbce81409 Abbruch aller Threads eingebaut
modified:   src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	new file:   src/main/java/de/dhbwstuttgart/typeinference/unify/UnifyTaskModel.java
2019-05-10 16:30:55 +02:00
Martin Plümicke 985704c0b0 modified: src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Wen kein Import für die Addition vorhanden ist, wird Fehler ausgegeben
2019-05-08 08:58:19 +02:00
Michael Uhl 1f20fecfee ResultPair durchgeschleift. 2019-05-07 10:38:25 +02:00
Michael Uhl 4b8b0ec362 ConcurrentModificationException umgangen. 2019-05-05 22:33:16 +02:00
Michael Uhl e48f2b2fd5 Merge remote-tracking branch 'origin/bigRefactoring' into bigRefactoring
# Conflicts:
#	src/main/java/de/dhbwstuttgart/bytecode/BytecodeGen.java
2019-04-27 16:33:20 +02:00
Michael Uhl 11bee80969 Bytecode-Generierung generiert jetzt wieder Bytecode für alle möglichen Typen. 2019-04-27 16:29:38 +02:00
Martin Plümicke 448c489a49 modified: src/main/java/de/dhbwstuttgart/typeinference/result/ResultSet.java
modified:   src/test/resources/bytecode/javFiles/Lambda.jav
	modified:   src/test/resources/bytecode/javFiles/MatrixOP.jav
	modified:   src/test/resources/bytecode/javFiles/OL.jav
2019-04-27 15:44:21 +02:00
pl@gohorb.ba-horb.de 1e1eb2a2f2 geändert: src/main/java/de/dhbwstuttgart/typeinference/result/ResultSet.java 2019-04-27 14:51:25 +02:00
pl@gohorb.ba-horb.de 4a7c124fd6 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2019-04-27 09:51:22 +02:00
pl@gohorb.ba-horb.de 7d01c866a9 modified: ../src/test/resources/bytecode/javFiles/Id.jav
modified:   ../src/test/resources/bytecode/javFiles/Matrix.jav
	modified:   ../src/test/resources/bytecode/javFiles/MatrixOP.jav
	modified:   ../src/test/resources/bytecode/javFiles/OL.jav
2019-04-26 14:12:46 +02:00
Fayez Abu Alia 73f412d22d Klassendatei fuer FunN beim Methodaufruf wird erzeugt, wenn der Receiver
den Typ FunN besitzt.
Die Loesung vom Duplicate Field Problem wird angepasst.
2019-04-26 11:56:58 +02:00
Fayez Abu Alia 9ffc74467b Wenn ein Attribut mehrere Loesungen bekommt, wird die Bytecodeerzeugung
abgebrochen und ensprechende Exception geworfen.
2019-04-26 10:27:15 +02:00
Fayez Abu Alia 5950fcc0a9 Neue Klasse MethodCallHelper und Exceptions definiert, die fuer die
Uebersetzung von MethodCalls verwendet werden
2019-04-24 15:43:00 +02:00
Martin Plümicke d2fb17ad4e Merge branch 'bcGenerics' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bcGenerics 2019-04-21 22:32:20 +02:00
Martin Plümicke d9f084cd0f modified: ../../bytecode/javFiles/Faculty.jav
neue Imports hinzugefuegt
2019-04-21 22:31:55 +02:00
Michael Uhl 481986e8ab Kein Compileraufruf bei Type-Insert
- ResultPairMap wird wieder geleeert.
2019-04-20 17:22:10 +02:00
Michael Uhl 23c37a8cc2 Richtiges Einsetzen ohne Speichern. 2019-04-19 20:49:28 +02:00
Fayez Abu Alia 6a519ff6dc Ein Feld wird nur einmal in Bytecode uebersetzt. genIns in ResultSet
wird angepasst.
2019-04-18 13:17:50 +02:00
Fayez Abu Alia 5b527ec8ab Merge branch 'bcGenerics' of ssh://abualia@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bcGenerics 2019-04-18 10:50:02 +02:00
Fayez Abu Alia 709041f024 Adapted TypedID jav-file 2019-04-18 10:48:59 +02:00
Michael Uhl 905d9e25a2 [PLUGIN]: Filter type insert points after insertion. 2019-04-18 09:48:56 +02:00
Martin Plümicke e086ff187e modified: ../../../../main/java/de/dhbwstuttgart/typeinference/result/ResolvedType.java
Attribut additionalGenerics auskommentiert.
2019-04-12 10:41:42 +02:00
Martin Plümicke 588212389a Die Bestimmung der Constraints aus dem ResolvedType herausgenommen und im ResultSet integriert.
Damit kommen immer die gleichen Constraints raus. Diese werden ohnehin in der Bytecodegenerierung
nochmals ausgewertet.

	modified:   ../../../../main/java/de/dhbwstuttgart/bytecode/TPHExtractor.java
Zugriff auf Constraints ueber ResultSet eingefuehrt

	modified:   ../../../../main/java/de/dhbwstuttgart/bytecode/signature/Signature.java
Zugriff auf Constraints ueber ResultSet eingefuehrt

	modified:   ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/result/GenericInsertPair.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/result/PairTPHequalRefTypeOrWildcardType.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/result/PairTPHsmallerTPH.java
toString veraendert

	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/result/ResultSet.java
Attribut genIns eingefuehrt, indem alle GenericInsertPairs gespeichert werden, die Form (TPH a <. TPH b)
im Attribut results haben

	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../bytecode/javFiles/Id.jav
	modified:   ../../bytecode/javFiles/MatrixOP.jav
2019-04-12 10:28:39 +02:00
Martin Plümicke 1454281628 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bcGenerics 2019-04-11 11:57:30 +02:00
Fayez Abu Alia 602216d9e2 Generics beruecksichtigt 2019-04-11 11:26:54 +02:00
Martin Plümicke e53c29f582 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Typeinference-Exception eingefuegt, wenn kein korrekter Typ inferierbar ist.

	modified:   ../../resources/bytecode/javFiles/Id.jav
2019-04-06 00:53:35 +02:00
Martin Plümicke 656c77d16b Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2019-04-05 12:52:28 +02:00
Fayez Abu Alia 9d16855ce2 Bug in Matrix gefixt 2019-04-05 12:38:29 +02:00
Fayez Abu Alia 9d2fdf9692 Merge branch 'bytecode2' of ssh://abualia@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-04-05 12:06:22 +02:00
Fayez Abu Alia 5c5b1ea2b1 IdTest funktioniert 2019-04-05 12:05:07 +02:00
Martin Plümicke 2e2227b701 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-04-05 12:00:30 +02:00
Martin Plümicke 16baa5eaa8 modified: ../../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java

Konstruktur fuer ReferenceType mit zwei Argumenten versehen, um Generice unterscheiden zu können.
2019-04-05 11:59:34 +02:00
Fayez Abu Alia 588b9ef83a Merge branch 'bytecode2' of ssh://abualia@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-04-05 10:44:52 +02:00
Fayez Abu Alia ee932892c6 subString durch contains ersetzt 2019-04-05 10:43:09 +02:00
Martin Plümicke 547ad9601a Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-04-04 14:08:31 +02:00
Michael Uhl 6c94404f27 [MINOR]: Optimized imports. 2019-03-31 11:45:49 +02:00
Michael Uhl 2b5b677682 Für Eclipse-Plugin: Vorläufige Lösung zum Einsetzen von Generics nur an Klassen ausgeschaltet. 2019-03-31 11:39:57 +02:00
Martin Plümicke 1edc023ed9 modified: ../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java
Generische Typvariablen im Unify durch Tag im ReferenceType eingefuehrt
2019-03-28 17:44:42 +01:00
Martin Plümicke df0f26c021 :w:wq 2019-03-28 16:55:48 +01:00
Martin Plümicke 0f1526daa2 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
deleted:    .gitignore
2019-03-28 15:44:03 +01:00
Michael Uhl 53d1f20a40 Merge remote-tracking branch 'origin/bytecode2' into bytecode2 2019-03-28 14:56:47 +01:00
Michael Uhl ec4defd087 Getter and setter for token. 2019-03-28 14:56:36 +01:00
Fayez Abu Alia 6a2a8313e6 Generics werden in Signature richtig dargestellt und die passende
Deskriptoren werden richtig erzeugt
2019-03-28 14:07:04 +01:00
Fayez Abu Alia d4a59517d3 Wenn die Klasse keine Generics besitzt und Methoden besitzen Generics
wird eine new SimplifyResult Instanz erzeugt, da sonst eine
NullException aufgelöst wird
2019-03-21 12:23:50 +01:00
Fayez Abu Alia f4b5124fd3 Merge branch 'bytecode2' of ssh://abualia@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-03-21 12:06:01 +01:00
Fayez Abu Alia c921330b55 Methode getSimplifyList definiert, die eine Liste von Ergebnisse des
Simplify-Alg zurueckliefert
2019-03-21 12:03:13 +01:00
Martin Plümicke 4ba4292db4 Merge branch 'unify-test' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2019-03-20 16:30:21 +01:00
Martin Plümicke 57b5a51895 modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java 2019-03-20 16:24:55 +01:00
Martin Plümicke 986ce8e6e0 modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2019-03-20 14:35:50 +01:00
Martin Plümicke 8a6646bd7c modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java 2019-03-20 13:00:08 +01:00
Martin Plümicke 01a548215a Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2019-03-20 12:53:35 +01:00
Martin Plümicke 66cd1e7012 modified: ../../bytecode/javFiles/MatrixOP.jav 2019-03-20 12:45:17 +01:00
Martin Plümicke 850fe39426 modified: ../../../main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java
Typen mit Argumenten korrgiert
2019-03-19 16:31:04 +01:00
Martin Plümicke 212aeaa3a0 modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2019-03-18 16:14:13 +01:00
Michael Uhl 7cb2eed36e Logger comes from plugin now. 2019-03-18 09:33:22 +01:00
Martin Plümicke 82f330eab5 modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../resources/bytecode/javFiles/Matrix.jav
2019-03-17 17:44:09 +01:00
Michael Uhl f25ba4d13e Merge remote-tracking branch 'origin/bytecode2' into bytecode2 2019-03-15 10:53:10 +01:00
Michael Uhl 4d4be5420b Anpassung asynchroner Aufruf des Plugins
========================================

UnifyResultListener muss übergeben werden, da sonst Ergebnisse gemeldet werden (notify), ohne dass das Plugin als UnifyResultListener registriert wurde.
2019-03-15 10:52:31 +01:00
Martin Plümicke a01779d6df modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
auskommentierter Code der nach checkA verschoben wurde geloescht
2019-03-14 00:27:21 +01:00
Martin Plümicke 44ed1d8e8d modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Die Ueberpruefung von a bzw. nSaL in Methode checkA ausgelagert und für die Faelle a <. th und ty <. a implementiert.
2019-03-14 00:20:19 +01:00
Martin Plümicke 75adbaf579 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2019-03-07 13:45:03 +01:00
Martin Plümicke 411629279d modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Kommentar eingefuegt
2019-03-07 13:44:29 +01:00
Martin Plümicke 47783083b0 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test
Conflicts:
	src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java

 It looks like you may be committing a merge.
 If this is not correct, please remove the file
	.git/MERGE_HEAD
 and try again.
2019-03-07 13:42:26 +01:00
Martin Plümicke 94c32609c6 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
disableCondWildcards wird aufgerufen

	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
/**
	 * wenn in einem  Paar bestehend aus 2 Typvariablen eine nicht wildcardtable ist,
	 * so beide auf nicht wildcardtable setzen
	 */
	public void disableCondWildcards()
eingefuegt
2019-03-07 13:37:08 +01:00
Martin Plümicke 6175fb3ee3 modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java 2019-03-07 09:17:05 +01:00
Martin Plümicke 2bd6147517 modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Noch einige Fehler
2019-03-07 09:14:41 +01:00
Martin Plümicke 728b729f08 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
in calculatePairSets werden andere Constraints fuer die gleiche Variable betrachtet
Sollte aber nach computeCartesianRecursive verschoben werden.
2019-03-05 00:24:11 +01:00
Martin Plümicke 27c6351aed modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Anfang Paare zusammenfassen
2019-03-01 16:52:59 +01:00
Martin Plümicke fc14cf9893 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
subst-Anwendung gleich am Anfang von unify eingefuehrt
2019-02-28 18:29:08 +01:00
Martin Plümicke b46e0b855c modified: ../../resources/bytecode/javFiles/MatrixOP.jav 2019-02-28 15:38:30 +01:00
Martin Plümicke 88ec8823fd modified: ../../../main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java
modified:   ../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
	deleted:    ../../../main/java/de/dhbwstuttgart/syntaxtree/type/FunN.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/FunNType.java
Es wird jetzt FunN-Type FunN$$ geparst
Der Typ FunN wurde entfernt
Der Name des Typs FunNType wurde um $$ am Ende ergänzt
2019-02-27 16:04:55 +01:00
Fayez Abu Alia c77a2b3354 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-02-25 19:20:43 +01:00
Fayez Abu Alia 8a5dbb28ac Bug gefixt: genericList als Paramater uebergeben 2019-02-25 19:20:11 +01:00
Michael Uhl 86768153c0 Merge remote-tracking branch 'origin/bytecode2' into bytecode2 2019-02-24 15:06:49 +01:00
Michael Uhl 5722f0285b Skip tests in maven build. 2019-02-24 15:06:34 +01:00
Fayez Abu Alia 6c19a9f78c Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-02-21 13:35:07 +01:00
Fayez Abu Alia 3e186334a2 Simpify Algo korrigiert so dass die lokalen Variablen der Methode beruecksichtigt werden 2019-02-21 13:34:36 +01:00
Martin Plümicke fcad60996c modified: de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java 2019-02-20 17:53:45 +01:00
Martin Plümicke 9c648546e4 modified: de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
	modified:   de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
	modified:   de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
FileWriter durch Writer ersetzt
2019-02-20 17:36:07 +01:00
Martin Plümicke 8e4b39b05e modified: ../../test/resources/bytecode/javFiles/Inf.jav 2019-02-20 16:03:56 +01:00
Martin Plümicke 926d911d21 modified: ../bytecode/MatrixTest.java 2019-02-20 15:08:06 +01:00
Fayez Abu Alia d010c843df Bug in MatrixTest gefixt. Die richtige Descriptor von MethodCalls wird erzeugt 2019-02-20 12:15:55 +01:00
Martin Plümicke 72705ac868 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
close log-Files
TypeUnifyTask in TypeUnify2Task bei Abarbeitung oderconstraints umgetauscht
2019-02-20 09:40:06 +01:00
Martin Plümicke 362e797b10 modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2019-02-19 17:51:11 +01:00
Martin Plümicke 1f12aaec82 modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
Einen Fall ? extends/super a <.? a ergaenzt bei dem compare falsches Ergbnis geliefret hat
2019-02-18 22:36:06 +01:00
Martin Plümicke 08d69ce6e3 modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/UnifyResultModel.java

zurueckumwandlung von den Unifytypen in UnifyResultModel verlegt.
2019-02-17 08:51:23 +01:00
Martin Plümicke 396efb52de modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java
subst-Anwendung auf oderconstraints eingebaut
2019-02-15 00:00:41 +01:00
Fayez Abu Alia 67469bbb84 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-02-14 11:44:37 +01:00
Fayez Abu Alia d2581b02ab modified: src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
Bug in generate BC fuer if(Boolean) gefixt

	modified:   src/main/java/de/dhbwstuttgart/bytecode/signature/Signature.java

	new file:   src/main/java/de/dhbwstuttgart/bytecode/utilities/ConstraintsFinder.java
	Fasst alle Constraints mit der gleichen Linke-Seite in einer Liste zusammen

	new file:   src/main/java/de/dhbwstuttgart/bytecode/utilities/NameReplacer.java
	Ersetzt die gleiche Type Variables durch einen neuen eindeutigen Namen

	modified:   src/main/java/de/dhbwstuttgart/bytecode/utilities/Simplify.java
	Algorithmus angepasst

	modified:   src/test/java/bytecode/FieldTphMMethTest.java
	Test funktioniert
	new file:   src/test/java/bytecode/InfTest.java
	Infimum Test funktioniert

	new file:   src/test/java/bytecode/simplifyalgo/FinderTest.java
	Tests fuer die HilfsMethoden
2019-02-14 11:37:15 +01:00
Martin Plümicke db91e73750 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
aParDef wird auch ausgewertet

	modified:   src/test/resources/bytecode/javFiles/MatrixOP.jav
2019-02-06 18:15:39 +01:00
Martin Plümicke e52181a0c7 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../resources/bytecode/javFiles/Matrix.jav
2019-02-04 23:32:52 +01:00
Michael Uhl 28c6f78715 Merge branch 'unify-test' into bytecode2 2019-02-02 15:50:34 +01:00
Michael Uhl 2eaebbf0f8 FileWriter -> Writer. 2019-02-01 22:56:30 +01:00
Michael Uhl 1e5e9f8cd4 Merge remote-tracking branch 'origin/bytecode2' into bytecode2 2019-02-01 22:15:28 +01:00
Martin Plümicke 33f2bf3d21 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/UnifyResultListenerImpl.java
Asynchrone Variante soweit ok
2019-01-31 15:08:36 +01:00
Martin Plümicke aa0b157374 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	new file:   src/main/java/de/dhbwstuttgart/typeinference/unify/UnifyResultListenerImpl.java
	modified:   src/test/resources/bytecode/javFiles/MatrixOP.jav
Erster Ansatz asyncrone Threads
2019-01-30 09:11:33 +01:00
Pluemicke Martin aaae762ca8 Merge branch 'unify-test' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test
src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
solved
2019-01-29 15:02:59 +01:00
Martin Plümicke 9e1d58f4b1 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
Threads soweit fertig
2019-01-29 14:51:19 +01:00
Pluemicke Martin 7f239d11ee Merge branch 'unify-test' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2019-01-29 14:48:54 +01:00
Pluemicke Martin ca7c76a99a geändert: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
geändert:       src/main/java/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java
	geändert:       src/main/java/de/dhbwstuttgart/typeinference/constraints/Pair.java
	geändert:       src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	geändert:       src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify2Task.java
	geändert:       src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	geändert:       src/main/java/de/dhbwstuttgart/typeinference/unify/UnifyResultModel.java
2019-01-29 14:47:20 +01:00
Martin Plümicke 26634bb038 modified: src/main/java/de/dhbwstuttgart/typeinference/unify/UnifyResultModel.java 2019-01-25 22:26:38 +01:00
Martin Plümicke 9dcb1f76ca modified: src/main/java/de/dhbwstuttgart/typeinference/unify/UnifyResultModel.java 2019-01-25 22:22:16 +01:00
Martin Plümicke e0da6b3d31 Merge branch 'unify-test' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2019-01-25 22:21:04 +01:00
Martin Plümicke 3c0beabc1b modified: src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
reduce2 nochmals angepasst

	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
- Fehler behoben
- In den Thread nur noch Element von nextSet verschieben, die auf alle Faele berechnet werdne muessen
2019-01-25 22:19:32 +01:00
Michael Uhl e83d59d97d Observer Pattern für ResultSet. 2019-01-24 11:16:26 +01:00
Michael Uhl 3ad51f952e Observer Pattern für ResultSet. 2019-01-23 22:28:07 +01:00
Michael Uhl 449a11f433 Observer für TypeResults. 2019-01-23 22:25:30 +01:00
Michael Uhl 9805f956c0 Merge remote-tracking branch 'origin/bytecode2' into bytecode2
# Conflicts:
#	pom.xml
2019-01-23 22:05:59 +01:00
Michael Uhl 0a4a625198 Removed "tycho-p2-repository-plugin". 2019-01-23 22:04:25 +01:00
Martin Plümicke 25487469c7 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
reduceEq-Regel korrigiert

	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Threads soweit fertig
2019-01-23 01:31:25 +01:00
Martin Plümicke 188ea1f7f8 modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
einige Aenderungen, die parallele Verarbeitung ermoeglicht
2019-01-20 21:49:22 +01:00
Martin Plümicke cf951043ef modified: src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2019-01-18 00:54:43 +01:00
Fayez Abu Alia fd72ed340d Test Erzeugung Type-Variablen fuer Klassen 2019-01-17 11:26:09 +01:00
Martin Plümicke 38d4481756 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Es muss noch geklaert werden, wann ein neuer Thread generiert werden darf.

	modified:   ../../resources/bytecode/javFiles/MatrixOP.jav
2019-01-16 22:57:24 +01:00
Pluemicke Martin 01891c9513 neue Datei: TypeUnify2Task.java 2019-01-16 20:25:54 +01:00
Martin Plümicke aae2e5244b modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Erster Ansatz Parallelisierung
2019-01-16 17:39:01 +01:00
Fayez Abu Alia d6961b0d0b Merge branch 'unify-test' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2019-01-16 14:42:07 +01:00
Fayez Abu Alia d4d668b662 Simplify fuer Klassen Type Variablen 2019-01-16 14:41:33 +01:00
Martin Plümicke 8c517e7f4a new file: ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/hashKeyType.java
modified:   ../../resources/bytecode/javFiles/VectorSuper.jav
2019-01-16 10:27:15 +01:00
Martin Plümicke b3622df2fd modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2019-01-15 22:45:58 +01:00
Martin Plümicke fa42a69374 modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
- Hastables fuer greater und smaller eingefuehrt
- ? extends/super a <. a = -1 hinzugefuegt
2019-01-15 15:58:39 +01:00
Martin Plümicke eb43a616e2 new file: ../../../java/bytecode/VectorSuperTest.java
new file:   VectorSuper.jav
2019-01-13 19:22:48 +01:00
Martin Plümicke faccdf5896 Ordnung fuer Variablen unterschieden, ob sie innere Typen sind oder nicht
modified:   ../../core/JavaTXCompiler.java
	modified:   UnifyTypeFactory.java
Bestimmung welche Typevariablen innere Typen sind

	modified:   ../../typeinference/unify/TypeUnifyTask.java
	modified:   ../../typeinference/unify/model/OrderingUnifyPair.java
Ordnungsfunktion geaendert

	modified:   ../../typeinference/unify/model/PlaceholderType.java
	modified:   ../../typeinference/unify/model/UnifyPair.java
2019-01-13 00:42:33 +01:00
Martin Plümicke 6de1c50542 modified: ../../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
Auswahl des Tphs bei der Abfrage, ob ein größerer oder kleinerer Typ des vorherigen bestimmt wurde
korrigiert
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
innerType eingeführt
	modified:   ../../bytecode/javFiles/MatrixOP.jav
	deleted:    ../Field.java
	deleted:    ../Import.java
	deleted:    ../Lam1.java
	deleted:    ../LamRun.java
	deleted:    ../MethFieldVar.java
	deleted:    ../Subclass.java
	deleted:    ../SuperTest.java
	deleted:    ../Superclass.java
	deleted:    ../TestMyTest.java
	deleted:    ../testF.java
	deleted:    ../testTets.java
	deleted:    ../testTetsF.java
2019-01-12 18:19:16 +01:00
Martin Plümicke 58d757398d modified: ../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
zurueck zum alten Zustand
2019-01-11 23:00:27 +01:00
Martin Plümicke 755fd5c821 modified: ../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	deleted:    ../javFiles/AddLong.jav
	deleted:    ../javFiles/EmptyClass.jav
	deleted:    ../javFiles/EmptyMethod.jav
	deleted:    ../javFiles/Expressions.jav
	deleted:    ../javFiles/FC_Matrix.jav
	deleted:    ../javFiles/Faculty.jav
	deleted:    ../javFiles/FacultyIf.jav
	deleted:    ../javFiles/FacultyTyped.jav
	deleted:    ../javFiles/Fields.jav
	deleted:    ../javFiles/Generics.jav
	deleted:    ../javFiles/IfTest.jav
	deleted:    ../javFiles/Import.jav
	deleted:    ../javFiles/Lambda.jav
	deleted:    ../javFiles/Lambda2.jav
	deleted:    ../javFiles/Lambda3.jav
	deleted:    ../javFiles/LambdaField.jav
	deleted:    ../javFiles/LambdaRunnable.jav
	deleted:    ../javFiles/ListenerOverload.jav
	deleted:    ../javFiles/Matrix.jav
	deleted:    ../javFiles/Meth_Gen.jav
	deleted:    ../javFiles/MethodCallGenerics.jav
	deleted:    ../javFiles/Methods.jav
	deleted:    ../javFiles/MethodsEasy.jav
	deleted:    ../javFiles/Op1.jav
	deleted:    ../javFiles/Package.jav
	deleted:    ../javFiles/Sorting.jav
	deleted:    ../javFiles/Subclass.jav
	deleted:    ../javFiles/Superclass.jav
	deleted:    ../javFiles/Vector.jav
	deleted:    ../javFiles/fc.jav
	deleted:    ../javFiles/mathStruc.jav
	deleted:    ../javFiles/test.jav
	deleted:    ../javFiles/test1.jav
2019-01-11 22:52:39 +01:00
Martin Plümicke c1e4f14fa4 Merge branch 'unify-test' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2019-01-11 19:27:19 +01:00
Martin Plümicke 7d514d617c modified: ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Nur log-Ausgaben hinzugefuegt
2019-01-11 19:24:23 +01:00
Martin Plümicke 4490de575c Merge branch 'bytecode2' into unify-test 2019-01-11 15:16:29 +01:00
Martin Plümicke 752b68d447 new file: ../../java/bytecode/Tph6Test.java 2019-01-11 14:50:19 +01:00
Martin Plümicke edd263ac15 bytecodeJavFiles in bytecode/javFiles geanedert
Please enter the commit message for your changes. Lines starting
2019-01-11 14:45:12 +01:00
Martin Plümicke d0a261f55c modified: ../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../../main/java/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Set<UnifyType> fBounded = new HashSet<>(pair.getfBounded()); //PL 2019-01-09 new HashSet eingefuegt

	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	modified:   ../../../main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
	modified:   ../../resources/bytecode/javFiles/Matrix.jav
2019-01-09 00:40:24 +01:00
Martin Plümicke 72a84323de modified: ../../../../main/java/de/dhbwstuttgart/typeinference/unify/Match.java
modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
im Fall 1 die Substitutionen der Typeplaceholders der Muster entfernt

	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java
	modified:   ../../../../main/java/de/dhbwstuttgart/typeinference/unify/model/WildcardType.java
	modified:   ../../bytecode/javFiles/MatrixOP.jav
	modified:   ../../bytecode/javFiles/Merge.jav
2019-01-04 01:19:31 +01:00
Fayez Abu Alia 9e0a6151fd Bug in der Implemintierung von Simplify Algorithmus gefixt 2019-01-03 21:05:36 +01:00
Martin Plümicke 013539e7e8 modified: ../../../../main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
Throwable wieder in Exception zurückgewandelt

	modified:   ../../../../main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
Log-Files um Name des jeweiligen Jav-Files ergaenzt

	modified:   ../../javFiles/Faculty.jav
2018-12-30 19:02:40 +01:00
Fayez Abu Alia e07b189ba4 MatrixOP funktioniert (mit JUnit wird class file erzeugt) und dann mit TestBytecode.java getestet 2018-12-29 21:49:01 +01:00
Martin Plümicke 531b484c53 modified: src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java
Pfad des log-Files angepasst
Error-Ausgabe in der log-File Exception eingefuegt.
2018-12-29 10:20:19 +01:00
Martin Plümicke cbe77d3722 modified: src/main/java/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
In Zeile 833 catch Exception durch catch Throwable ersetzt, da der UnsupportedClassVersionError geworfen wurde

	modified:   src/test/java/bytecode/FacTest.java
	modified:   src/test/java/bytecode/FacultyTest.java
	modified:   src/test/java/bytecode/FieldTest.java
	modified:   src/test/java/bytecode/FieldTph.java
	modified:   src/test/java/bytecode/FieldTph2Test.java
	modified:   src/test/java/bytecode/FunOLTest.java
	modified:   src/test/java/bytecode/GenTest.java
	modified:   src/test/java/bytecode/GreaterEqualTest.java
	modified:   src/test/java/bytecode/GreaterThanTest.java
	modified:   src/test/java/bytecode/LambdaCapturetest.java
	modified:   src/test/java/bytecode/LambdaTest.java
	modified:   src/test/java/bytecode/LambdaVoidTest.java
	modified:   src/test/java/bytecode/LessEqualTest.java
	modified:   src/test/java/bytecode/LessThanTest.java
	modified:   src/test/java/bytecode/MatrixOpTest.java
	modified:   src/test/java/bytecode/MergeTest.java
	modified:   src/test/java/bytecode/OLTest.java
	modified:   src/test/java/bytecode/OpTest.java
	modified:   src/test/java/bytecode/OverloadingSortingTest.java
	modified:   src/test/java/bytecode/OverloadingTest.java
	modified:   src/test/java/bytecode/PlusTest.java
	modified:   src/test/java/bytecode/PostIncTest.java
	modified:   src/test/java/bytecode/PreIncTest.java
	modified:   src/test/java/bytecode/RelOpsTest.java
	modified:   src/test/java/bytecode/SortingTest.java
	modified:   src/test/java/bytecode/SubMatTest.java
	modified:   src/test/java/bytecode/Tph2Test.java
	modified:   src/test/java/bytecode/Tph3Test.java
	modified:   src/test/java/bytecode/Tph5Test.java
	modified:   src/test/java/bytecode/TphTest.java
	modified:   src/test/java/bytecode/WhileTest.java
	modified:   src/test/java/bytecode/YTest.java
Pfade angepasst
2018-12-28 23:39:59 +01:00
Martin Plümicke 20abd181b6 modified: ../../pom.xml
modified:   ../../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Abfrage, ob OderConstraints empty sind, bei der Unify-Abbruchbedingungen eingefuegt

	modified:   ../../src/test/java/bytecode/BinaryTest.java
	modified:   ../../src/test/java/bytecode/MatrixTest.java
	modified:   ../../src/test/java/bytecode/applyLambdaTest.java
Pfadanpassungen
2018-12-28 19:37:45 +01:00
Michael Uhl 90c0cd431f Removed compiler plugin with target 9, 2018-12-25 16:02:31 +01:00
Martin Plümicke f8d3263d24 Pfadumstellung 2018-12-21 15:27:29 +01:00
Martin Plümicke ffa30e50c3 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2018-12-21 12:19:38 +01:00
Fayez Abu Alia 5798c47d62 Tests funktionieren 2018-12-20 15:19:51 +01:00
Fayez Abu Alia f21959fef8 Neue Umstellung 2018-12-20 12:26:37 +01:00
Fayez Abu Alia 85fcef8289 commit 2018-12-20 10:25:55 +01:00
Fayez Abu Alia 5a3145281e Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-12-19 14:21:27 +01:00
Fayez Abu Alia 5624af609c Simplify fuer TPH Method < TPH Field angepasst 2018-12-19 14:18:50 +01:00
Martin Plümicke a4eaaa748e Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-12-19 14:09:48 +01:00
Martin Plümicke 83b9f7edb8 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2
Conflicts:
	src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java

 It looks like you may be committing a merge.
 If this is not correct, please remove the file
	.git/MERGE_HEAD
 and try again.

 Please enter the commit message for your changes. Lines starting
 with '#' will be ignored, and an empty message aborts the commit.

 Committer: Martin Plümicke <pl@macmini_pl.verw.ba-horb.de>

 On branch bytecode2
 Your branch and 'origin/bytecode2' have diverged,
 and have 1 and 2 different commits each, respectively.
   (use "git pull" to merge the remote branch into yours)

 All conflicts fixed but you are still merging.

 Changes to be committed:
	modified:   src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2018-12-19 14:08:42 +01:00
Fayez Abu Alia b71efd65a0 Tphs einer Methode, die groesser als Tphs der Felder, werden als Class-Generics definiert 2018-12-19 13:20:09 +01:00
Fayez Abu Alia e380c77ce6 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-12-19 10:13:27 +01:00
Fayez Abu Alia 794412a402 Tph von Felder werden als Class-Generics definiert werden 2018-12-19 10:12:45 +01:00
Martin Plümicke f256714223 modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Returntype der Binary korrigiert.
2018-12-18 16:18:36 +01:00
Martin Plümicke 1931c61392 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Loesung Fehler rausgemacht
2018-12-14 17:46:09 +01:00
Martin Plümicke c1a4617085 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Loeschen von Ueberzaehlugen Elementen eingefuegt.
2018-12-14 16:51:02 +01:00
Martin Plümicke a733f373a7 modified: ../../../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-12-14 12:09:12 +01:00
Martin Plümicke 9dbfbe9e6a modified: ../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
2018-12-14 09:31:58 +01:00
Martin Plümicke 6b33fdc5fb Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-12-12 16:50:38 +01:00
Martin Plümicke 2f9d44d0b0 modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
im Max den Fall a <.? ? extends a beruecksichtigt
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
; in der Schleife generate fresh Type Var entfernt
2018-12-12 16:49:16 +01:00
Fayez Abu Alia 3bf45888e5 Simplify gefixt 2018-12-12 13:03:53 +01:00
Fayez Abu Alia dab0dc180c Aenderung in Signature-Wildcars rueckgaengig gemacht 2018-12-06 11:08:03 +01:00
Martin Plümicke 2d73b4e47f modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
Argumente von Konstruktore auch mit Varaincen und not wildcardable versehen
2018-12-06 10:43:46 +01:00
Martin Plümicke 54325d5168 modified: ../../src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
new Arraylist erzeugt beim setzen der Initializer in den Pseudoconstruktor
2018-12-04 15:30:04 +01:00
Fayez Abu Alia af6537841c modified: src/de/dhbwstuttgart/bytecode/BytecodeGen.java
modified:   src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
	modified:   src/de/dhbwstuttgart/bytecode/signature/Signature.java
	modified:   src/de/dhbwstuttgart/bytecode/utilities/KindOfLambda.java
	modified:   src/de/dhbwstuttgart/bytecode/utilities/Simplify.java
	modified:   src/de/dhbwstuttgart/syntaxtree/Constructor.java
	modified:   test/bytecode/MatrixOpTest.java
	modified:   test/bytecode/YTest.java
	modified:   test/bytecode/javFiles/OL.jav
2018-12-04 15:01:50 +01:00
Martin Plümicke 964b73e8c4 modified: ../../src/de/dhbwstuttgart/syntaxtree/Constructor.java
In der abstrakten Syntax Einbau vom super-Konstruktor Aufrufen in den Konstruktoren entfernt.
Dies muss nun beim Bytecode jeweils eingefügt werden
2018-12-03 15:06:56 +01:00
Martin Plümicke c7c9f65ecf Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-11-26 11:00:58 +01:00
Martin Plümicke 416d68bcb0 Aenderugen siehe http://bugzilla.ba-horb.de/show_bug.cgi?id=124
modified:   ../../src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
Zusäztlich Ein Fehler in der Trennung von Konstruktoren und Methoden gefixt.

	modified:   ../../src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java
	modified:   ../../src/de/dhbwstuttgart/syntaxtree/Constructor.java
	modified:   ../../src/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
	modified:   ../../test/bytecode/MatrixOpTest.java
2018-11-26 10:59:06 +01:00
Fayez Abu Alia 5c74c69b9e Bytecode fuer Lambdas in denen Variablen von lexical scope verwendet werden 2018-11-23 14:30:15 +01:00
Martin Plümicke 4da4966b86 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2018-11-21 23:17:17 +01:00
Fayez Abu Alia 7bfc222037 Bug in Simplify-Algo gefixt 2018-11-21 11:58:58 +01:00
Fayez Abu Alia a269ee9690 TPHExtractor verbessert, Transivitat-Algortmus ergaenzt und JUnit Tests dazu geschrieben. FacultyTest funktioniert 2018-11-15 20:52:27 +01:00
Martin Plümicke 134496129a Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test
Conflicts:
	src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
2018-11-15 16:04:16 +01:00
Fayez Abu Alia d4b6073760 Faculty funktioniert rihtig 2018-11-14 16:19:25 +01:00
Fayez Abu Alia 2275153590 bug gefixt methodCall in MatrixOP 2018-11-14 13:26:37 +01:00
Fayez Abu Alia 95043455fa Merge branch 'unify-test' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2018-11-14 13:02:53 +01:00
Fayez Abu Alia 2ef7bae78a e.printStackTrace in MethodCall entfernt 2018-11-14 12:51:41 +01:00
Fayez Abu Alia 0ceae1ebb7 Bug 122 gefixt. MatrixTest und OLTest funktionieren 2018-11-14 12:11:03 +01:00
Martin Plümicke 07c679a598 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Variance =2 eingefuehrt, wenn Variancen einer Menge unterschiedlich sind (Oer-Constraints)
	modified:   ../bytecode/MatrixOpTest.java
wieder zum Ausfuehren eingeschaltet
2018-11-13 16:08:07 +01:00
Martin Plümicke 74ad081e78 modified: JavaTXCompiler.java
wieder das aus uniy-test hinkopiert
2018-11-13 14:28:33 +01:00
Martin Plümicke af93ea4750 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2018-11-13 11:01:23 +01:00
Martin Plümicke e72310278d modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Oder-Constraints als Subsitutions zu den Substitutions der UnifyPairs hinzugefuegt.
2018-11-12 17:57:51 +01:00
Martin Plümicke 3ce60eec8d modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Rekursionstife dokumentieten eingefuegt.
2018-11-12 11:55:37 +01:00
Fayez Abu Alia d27e0af57c Rekursiver Aufruf von Atrributen funktioniert 2018-11-08 13:02:33 +01:00
Martin Plümicke 0a9e325f54 modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
2018-11-07 17:49:12 +01:00
Fayez Abu Alia ea65a87336 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-11-07 15:30:04 +01:00
Fayez Abu Alia 623705d38a (Transivitaet) Algorithmus funktioniert 2018-11-07 15:29:37 +01:00
Martin Plümicke 72fa0978c2 modified: JavaTXCompiler.java
Kleinigkeit entfernt, dass varianceInheritance die gesamte variance-Vererbung macht.
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
2018-11-07 13:46:03 +01:00
Martin Plümicke fc3331d810 modified: src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
OderConstraints in Unify integriert
2018-11-06 23:35:57 +01:00
Martin Plümicke d08708878f modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
Variance distribut korrigiert
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Fehler im computeCartesianRecursiveOderConstraints beseitigt

	modified:   ../bytecode/javFiles/Matrix.jav
2018-11-05 23:28:08 +01:00
Martin Plümicke d5d49ad30e Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test
modified:   ../../src/de/dhbwstuttgart/bytecode/BytecodeGen.java
	modified:   ../../src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
	new file:   ../../src/de/dhbwstuttgart/bytecode/constraint/EqualConstraint.java
	new file:   ../../src/de/dhbwstuttgart/bytecode/constraint/ExtendsConstraint.java
	new file:   ../../src/de/dhbwstuttgart/bytecode/constraint/TPHConstraint.java
	modified:   ../../src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
	modified:   ../../src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	new file:   ../bytecode/FieldTest.java
	modified:   ../bytecode/MatrixOpTest.java
	modified:   ../bytecode/OverloadingSortingTest.java
	new file:   ../bytecode/YTest.java
	new file:   ../bytecode/javFiles/Field.jav
	modified:   ../bytecode/javFiles/Matrix.jav
	modified:   ../bytecode/javFiles/Sorting.jav
	modified:   ../bytecode/javFiles/Tph.jav
	new file:   ../bytecode/javFiles/Y.jav
2018-11-05 14:39:06 +01:00
Martin Plümicke 35696efd1c modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Alle Basistype bei Literalen hinzugefuegt.
2018-11-05 14:33:44 +01:00
Martin Plümicke f0ba7c03b5 modified: ../../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Bei Int-Literal werden imports beruecksichtigt
2018-11-05 12:01:16 +01:00
Fayez Abu Alia e6387dca6b Bug 116 gefixt 2018-11-04 12:49:11 +01:00
Martin Plümicke 5ddc9201f7 new file: ../YTest.java
new file:   Y.jav
2018-11-04 12:06:09 +01:00
Martin Plümicke 26477b60fb modified: ../bytecode/javFiles/Matrix.jav
Typannotationen wieder entfernt
2018-11-04 11:55:45 +01:00
Martin Plümicke 9bf273ac1a modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Unterscheidung zwischen FUNN-Receiver und anderem Receiver wieder geloescht
(war nur auskmmentiert)

	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
Fehler in der Reduce-FUNN-Rege beseitigt
2018-11-04 11:33:32 +01:00
Martin Plümicke 4ef360e41e modified: ../../src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
modified:   ../../src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
FieldVars eingefuegt, dass sie genauso wie localsvars immer die gleiche Typvariable in der abstrakten Syntax bekommen
2018-11-02 22:53:34 +01:00
Martin Plümicke 5849cd6f39 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-10-31 17:00:34 +01:00
Martin Plümicke 27b73f55e7 modified: ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
log-Ausgaben eingefuegt
2018-10-31 16:59:53 +01:00
Fayez Abu Alia a02e5a16a8 Transivitaet-Algo version 1 2018-10-31 16:07:37 +01:00
Fayez Abu Alia 788ddb2bcc modified: src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
modified:   test/bytecode/javFiles/Field.jav
Field-Test funktioniert
2018-10-25 12:41:26 +02:00
Fayez Abu Alia de08e5830d Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-10-25 12:27:28 +02:00
Fayez Abu Alia 7a1ed7ce6f Neuer Transivitaet-Algorithmus Step 1 und Step 2 2018-10-25 12:26:56 +02:00
Martin Plümicke d4c17053d7 modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
public void visit(AssignToField assignLeftSide) {
        //Hier ist kein Code nötig. Es werden keine extra Constraints generiert
    	//HIER muss Code rein PL 2018-10-24
    	assignLeftSide.field.accept(this); eingefuegt
    }
2018-10-24 15:36:20 +02:00
Martin Plümicke e6d8b92ffa modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
kleine Fehler
2018-10-24 14:05:20 +02:00
Martin Plümicke d7e59ecdc7 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Erste Version mit Recursiv oder

	modified:   ../bytecode/javFiles/Matrix.jav
2018-10-20 17:42:44 +02:00
Martin Plümicke 141194c983 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
erste version mit computeCartesianRecursiveOderConstraints aktiviert
Fehler bei durchschnitt leer wird Element geloescht.
2018-10-19 17:36:23 +02:00
Martin Plümicke 6dce7058a0 modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
typeInference <-> typeInferenceOld
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
compute <-> computeOld
2018-10-19 16:24:00 +02:00
Martin Plümicke 225f380735 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
letzte Version bevor computeCartesianRecursiveOderConstraints aktiviert wird
2018-10-19 16:09:59 +02:00
Martin Plümicke 6a87f443e4 modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../src/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2018-10-19 13:08:37 +02:00
Martin Plümicke 6ce9f4415e modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../src/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java
2018-10-18 23:47:38 +02:00
Fayez Abu Alia e3f2e4d793 Alle Tests funktionieren 2018-10-18 19:53:41 +02:00
Fayez Abu Alia 3fb95600a0 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-10-17 14:30:45 +02:00
Fayez Abu Alia 94b93c39df modified: src/de/dhbwstuttgart/bytecode/BytecodeGen.java
modified:   src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
	new file:   test/bytecode/FieldTest.java
	modified:   test/bytecode/MatrixOpTest.java
	new file:   test/bytecode/javFiles/Field.jav
	modified:   test/bytecode/javFiles/Sorting.jav
Boxing-Problem bei methodCall geloest und Tests funktionieren
2018-10-17 14:29:12 +02:00
Martin Plümicke 60be47c0f1 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-10-17 07:31:58 +02:00
Martin Plümicke 693b47b619 modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/de/dhbwstuttgart/typeinference/result/ResultSet.java
	modified:   src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Pair.java
2018-10-12 23:44:48 +02:00
Martin Plümicke 99bf02606b modified: src/de/dhbwstuttgart/typeinference/result/ResultPair.java
toString() eingefuegt

	modified:   src/de/dhbwstuttgart/typeinference/result/ResultSet.java
toString() eingefuegt

	modified:   src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
int-Lieterals können auch double-Literals sein.

	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
kleien Ausgabeerweiterung
2018-10-12 13:17:59 +02:00
Martin Plümicke 2869f07a58 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2018-10-11 16:58:06 +02:00
Pluemicke Martin 2be9055608 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
aufgeraeumt
2018-10-11 16:31:02 +02:00
Fayez Abu Alia 0d83ee8505 modified: src/de/dhbwstuttgart/bytecode/signature/Signature.java
Zyklen werden abgefangen.
2018-10-11 16:01:26 +02:00
Fayez Abu Alia f325b04ee2 Bugs 111 und 114 gefixt. Unboxing wird aufgerufen wenn es noetig ist 2018-10-11 14:17:54 +02:00
Martin Plümicke 56dd759762 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Nur bei leerem Durchscnit filtern geloescht.
2018-10-11 13:09:18 +02:00
Martin Plümicke 1b7bded3c3 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
1. Version läuft aber nicht schnell
2018-10-11 12:40:20 +02:00
Martin Plümicke bda7dcb5c1 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-10-11 09:47:55 +02:00
Martin Plümicke 241c7f37d9 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
weitere Element rausfiltern angefangen

	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Methode: getGroundBasePair eingefuegt
2018-10-11 00:45:59 +02:00
Martin Plümicke 54b4ad97f6 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-10-10 14:41:35 +02:00
Martin Plümicke 674233e2f9 modified: ../../src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
Trennung von Integer und Double in private Expression convert(Java8Parser.LiteralContext literal) eingefuegt

	modified:   ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Typisierung von Literals eingefuegt

	modified:   ../../test/bytecode/javFiles/MatrixOP.jav
Name Matrix durch MatrixOP ersetzt
2018-10-05 00:23:04 +02:00
Fayez Abu Alia b56f18c16e Unboxing fuer methodcall wird nicht gemacht wenn es sich in Returnstatement befindet. SimplifyPairs fuer Paramtrisierte Typen wird einmal vor die Signatureerzeugung ausgefuehrt und nicht separat. getAllPairs in Signature gefixt. 2018-10-04 12:54:03 +02:00
Martin Plümicke 8e220b81d5 modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
bei der der Rueckgabe von subst wurde noch Optional beruecksichtigt
2018-09-27 17:17:36 +02:00
Martin Plümicke 8a43839c28 modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Gleichungen a <.? b werden durch a =. b ersetzt und subst angewandt.

	deleted:    ../../test/bytecode/VectorAddTest.java
	modified:   ../../test/bytecode/javFiles/Matrix.jav
	modified:   ../../test/bytecode/javFiles/Sorting.jav
2018-09-27 15:59:57 +02:00
JanUlrich 0594fc7381 aufräumen 2018-09-26 16:46:55 +02:00
Fayez Abu Alia 77a952c997 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-09-26 16:31:36 +02:00
Fayez Abu Alia 3c7b1451d4 MatrixTest funktioniert 2018-09-26 16:25:52 +02:00
JanUlrich ceba60cccb Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-09-26 16:21:22 +02:00
JanUlrich 88e2366eab ListenerOverload Test 2018-09-26 16:21:10 +02:00
Martin Plümicke 334b56234f Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2
Conflicts:
	test/bytecode/javFiles/VectorAdd.jav
2018-09-26 15:45:23 +02:00
Martin Plümicke 4ace3b6f92 new file: ../../test/bytecode/javFiles/VectorAdd.jav 2018-09-26 15:44:36 +02:00
Martin Plümicke 355df5fab7 new file: ../../test/bytecode/FunOLTest.java
new file:   ../../test/bytecode/javFiles/FunOL.jav
	new file:   ../../test/bytecode/vectorAddTest.java
2018-09-26 15:43:27 +02:00
Martin Plümicke 85d5485595 modified: ../../test/bytecode/javFiles/Sorting.jav
sort hinzugefuegt
2018-09-26 15:40:51 +02:00
Fayez Abu Alia d3d1d658b8 Bug 112 gefixt 2018-09-26 15:37:00 +02:00
Fayez Abu Alia 2add9f518c Richtiger Bytecode fuer If-Statements wird erzeugt.
modified:   test/bytecode/FacultyTest.java
FacultyTest geaendert.

	new file:   test/bytecode/VectorAddTest.java
VectorAddTest hinzugefuegt.
2018-09-26 13:46:34 +02:00
Martin Plümicke f46d26e53f Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-09-19 22:22:36 +02:00
Martin Plümicke 315b6172a0 modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/FCGenerator.java

Die Anzahl der mehrfachen Lösungen bei sorting.jav reduziert
2018-09-19 22:21:07 +02:00
Fayez Abu Alia ea3ff69047 Faculty.jav geaendert 2018-09-19 16:00:55 +02:00
Fayez Abu Alia 44edc7e9cb Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-09-19 15:55:17 +02:00
Fayez Abu Alia 673c249b68 modified: src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
new file:   src/de/dhbwstuttgart/bytecode/IfStatement.java
Bytecode für If statement wir erzeugt aber noch nicht vollständig.
	modified:   test/bytecode/javFiles/Faculty.jav
Test angepasst.
2018-09-19 15:52:29 +02:00
JanUlrich d165260be0 Beginnen mit Parser Dokumentation 2018-09-19 14:37:40 +02:00
Fayez Abu Alia aeb8bb92ed Bug 108 gefixt 2018-09-19 13:05:00 +02:00
Martin Plümicke 5768783828 modified: ../../test/bytecode/javFiles/Matrix.jav
Argumenttype von mul wieder entfernt.
2018-09-13 12:07:02 +02:00
Martin Plümicke acc7d95060 modified: ../../test/bytecode/javFiles/Matrix.jav
mul hat Argumenttype der nicht funktioniert.
2018-09-13 12:04:50 +02:00
Martin Plümicke 50027a9da0 modified: ../../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
Variance für Attribute/Fields eingefuegt

	new file:   ../FacultyTest.java
	new file:   ../MatrixOpTest.java
	new file:   ../SortingTest.java
	new file:   MatrixOP.jav
	modified:   Sorting.jav
2018-09-11 21:59:20 +02:00
Martin Plümicke 236afea4f9 modified: ../../test/bytecode/javFiles/Faculty.jav
Typannotation entfernt
2018-09-10 13:14:36 +02:00
JanUlrich b8741d881b Sorting Test für Bytecoded generierung 2018-09-10 02:36:53 +02:00
JanUlrich 16ca123780 Testfall anfügen 2018-09-09 18:53:43 +02:00
JanUlrich 654f347450 Fehler in Test Lambda beheben 2018-09-07 04:35:58 +02:00
JanUlrich c72204428f == Operator anfügen 2018-09-07 01:41:26 +02:00
JanUlrich 1e037a0019 Fehler im Parsen von Typen mit Package Namen behoben 2018-09-07 00:39:31 +02:00
JanUlrich 8759a9cc5d IfStmt Constraints erstellen 2018-08-30 00:02:17 +02:00
JanUlrich 0ee5a6791d FunN falsch benannt 2018-08-29 21:48:15 +02:00
JanUlrich 1a8115bf07 Field Initialisierungen anfügen 2018-08-29 02:43:32 +02:00
Martin Plümicke 72e128d3f3 modified: test/javFiles/Fields.jav
Typdeklaration von Filed test2 entfernt

	modified:   test/typeinference/JavaTXCompilerTest.java
Unittest LambdaFiled.java reingenommen
2018-08-28 10:11:46 +02:00
JanUlrich b70e261b23 Var Keyword in Java8.g4 Grammatik verlagern 2018-08-24 19:33:55 +02:00
JanUlrich df95c244bf add Fields Test. Felder können ohne Typ oder mit var-Keyword initialisiert werden 2018-08-24 18:25:34 +02:00
JanUlrich 1061f355ff Felder aktivieren 2018-08-20 18:22:21 +02:00
JanUlrich 4ca671631d Merge branch 'bigRefactoring' into bytecode2 2018-08-20 14:17:09 +02:00
JanUlrich 7ee06254f0 Resolve fixen 2018-08-19 19:43:29 +02:00
JanUlrich a823ef2b16 Generics Resolve fixen 2018-08-19 19:42:31 +02:00
Fayez Abu Alia 9281786db4 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-08-13 18:29:30 +02:00
Fayez Abu Alia 77d397fc53 modified: src/de/dhbwstuttgart/bytecode/BytecodeGen.java
modified:   src/de/dhbwstuttgart/bytecode/signature/Signature.java
	modified:   src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java
	modified:   test/bytecode/javFiles/Merge.jav
	modified:   test/bytecode/javFiles/OL.jav
	modified:   test/bytecode/javFiles/Tph.jav
	modified:   test/bytecode/javFiles/Tph3.jav
	new file:   test/bytecode/javFiles/WC.jav
2018-08-13 18:28:41 +02:00
Martin Plümicke 5f89188d00 new file: ../../test/bytecode/Tph5Test.java
new file:   ../../test/bytecode/javFiles/Tph5.jav
erzeugt Typfehler zur Laufzeit mit
mport java.util.Vector;

public class Tph5Use {
	public static  void main(String[] args) {
		Tph5 tph5 = new Tph5();
		Integer i = tph5.<Integer, Integer, Integer, Integer>m(1,2,3);
		String s = tph5.<String, String, Integer, Integer>m("xx",2,3);
	}
}
2018-08-13 18:19:02 +02:00
Martin Plümicke 6bdd347298 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2
Conflicts:
	test/bytecode/javFiles/Lambda.jav
2018-08-09 15:34:57 +02:00
Martin Plümicke 9b131c48b0 modified: test/bytecode/LambdaTest.java
modified:   test/bytecode/javFiles/Lambda.jav
aufgeraeumt

	new file:   test/bytecode/LambdaVoidTest.java
	new file:   test/bytecode/javFiles/LambdaVoid.jav
FunVoidN-Tests
2018-08-09 15:32:48 +02:00
Martin Plümicke 5e14acfa12 modified: ../../test/bytecode/javFiles/Merge.jav
modified:   ../../test/bytecode/javFiles/OL.jav
2018-08-08 18:12:24 +02:00
Martin Plümicke 7d9976e638 modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java
superwildcard durch extendswildcard ausgetauscht.
2018-08-08 15:32:42 +02:00
Fayez Abu Alia 2bbb6e0b6b Bug in Signature gefixt. Merge Test tut. 2018-08-08 14:33:31 +02:00
Martin Plümicke 6d34ae89ae modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
logging für TypeUnify aus commit d6364040 wiederhergestellt
2018-08-07 17:38:40 +02:00
JanUlrich 9492c43e70 Merge mit bigRefactoring 2018-08-06 16:43:24 +02:00
JanUlrich f18083ba06 Merge 2018-08-06 16:41:38 +02:00
JanUlrich b9aee4da77 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-08-06 16:40:08 +02:00
JanUlrich 70972a5cbf Fehler mit GenericRefTypes in Wildcards beheben 2018-08-06 16:39:49 +02:00
Fayez Abu Alia f99d4dae5a DUP Befehl fuer UnaryExpr 2018-08-06 16:14:09 +02:00
Fayez Abu Alia dc535ad9b7 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-08-06 14:47:26 +02:00
Fayez Abu Alia dd8b4f322e BinaryTest funktioniert 2018-08-06 14:46:54 +02:00
JanUlrich af894ebfe4 Fehler mit Wildcards in ASTFactory beheben 2018-08-06 14:03:09 +02:00
JanUlrich cc676f32c5 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-08-06 14:01:53 +02:00
JanUlrich 272948f70d Fehler mit Wildcards in ASTFactory beheben 2018-08-06 14:01:31 +02:00
Fayez Abu Alia 5d0603f423 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-08-06 13:53:19 +02:00
Martin Plümicke 3e9e222d73 Merge branch 'plugin' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2
test/bytecode/javFiles/Lambda.jav
	test/bytecode/javFiles/OL.jav
2018-08-06 13:45:20 +02:00
Fayez Abu Alia d6364040fa merge 2018-08-06 13:34:34 +02:00
Fayez Abu Alia 52c445435d MergeTest 2018-08-06 13:25:41 +02:00
Martin Plümicke 6264d928b2 modified: test/bytecode/javFiles/Merge.jav
modified:   test/bytecode/javFiles/OL.jav
2018-08-06 13:14:08 +02:00
Martin Plümicke 89387d2718 new file: ../../test/bytecode/MergeTest.java
new file:   ../../test/bytecode/javFiles/Merge.jav
2018-08-06 10:03:03 +02:00
Fayez Abu Alia 0443f1e528 Lambda Test angepasst 2018-08-03 14:02:09 +02:00
Fayez Abu Alia 34969e66ba bug in Signature gefixt 2018-08-03 13:48:45 +02:00
Fayez Abu Alia dcbcf873e4 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-08-01 14:04:06 +02:00
Fayez Abu Alia deb632050a LDC2_W fuer Long verwendet. Tests bereinigt. 2018-08-01 14:03:23 +02:00
JanUlrich acf8c108e8 Diamantoperator 2018-07-26 16:25:54 +02:00
JanUlrich 968dc06edc Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-07-26 15:16:28 +02:00
JanUlrich 47808c4e6f Diamantoperator 2018-07-26 14:57:13 +02:00
Fayez Abu Alia 5029cca0f1 Transivitaet Berechnung bei TPHs korrigiert 2018-07-26 14:37:11 +02:00
JanUlrich 79eb3135d6 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-07-26 14:04:12 +02:00
Fayez Abu Alia adf675e595 Bug 98 gefixt, kleine Aenderung in Signature Klasse und Tph4 Test eingefuegt 2018-07-25 16:45:59 +02:00
Fayez Abu Alia f3e60e50ef Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-07-25 11:01:33 +02:00
Fayez Abu Alia 30f75f2f17 LambdaTest 2018-07-25 11:01:03 +02:00
Martin Plümicke 4e5c75673d new file: ../../test/bytecode/Tph3Test.java
new file:   ../../test/bytecode/javFiles/Tph3.jav
Test mit wechselseitiger Rekursion
2018-07-19 13:57:01 +02:00
Martin Plümicke 2421dd0222 modified: ../../test/bytecode/LambdaTest.java
jetzt korrekt
	modified:   ../../test/bytecode/Tph2Test.java
jetzt korrekt
	modified:   ../../test/bytecode/TphTest.java
jetzt korrekt
	modified:   ../../test/bytecode/applyLambdaTest.java
jetzt korrekt
	modified:   ../../test/bytecode/javFiles/Tph.jav
Rueckgabewert veraendert
2018-07-19 13:54:31 +02:00
Fayez Abu Alia 14be882b7b LambdaTest Funktioniert. 2018-07-18 22:49:21 +02:00
Martin Plümicke 448d3e04f8 modified: ../../test/bytecode/LambdaTest.java 2018-07-18 17:56:20 +02:00
Martin Plümicke fe99db81b3 modified: ../../test/bytecode/LambdaTest.java
Lambda-Ausruck wird ausgewertet. Funktioniert nicht, vermutich, weil Lambda-Methode apply private
2018-07-18 17:54:44 +02:00
Martin Plümicke c3ca4777bb modified: ../../test/bytecode/LambdaTest.java
noch unvllstaendig

	modified:   ../../test/bytecode/MatrixTest.java
Test korrekt
	modified:   ../../test/bytecode/javFiles/Matrix.jav
import byte entfernt, so dass Laufzeit passt
2018-07-18 17:01:01 +02:00
Martin Plümicke 16b7db9218 modified: test/bytecode/MatrixTest.java
Test einfeguegt nicht getestet
	modified:   test/bytecode/OLTest.java
Test eingefuegt
	modified:   test/bytecode/javFiles/OL.jav
- Main in OLMain umbenannt
- Klassen publich gemacht
2018-07-18 15:34:49 +02:00
Fayez Abu Alia 2d5f03a3e0 Bugs 89 und 90 2018-07-18 13:51:05 +02:00
Martin Plümicke fd64b84072 modified: TYPEStmt.java
Bei der Addition + Abfragen eingefuegt, ob die Subtypen von Number jeweils import sind. Nur dann werden Annahmen erstellt.

	modified:   ../../../../../test/bytecode/javFiles/Matrix.jav
	modified:   ../../../../../test/bytecode/javFiles/OL.jav
2018-07-17 17:38:00 +02:00
Martin Plümicke 2a5c727400 new file: applyLambdaTest.java
modified:   javFiles/Lambda.jav
	new file:   javFiles/applyLambda.jav
An das JavaTXExamples angepasst
2018-07-14 09:28:13 +02:00
Martin Plümicke 3fedbcc4a0 modified: target/JavaTXcompiler-0.1-jar-with-dependencies.jar 2018-07-13 11:49:43 +02:00
Martin Plümicke 4f84e60246 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into plugin 2018-07-12 16:17:07 +02:00
Fayez Abu Alia d373b3dbf8 merge 2018-07-10 22:26:52 +02:00
Fayez Abu Alia 7c3ca93c0b Bug 88 gefixt.
new file:   src/de/dhbwstuttgart/bytecode/ArgumentVisitor.java
Visitor für Argumente des Method Call einer Methode aus Standard-Bibliothek und dient dazu,
wenn die Argument eine primitive Typ besitzt dann wird unboxing gemacht.
Signatur von Konstruktoren angepasst.
2018-07-10 22:15:26 +02:00
Martin Plümicke 72a4c64c5c modified: ../../test/bytecode/javFiles/Matrix.jav
Konstruktoren eingefuegt
2018-07-06 10:37:59 +02:00
Martin Plümicke 72c2e19def Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into plugin
src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	test/bytecode/javFiles/Lambda.jav
	test/typeinference/UnifyTest.java

	modified:   src/de/dhbwstuttgart/.DS_Store
	modified:   src/de/dhbwstuttgart/bytecode/BytecodeGen.java
	modified:   src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java
	modified:   src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java
	modified:   src/de/dhbwstuttgart/bytecode/signature/Signature.java
	modified:   src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java
	modified:   src/de/dhbwstuttgart/bytecode/utilities/MethodFromMethodCall.java
	modified:   src/de/dhbwstuttgart/syntaxtree/type/FunN.java
	modified:   src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java
	modified:   src/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java
	modified:   src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
	modified:   target/JavaTXcompiler-0.1-jar-with-dependencies.jar
	modified:   test/bytecode/javFiles/Lambda.jav
	modified:   test/bytecode/javFiles/Matrix.jav
	modified:   test/javFiles/Lambda.jav
	modified:   test/javFiles/Matrix.jav
	modified:   test/javFiles/Vector.jav
	modified:   test/typeinference/UnifyTest.java
2018-07-05 00:54:40 +02:00
Fayez Abu Alia bd0bfed2cb Matrix Test läuft. Code muss noch aufgeräumt werden 2018-07-04 22:18:16 +02:00
JanUlrich 80b4f631ed Verzeichnis test/logfiles anfügen 2018-07-04 12:36:59 +02:00
Martin Plümicke cee86a6b61 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-07-04 12:07:21 +02:00
Martin Plümicke f1f34a6733 modified: test/javFiles/Matrix.jav 2018-07-04 12:07:11 +02:00
Martin Plümicke 1a2454e00b modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Kommentare zur Max Min optimierung rasugenommen
2018-07-04 11:47:02 +02:00
Martin Plümicke bc1a796e28 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-07-03 11:54:24 +02:00
Fayez Abu Alia 9f53d1fdc2 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-07-03 11:20:33 +02:00
Fayez Abu Alia 69706ee1d2 Bug 82 gefixt und getestet. Descriptor von MethodCall von Interface korrigiert. 2018-07-03 11:15:58 +02:00
Martin Plümicke b8e229cf3f modified: ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
	modified:   ../javFiles/Matrix.jav
2018-07-02 17:24:16 +02:00
Martin Plümicke e0c5afcd6d modified: test/bytecode/javFiles/Lambda.jav
modified:   test/javFiles/Vector.jav
	modified:   test/typeinference/UnifyTest.java
2018-07-02 11:11:29 +02:00
JanUlrich 9123e222f4 Vector TEst anfügen 2018-06-28 16:47:05 +02:00
Fayez Abu Alia 29bd9a3f4f remove logFile 2018-06-27 15:39:04 +02:00
Fayez Abu Alia 7926c25c7d Soviel wie möglich unnötige TPHs aus Signaturen von Paramtrisierten Typen entfernt 2018-06-27 15:20:35 +02:00
Fayez Abu Alia b4c604e2b1 Bug in der Methode simplifyPairs gefixt.
Bug 82 gefixt.
TPHs in paramtrisierten Typen als TypeVariablen in Signature hinzugefügt.
Lambda.jav funktioniert.
2018-06-27 14:49:22 +02:00
Martin Plümicke d8bb4d6188 modified: test/bytecode/javFiles/Lambda.jav
Lambda auf apply angepasst
2018-06-23 10:54:14 +02:00
Martin Plümicke 0ecaf36648 modified: src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Bei Literal die Zuweisung des Typs eingefuegt aber wieder auskommentiert,
weil es im Moment nur double Literals gibt.
	modified:   test/javFiles/Lambda.jav
2018-06-23 10:42:46 +02:00
Martin Plümicke 2eb7a63480 modified: src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
FunN$$ eingefuegt

	modified:   src/de/dhbwstuttgart/syntaxtree/type/FunN.java
	modified:   src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java
	modified:   src/de/dhbwstuttgart/typeinference/assumptions/MethodAssumption.java
	modified:   src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Methodcall einige Bugs sowohl beim apply als uch bei allen anderen gefixt.

	modified:   test/javFiles/Lambda.jav
2018-06-23 01:05:13 +02:00
Martin Plümicke 1991bbbcd3 modified: src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
FunN-Types werden nach RefTypes mit FunN$$ nach Unifikation zurueckkonvertiert.

	modified:   target/JavaTXcompiler-0.1-jar-with-dependencies.jar
	modified:   test/bytecode/javFiles/Faculty.jav
	modified:   test/bytecode/javFiles/Lambda.jav
	modified:   test/bytecode/javFiles/OL.jav
	modified:   test/javFiles/Lambda.jav
2018-06-21 09:51:05 +02:00
Martin Plümicke b5bc9fa01a modified: target/JavaTXcompiler-0.1-jar-with-dependencies.jar 2018-06-20 20:27:19 +02:00
Martin Plümicke a92521f04a Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into plugin 2018-06-20 20:06:37 +02:00
Martin Plümicke 895b5a972e new file: doc/PluginBau.pdf
modified:   src/de/dhbwstuttgart/typedeployment/TypeInsert.java
	modified:   src/de/dhbwstuttgart/typedeployment/TypeInsertPoint.java
equals Methoden eingefuegt um Marker nur einmal im Plugin zu haben

	modified:   target/JavaTXcompiler-0.1-jar-with-dependencies.jar
	modified:   test/bytecode/javFiles/OL.jav
	modified:   test/typeinference/UnifyTest.java
2018-06-20 19:52:58 +02:00
Fayez Abu Alia 11649b39d3 generateBCForFun() um Parameter path erweitert. 2018-06-20 18:15:44 +02:00
Fayez Abu Alia 303cfa5409 log entfernt 2018-06-20 18:08:25 +02:00
Fayez Abu Alia 660ef68f7e generateBytecode() um Parameter path erweitert. Alle Tests angepasst 2018-06-20 18:07:17 +02:00
Fayez Abu Alia 23eab0c9a4 TPHs, die nicht in ParameterListe der Methode vorkommen, werden in Signature geschrieben 2018-06-19 14:56:22 +02:00
Fayez Abu Alia 162ca3eb27 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-06-19 13:32:24 +02:00
Fayez Abu Alia 6d70464a1c TPH X < TPH Y <...< TPH Z vereinfacht => TPH X < TPH Z und Signature-Erzeugung wird angepasst 2018-06-19 13:31:39 +02:00
Martin Plümicke 1437788f5a Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into plugin 2018-06-18 11:50:55 +02:00
Martin Plümicke 04d3ac84e7 jeweils apply eingefuegt, was nicht funktioniert
modified:   ../../test/typeinference/UnifyTest.java
Matrix auskommentiert und Lambda einkommentiert
2018-06-15 16:19:12 +02:00
Fayez Abu Alia 2db5ecc260 logFile deleted 2018-06-13 15:51:59 +02:00
Fayez Abu Alia b325e205a1 Bugs gefixt. Bytecode-Erzeugung für MethodCall ergänzt. Bytecode für Matrix-Test (Funktioniert noch nicht ganzErzeugung Signatures und Descriptors verbessert 2018-06-13 15:50:05 +02:00
Fayez Abu Alia ff2bca5ce5 Alle TPHS einer Methode und pairs (TPH < SuperTPH) werden gesammelt,
gemeinsamme TPHs werden bestimmt, die Klassenkopf als Type-Variables
	definiert werden sollen.
	Erzeugung von Signature angepasst.
2018-06-12 11:41:59 +02:00
Martin Plümicke c08d4b8457 Merge branch 'plugin' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into plugin 2018-06-08 14:39:51 +02:00
Martin Plümicke d2d02e26f0 modified: target/JavaTXcompiler-0.1-jar-with-dependencies.jar 2018-06-08 14:35:22 +02:00
Martin Plümicke e0d5699ae7 deleted: Installation/install.html 2018-06-01 17:13:05 +02:00
Martin Plümicke 3f2558d21e new file: Website/Installation/install.html
new file:   Website/JavaTXExamples.zip
	new file:   Website/index.html
	new file:   Website/install/Restart.png
	new file:   Website/install/availableSoftware1.png
	new file:   Website/install/availableSoftware2.png
	new file:   Website/install/instal.html
	new file:   Website/install/install.html
	new file:   Website/install/installAnyway.png
	new file:   Website/install/installationDetails.png
	new file:   Website/install/licenseAgreement.png
	new file:   Website/install/newsoftware.png
	new file:   Website/install/selectInstallation.png
	new file:   Website/newJavaTXProject/addLibrary2.png
	new file:   Website/newJavaTXProject/buildPath1.png
	new file:   Website/newJavaTXProject/buildPath2.png
	new file:   Website/newJavaTXProject/buildPath3.png
	new file:   Website/newJavaTXProject/buildPath4.png
	new file:   Website/newJavaTXProject/newJavFile.png
	new file:   Website/newJavaTXProject/newJavFolder1.png
	new file:   Website/newJavaTXProject/newJavFolder2.png
	new file:   Website/newJavaTXProject/newJavaTXProject.html
	new file:   Website/newJavaTXProject/newJavaTXProject.png
	new file:   Website/usePlugin/usePlugin.html
	new file:   Website/usePlugin/usePlugin1.png
	new file:   Website/usePlugin/usePlugin2.png
	modified:   test/bytecode/javFiles/OL.jav
2018-06-01 16:57:35 +02:00
Martin Plümicke 814aef082d modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
log-File schreiben entfernt
2018-05-30 18:35:57 +02:00
Martin Plümicke 5a0e53485c modified: src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Unary-Expression SMALLERNEQDOT eingefuegt
	modified:   test/bytecode/javFiles/Fac.jav
2018-05-30 17:23:55 +02:00
JanUlrich 1ca7fba835 Generics fix 2018-05-30 16:10:20 +02:00
JanUlrich 98eb1827b8 Fix Generics parsing 2018-05-30 15:57:51 +02:00
JanUlrich ee1fa17aba Implement convert(ClassOrInterfaceType) 2018-05-30 15:29:59 +02:00
Fayez Abu Alia 66078360da Alle TPH der Methode werden in eine Liste gespeichert.
Bug gefixt => FacTest liefert richtiges Ergebnis.
Deskriptoren von Methoden, in denen TPHs auftauchen, werden erzeugt.
Signaturen von von Methoden, in denen TPHs auftauchen, werden erzeugt.
Test, RückagbeTypen der Methoden = TPH und ParameterTypen = TPH.
2018-05-30 15:27:21 +02:00
Martin Plümicke bb26112a9b modified: ../../../target/JavaTXcompiler-0.1-jar-with-dependencies.jar
modified:   Fac.jav
	modified:   Faculty.jav
	modified:   OL.jav
	modified:   While.jav
	modified:   ../../javFiles/AddLong.jav
2018-05-30 00:27:20 +02:00
JanUlrich 26f24db0a3 Kleiner Fix am ASTWalker 2018-05-28 17:08:20 +02:00
Martin Plümicke 97d893e66b Merge branch 'plugin' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into plugin
merge
2018-05-28 16:36:46 +02:00
Martin Plümicke 57fb90afaf modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
LogFile  optional gemacht
2018-05-28 16:35:47 +02:00
JanUlrich 63ac79f02c Hotfix für Typparsen Problem 2018-05-28 16:21:52 +02:00
JanUlrich 07fa62d11d merge Keine Ahnung mit was ... 2018-05-28 16:21:43 +02:00
JanUlrich c7042d185f Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2018-05-28 16:18:49 +02:00
JanUlrich 7e3fca2da9 Hotfix für Typparsen Problem 2018-05-28 16:18:33 +02:00
Martin Plümicke 66587a8f71 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
SMALERNEQDOT in Regel a <!=. Theta korrigiert
SMALERNEQDOT in Regel Theta <!=. a geloescht
2018-05-28 16:07:29 +02:00
JanUlrich ad42282485 Test 2018-05-28 15:55:14 +02:00
Martin Plümicke 581e5e574e Merge branch 'bytecode2' into plugin 2018-05-25 14:41:22 +02:00
Martin Plümicke ae14dfd947 modified: src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2018-05-25 14:39:54 +02:00
Martin Plümicke 9d53d9d5d1 modified: src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
kleiner Fehler korrigiert
	modified:   test/javFiles/Matrix.jav
2018-05-25 11:16:02 +02:00
Fayez Abu Alia 58f5e17ab5 FacTest.java 2018-05-25 10:01:44 +02:00
Fayez Abu Alia 6fce2760c5 While.jav 2018-05-25 09:53:30 +02:00
Martin Plümicke 1de897fb1f modified: src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
System.out.println geloescht
2018-05-24 17:59:51 +02:00
Martin Plümicke 87dede5d5f modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
F-Bounded Problematik durche neues greater ggf. geloest.
Es werden Falle ausgeschlossen. Diese Faelle muessen noch ergaenzt werden.
2018-05-24 17:45:10 +02:00
Fayez Abu Alia f085f9f499 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-05-24 16:44:28 +02:00
Fayez Abu Alia a40d2b991f kleine Änderung 2018-05-24 16:44:05 +02:00
Martin Plümicke 704415ae3b Merge branch 'unifyOptimierung' into plugin
fixed	test/javFiles/Matrix.jav
2018-05-24 16:43:31 +02:00
Martin Plümicke 65531ac12e modified: ../../src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
modified:   ../../src/de/dhbwstuttgart/typeinference/constraints/Pair.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/PairOperator.java
Einführung eines neuen Operators SMALLERNEQDOT um Ungleichungen a <!=. Number für die Relationsoperatoren einfuehren zu koennen.

	modified:   ../../test/javFiles/Matrix.jav
2018-05-24 16:20:57 +02:00
Martin Plümicke 34e632b872 modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
Reduce ausgetauscht bei ArgPara und Returntype
	modified:   ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
isUndefinedPair korrigiert.
	modified:   ../../test/bytecode/LambdaTest.java
	modified:   ../../test/bytecode/javFiles/Plus.jav
	modified:   ../../test/bytecode/javFiles/RelOps.jav
2018-05-24 14:11:04 +02:00
Martin Plümicke 3470215bae Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-05-24 10:48:57 +02:00
Martin Plümicke f5398fa8e9 deleted: ../../test/logFiles/log 2018-05-24 10:34:50 +02:00
Martin Plümicke f617ad8946 modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Relationen auf verschiedene Numeric-Typen umgestellt
im equals Null abgefragt
2018-05-24 10:28:22 +02:00
Martin Plümicke 876ec6a4f6 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unifyOptimierung
Conflicts:
	src/de/dhbwstuttgart/core/JavaTXCompiler.java
solved
2018-05-24 09:41:15 +02:00
Martin Plümicke 26d9b1215f modified: ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java
	modified:   ../../test/javFiles/Matrix.jav
F-Bounded angefangen
2018-05-24 09:17:31 +02:00
Fayez Abu Alia 0f29bc038a Bugs gefixt. Tests für relationalen Operatoren(GreaterEqualTest, ...) laufen.
Für Typplaceholder werden Generics verwendet.

Neue Tests angefügt.
2018-05-23 15:38:41 +02:00
Martin Plümicke a5ed5a2a46 Merge branch 'unifyOptimierung' into plugin 2018-05-22 17:29:44 +02:00
Martin Plümicke c597b0430a modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
cardProd als Variable eingfuegt
	modified:   ../../src/de/dhbwstuttgart/syntaxtree/ClassOrInterface.java
toString() eingfuegt
	modified:   ../../src/de/dhbwstuttgart/syntaxtree/GenericDeclarationList.java
toString() eingfuegt
	modified:   ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
BinaryOp <. statt =.
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Bei nicht importierten (result []) undefinPair gesetzt
	modified:   ../javFiles/Matrix.jav
falsche importe rausgenommen
2018-05-22 17:10:07 +02:00
Martin Plümicke 06a0cb8eaf modified: TypeUnifyTask.java
noAllErasedElements eingefuegt
2018-05-19 10:13:08 +02:00
Martin Plümicke b5a601d798 modified: TypeUnifyTask.java
Varianceweitergabe in den verschiedenen Cases eingefuegt
Erste Zaehlungen eingefuegt
2018-05-19 09:50:57 +02:00
Martin Plümicke 7ea6777906 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../javFiles/Lambda.jav
	modified:   ../typeinference/UnifyTest.java
2018-05-18 13:12:49 +02:00
Martin Plümicke 6b1896f58c modified: src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   src/de/dhbwstuttgart/typeinference/unify/distributeVariance.java
greaterFUNN und smallFUNN fuer generierte TPHs Variance gesetzt
	modified:   test/javFiles/Lambda.jav
vom bytecode ruebergeholt
2018-05-18 09:55:45 +02:00
Martin Plümicke d81c06cdd9 modified: ../../src/de/dhbwstuttgart/typeinference/unify/distributeVariance.java
Implementierung fuer FuNN eingefuegt
	deleted:    ../../src/de/dhbwstuttgart/typeinference/unify/inheritVariance.java

wahrscheinlich bei FuNN-Regeln Variance setzen.
2018-05-18 00:03:07 +02:00
Martin Plümicke 8baff8f376 modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
Variancenvererbung eingefuegt
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Variancenvererbung geloescht
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	modified:   ../../test/typeinference/UnifyTest.java
2018-05-17 22:51:41 +02:00
Martin Plümicke bc2cab8c95 modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/de/dhbwstuttgart/syntaxtree/factory/UnifyTypeFactory.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	modified:   test/javFiles/Lambda.jav
	modified:   test/javFiles/Lambda3.jav
2018-05-17 18:07:21 +02:00
JanUlrich dca5d21c23 JavaCompilerCoreWithDependencies upload 2018-05-17 12:47:01 +02:00
Martin Plümicke 51a2acdbaf modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   test/typeinference/UnifyTest.java
2018-05-17 11:42:03 +02:00
stan 832623a738 ClassOrInterface muss im Modifier INTERFACE haben, wenn isInterface gesetzt ist 2018-05-16 15:37:46 +02:00
Fayez Abu Alia dcc36f082f code aufräumen 2018-05-16 13:37:31 +02:00
Fayez Abu Alia 9575afd0b4 Fun umbenannt und Argumente umgedreht 2018-05-15 10:33:30 +02:00
Martin Plümicke 5c797a44a1 modified: ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
disableWildcardtable in den FUNN-Regeln eingefuegt.
2018-05-10 09:07:33 +02:00
Martin Plümicke 87dbcfdad4 Merge branch 'unifyOptimierung' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unifyOptimierung
Merge
2018-05-09 18:10:17 +02:00
Martin Plümicke 8048af2106 modified: ../../test/javFiles/Lambda2.jav
modified:   ../../test/typeinference/UnifyTest.java
2018-05-09 18:10:08 +02:00
Martin Plümicke e4243b612c modified: src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
Operatoren neue getypte
Returnargument bei FUNN nach hinten verschoben
	modified:   src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
Returnargument bei FUNN nach hinten verschoben
Wildcards in Argumenten von als Undefined Pairs (funktioniert noch nicht)
Methode wrongWildcard eingefuegt
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Methode doubleWildcard ind wrongWildcard umbenannt
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java
Methode doubleWildcard ind wrongWildcard umbenannt
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/WildcardType.java
Methode doubleWildcard ind wrongWildcard umbenannt
2018-05-09 18:05:06 +02:00
Martin Plümicke da4c59f2cf modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
modified:   ../../test/typeinference/UnifyTest.java
2018-05-09 16:24:28 +02:00
Martin Plümicke 1c22fc7d57 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unifyOptimierung
merge bytecode2
2018-05-09 13:29:11 +02:00
Martin Plümicke 0b7aea21d9 modified: ../../test/bytecode/LambdaTest.java
modified:   ../../test/bytecode/javFiles/Lambda2.jav
2018-05-08 18:52:43 +02:00
Fayez Abu Alia 521a1cbf3b Bug 77 gefixt 2018-05-08 17:42:58 +02:00
Martin Plümicke 22ca2cbd4a modified: BytecodeGenMethod.java 2018-05-08 11:28:24 +02:00
Fayez Abu Alia 49ea4ee283 Pfad der erzeugten klassendateien angepasst 2018-05-08 10:19:13 +02:00
Martin Plümicke 225dc16a89 modified: test/typeinference/UnifyTest.java 2018-05-08 09:23:20 +02:00
Martin Plümicke 4738add4fc modified: ../../../../../test/javFiles/Matrix.jav
modified:   ../../../../../test/typeinference/UnifyTest.java
2018-05-07 15:31:31 +02:00
stan 35d5fb2f03 Fehler in ASTFactory mit Generischen FEldern beheben 2018-05-07 15:12:07 +02:00
stan c8728bab10 Testfall fix 2018-05-07 12:51:29 +02:00
JanUlrich bc99dc4c8b Merge branch 'plugin' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into plugin 2018-05-02 21:30:11 +02:00
JanUlrich 2bbf9eac36 target/repository anlegen 2018-05-02 21:08:32 +02:00
Fayez Abu Alia a785c85d42 tests 2018-05-02 20:54:07 +02:00
Martin Plümicke ec2b501e63 new file: test/javFiles/LambdaField.jav
modified:   test/typeinference/UnifyTest.java
Lambda-Ausdruck als Attribute/field eingefuegt
2018-04-26 15:10:23 +02:00
Martin Plümicke 8be4f94edf modified: test/javFiles/Matrix.jav
In Matrix.jav Binary-Operation eingefuegt.

	new file:   test/javFiles/Meth_Gen.jav
	new file:   test/typeinference/Meth_GenTest.java
Test zu Constraints ueber eine Methode hinaus
2018-04-25 23:32:12 +02:00
Fayez Abu Alia 1b6cae1be0 GenTest angefügt 2018-04-25 16:44:27 +02:00
JanUlrich 41774b3faf Merge mit bytecode 2018-04-25 16:13:23 +02:00
Martin Plümicke 62d44eb15c modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Undefined Pairs auf oberster Ebene wird zu new HashTable<>() in compute
	new file:   ../../src/de/dhbwstuttgart/typeinference/unify/inheritVariance.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
Unterscheidung zw. <. <? ein compere eingefuegt
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
Attribut wildcardable eingefuegt
2018-04-24 00:53:33 +02:00
Martin Plümicke 5f8c73f176 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
In compare wird die Gleichung a =. Theta neu gefiltert
2018-04-22 00:56:49 +02:00
Martin Plümicke 0ae777b4ac modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
varianceInheritance nach TypeUnifyTask.java verschoben
Kommentar eingefuegt

TODO:
1. compare-Funktinen nochmals ueberpruefen
2. Undef-Pairs in JavaTXiCompiler.java abfangen
3. ? extends bei allen Argumenttypen und Returntypen rauslassen
2018-04-20 23:52:12 +02:00
Martin Plümicke 087170bdbf modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
Variance wieder auskommentiert
	modified:   test/javFiles/Matrix.jav
import String
2018-04-20 13:16:49 +02:00
Martin Plümicke 93d0caaefb modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Varianceberechnung geaendert
2018-04-20 09:36:29 +02:00
Martin Plümicke 1f031149d3 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
Varianceweitergabe eingefuegt
2018-04-20 01:08:35 +02:00
Martin Plümicke fc870fd706 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-04-18 19:44:00 +02:00
stan 4450f5c0cd Merge 2018-04-18 15:08:37 +02:00
JanUlrich 92693c2c15 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2018-04-18 14:08:25 +02:00
JanUlrich 50a1f979a0 Fehler beim Parsen beheben 2018-04-18 14:08:12 +02:00
Fayez Abu Alia 478a2df3dc Statische Methoden Test 2018-04-18 11:51:10 +02:00
Martin Plümicke 59243d9f94 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-04-17 16:31:13 +02:00
Martin Plümicke 82b08c5aae modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
Wildcard Ordnung veraendert
2018-04-17 14:25:52 +02:00
Martin Plümicke 615983bf37 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
resuat add in cartesion angepasst
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java

equals in UnfyPair auf UndefinedPairs angepasst
2018-04-13 18:13:31 +02:00
JanUlrich f40c82af4a Matrix Test anpassen 2018-04-12 20:06:37 +02:00
Martin Plümicke 21bc2a67a1 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-04-11 16:58:38 +02:00
Fayez Abu Alia 52a96d7253 OL Test eingefügt 2018-04-11 13:55:32 +02:00
Martin Plümicke fef4d27d21 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-04-11 11:10:08 +02:00
Martin Plümicke 603c4c9c46 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
logging ergaenzt

	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
getSubstitution() durch getAllSubstitutions() ersetzt
2018-04-06 20:01:14 +02:00
Martin Plümicke baee0024e9 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Zu beginn von unify werden doppelte wildcard konstruktionen entfernt
Variableneumbenennung bei smaller in Fall 1 weider entfernt

	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/interfaces/IMatch.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/interfaces/IUnify.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
In computeGreater unify durch match ersetzt

	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java

	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/WildcardType.java
Abfrage ob eine doppelte wildcard konstruktion vorhanden ist eingefuegt
2018-04-05 18:09:24 +02:00
Martin Plümicke 1baaf79f8c modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
UndefPairs werden zurueckgegegeben und die naechsten gefiltert

protected boolean isUndefinedPairSet(Set<UnifyPair> s) hat Fehler
2018-04-04 21:47:07 +02:00
Martin Plümicke 52f480147e modified: src/de/dhbwstuttgart/typeinference/unify/MartelliMontanariUnify.java
modified:   src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java

Subsitution auf UnifyPair umgestellt
2018-04-04 01:14:30 +02:00
Martin Plümicke 9717c54d53 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Mehrfacher Aufruf von computeCartesianRecursive entfernt
2018-04-03 14:16:38 +02:00
Martin Plümicke c271c689de modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
abhaengige Substitutionen auch bei Faellen 1 - 8 eingefuegt
2018-04-03 10:29:58 +02:00
Martin Plümicke 24c27303dd modified: src/de/dhbwstuttgart/typeinference/unify/MartelliMontanariUnify.java
modified:   src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Substututions die eine UnifyPair erzeugen eingefuegt
UnifyCase1-8 weitermachen
2018-04-01 22:04:10 +02:00
Martin Plümicke 117106a7b3 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
? ext theta bei smaller eingefuegt

	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
basiPair und Subsitution nur noch gefuegt, wen wirk etwas eingesetzt wurde

	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
unifier umbenannt in substitution
getBasePair und getSubsitutuon eingefuegt
2018-04-01 17:07:58 +02:00
Martin Plümicke 5680f913ef modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
new file:   src/de/dhbwstuttgart/typeinference/unify/distributeVariance.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	new file:   src/de/dhbwstuttgart/typeinference/unify/visitUnifyTypeVisitor.java
2018-03-28 17:42:25 +02:00
stan 22ff521d08 Aufräumen 2018-03-28 15:35:04 +02:00
Fayez Abu Alia 32ab198f9e Bugfix für duplicate methods 2018-03-28 14:57:36 +02:00
Martin Plümicke fae26a8f26 modified: src/de/dhbwstuttgart/typeinference/unify/freshPlaceholder.java
modified:   src/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java

Visitors verallgemeinert
2018-03-28 12:06:23 +02:00
Fayez Abu Alia bb5a4e8580 Bug 72 gefixt 2018-03-28 11:31:32 +02:00
JanUlrich 000c16b907 Gencoy ASP Generator implementieren 2018-03-27 23:56:12 +02:00
JanUlrich 87a2ed8117 APS GeneratorTest.simple anfügen 2018-03-27 14:25:54 +02:00
Fayez Abu Alia a0de7a4467 Test, bei dem Bug 72 auftritt 2018-03-24 20:28:26 +01:00
JanUlrich 3e829eee54 Tests anpassen 2018-03-23 17:45:41 +01:00
JanUlrich 7ff3f22db5 Fehler in FCGenerator beheben 2018-03-23 17:20:35 +01:00
JanUlrich 4886976752 Fehler in FCGenerator beheben 2018-03-23 17:20:15 +01:00
JanUlrich daf684deef ASP Factory für Algorithmus von Herr Gencay 2018-03-23 16:54:32 +01:00
Martin Plümicke 0b680f831d modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
2018-03-22 20:40:22 +01:00
JanUlrich 41c87e3085 Merge branch 'bigRefactoring' into sat 2018-03-22 13:50:30 +01:00
JanUlrich bcee5e5209 Fehler im Parsen von Package beheben 2018-03-22 11:41:59 +01:00
Martin Plümicke 95e9b2dbda modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Variance auf PlacehloderType uebertragen
2018-03-22 11:26:29 +01:00
JanUlrich 72f27fab7a Fehler in ASTFactory Generierung von Superinterfaces beheben 2018-03-22 11:17:51 +01:00
JanUlrich 06bb978cf6 Testfall erweitern 2018-03-21 18:08:33 +01:00
Pluemicke Martin dbe05bb718 modified: src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/FCGenerator.java
Feher rausgemacht

TODO: Varianven werden nicht uebertragen wahrscheinlich subst
2018-03-21 17:37:34 +01:00
JanUlrich 9a735e86dd GenericFC Test anfügen 2018-03-21 17:26:43 +01:00
JanUlrich 240d57a8ba Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2018-03-21 17:26:23 +01:00
stan dd18c7c40e Test anfügen 2018-03-21 17:24:12 +01:00
JanUlrich 45ccfb58e3 Test commit 2018-03-21 17:10:40 +01:00
Pluemicke Martin 4ac99b61bf Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2018-03-21 17:07:14 +01:00
Pluemicke Martin f107c8d1f7 modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
Variancebestimmung fuer Argument- und Returntypen der Methoden eingefuegt.
2018-03-21 17:03:32 +01:00
stan 161c1a1b53 Test anfügen 2018-03-21 15:15:31 +01:00
stan 6b1a4eddfc Java 9 zu Java 8 ändern. Sollte ausreichen 2018-03-21 14:40:47 +01:00
JanUlrich ae7a63fbca Tests fix 2018-03-21 14:22:30 +01:00
stan 79810be94f FC Generator berücksichtig interfaces 2018-03-21 14:21:50 +01:00
Fayez Abu Alia 8870bc326c Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-03-21 13:47:19 +01:00
Fayez Abu Alia e1c6369bcb Bytecode für Post-/Preincrement und Post-/Predecrement 2018-03-21 13:08:39 +01:00
Pluemicke Martin 46255efb70 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2018-03-21 11:29:01 +01:00
JanUlrich fb77f9192f Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2018-03-21 11:28:35 +01:00
JanUlrich a71e56ea97 Fix 2018-03-21 11:28:21 +01:00
Pluemicke Martin 5dfa6769b2 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test 2018-03-21 11:16:45 +01:00
JanUlrich 77be216ee5 Fix 2018-03-21 11:15:59 +01:00
Pluemicke Martin 100db9baac Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test
Fehler by atElement
2018-03-21 11:13:20 +01:00
JanUlrich e1f579664a Fix Generics in MethodCall 2018-03-21 11:12:06 +01:00
JanUlrich 7a9c0a1e69 LambdaRunnableTest fix 2018-03-21 11:09:29 +01:00
JanUlrich 7e5aa852d7 Fehler fix 2018-03-21 10:35:46 +01:00
Martin Plümicke 5d39863cc6 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Maximumsbildung auf maximale Elemente soweit fertig
Argument von mul funktion nicht, liefret nur Vec<TypPl>
2018-03-20 22:30:57 +01:00
Martin Plümicke 01dd4e57e6 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
Letzte Version bevor MatchUnifyTask
2018-03-20 10:14:01 +01:00
Martin Plümicke 6faffdf90c modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java 2018-03-19 17:43:27 +01:00
Martin Plümicke f4bc057aff modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
LogAusgabe FC

	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
fresh TV in unifyCase1 auf alle cs ausgedehnt
	modified:   test/javFiles/Matrix.jav
2018-03-19 15:25:40 +01:00
Martin Plümicke 78db0f0177 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Errorrueckgabe auskommentiert
	new file:   src/de/dhbwstuttgart/typeinference/unify/interfaces/UnifyTypeVisitor.java
eingecheckt vorher vergessen
	modified:   test/javFiles/Matrix.jav
add und mul aktiviert
2018-03-19 09:38:37 +01:00
Fayez Abu Alia 3233ccd845 Overloading funktioniert. Erzeugt Bytecode für Postincrement (für Integers). 2018-03-18 16:08:52 +01:00
Martin Plümicke b0b1426e20 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
new file:   src/de/dhbwstuttgart/typeinference/unify/freshPlaceholder.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java
freshtypevraiable Vistor soweit fertig noch nicht getestet
2018-03-18 15:11:45 +01:00
Martin Plümicke 103c7e4b14 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java
visitor freshPlaceholder implements UnifyTypeVisitor
2018-03-17 15:01:03 +01:00
Martin Plümicke 3638edfa73 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   test/javFiles/Matrix.jav
Fehler entdeckt, in unifyCase1 fuer die Typen aus FC keine fresh TV getsetzt werden.
2018-03-16 14:10:40 +01:00
Martin Plümicke bd98bed5ca Merge branch 'unify-test' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test
Merge
2018-03-15 20:50:59 +01:00
Martin Plümicke 6299086297 modified: typeinference/unify/TypeUnifyTask.java
modified:   typeinference/unify/model/UnifyPair.java
2018-03-15 20:47:16 +01:00
Martin Plümicke de5b43d72b modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java

Links der substitierten Pare eingefuegt.
2018-03-15 17:00:26 +01:00
Martin Plümicke 7e6dee8e1d modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../javFiles/Matrix.jav
2018-03-14 17:48:04 +01:00
Fayez Abu Alia dafcd2f125 Bytecode für While-Schleifen 2018-03-14 15:51:38 +01:00
JanUlrich 6a5ababa51 ANTLR Parsetreewalker für ASP Result implementieren 2018-03-14 14:32:36 +01:00
Martin Plümicke 273ddb92d7 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
	modified:   ../javFiles/Matrix.jav
2018-03-14 13:56:28 +01:00
JanUlrich 4a2b901465 aufräumen 2018-03-13 14:53:27 +01:00
Martin Plümicke dea3da3b69 Merge branch 'bigRefactoring' into unify-test
Fehelr mit elementAt geloest
2018-03-13 10:41:57 +01:00
Martin Plümicke 13c70148a8 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
	modified:   ../javFiles/Matrix.jav
mul1 und add ergaenzt.
Fehler bei elementAt: Liefert Object als Returntyp
2018-03-13 08:46:25 +01:00
JanUlrich bb5945898a Bug in ASTFactory beseitigen 2018-03-13 01:57:21 +01:00
JanUlrich 123f94aea7 ANTLR Parser für ASP Statements implementieren 2018-03-13 00:24:40 +01:00
JanUlrich dff72b0c97 ResultSetOutputGenerator 2018-03-12 00:38:02 +01:00
Martin Plümicke 1667b394f2 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
Variancen gesetzt
2018-03-11 20:39:38 +01:00
Martin Plümicke 95943b1627 modified: src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
compare(Matrix, Vector<gen_ab>, ? extends Vector<? extends Integer>> <.? gen_ab
   eingefuegt.
2018-03-10 12:32:07 +01:00
Martin Plümicke 0315a1f144 modified: ../../src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnify.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
compare(Matrix, Vector<gen_ab>, ? extends Vector<? extends Integer>> <.? gen_ab
funktioniert nicht
2018-03-10 01:04:19 +01:00
Fayez Abu Alia 52a5fd7904 erzeugt Bytecode für relationale Operatoren. Getestet. 2018-03-09 21:57:39 +01:00
Martin Plümicke b5b5b5d9c9 modified: ../../src/de/dhbwstuttgart/typeinference/constraints/Pair.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyPair.java
Varinace in UnfyPair eingefuegt und Abfrage in computeCartesianRecursive eingefuegt
Pruefen, ob Varianve bei Subst und andrene erhalten bleibt.
2018-03-09 01:23:02 +01:00
JanUlrich 83aaff140c Aufräumen 2018-03-08 01:44:40 +01:00
JanUlrich 3deaceec01 UnifyWithoutWildcards Test läuft durch 2018-03-08 01:41:38 +01:00
Martin Plümicke 9862df9e63 modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java

Minimum funktion soweit
2018-03-08 01:12:17 +01:00
JanUlrich 9f2702276f Fehler beheben 2018-03-08 00:03:26 +01:00
JanUlrich 87cf674352 Fehler in FCGenerator beheben 2018-03-07 23:07:53 +01:00
JanUlrich dfd6a1f532 erge branch 'bigRefactoring' into sat 2018-03-07 23:04:16 +01:00
JanUlrich e8388e2748 Aufräumen 2018-03-07 22:42:05 +01:00
JanUlrich 095f9a7956 Tests an neue ASPFactory anpassen 2018-03-07 22:41:00 +01:00
JanUlrich c4aec8379e Erste Version von ASPFactory implementieren 2018-03-07 21:52:46 +01:00
Martin Plümicke ccc16fd22b modified: ../../src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/interfaces/IRuleSet.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   ../../src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java

1. Version mit compare von UnifyPairs
2018-03-07 13:09:47 +01:00
Fayez Abu Alia 54cf24926e Bytecode arithmetische Operatoren unterschiedlischer Typen vollständig und getestet 2018-03-07 12:26:30 +01:00
Fayez Abu Alia 94d39ee21a Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-03-07 11:49:16 +01:00
JanUlrich 725b071d28 Problem mit BinaryExpr gefixt 2018-03-07 08:47:43 +01:00
JanUlrich 284af1246b Nicht lauffähig. ASPFactory neu implementieren 2018-03-07 07:41:46 +01:00
Fayez Abu Alia f453343f1c Bytecode für arithmetische Operatoren mit Parametern unterschiedlicher Typen. Testfälle bereinigt und aufgeräumt. 2018-03-06 19:14:27 +01:00
Martin Plümicke bb016e6417 modified: src/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
2018-03-05 20:04:10 +01:00
Martin Plümicke 831bf1fe17 modified: src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
weitere Fälle in die Ordnung eingebaut
2018-03-04 22:58:31 +01:00
Martin Plümicke cba489f279 modified: src/de/dhbwstuttgart/typeinference/unify/model/OrderingUnifyPair.java
eine Variable korrigiert
TODO eingefuegt
compare muss fuer ale moeglichen Faelle aus calculatePairSets erstellt werden
2018-03-03 01:07:25 +01:00
Martin Plümicke 9f3439a15e x 2018-03-02 14:12:06 +01:00
Martin Plümicke 356b8a7a34 modified: src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
Eq for Unify vereinfachen noch nicht fertig
2018-03-01 18:00:38 +01:00
JanUlrich ab37e1a607 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2018-03-01 15:03:48 +01:00
JanUlrich 18545cff9a GenericRefType umgestalten. Unnötige Backreferenzen entfernen 2018-03-01 13:25:03 +01:00
JanUlrich 9840281d83 Test für ASP anfügen 2018-03-01 12:31:56 +01:00
Martin Plümicke 6256bdfe2e modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
In Unfy:
- Bildung des kartesischen Produkts auf secondlevel-Ebene entfernt

In computeCartesianRecursive:
- Vereinigung der Ergebnisse ueber die Schleifen und die Rekursion eingefuegt
- Minimumbestimmung korrigiert
2018-03-01 12:27:38 +01:00
Martin Plümicke 6a9db81981 Merge 2018-02-28 17:16:28 +01:00
Pluemicke Martin 53087a8e04 result.add wieder aktiviert 2018-02-28 17:11:50 +01:00
JanUlrich aa631b5099 UnifyTest korrekt benennen 2018-02-28 16:35:45 +01:00
JanUlrich a3a02fe475 Merge branch 'bigRefactoring' into unify-Test 2018-02-28 16:34:48 +01:00
JanUlrich 99ce7c1122 <, > Operatoren einführen 2018-02-28 16:33:18 +01:00
Martin Plümicke cef82c6359 Typgenerator auf alten Stand setzen, damit Matrix test lauft 2018-02-28 16:27:08 +01:00
Martin Plümicke 67fe88215a eigenerTest 2018-02-28 16:25:45 +01:00
Martin Plümicke f31023b4fa merge2 2018-02-28 16:16:22 +01:00
Martin Plümicke a733eee8b5 merge 2018-02-28 16:12:57 +01:00
Martin Plümicke 15f5a2dc76 Merge branch 'bigRefactoring' into unify-Test 2018-02-28 16:10:08 +01:00
Martin Plümicke 6fcaafe477 test 2018-02-28 16:07:02 +01:00
Fayez Abu Alia 35b99a4095 Bytecode kann für folgende Operationen +,-,*,/,% erzeugt werden 2018-02-28 15:59:21 +01:00
JanUlrich 327f36f1c2 Faculty Test ändern. UnifyTypeFactory konvertiert automatisch FunN Typen korrekt 2018-02-28 15:21:12 +01:00
Fayez Abu Alia 6b57aacef0 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-02-28 14:58:58 +01:00
JanUlrich f023754328 TypeStmt für +,-,/,*,% einführen 2018-02-28 14:50:16 +01:00
JanUlrich 77aaa0ecb6 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2018-02-28 13:32:51 +01:00
JanUlrich 9f9a94b5cf Testfälle bereinigen 2018-02-28 13:32:36 +01:00
JanUlrich b66d06a165 Merge branch 'parser' into bigRefactoring 2018-02-28 11:53:53 +01:00
JanUlrich 92b110a971 Funktionierender Clingo Test 2018-02-27 19:10:16 +01:00
Fayez Abu Alia 2277f68509 Ordner manually/ in .gitignore hinzugefügt 2018-02-25 13:20:19 +01:00
Martin Plümicke 1c0fa6a820 modified: de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
logFile eingefuegt
2018-02-24 19:56:22 +01:00
Fayez Abu Alia 59569380ed Kleiner Bug beseitigt 2018-02-23 20:17:32 +01:00
Fayez Abu Alia 4fbcf87e0c Methoden visit(assign)/visit(literal) angepasst und generiert bytecode für Binaryexpressions. noch nicht fertig 2018-02-23 20:10:11 +01:00
JanUlrich 10b5d87119 Merge branch 'bigRefactoring' into sat 2018-02-23 11:14:47 +01:00
JanUlrich 73c37027d9 Fehler in TypeStmt UnaryExpression beheben 2018-02-23 09:16:12 +01:00
Martin Plümicke 8e198679c7 Instabiler Zustand reduce funktionert nicht 2018-02-23 00:37:59 +01:00
Martin Plümicke 419e4a6d0e MERGE
Merge branch 'unify-test' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify-test
2018-02-21 17:55:47 +01:00
Pluemicke Martin 5cd2ee7d80 geändert: src/de/dhbwstuttgart/core/JavaTXCompiler.java
geändert:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
recursiveCartesionProduct wieder entfernt
2018-02-21 17:54:26 +01:00
Martin Plümicke 9c35f04a09 modified: src/de/dhbwstuttgart/typeinference/unify/RuleSet.java 2018-02-21 17:22:23 +01:00
Fayez Abu Alia 6808535f67 Merge branch 'parser' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-02-21 15:45:22 +01:00
Fayez Abu Alia ac4a79f0e7 Additive/multiplicativeExpression und UnaryExpression implementiert 2018-02-21 15:43:28 +01:00
Martin Plümicke 89246ece5c modified: src/de/dhbwstuttgart/core/JavaTXCompiler.java
modified:   src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   test/javFiles/Matrix.jav
2018-02-21 14:02:48 +01:00
Fayez Abu Alia 7c2f7c54dd Kleine Änderung 2018-02-21 11:44:03 +01:00
JanUlrich c747ab0885 Additive Expression implementieren 2018-02-21 11:40:54 +01:00
JanUlrich 6cf98f200b Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-02-21 11:05:57 +01:00
JanUlrich ed3a3909c0 Merge branch 'bytecode2' into bigRefactoring 2018-02-21 11:05:25 +01:00
JanUlrich d53faa0c86 FiniteClosure korrekt generieren 2018-02-19 11:33:08 +01:00
JanUlrich b7bb0fa1c4 Vector Test Fehler beheben 2018-02-19 04:47:10 +01:00
JanUlrich 166aa5e506 merge mit sat 2018-02-19 04:22:08 +01:00
Martin Plümicke 5270cecec9 Changes to be committed:
modified:   src/de/dhbwstuttgart/core/JavaTXCompiler.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   test/javFiles/Matrix.jav

Fehler in der Aufteilung von Unify korrigiert.
Equalcheck in Schritt 6 wiedre eingefuegt.
2018-02-14 17:45:08 +01:00
Fayez Abu Alia f6e0c561bb Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-02-14 14:38:46 +01:00
Fayez Abu Alia a45aa50574 erzeugt bytecode für Zuweisung von Literale 2018-02-14 14:37:36 +01:00
JanUlrich 191a1166b9 ASP Generator auf neues Format anpassen 2018-02-13 05:25:18 +01:00
JanUlrich 6e770b5ec5 Java 9: Classloader ändern
*
2018-02-12 22:32:03 +01:00
Martin Plümicke 87fe51767c modified: src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
Reduce 1
C und D koennen auch gleich sein.
Muss nochmals ueberprueft werden.
2018-02-09 22:55:40 +01:00
Martin Plümicke f0610aeff1 Changes to be committed:
modified:   src/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	modified:   test/typeinference/JavaTXCompilerTest.java
2018-02-09 21:32:15 +01:00
Martin Plümicke e4fbd17a55 modified: src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
modified:   test/javFiles/Matrix.jav
Rekursive Berechnung des Kartesischen Produkts
2018-02-08 00:02:27 +01:00
Martin Plümicke 9c526f20fb merge 2018-02-07 16:56:11 +01:00
Martin Plümicke 1f269918fb nicht lauffaehig 2018-02-07 16:53:24 +01:00
Martin Plümicke 2d5c863008 HEAD detached at 2f994cdf
Changes to be committed:
Aenderungen am Unify: Fehler behoben und Vereinfachung

	modified:   src/de/dhbwstuttgart/core/JavaTXCompiler.java
	new file:   src/de/dhbwstuttgart/typeinference/unify/Match.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
	new file:   src/de/dhbwstuttgart/typeinference/unify/interfaces/IMatch.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Node.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java
	modified:   src/de/dhbwstuttgart/typeinference/unify/model/Unifier.java
	modified:   test/javFiles/Matrix.jav
2018-02-07 14:38:45 +01:00
Martin Plümicke 22499f09e8 modified: src/de/dhbwstuttgart/typeinference/unify/model/TypeParams.java
Zeile 101 Dangling-else Problematik behoben
War Fehler im Occurs-Cheeck von Montanari-Martelli.
2018-02-01 00:17:12 +01:00
JanUlrich 1f89238fe4 Kleiner Bug beseitigt. Ungetesteter Stand 2018-01-31 18:38:52 +01:00
Fayez Abu Alia c61dd5411e Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2018-01-31 16:47:18 +01:00
Fayez Abu Alia 52487f3389 test LamAssign 2018-01-31 16:47:08 +01:00
stan 5a3dcd7100 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into plugin 2018-01-31 16:43:04 +01:00
JanUlrich 2f994cdfa8 java.lang. nicht standardmäßig importieren 2018-01-31 16:42:51 +01:00
JanUlrich 9c4f763c9a java.lang. nicht standardmäßig importieren 2018-01-31 16:42:25 +01:00
JanUlrich 8f9c07d88e Merge 2018-01-31 16:18:29 +01:00
Fayez Abu Alia b32e437a05 Fehler 2018-01-31 16:16:05 +01:00
JanUlrich 48e2d2eec2 Tests fixen 2018-01-31 16:15:07 +01:00
stan 1a1ab2696d Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into plugin 2018-01-31 16:06:21 +01:00
Fayez Abu Alia 1888eb6d46 merge 2018-01-31 15:57:58 +01:00
Fayez Abu Alia 56d919f446 bug fix 2018-01-31 15:55:02 +01:00
JanUlrich 15d120d594 Funktionsfähiges Matrix Beispiel, aber nicht komplett 2018-01-31 15:51:38 +01:00
JanUlrich e556a470e7 Literal löschen 2018-01-31 15:39:19 +01:00
Fayez Abu Alia 398c1992fa merge 2018-01-31 14:23:19 +01:00
Fayez Abu Alia 9a94ba2114 unnötige Kommentare wurden entfernt 2018-01-31 14:16:20 +01:00
JanUlrich cdcebdd4ac Merge 2018-01-31 13:36:35 +01:00
JanUlrich 8e4791cca6 Anpassungen im Matrix Test 2018-01-31 13:34:54 +01:00
JanUlrich 3ce4937bc1 Fehler im Trailing Return anhängen beheben 2018-01-30 02:23:58 +01:00
JanUlrich 027538a082 Unary Expression und while statement anfügen 2018-01-30 01:08:21 +01:00
Martin Plümicke 39793b461e modified: test/javFiles/Matrix.jav
Falsche Typen in methode korrigiert.
2018-01-29 22:35:48 +01:00
Martin Plümicke 29173ba172 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring
Genauere Fehlermeldung im Unify
2018-01-29 21:32:46 +01:00
Martin Plümicke 5d94820fed modified: src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
modified:   src/de/dhbwstuttgart/typeinference/unify/model/Node.java
Genauere Fehlermeldung
2018-01-29 21:30:45 +01:00
JanUlrich c7dea4c86b Matrix Test 2018-01-29 18:26:14 +01:00
JanUlrich ede55d228e Fehler in ASTFactory beheben. GenericRefType statt RefType in den Parameterlisten 2018-01-29 17:35:49 +01:00
JanUlrich 0610ea8e63 FC Generator 2018-01-29 17:32:25 +01:00
stan 9186f5dff5 Alle Dependencies werden in eine Jar gepackt. Diese in Eclipseplugin umwandeln und einbinden funktioniert \o/ 2018-01-24 19:05:09 +01:00
stan 5c9b40e0b7 Rumprobieren. Nicht lauffähig 2018-01-24 16:37:01 +01:00
JanUlrich 8d12821c68 Methode erbt nicht mehr von Feld 2018-01-21 11:38:55 +01:00
JanUlrich 311d7ee63a Merge branch 'bigRefactoring' into sat 2018-01-21 11:17:46 +01:00
JanUlrich bd0678f362 Lokales Repo eintragen 2018-01-21 11:17:20 +01:00
stan a08e2e8815 Versuche google und reflections auch noch als plugin zu verpacken. WIll nicht funktionieren 2018-01-19 17:48:25 +01:00
stan 47689f2fc6 ZIP-FIle erstellen 2018-01-19 16:55:23 +01:00
stan b7aca99301 local maven repository 2018-01-19 16:36:08 +01:00
JanUlrich 8920b32020 Unnötige import entfernen 2018-01-19 15:28:54 +01:00
JanUlrich 1f5071d4e4 Methode soll kein Feld mehr sein. Nicht lauffähig! 2018-01-19 15:24:49 +01:00
stan da41857a4f Plugin deploy backup 2018-01-19 15:22:29 +01:00
stan 09dcdaeb96 Local Repo anfügen 2018-01-19 15:14:39 +01:00
stan 6d0392956d Pom anpassen 2018-01-19 14:34:41 +01:00
Fayez Abu Alia 542f87e8a3 erzeugt Klassendatei für FunN 2018-01-17 13:49:18 +01:00
JanUlrich 57df329751 Merge branch 'bigRefactoring' into sat 2018-01-12 22:47:49 +01:00
Fayez Abu Alia 7b24e2d83f bytecode für Generics: LamAssignTest funktioniert richtig 2018-01-10 15:37:50 +01:00
JanUlrich b1b1cfdc54 --amend 2018-01-10 12:14:20 +01:00
JanUlrich 672373fc8d --amend 2018-01-10 12:11:51 +01:00
JanUlrich ab86cc3229 RefType.toString(): Ausgabe von Parameterliste implementieren 2018-01-10 12:10:01 +01:00
JanUlrich 0c19cc7400 Merge branch 'bigRefactoring' into bytecode2 2018-01-10 11:58:03 +01:00
Fayez Abu Alia 268056542b erzeugt bytecode für generics 2018-01-10 11:36:29 +01:00
JanUlrich 19a1ef4024 Erste lauffähige aber unvollständige Version des UnifyWithoutWildcards 2018-01-10 10:53:07 +01:00
JanUlrich 3c732346d9 ASPParameterlist erzeugt auch paramNum 2018-01-06 09:38:53 +01:00
Fayez Abu Alia 01339ca7ec Descriptor-Erzeugen neu mit Visitor-pattern implementiert 2017-12-28 10:20:28 +01:00
JanUlrich 6ddc4983b0 Fehler im Type beheben 2017-12-20 17:12:40 +01:00
JanUlrich 719d1a5ced Interface Modifier setzen 2017-12-20 15:59:07 +01:00
JanUlrich 90a9273fc2 TypeToStringVisitor 2017-12-20 15:37:33 +01:00
JanUlrich 009a638c9a FC ohne java.lang generieren 2017-12-20 15:27:39 +01:00
JanUlrich 55be865ab4 Bugfix 2017-12-20 15:06:04 +01:00
Fayez Abu Alia 01fd396d29 Test generics 2017-12-20 15:04:03 +01:00
JanUlrich dccdc5da2b Merge branch 'bigRefactoring' into bytecode2 2017-12-20 15:01:19 +01:00
JanUlrich 940c922c80 ResultSet kann GenericRefTypes auflösen 2017-12-20 15:01:02 +01:00
JanUlrich bdc2a83b1c Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-12-20 14:14:25 +01:00
Fayez Abu Alia d989100b47 korrekte bytecode 2017-12-20 14:14:05 +01:00
JanUlrich f015ef75f7 Merge branch 'bigRefactoring' into bytecode2 2017-12-20 13:43:46 +01:00
Fayez Abu Alia 5f731bb09c letzte tests 2017-12-20 13:35:55 +01:00
JanUlrich 09bdaa6a21 Generics Test erzeugt falsches ConstraintSet 2017-12-20 13:34:34 +01:00
JanUlrich e8757a179f ASP-Generierung: parameterListe 2017-12-18 14:43:03 +01:00
JanUlrich 3a444c0172 Aufräumen 2017-12-15 13:12:18 +01:00
Fayez Abu Alia ab36050f9b Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-12-15 09:01:59 +01:00
JanUlrich 9919ecd083 Anfangen mit Masterarbeit 2017-12-15 00:06:57 +01:00
JanUlrich 7d8e8249ed Merge branch 'sat' into bigRefactoring 2017-12-15 00:05:47 +01:00
JanUlrich fb0ef510b2 Fehlende Klasse 2017-12-15 00:05:30 +01:00
Fayez Abu Alia 72fdf2dca8 merge 2017-12-14 21:20:57 +01:00
JanUlrich eb8db0e0eb TPH = TPH ist jetzt auch im ResultSet möglich. Anpassungen an der Generierung der Imports einer SourceFile; läuft noch nicht fehlerfrei 2017-12-14 17:44:43 +01:00
JanUlrich 5386227a34 Merge branch 'bigRefactoring' into sat 2017-12-14 00:06:11 +01:00
JanUlrich 5e675b9a93 Test anfügen 2017-12-13 13:34:22 +01:00
JanUlrich fd8df92c03 generatedBC-Directory anfügen 2017-12-13 13:32:00 +01:00
JanUlrich eddac2c8ed VoidMeth Test korrigieren 2017-12-13 13:15:11 +01:00
Fayez Abu Alia a8274bdc69 erzeugt bytecode fuer lambda 2017-11-29 14:45:15 +01:00
JanUlrich e702f745c3 Dirty fix 2017-11-29 14:31:07 +01:00
JanUlrich 4616f82b09 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-11-22 13:15:21 +01:00
JanUlrich dbe47f41c1 FunNClass anfügen 2017-11-22 13:12:21 +01:00
JanUlrich b55d0779e9 ResultPairs des Unify Algorithmus könnnen nun auch Wildcard-Typen enthalten 2017-11-22 06:49:11 +01:00
JanUlrich 928396927e Faculty Test geht wieder 2017-11-16 17:28:50 +01:00
JanUlrich 9a886ed223 Typdeklarationen wie List, werden jetzt automatisch TPHs eingesetzt. (Als hätte man den Diamond-Operator benutzt) 2017-11-16 16:56:12 +01:00
JanUlrich 16e14f9363 Finite CLosure TEst läuft wieder halbwegs. Sonst unfertiger Zustand 2017-11-16 15:10:08 +01:00
JanUlrich b51d8356b7 Unvollständiger Zustand; Verknüpfung zwischen GTVs und TPH geändert. Änderungen in TypeStmt 2017-11-15 17:58:15 +01:00
JanUlrich 48dc76646b createPair Methode entfernen. Die Generics können nicht generell aufgelöst werden. (unvollständiger Zustand) 2017-11-14 19:28:46 +01:00
JanUlrich fea86460e8 Änderungen an der FC generierung und an dem Verhalten von GTVs im Type Algorithmus UNVOLLSTÄNDIG. Kleines Backup, da große Änderung am Type-Algorithmus noch ansteht. 2017-11-09 19:41:53 +01:00
Fayez Abu Alia 01703a73c5 generiert Bytecode fuer einfachen Lambda 2017-11-07 10:55:33 +01:00
Fayez Abu Alia bb5e697699 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-11-03 14:18:32 +01:00
Fayez Abu Alia 5a026a431c kleine Aenderung 2017-11-03 14:17:36 +01:00
JanUlrich 1d767a7696 Matrix Test 2017-11-03 13:56:04 +01:00
JanUlrich d2fa9e00f8 Fix bug #60 2017-10-30 18:08:40 +01:00
JanUlrich 934e5f85f8 Unterschied zwischen Expr-Receiver und Classname-Receiver 2017-10-26 21:45:04 +02:00
JanUlrich bfa106913b extends in Parser implementieren. Dirty fix für fehlende Object-Klasse in der JavaClassNameRegistry 2017-10-18 16:40:27 +02:00
JanUlrich 44f4aa4b27 Test anfügen 2017-10-18 16:18:46 +02:00
JanUlrich a69b827805 Var Keyword ist kein keyword mehr, kann also auch als Variablennamen verwendet werden 2017-10-18 00:22:42 +02:00
JanUlrich 0c80a4c343 Fix bei Typeinsetzung 2017-10-16 19:19:42 +02:00
JanUlrich e18439918c Merge 2017-10-15 23:09:46 +02:00
JanUlrich b116139357 Guava Version update 2017-10-15 22:49:23 +02:00
JanUlrich 040300d78e unnötige Imports entfernen 2017-10-10 17:05:32 +02:00
JanUlrich c442e2ac17 Merge branch 'bigRefactoring' 2017-10-10 15:51:13 +02:00
JanUlrich 9607fcf980 Imports in parser implementieren 2017-10-10 15:34:52 +02:00
JanUlrich cecec91f74 Merge 2017-10-10 14:51:53 +02:00
JanUlrich 8c00d89731 Finite Closure beachtet imports 2017-10-10 14:47:05 +02:00
JanUlrich d5d74fef85 Merge 2017-10-06 14:13:31 +02:00
JanUlrich 36bb442bff Aufräumen 2017-10-06 13:34:03 +02:00
Fayez Abu Alia c595925112 Fehlende Tests anfügen 2017-10-06 13:31:36 +02:00
JanUlrich 0116643bc1 .gitignore erweitern 2017-10-06 13:24:17 +02:00
JanUlrich 8d6a722cec .gitignore erweitern 2017-10-06 13:23:48 +02:00
Fayez Abu Alia 672d40c557 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-10-06 09:16:42 +02:00
JanUlrich 94c69cca55 Merge branch 'bigRefactoring' into bytecode2 2017-10-06 03:59:58 +02:00
JanUlrich 843dd7453d ANTLR Plugin + Configuration an pom.xml anfügen 2017-10-06 03:59:35 +02:00
Fayez Abu Alia ad36158a47 Test dateien 2017-10-05 20:23:27 +02:00
Fayez Abu Alia 7de617f0c1 test 2017-10-05 20:02:11 +02:00
JanUlrich 6738eecdf3 Merge 2017-10-05 19:21:30 +02:00
JanUlrich a011061f22 Merge branch 'bytecode2' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-10-05 18:29:37 +02:00
JanUlrich 15e18c5907 merge unvollständig 2017-10-05 18:29:27 +02:00
Fayez Abu Alia 4c213eb3cf generate bytecode 2017-10-05 18:25:52 +02:00
JanUlrich a194bdbc9f Aufräumen 2017-10-05 18:23:28 +02:00
JanUlrich e341d9075e Alle Klassen aus Standard Library laden 2017-10-05 01:13:08 +02:00
JanUlrich b104ff591f Aufräumen 2017-10-05 00:47:05 +02:00
JanUlrich bf8e6d1492 merge 2017-10-04 16:46:31 +02:00
JanUlrich bd024d9f4a Aufräumen 2017-10-04 16:39:02 +02:00
JanUlrich a78b7c5af3 unnötige librarys löschen 2017-10-04 13:26:18 +02:00
JanUlrich 5d5132faf4 Merge branch 'bigRefactoring' 2017-10-04 13:23:56 +02:00
Martin Plümicke 0a8236cd86 modified: src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
In reduceFunN:
&& (pair.getPairOp() != PairOperator.EQUALSDOT))     //PL 2017-10-03 hinzugefuegt
		                                                       //da Regel auch fuer EQUALSDOT anwendbar
			                                                   //TODO: fuer allen anderen Relationen noch pruefen
2017-10-03 22:06:37 +02:00
Martin Plümicke 7f888a1bf8 modified: src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
FunType von Bedingung <. auf beliebig zu gelassen
	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
bei childrenaufruf unifyCase1 gleiches Element hinzugefuegt
	modified:   test/typeinference/JavaTXCompilerTest.java
typeinference-Aufruf vor die Schleife gezogen
2017-10-03 21:58:39 +02:00
Martin Plümicke fa92fee98d modified: .classpath
Keine Ahnung

	modified:   src/de/dhbwstuttgart/typeinference/unify/RuleSet.java
Aenderung Zeile 578
				rhsType = pair.getRhsType(); //PL eingefuegt 2017-09-29 statt !((rhsType = pair.getRhsType()) instanceof PlaceholderType)
			if(lhsType != null
					//&& !((rhsType = pair.getRhsType()) instanceof PlaceholderType) //PL geloescht am 2017-09-29 Begründung: auch Typvariablen muessen ersetzt werden.

	modified:   src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java

1. Aenderung: Zeile 168
/*
			 * Step 6 a) Restart (fork) for pairs where subst was applied
			 */
			if(parallel) {
				if //(eqPrime.equals(eq))         //PL 2017-09-29 auskommentiert und durch
					(!eqPrimePrime.isPresent())   //PL 2071-09-29 dies ersetzt
					                              //Begruendung: Wenn in der Substitution keine Veraenderung
					                              //(!eqPrimePrime.isPresent()) erfolgt ist, ist das Ergebnis erzielt.
					eqPrimePrimeSet.add(eqPrime);

2. Aenderung: Ziel 188
else { // sequentiell (Step 6b is included)
				if //(eqPrime.equals(eq))         //PL 2017-09-29 auskommentiert und durch
				(!eqPrimePrime.isPresent())       //PL 2071-09-29 dies ersetzt
                                                  //Begruendung: Wenn in der Substitution keine Veraenderung
                                                  //(!eqPrimePrime.isPresent()) erfolgt ist, ist das Ergebnis erzielt.
					eqPrimePrimeSet.add(eqPrime);
2017-09-30 14:51:05 +02:00
JanUlrich 43413d5e3c Bugfix in Test 2017-09-28 16:55:29 +02:00
JanUlrich d24b2fa7d6 bcel entfernen. pom.xml anlegen 2017-09-28 16:52:07 +02:00
JanUlrich db9298e383 library adden 2017-09-26 12:37:21 +02:00
JanUlrich 1e0da98c4b auto-keyword zu var-keyword ändern 2017-09-25 23:47:38 +02:00
JanUlrich 4b44fba421 Bugfix 2017-09-25 16:49:27 +02:00
JanUlrich 07b159f9a3 Bugfix 2017-09-25 15:57:35 +02:00
JanUlrich 276ff44756 Berücksichtige TPH =. TPH Ergebnisse im ResultSet 2017-09-25 11:22:53 +02:00
JanUlrich b31da88902 Logik für Generics implementieren. Unvollständig 2017-09-25 01:14:02 +02:00
JanUlrich 6a1f5dc248 Unvollständiger Stand bei der Implementierung von Generics 2017-09-22 18:31:47 +02:00
JanUlrich 0e2390a80a GlobalGenerics eingeführt 2017-09-20 23:41:06 +02:00
JanUlrich 8ce017c2f2 Fehler beheben. PackageCrawler lauffähig 2017-09-20 18:20:52 +02:00
stan b8a5795bb3 PackageCrawler und CompilationEnvironment implementieren 2017-09-20 17:26:09 +02:00
stan 9b960329fc PackageCrawler wieder einführen. Unvollständig 2017-09-20 15:52:14 +02:00
stan b1adc4671d Environment einführen 2017-09-20 14:00:44 +02:00
JanUlrich 6e03d24582 Tests auslagern 2017-09-19 18:51:44 +02:00
JanUlrich f81496fe1f Fehler in TypeStmt beheben 2017-09-18 18:32:22 +02:00
JanUlrich 201a0978bc Constructor für IfStmt 2017-09-18 13:56:27 +02:00
JanUlrich 98331af3c0 Fehler in UnifyTypeConvert beheben 2017-09-07 19:52:05 +02:00
JanUlrich a355fe7786 fehler beheben 2017-09-07 18:37:56 +02:00
JanUlrich ea1e81bb95 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2017-09-07 17:03:15 +02:00
JanUlrich b6f62b48eb ResultSet um resolveType erweitern 2017-09-07 17:02:49 +02:00
Fayez Abu Alia 995af3004a Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-09-07 16:42:19 +02:00
Pluemicke Martin 5c66212afb neue Datei: S2017_Jan-Elric_Neumann.pdf 2017-09-04 09:30:59 +02:00
Fayez Abu Alia 9a233e437b bytecode 2017-08-30 18:08:05 +02:00
Fayez Abu Alia 9918e78f97 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-08-30 17:21:17 +02:00
JanUlrich d245aa7367 Added Modifier to Method 2017-08-30 17:20:59 +02:00
Fayez Abu Alia 3d07f60145 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-08-30 17:11:46 +02:00
JanUlrich 7c3181c3f0 Super-Statement an Constructor angefügt 2017-08-30 17:06:42 +02:00
JanUlrich b251a646ca System.out.println Statement schein halbwegs zu funktionieren ^^ 2017-08-30 15:29:34 +02:00
Fayez Abu Alia 276f235b56 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-08-30 14:43:53 +02:00
Fayez Abu Alia 866429ffe7 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode2 2017-08-30 14:43:31 +02:00
JanUlrich 4b21f03a5a Refactoring 2017-08-30 14:36:40 +02:00
JanUlrich a7e1a5e2c2 Fehler beheben 2017-08-28 18:36:26 +02:00
JanUlrich 932b277dcc Imports implementieren 2017-08-28 17:36:51 +02:00
JanUlrich 45c85b7686 Type refactoring 2017-08-28 15:42:51 +02:00
JanUlrich ff59b585bd TypeInsert ausbessern 2017-08-25 03:39:54 +02:00
JanUlrich 397ac3cd58 TypeInsert ausbessern 2017-08-25 02:59:16 +02:00
JanUlrich 77c59de0f0 Assign ändern. Es gibt jetzt eine AssignLeftSide 2017-08-23 18:28:26 +02:00
Fayez Abu Alia 6e72bbab16 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/gast/abualia/test/JavaCompilerCore into bytecode2 2017-08-23 17:27:23 +02:00
Fayez Abu Alia 43f017a224 Bytecode TEst 2017-08-23 17:26:59 +02:00
JanUlrich 9a7e717c25 Constructor um fieldInits erweitern, auch der TYPE algo 2017-08-23 16:24:25 +02:00
JanUlrich 6b98bf6a58 Feld initialisierungen werden an Konstruktoren angehängt 2017-08-23 03:52:24 +02:00
JanUlrich bbc61c67a9 TypeInsert Fehler beheben 2017-08-23 01:43:20 +02:00
JanUlrich 1023ed8557 Generics einsetzen 2017-08-22 18:31:07 +02:00
JanUlrich 3274f12922 Fehler in TypeInsert beheben 2017-08-22 16:45:28 +02:00
JanUlrich 52f562b570 DoStmt zu ASTPrinter hinzufügen 2017-08-17 15:58:56 +02:00
FelixKrespach a9c49676a9 do statement implemented 2017-08-17 15:30:57 +02:00
FelixKrespach 856f9b059d while Statement implemented 2017-08-17 15:08:30 +02:00
JanUlrich ae02ee247a SAT Package erstellen 2017-08-17 15:08:07 +02:00
JanUlrich 0cf8f82283 Remove ClassNotFoundException 2017-08-07 23:51:22 +02:00
stan 1e6f046eff Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2017-07-14 17:48:04 +02:00
stan 841ac5fcbf PackageCrawler durch ClassLoader ersetzen 2017-07-14 17:47:02 +02:00
stan 3b95cdd76f Merge (auweioiwae) 2017-07-14 15:39:16 +02:00
JanUlrich 057df7c702 TypeInsert API anpassen 2017-07-10 21:23:48 +02:00
JanUlrich 86f29f1396 TypeInsert API anpassen 2017-07-09 16:35:33 +02:00
JanUlrich 0f6381f30b TypeInsert anpassen 2017-07-05 20:09:09 +02:00
JanUlrich adda1db195 Add parse(String) to Compiler 2017-07-05 18:46:08 +02:00
JanUlrich 2167a4288e Add possibility to parse a String to parser 2017-07-05 17:52:23 +02:00
JanUlrich 0ad97251ca Change Parser FileInput to InputStream 2017-07-05 17:50:38 +02:00
JanUlrich 87d2edaaa6 Change TIP creation 2017-07-05 17:42:41 +02:00
JanUlrich fc6040da39 Fehler in TYPE beseitigen 2017-06-30 13:48:59 +02:00
JanUlrich d64823ea30 Fehler bei GenericInsertPoints beheben 2017-06-30 12:14:07 +02:00
JanUlrich 3b8ef58222 ASTTypePrinter anfügen 2017-06-30 11:13:15 +02:00
JanUlrich 0aa18c74ba ASTPrinter verbessern 2017-06-29 01:19:13 +02:00
JanUlrich 726eb60eb3 ASTPrinter einführen 2017-06-28 21:10:28 +02:00
JanUlrich afd3f32f23 ASTVisitor implementieren 2017-06-28 17:20:26 +02:00
JanUlrich 3173cccefa Typen einsetzen um Wildcards erweitern 2017-06-26 18:19:56 +02:00
JanUlrich e6c58d44c2 Type für Return fixen 2017-06-26 16:59:10 +02:00
JanUlrich 1be1bb83ca FunN-Typen erstellen bei Methodenaufrufen 2017-06-23 21:33:27 +02:00
JanUlrich 2c25e56a76 Einsetzen von Generics korrigieren 2017-06-20 14:50:27 +02:00
JanUlrich c272688b2d Fehler beim Ausrechnen zusammenhängender Constraints beheben 2017-06-20 01:14:04 +02:00
JanUlrich cf6d9880e3 Generische Parameter einsetzen (nur Test, nicht korrekt eingesetzt) 2017-06-15 04:48:53 +02:00
JanUlrich 920eea43ad Lambda Test angepasst 2017-06-15 02:57:49 +02:00
JanUlrich 70ca62202d Typeinsetzen erweitert 2017-06-15 02:17:46 +02:00
JanUlrich 44481b4140 Merge branch 'bigRefactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2017-06-14 04:07:43 +02:00
JanUlrich 7a337843e6 Lambda-TYPE anpassen. Beginnen mit TypeInsert 2017-06-14 04:07:27 +02:00
Martin Plümicke fcca50ed78 modified: .classpath
modified:   src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/SyntaxTreeGenerator.java
	modified:   src/de/dhbwstuttgart/syntaxtree/SourceFile.java
	modified:   src/de/dhbwstuttgart/syntaxtree/statement/LambdaExpression.java
	modified:   src/de/dhbwstuttgart/typecheck/GenericTypeName.java
	modified:   src/de/dhbwstuttgart/typeinference/typeAlgo/TYPE.java
	modified:   test/astfactory/ASTFactoryTest.java

imports auskommentiert
2017-06-13 17:38:43 +02:00
JanUlrich 5f31150dc8 TYPE-Algo für LambdaExpression implementieren 2017-06-12 18:57:12 +02:00
JanUlrich 2129299eed Auto-Keyword an Grammatik anfügen 2017-05-31 17:10:50 +02:00
Jan-Elric Neumann a48cbae5a5 Removed faulty (and unused import), which prevented ObjectiF from parsing SyntaxTreeNode 2017-05-30 19:40:51 +02:00
Jan-Elric Neumann b395f6e137 Fixed return type to make code parsable for ObjectiF 2017-05-30 19:38:03 +02:00
JanUlrich 810164ac17 LocalVar bekommt den Typ beim Parsen 2017-05-19 17:40:47 +02:00
JanUlrich 4a52bc0e6e TypeInsertFactory anfügen, convert UnifyPair->Pair implementieren 2017-05-18 13:17:52 +02:00
JanUlrich 2c999d0eb6 Umstellung auf Visitor Pattern des TYPE-Algos 2017-05-15 13:15:49 +02:00
JanUlrich 058402e056 StatementVisitor einführen 2017-05-11 17:39:48 +02:00
JanUlrich 43bfc551ff Fehler in Test beheben 2017-05-09 20:15:42 +02:00
JanUlrich 4261ce2603 Interfaces angefügt. Generierung von Generics im Parser geändert 2017-05-05 16:20:12 +02:00
Pluemicke Martin 88ea14bbe8 Studienarbeiten Schroedter Steurer hinzugefuegt 2017-05-03 17:59:34 +02:00
JanUlrich a9909d5f32 Merge mit Antlr 2017-04-20 18:55:34 +02:00
JanUlrich caa7f7deee Lambdas einführen 2017-04-20 18:51:27 +02:00
Jakob Herrmann f05222fb56 Some cleanup to be able to recompile, i.e:
* Remove handling of superclasses which needs further debugging
* add missing exceptions
* remove ClassFinder as it is not used and needs debugging
2017-04-20 17:15:52 +02:00
Jakob Herrmann 5cc418371d Main class for JavaTXParser. 2017-04-20 13:47:06 +02:00
JanUlrich e5d3d67dad sun.NotImplementedExceptions ersetzen 2017-04-19 15:31:11 +02:00
JanUlrich 3d835304cf Lambda Ausdruck dem Parser anfügen 2017-04-19 15:26:37 +02:00
JanUlrich 29a17731fd NewClass Constraints generieren angefügt 2017-04-18 21:06:04 +02:00
Jakob Herrmann 18965e0eda Simple bash script to compile packages needed for parser. 2017-04-13 15:00:13 +02:00
JanUlrich af1f7f28e2 New Aufruf im Parser anfügen 2017-04-07 02:33:20 +02:00
JanUlrich e1af4e1f65 Tests ändern 2017-04-06 16:22:36 +02:00
JanUlrich ed56e24ff6 Merge branch 'bigRefactoring' into antlr 2017-04-06 16:20:33 +02:00
Jakob Herrmann dad08cfa46 PackageCrawler latest version 2017-04-06 16:16:47 +02:00
JanUlrich f920269e51 @NotNull entfernen 2017-04-06 16:01:32 +02:00
JanUlrich 5d32f20a51 @NotNull entfernen 2017-04-06 16:01:10 +02:00
JanUlrich 42010c5859 NotNull entfernen 2017-04-06 15:35:52 +02:00
JanUlrich 0c4cdd63b5 NotNull entfernen 2017-04-06 15:33:20 +02:00
JanUlrich c02a3480e8 Cast Test 2017-04-06 12:26:04 +02:00
JanUlrich 561f1d1150 Fehler beim Parsen von Method behoben 2017-04-06 12:12:06 +02:00
JanUlrich 30099f5e50 Parser um Cast erweitern 2017-04-06 11:23:25 +02:00
JanUlrich de91e49bcc Fehlendes Return am Ende von Blocks beim Parsen einfügen 2017-03-29 19:44:24 +02:00
JanUlrich 4ecf526b14 Generics anfügen 2017-03-29 17:28:29 +02:00
JanUlrich 56e4192df4 Fehler in JavaClassRegistry.contains fixen 2017-03-22 17:10:51 +01:00
JanUlrich c480e25805 Bug im convert(Feld) gefixt 2017-03-22 16:16:38 +01:00
JanUlrich 47f1f9ad54 Generics angefügt 2017-03-22 16:05:59 +01:00
JanUlrich d0eb091666 Unify angefügt 2017-03-17 15:48:06 +01:00
JanUlrich c8beb9579e UnifyTypeFactory angefügt 2017-03-16 20:02:53 +01:00
JanUlrich 92c284a04b Constraints generieren. Fehler beheben 2017-03-15 16:54:43 +01:00
JanUlrich 5fab817154 MethodCall Constraints erstellen 2017-03-15 16:17:07 +01:00
JanUlrich a38b796a6f ImportTest2 2017-03-09 16:20:05 +01:00
JanUlrich d9cc613600 JavaClassName nur in der Regestry erstellen 2017-03-09 15:43:13 +01:00
JanUlrich 2cdca93077 ASTFactory erweitert 2017-03-08 17:51:59 +01:00
JanUlrich 9fae52e1e6 Factory angefügt. java.lang.reflect.Modifier benutzen 2017-03-08 03:43:47 +01:00
JanUlrich 4c4c0d5ada getConstraints() eingeführt 2017-03-06 17:59:01 +01:00
JanUlrich a44baeaa34 Beginnen mit Typinferenzalgorithmus 2017-03-02 18:16:14 +01:00
JanUlrich 0b17894ed2 Parser erweitert 2017-03-02 16:48:08 +01:00
JanUlrich 52f51c7932 Parser erweitern 2017-03-01 15:34:57 +01:00
JanUlrich a51cef7100 Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2017-02-23 01:11:35 +01:00
Jakob Herrmann 2e9a71a18d * Implemented recognition of SingleTypeImportDecl (tested).
* InvalidClassNameException is thrown if class/package in ImportDecl is
not known.
2017-02-22 21:25:57 +01:00
JanUlrich fbcb369f1c Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2017-02-22 14:47:53 +01:00
JanUlrich 32d262341a SyntaxtreeGenerator um einige Regeln zur Erstellung von Statements erweitert 2017-02-22 14:47:34 +01:00
Jakob Herrmann d5ba34e620 * Extend PackageCrawler
* Dummy methods for converting imports
2017-02-22 14:31:59 +01:00
Jakob Herrmann d63fe45d08 Helper methods to convert type names. 2017-02-22 13:14:32 +01:00
JanUlrich d328faeee2 Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bigRefactoring 2017-02-22 01:35:59 +01:00
Jakob Herrmann 15f8a1b99d PackageCrawler: Convert class names to list of strings. 2017-02-22 00:04:16 +01:00
Jakob Herrmann 72bf03ec58 RunParser now reads from file instead of stdin. 2017-02-21 22:19:00 +01:00
JanUlrich 18d477ba07 Merge branch 'refactoring' into bigRefactoring 2017-02-17 18:00:08 +01:00
JanUlrich 40d87c8636 Method Parsen verbessert 2017-02-17 17:20:50 +01:00
JanUlrich fb629b417f FormalParameter convert änderung 2017-02-17 17:08:10 +01:00
JanUlrich 3299f329ea Method Parameter parsen 2017-02-17 16:58:19 +01:00
JanUlrich 656b014ad4 Parser um return und method call erweitern 2017-02-17 16:34:40 +01:00
JanUlrich fa4a24c653 Reflections Library anfügen. PackageCrawler anfügen 2017-02-15 16:29:11 +01:00
Jakob Herrmann d9b81224b6 Notes/Fragen 2017-02-15 13:05:51 +01:00
Jakob Herrmann b5a2d64a7b * Some getters in syntaxtree
* Extend RunParser (makes problems).
2017-02-15 12:22:06 +01:00
Jakob Herrmann 7f05966093 Idea to resolve the problem with initial fields. 2017-02-15 00:51:34 +01:00
Jakob Herrmann cca2da8018 Implemented converter for FieldModifier. 2017-02-14 21:37:17 +01:00
Jakob Herrmann e9e2d5c27b Generate classes of interface FieldModifier. 2017-02-14 15:26:56 +01:00
JanUlrich 5c36e68825 Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into antlr 2017-02-10 17:37:56 +01:00
JanUlrich 60a304667a ANTLR Parser erweitert 2017-02-10 17:37:42 +01:00
Jakob Herrmann 50a618ee4b SyntaxTreeGenerator.setPackageName() is now used properly. 2017-02-07 22:12:40 +01:00
JanUlrich 8d0f24f2f8 Merge 2017-02-03 15:22:45 +01:00
JanUlrich d064f16de4 Merge 2017-02-03 15:21:45 +01:00
JanUlrich 39747f4138 ANTLR Parser SyntaxtreeGenerator erweitern. 2017-02-03 15:20:26 +01:00
Jakob Herrmann ade687483c Fixed RunParser according to new constructor. 2017-02-01 12:36:23 +01:00
Jakob Herrmann d55d6734d9 JavaClassRegistry is now required for constructor. 2017-02-01 12:32:20 +01:00
JanUlrich 77fbe99fed merge 2017-01-27 14:20:33 +01:00
JanUlrich bee92ef11d Parser package-Struktur umstellen 2017-01-27 13:20:22 +01:00
JanUlrich f92a53ce74 Aufräumen 2017-01-26 17:16:06 +01:00
JanUlrich acf9cbd20b Merge mit antlr-branch. Löschen aller ino.Kommentare 2017-01-20 15:20:45 +01:00
JanUlrich 049f435537 Unnötige ino-Kommentare entfernen 2017-01-20 13:57:20 +01:00
JanUlrich f2ddce2e89 Merge mit antlr 2017-01-20 13:54:06 +01:00
JanUlrich a4dc47cc4e Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into antlr 2017-01-20 13:01:08 +01:00
JanUlrich 10ede1ba98 Entfernen von unnötigen ino.* Kommentaren 2017-01-20 13:00:25 +01:00
Jakob Herrmann a77b65e65c Extend converter for modifiers by strictfp. 2017-01-18 15:58:34 +01:00
Jakob Herrmann a1bbd8b11e Implement Strictfp modifier. 2017-01-18 15:55:07 +01:00
Jakob Herrmann e8537c3886 TODO cleanup 2017-01-18 15:12:16 +01:00
Jakob Herrmann c3320858a3 RunParser no handles line breaks.This should also fix problems with
comments.
2017-01-18 13:27:17 +01:00
Jakob Herrmann 68476f9f96 * Implemented converter for Modifier.
* Missing getters etc. in some classes added.
2017-01-18 00:45:46 +01:00
Jakob Herrmann fbfa407c26 More converters & cleanup. 2017-01-17 20:59:42 +01:00
Jakob Herrmann 5814cac83f Start rewriting converters to simplify readability etc. 2017-01-17 12:34:23 +01:00
Jakob Herrmann 9ef41280ca * Implement missing constructor for Modifiers.
* TODO: convert for Modifier
2017-01-17 00:58:03 +01:00
Jakob Herrmann 0db15bffa8 Begin rewriting of convert for TypeDecl. 2017-01-16 23:32:12 +01:00
Jakob Herrmann 4c79023889 Implement base constructor in ClassOrInterface. 2017-01-16 14:28:22 +01:00
JanUlrich 72bcfd41d3 Merge mit ANTLR branch 2017-01-13 17:49:58 +01:00
Jakob Herrmann e4e98797fc Extend constructor of SourceFile. 2017-01-11 16:42:02 +01:00
Jakob Herrmann 647196bf16 * Start implementing "getters and setters" for
symtaxtree.ClassOrInterface (=no choice!!!).
* Start implementing converters TypeDeclerytion -> Class.
2017-01-10 23:44:19 +01:00
Jakob Herrmann 3c6ffcf4d8 * "Normal" class and interface names can now be resolved.
* TODO: line comments
2017-01-10 22:20:44 +01:00
Jakob Herrmann fb10220da9 * Set JavaClassName constroctur to public.
* Implemented "class resolution" for interfaces.
2017-01-10 20:07:23 +01:00
Jakob Herrmann 599c8b2573 * SyntaxTreeGenerator: Implemented method to get package name of
CompilationUnitCtx (ongoing).
* RunParser: test methods
2017-01-10 17:42:20 +01:00
Jakob Herrmann f0028f6aaf Minor changes (nameReg/constructor). 2016-12-21 15:49:38 +01:00
JanUlrich 5f61d478fa Class ändern zu ClassOrInterface 2016-12-21 15:46:28 +01:00
JanUlrich aed261c807 JavaClassName aufräumen 2016-12-21 15:39:07 +01:00
JanUlrich 3b6363d71a Aufrömen 2016-12-21 15:06:55 +01:00
JanUlrich ddbcc5ee6e GenericType für Bytecodegenerierung eingeführt 2016-12-16 14:33:04 +01:00
JanUlrich 1b99f74f39 Generics als RefType entfernen 2016-12-16 13:26:28 +01:00
JanUlrich 7b9a00a7e6 Revert "Syntaxbaum bereinigen. Allen Code löschen. Nur Struktur bleibt erhalten"
This reverts commit 3ab96a3ed7.
2016-12-16 01:05:54 +01:00
JanUlrich c329ba6cef merge 2016-12-16 01:05:45 +01:00
JanUlrich 3ab96a3ed7 Syntaxbaum bereinigen. Allen Code löschen. Nur Struktur bleibt erhalten 2016-12-16 00:00:37 +01:00
JanUlrich 76880708a1 Merge 2016-12-15 17:07:17 +01:00
JanUlrich e84d6373c7 Aufräumen 2016-12-15 17:02:39 +01:00
JanUlrich a35bcd490b Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into antlr 2016-12-15 16:28:26 +01:00
JanUlrich 40ba5fb621 Beispiel für ANTLR Parser 2016-12-15 16:28:12 +01:00
Jakob Herrmann ad02e94967 notes parse_tree 2016-12-15 16:17:40 +01:00
JanUlrich c34b3c4c14 Aufräumen 2016-12-15 16:00:28 +01:00
JanUlrich 01a954ca68 TypeCheck package 2016-12-15 15:45:23 +01:00
JanUlrich 5c6b001ae1 Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into antlr 2016-12-15 15:35:26 +01:00
JanUlrich fc43cd11da Aufräumen 2016-12-15 15:35:14 +01:00
Jakob Herrmann e1d68291c9 Added some basic handling of package declarations. 2016-12-15 15:01:57 +01:00
Jakob Herrmann b0a6585252 Small changes, i.e. RunParser now reads from System.in. 2016-12-15 13:35:07 +01:00
Jakob Herrmann 81e223334b Created RunParser which is supposed the main class (still rather
experimental).
2016-12-15 12:05:23 +01:00
Jakob Herrmann 82a1e86186 * Started implementing CompilationUnitEvaluator.java which is supposed to be the base
class for syntax tree construction.
* Deleted JavaClassName and JavaClassRegistry as they cannot be compiled
so far (backups exist).
2016-12-15 11:21:33 +01:00
JanUlrich aff39ba442 Type löschen 2016-12-09 04:34:50 +01:00
JanUlrich 343c7d3a55 Merge branch 'antlr' of /home/janulrich/Development/intellijworkspace/../eclipseworkspace/eclipseWorkspaceHorb/JavaCompilerCore into antlr 2016-12-07 14:32:56 +01:00
JanUlrich c1cbb78fe5 Aufräumen 2016-12-07 14:32:48 +01:00
JanUlrich 4e43de987d Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into antlr 2016-12-07 14:06:19 +01:00
JanUlrich 717fd5d53e Field anpassen 2016-12-02 01:23:01 +01:00
Jakob Herrmann d9e6ef6e47 Parser now handles untyped method declarations but this needs further
inspection as constructors are not handled properly.
2016-11-29 21:08:53 +01:00
Jakob Herrmann b2e5555da5 Grammar now supports untyped parameters in method declarations. 2016-11-29 19:46:07 +01:00
Jakob Herrmann c5ea9a3464 Grammar now supports untyped field declarations. 2016-11-29 18:34:33 +01:00
Jakob Herrmann 52a5e54c3a Recompile grammer due to some technical problems. 2016-11-29 18:31:50 +01:00
Jakob Herrmann 264ede100c Create list with notes/questions/problems. 2016-11-23 00:43:57 +01:00
JanUlrich d651a6cdff Parser austauschen 2016-11-16 14:51:45 +01:00
JanUlrich c9e3743fb5 Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into antlr 2016-11-16 14:33:38 +01:00
Jakob Herrmann 7d38c9af43 Added package declaration to sources. 2016-11-16 14:32:51 +01:00
JanUlrich cdb1850668 ANTLR Lib an classpath anfügen 2016-11-16 14:28:28 +01:00
JanUlrich 90b6e81195 Merge branch 'antlr' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into antlr 2016-11-16 14:17:47 +01:00
JanUlrich 7606aee9c3 Unnötige Datein in bin löschen 2016-11-16 14:17:38 +01:00
Jakob Herrmann 7504211df2 * Add base antlr grammer and corresponding classes.
* Add antlr4 runtime library.
2016-11-16 14:09:33 +01:00
JanUlrich 7d09131c27 ObjectClass einführen 2016-11-16 13:41:25 +01:00
JanUlrich 388685d3b2 Bugfix #4 (FunVoidN Typen) 2016-11-15 23:00:07 +01:00
JanUlrich 642394c25b ObjectClass added 2016-11-15 21:15:09 +01:00
JanUlrich 85dc60169a Merge, ObjectClass anfügen 2016-11-15 19:47:46 +01:00
JanUlrich 73e6e5c45f LambdaTest30 anfügen 2016-11-15 19:46:50 +01:00
JanUlrich 1a94f449a0 bugfix 2016-11-11 11:50:55 +01:00
JanUlrich 6a4cb673bf Mergen... (nicht fertig) 2016-11-11 11:01:55 +01:00
JanUlrich accbe5bbfc Beginnen der BytecodeTypeFactory 2016-11-09 16:59:08 +01:00
JanUlrich c4aff43f71 NameGenerator einführen 2016-10-28 18:32:05 +02:00
JanUlrich 107201c00c Fehler in FunN Generierung beheben 2016-10-28 18:31:42 +02:00
JanUlrich e60e6b622c Bugfix 2016-10-07 14:12:18 +02:00
Martin Plümicke a33ce04734 modified 2016-09-30 12:48:41 +02:00
JanUlrich b05b0ea5df Syntaxbaum anpassen 2016-09-30 12:46:02 +02:00
JanUlrich a1227a8b1b Expr und ExprStmt ändern 2016-09-20 15:18:13 +02:00
JanUlrich a5c34896ba Fehler in Lambda-Generierung fixen 2016-09-16 14:26:18 +02:00
JanUlrich bc812ad083 Aufräumen 2016-09-16 13:25:20 +02:00
JanUlrich 1ac500715b Aufräumen 2016-09-13 17:32:22 +02:00
JanUlrich 5be508e943 Beginnen der AST Anpassungen für das ANTLR-Projekt. Constructor-Aufrufe ändern. UsedID entfernen. parserPostProcessing entfernen. Anpassungen am AST Layout. 2016-09-10 00:40:17 +02:00
JanUlrich aa6a6beb93 StackMapTable-Fix 2016-08-25 19:52:06 +02:00
JanUlrich dbe09c237c Lambda Bytecodegenerierung implementieren 2016-08-17 00:45:14 +02:00
JanUlrich 592af65c08 Einführen von BCEL 6.1 2016-07-21 16:36:53 +02:00
JanUlrich 25329cd39e Einführen von BCEL 6.1 2016-07-21 16:36:33 +02:00
JanUlrich 5aebc06337 Fehlerhaften Filter auslassen 2016-07-21 16:20:37 +02:00
JanUlrich 0896cf8236 StackMapTable funktioniert 2016-07-11 20:23:36 +02:00
JanUlrich 81c8764fc6 Aufräumen, neue BCEL-Version 2016-06-23 16:49:30 +02:00
JanUlrich eb0da3c36a Aufräumen, neues Eclipse-Projekt anlegen 2016-06-22 20:29:16 +02:00
JanUlrich dab2087f0a BCEL aktualisiert 2016-06-17 14:21:30 +02:00
JanUlrich e19dee4c99 Umstellung auf Intellij IDEA 2016-06-17 13:55:14 +02:00
JanUlrich f88d58d548 Update für StackMapTable 2016-06-17 07:02:15 +02:00
JanUlrich 9d9526ae72 Testen von StackMapTable-Generator 2016-06-15 20:58:55 +02:00
JanUlrich 86a94dfae9 Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-06-03 13:47:37 +02:00
JanUlrich fe35a1f56d Merge mit bytecode 2016-06-03 13:47:22 +02:00
i13026 5821839cbc Test für Methodenparameter erstellt 2016-06-03 10:57:48 +02:00
i13026 b6df854cc6 Stack wird pro Methode behandelt 2016-05-26 11:02:02 +02:00
JanUlrich 52b6f438b0 Merge mit Bytecode 2016-05-25 18:18:05 +02:00
JanUlrich 07ea25b5b7 Filtern von Constraints vor dem Karthesischen Produkt bilden 2016-05-25 17:46:33 +02:00
JanUlrich 0d51c3e94d Bug 49 und 52 fix 2016-05-24 00:36:59 +02:00
i13026 47c2b78713 Testfall für Bug 48: Uninizierte Variablen erstellt 2016-05-12 21:14:57 +02:00
i13026 58db64ad22 WildCardTest implementiert 2016-05-12 20:50:36 +02:00
JanUlrich b67816775e Merge branch 'refactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-05-12 19:48:39 +02:00
JanUlrich 748f25a2fd gen-TPH richtig konvertieren 2016-05-12 19:48:19 +02:00
Florian Steurer 318f6e1cc5 code review todos erledigt 2016-05-06 16:59:59 +02:00
Martin Plümicke 223f6facc7 modified: ../../../src/de/dhbwstuttgart/bytecode/ClassGenerator.java
in addMethod :
String methodNameAndTypes = m.getName()+Arrays.toString(m.getArgumentTypes());
durch
String methodNameAndTypes = m.getReturnType().getSignature()+m.getName()+Arrays.toString(m.getArgumentTypes());
ersetzt
	modified:   OL.jav
Main-Klasse hinzugefuegt
2016-05-04 00:28:57 +02:00
JanUlrich edda41f546 Generic Type Var werden zu PlaceholderTypen konvertiert 2016-05-03 22:43:43 +02:00
JanUlrich 5d760d4222 Aufruf im UnifyTest OverloadingVector ändern 2016-05-03 22:15:19 +02:00
Florian Steurer 005ed60c26 fixed vector 2016-05-03 21:07:52 +02:00
Florian Steurer 78794e377a fixed vector 2016-05-03 20:44:55 +02:00
i13026 ae01af7a40 Bugfix: OverloadingTest 2016-05-03 18:15:14 +02:00
JanUlrich db93a1dfe1 Void Reference-Typen wieder zu Void RefTypes konvertieren 2016-05-03 13:58:54 +02:00
JanUlrich f17745bfa5 Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-05-03 13:55:19 +02:00
Florian Steurer 84176275be Merge branch 'unify' of ssh://i13029@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify 2016-05-03 13:43:16 +02:00
Florian Steurer da49e42515 fixed long running times for lambda tests 2016-05-03 13:42:14 +02:00
JanUlrich 0a6aa450db OverloadingVector Test 2016-05-03 13:03:14 +02:00
JanUlrich dc52dc5dec Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode 2016-05-03 12:47:35 +02:00
JanUlrich ca8952a43c Void Reference-Typen wieder zu Void RefTypes konvertieren 2016-05-03 12:46:32 +02:00
JanUlrich 4a6a8d62e3 Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-05-03 12:42:04 +02:00
Florian Steurer 4f265b56a4 big refactoring of smaller and greater 2016-04-30 19:35:34 +02:00
i13026 e5fc8c8288 - Div und MulOperatoren für alle numerischen Datentypen implementiert (Nur wenn beide Operanten den gleichen Typ haben) 2016-04-30 11:14:24 +02:00
JanUlrich c2d3fce75e FormalParameter getDiscription Fix 2016-04-29 16:52:35 +02:00
JanUlrich 8134bbb297 Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-29 16:03:50 +02:00
JanUlrich 46f1134bad Aufräumen 2016-04-29 16:03:38 +02:00
i13026 32741f41e9 - Addition für alle Typen implementiert
- Mehrere Klassen in einer jav Datei möglich
- OLTest läuft
2016-04-29 15:52:20 +02:00
JanUlrich d03e20df90 FunN Typen konvertieren. FunVoidN Typen werden nicht mehr benutzt 2016-04-29 15:23:42 +02:00
JanUlrich d19414c513 Merge mit Bytecode 2016-04-29 14:05:25 +02:00
i13026 ba6ae74ad1 -Tests für for und While Schleife korrigiert
- While teilweise implementiert
2016-04-29 10:00:33 +02:00
i13026 dad06a5626 Alle Bytecode Tests in SourceBytecodeTests transformiert 2016-04-29 09:43:36 +02:00
JanUlrich 324864f8d8 FunN Typen werden zu den entsprechenden UnifyTypen konvertiert 2016-04-29 04:00:46 +02:00
JanUlrich f2410154aa Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-29 03:09:31 +02:00
Florian Steurer b39dedb9aa added application of funN Rules 2016-04-28 21:33:33 +02:00
Florian Steurer 7c0a91e624 unitTest for lambda6, alternative sequential execution, minor bugs 2016-04-28 21:24:52 +02:00
Florian Steurer c043717c06 removed todo 2016-04-28 21:04:58 +02:00
JanUlrich 9a51e79f2a Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-28 16:42:16 +02:00
JanUlrich a31e7b1108 BCEL Framework aktualisiert. FunN Typen implementieren 2016-04-28 15:32:12 +02:00
i13026 bbb79b1a1d - Tests für Vergleichsoperatoren angelegt 2016-04-27 15:41:49 +02:00
i13026 b3e13d09b9 - Alle Operatoren implementiert
- Tests für Sub, Mul, Div
2016-04-27 15:08:17 +02:00
i13026 5ac19d7a59 - args_size bugfix 2016-04-26 16:15:53 +02:00
i13026 362be98c30 -Test für Stackmaptable ifstatement verbessert
- IFStatementCreator erstellt
2016-04-26 15:52:22 +02:00
i13026 8bda352bc9 - Method refactored 2016-04-25 14:58:52 +02:00
Florian Steurer 856f5da86b Parallelisierung mit Fork-Join Pool 2016-04-22 16:52:16 +02:00
Florian Steurer 7d75f18319 Parallelisierung mit Fork-Join Pool 2016-04-22 16:51:05 +02:00
Florian Steurer 8fa8fc8758 comment 2016-04-22 16:11:18 +02:00
Florian Steurer 752723020e pipe execution 2016-04-22 15:45:20 +02:00
Florian Steurer 6eb7f2d1bb removed creation of new strings 2016-04-22 10:24:33 +02:00
Florian Steurer 7b6b720b57 memory optimization 2016-04-21 22:31:36 +02:00
Florian Steurer bb8df92cba equals / hashcode optimization 2016-04-21 22:19:48 +02:00
Florian Steurer b8415b122b stringbuilder in logger 2016-04-21 20:26:33 +02:00
JanUlrich 629d2dcc4d Merge branch 'unify' into refactoring 2016-04-21 14:27:49 +02:00
JanUlrich 16cbf8e1b7 Fehler bei TPH Generierung behoben 2016-04-21 14:27:32 +02:00
JanUlrich 0ca4f16c49 Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify 2016-04-21 13:25:04 +02:00
Florian Steurer 1a32ea9ce9 size of unify result 2016-04-20 18:38:20 +02:00
JanUlrich 1afe2d4d5c Unnötige Kommentare löschen 2016-04-20 18:04:28 +02:00
Florian Steurer d8feb04938 time log 2016-04-20 17:10:26 +02:00
JanUlrich e08485740f Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-20 14:48:03 +02:00
Florian Steurer 8780d5d47a option for parallelization 2016-04-20 12:15:04 +02:00
Florian Steurer 863bfa40d3 performance opt 2016-04-20 11:34:40 +02:00
Florian Steurer 6a42c8ef11 performance optimization 2016-04-20 11:25:45 +02:00
JanUlrich 07d63a9586 Merge mit bytecode 2016-04-19 16:59:59 +02:00
JanUlrich fcbd05fa9c Im Unify generierte TPH beachten 2016-04-19 15:27:46 +02:00
i13026 8bad95f774 -AndOperator erweitert 2016-04-19 15:24:43 +02:00
i13026 5a7c2310a1 -Test für Methodenaufrufe und Variablen erstellt 2016-04-19 14:40:29 +02:00
JanUlrich a8f18e77be Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify 2016-04-19 12:58:00 +02:00
Florian Steurer 904ca01207 cleaned up 2016-04-19 11:42:15 +02:00
JanUlrich b70dc71a62 Convert zu FunNTypen hinzufügen 2016-04-18 15:38:47 +02:00
Florian Steurer afc6bc7b89 neue abbruchbedingung 2016-04-14 15:15:21 +02:00
Florian Steurer fbcd0cd8a5 Merge branch 'unify' of ssh://i13029@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify 2016-04-14 14:56:24 +02:00
Florian Steurer 12abb0b34d reduced cases of cart product 2016-04-14 14:54:59 +02:00
i13026 65a1038574 - Speichern einer lokalen Variable unter Verwenung der InstructionFactory 2016-04-14 14:53:18 +02:00
JanUlrich 9e114207ce Fehler mit SMALLER und SMALLERDOT behoben 2016-04-14 14:50:31 +02:00
i13026 a23f77c337 -Test für Variablen erstellt 2016-04-14 14:36:18 +02:00
JanUlrich 5c12a61699 Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify 2016-04-14 14:22:53 +02:00
JanUlrich 4b9eda962e Tests anfügen 2016-04-14 14:22:41 +02:00
Florian Steurer e26f87afba fixed rule set test 2016-04-14 14:21:19 +02:00
JanUlrich 3cd7dba316 Merge branch 'unify' into refactoring 2016-04-14 14:03:15 +02:00
i13026 9a07201498 And, Or, Plus Operator implementiert 2016-04-14 12:00:15 +02:00
i13026 dfe79a8030 Equal Operator implementiert 2016-04-13 19:31:35 +02:00
Florian Steurer e8c46dcdbd rename unify to typeUnify 2016-04-13 18:32:09 +02:00
Florian Steurer 558a873e68 commenting 2016-04-13 11:58:33 +02:00
Florian Steurer b1febd7a50 commenting refactoring 2016-04-13 11:38:07 +02:00
Florian Steurer ae9220c04b made the ruleSet interface functional (added fc in arguments) 2016-04-13 11:13:20 +02:00
i13026 11e149110a - OLTest verbessert, ist aber nicht positiv, da Autoboxing fehlt 2016-04-12 20:06:22 +02:00
Florian Steurer d8e7df425d refactoring 2016-04-12 15:47:38 +02:00
Florian Steurer 27f6abefe8 commenting and refactoring 2016-04-12 15:43:32 +02:00
Florian Steurer ba636e1da0 fixed bug in standard unify 2016-04-12 15:17:12 +02:00
JanUlrich 4173733ada Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-12 14:00:53 +02:00
Florian Steurer 1b9a9c0841 commenting / refactoring 2016-04-12 13:39:08 +02:00
Florian Steurer ff0d1e907f fixed flattening of sets 2016-04-12 13:21:17 +02:00
JanUlrich 3f62ef4072 Merge branch 'bytecode' into refactoring 2016-04-12 12:43:42 +02:00
JanUlrich b14c264435 Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode 2016-04-12 12:24:15 +02:00
JanUlrich 7a47de7bfa Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-12 12:14:38 +02:00
JanUlrich f4d0dbf95d Unify Test anfügen 2016-04-12 12:14:31 +02:00
JanUlrich b0aeaae80e Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-12 11:54:46 +02:00
JanUlrich 03b1321a45 UnifyTestSubclasses anfügen 2016-04-12 11:54:26 +02:00
Pluemicke Martin 7363758603 new file: OL.jav
new file:   OLTest.java
	modified:   Overloading.jav
main Methode angefuegt
2016-04-12 11:37:00 +02:00
Florian Steurer f8d7a95731 commenting 2016-04-12 11:36:43 +02:00
Florian Steurer 8b6a4d1746 refactoring and commenting 2016-04-12 11:28:07 +02:00
Florian Steurer a16e62f4bd refactoring and commenting 2016-04-12 11:18:55 +02:00
Florian Steurer ea32cd5680 commenting and refactoring 2016-04-12 11:12:57 +02:00
JanUlrich 377987abda Aufräumen in test/bytecode 2016-04-12 11:08:39 +02:00
Florian Steurer 1e96811127 refactoring and commenting 2016-04-12 10:54:17 +02:00
JanUlrich 22393888f1 Merge branch 'refactoring' into bytecode 2016-04-12 10:28:20 +02:00
JanUlrich b68107286a Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode 2016-04-12 10:23:15 +02:00
JanUlrich f630f93a3d Debug Ausgabe anfügen 2016-04-12 10:06:58 +02:00
Martin Plümicke 0438ef9af4 Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode 2016-04-12 09:57:09 +02:00
JanUlrich 3bb2153b6a Java Parser an umbenennung anpassen 2016-04-11 18:36:43 +02:00
JanUlrich 6cc0d462ab Merge branch 'unify' into refactoring 2016-04-11 18:35:50 +02:00
JanUlrich df1881bf41 Merge branch 'bytecode' into refactoring 2016-04-11 18:35:44 +02:00
JanUlrich de238b90df Assumptions erweitern 2016-04-11 18:35:18 +02:00
Florian Steurer 55f288022a commenting, refactoring 2016-04-11 16:31:55 +02:00
Florian Steurer 0313d297e1 comments and refactoring 2016-04-11 16:26:59 +02:00
Florian Steurer 044e6fbc3f comments & refactoring 2016-04-11 16:05:36 +02:00
Florian Steurer aa692c2f25 comments 2016-04-11 15:30:01 +02:00
Florian Steurer 6616d78dcb . 2016-04-11 09:56:29 +02:00
Florian Steurer 5dd90cb30c refactored standard unification 2016-04-11 09:56:06 +02:00
Florian Steurer 64247b689b signature from getLeftHandedType from type to string 2016-04-10 14:52:07 +02:00
Florian Steurer 23e0be2572 extended all cases / fixed random placeholder generation 2016-04-09 15:07:41 +02:00
Florian Steurer d080eb4a0a extended case 6 2016-04-08 18:48:35 +02:00
Florian Steurer 41b3e4f6c2 extended case 5 2016-04-08 18:28:34 +02:00
Florian Steurer 5c73224f8f support for extended case 1 // tests // bugfix in "big" cases 2016-04-08 18:04:11 +02:00
Florian Steurer e06888f5f7 organized imports 2016-04-07 22:33:14 +02:00
Florian Steurer 3a2a5510b9 removed printLn-tests fuer smArg und grArg 2016-04-07 22:32:42 +02:00
Florian Steurer b7f41c4d13 funN greater 2016-04-07 22:30:30 +02:00
Florian Steurer 53cfb4b046 Support for FunN in FC added // swap for unifiers 2016-04-07 22:24:35 +02:00
Florian Steurer 284447aad2 removed unify old test 2016-04-07 21:45:27 +02:00
i13026 b707a0f03e Bugfix: Methodenparameter 2016-04-07 15:44:29 +02:00
JanUlrich d63f08bf33 BytecodeTest falsch aufgerufen 2016-04-07 15:08:11 +02:00
JanUlrich d3ebee1b3c Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-07 14:55:46 +02:00
i13026 45cad9f675 - getDescription ist nicht die Descripiton im Bytecode 2016-04-07 14:53:29 +02:00
JanUlrich 74c2b5e323 Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-07 14:52:04 +02:00
JanUlrich e537a76cd9 Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-04-07 14:39:15 +02:00
JanUlrich 44318ee5d8 Aufräumen 2016-04-07 14:39:07 +02:00
Florian Steurer 8d69f6c82b adapt rule fixed 2016-04-07 14:30:23 +02:00
i13026 943c4e6043 Test für System.out.println erstellt. Umsetzung vorerst nicht möglich, da ein Fehler der Typeinferenz auftritt 2016-04-07 13:54:29 +02:00
i13026 7b78cf8471 Bugfix: Store and Load 2016-04-07 12:19:42 +02:00
JanUlrich 3a8f1252a4 Merge branch 'bytecode' into refactoring 2016-04-06 14:23:26 +02:00
JanUlrich e1c925b9bc Unnötige Kommentare löschen 2016-04-06 12:42:15 +02:00
Florian Steurer 6793b0bd24 rename mpair to unify pair / refactoring 2016-04-04 11:23:14 +02:00
Florian Steurer 2e30429252 added wildcardtype 2016-04-04 10:18:34 +02:00
Florian Steurer 2c642cb6ef permute params test with assert 2016-04-03 22:57:11 +02:00
Florian Steurer 20d1106e07 refactored Types // 2016-04-03 22:43:55 +02:00
Florian Steurer 6c2d71d005 random with seed 2016-04-03 17:36:44 +02:00
Florian Steurer 0d5b515a47 added extra set level / fixed subst rule bug / 2016-04-03 16:53:45 +02:00
Florian Steurer b12f301656 Merge branch 'unify' of ssh://i13029@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into unify 2016-04-02 11:29:43 +02:00
Florian Steurer 0be7534b98 . 2016-04-02 11:29:31 +02:00
JanUlrich 1bf208b833 Merge mit refactoring 2016-04-01 18:24:36 +02:00
JanUlrich a3e7b4567a Merge mit refactoring 2016-04-01 18:21:51 +02:00
JanUlrich 4cdcde8fef Neuen Unify Algorithmus eingebaut 2016-04-01 16:12:30 +02:00
Florian Steurer d89d06797e isInSolvedForm(), Unit-Tests, removed PairOp.Equals 2016-03-31 22:09:46 +02:00
i13026 336dc52be6 Merge branch 'bytecode' of ssh://i13026@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode 2016-03-31 18:09:16 +02:00
i13026 098cafac00 - IdentityFieldTest erstellt 2016-03-31 18:08:48 +02:00
JanUlrich 4deb91b99f Merge branch 'bytecode' into refactoring 2016-03-31 11:50:53 +02:00
i13026 8d8e27c84c - Bugfix new Statement, Deskription darf nicht mit Semikolon enden 2016-03-31 08:52:23 +02:00
JanUlrich e2d384e7f9 Merge mit Unify und Einbinden der neuen Unifizierung. Nich lauffähige Version 2016-03-30 18:16:27 +02:00
Florian Steurer 304a5693a6 wc regeln angepasst, triviale tests fertig 2016-03-30 16:25:26 +02:00
i13026 5b07d58093 - Klassenvariable ohne Wert 2016-03-30 10:14:05 +02:00
i13026 b51079280e - New Statement, Problem Syntax des Klassennamens 2016-03-30 10:09:17 +02:00
Florian Steurer 5030410978 finitclosure tests angepasst 2016-03-29 19:07:54 +02:00
Florian Steurer 23142adc70 reduce rules 2016-03-29 17:52:38 +02:00
JanUlrich 43a8c9e647 Umstellung auf MPair beginnen 2016-03-29 13:23:15 +02:00
JanUlrich fa337c5546 Umstellung auf MPair beginnen 2016-03-29 13:23:05 +02:00
Florian Steurer 639ac8430c adapted adaptRules 2016-03-28 20:56:24 +02:00
Florian Steurer 332dd57de3 greater und testy 2016-03-28 15:00:34 +02:00
Florian Steurer ac3ce7d214 smaller 2016-03-28 11:40:21 +02:00
i13026 b4d7ab02eb - UnitTest für MultiExtends Problem
- Verhindern von doppelten Methoden von Class -> ClassGen
2016-03-28 10:33:04 +02:00
Florian Steurer 67e1c5c736 15ter testcase 2016-03-28 01:26:53 +02:00
Florian Steurer de607cfd53 noch ein smaller test 2016-03-28 01:19:57 +02:00
Florian Steurer 26cc9b85ef smalller und neue testcases 2016-03-28 01:01:46 +02:00
Florian Steurer 257edfc0b3 fc smaller test 2016-03-26 14:09:45 +01:00
Florian Steurer 5e18496847 smaller and test cases 2016-03-26 12:59:38 +01:00
Florian Steurer bbfd8699e8 smaller / smArg / grArg / TODO: greater 2016-03-26 00:03:26 +01:00
JanUlrich ad2804fab9 Umstellung auf MPair beginnen 2016-03-24 11:57:31 +01:00
JanUlrich 1e9d0517f2 Umstellung auf MPair beginnen 2016-03-24 11:57:17 +01:00
Florian Steurer a5b86dc84c freshPlaceholder / implemented funn rules 2016-03-23 11:44:31 +01:00
Florian Steurer 11bcf5735a freshPlaceholder Method // funN rules (not implemented yet) 2016-03-23 10:59:41 +01:00
Florian Steurer 88726ccb70 added funN 2016-03-23 09:45:36 +01:00
Florian Steurer 14e00913e8 application of new rules 2016-03-22 20:47:39 +01:00
Florian Steurer 0e524caae7 Added missing rules 2016-03-22 20:41:24 +01:00
JanUlrich f788b74f26 Merge mit Unify und Bytecode 2016-03-22 15:13:51 +01:00
JanUlrich 47c9be5488 Aufräumen 2016-03-22 13:17:56 +01:00
i13026 c80dc162d9 - Verhindern von der Generierung von doppelte Methoden 2016-03-20 18:55:36 +01:00
Florian Steurer 21c6aef7fd cartesische produkte überarbeitet 2016-03-20 18:05:34 +01:00
Florian Steurer 299f8f56ca added missing cases 2016-03-20 15:09:12 +01:00
JanUlrich 1f825360df Test GenerateFiniteClosure anfügen 2016-03-17 16:54:43 +01:00
Florian Steurer fa9627b883 unify case 1 2016-03-17 16:35:33 +01:00
Florian Steurer d19a79bd63 finite closure greater smaller funktioniert jetzt auch mit wildcards
(muss noch getestet werden)
2016-03-16 23:27:45 +01:00
JanUlrich 1762101330 Type Factory in unifyNew bewegen 2016-03-16 14:56:02 +01:00
JanUlrich e061dea7f5 Aufräumen SourceFile 2016-03-16 14:54:41 +01:00
JanUlrich a8d8dec899 Merge branch 'unify' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2016-03-15 13:57:21 +01:00
JanUlrich 4681b03838 Unify Paper anfügen 2016-03-15 13:26:22 +01:00
Florian Steurer 6acc3c1366 step 4 rule 1 2016-03-14 14:46:10 +01:00
Florian Steurer 863904a4e8 unifier fixed (no iterated application necessary anymore) 2016-03-14 12:59:31 +01:00
Florian Steurer 6778160315 various 2016-03-13 23:01:28 +01:00
Florian Steurer 27acee3385 standard martelli montanari unifiy fixed 2016-03-13 16:00:00 +01:00
JanUlrich b1d6b44fb9 BCEL Library aktualisiert, Stackmaptable angefügt, Tests angepasst 2016-03-10 15:28:03 +01:00
JanUlrich a4ea466fe6 Methode generiert StackMapTable 2016-02-18 18:28:08 +01:00
JanUlrich 7c00940cba Merge branch 'unify' into refactoring 2016-01-12 13:32:45 +01:00
JanUlrich b069bb7b8f StackMapTable Notizen 2016-01-12 13:32:16 +01:00
Florian Steurer bdd018d922 regel 4 für paare (a <. Theta') (funktioniert zu 99 Prozent noch nicht
richtig)
2015-12-27 15:01:59 +01:00
Florian Steurer 98cbe9b389 package rename + Mapping Klasse 2015-12-27 00:29:23 +01:00
Florian Steurer 039dd3b3f4 step 5 and 6 implemented 2015-12-26 18:49:11 +01:00
Florian Steurer 8eecda2a8f subst rule 2015-12-26 16:52:18 +01:00
Florian Steurer 3ff45a01de fixed cartesian products in step 4 2015-12-26 16:22:35 +01:00
Florian Steurer 264910bfa4 tests 2015-12-23 22:53:24 +01:00
Florian Steurer 89b53351ce martelli montanari unifikation 2015-12-23 13:25:43 +01:00
Florian Steurer ab7f56db6f martelli montanari unification (unfinished) 2015-12-21 15:44:13 +01:00
JanUlrich ac42bdf0a2 Merge mit Unify und Bytecode 2015-12-11 15:44:44 +01:00
JanUlrich cd569a8374 Fehler in AutoOverloadingVector beheben 2015-12-08 16:27:15 +01:00
JanUlrich bb165e007d Filter entfernen 2015-12-08 15:48:35 +01:00
JanUlrich 5f428894ea Merge mit bytecode 2015-12-08 13:34:16 +01:00
i13026 116232df57 AutoOverloadingVector Test hinzugefügt 2015-12-05 15:15:28 +01:00
Florian Steurer 53dd7b019e cartesian products 2015-11-27 19:52:59 +01:00
i13026 3c80cb275b Doppelte Methodengenerierungen verhindert 2015-11-27 18:10:46 +01:00
JanUlrich 1017b02704 Fehler in Bytecodegen der Methode beheben 2015-11-27 16:53:01 +01:00
i13026 f7804b754d Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode 2015-11-27 16:11:06 +01:00
i13026 dd478961e2 TypeinferenceResultSet von ClassGenerator getrennt 2015-11-27 16:10:35 +01:00
JanUlrich 141e952c7a Merge mit refactoring 2015-11-27 15:47:09 +01:00
JanUlrich 63b2224f46 Datei für Logausgabe in compileToBytecode ändern 2015-11-27 13:15:13 +01:00
i13026 8ae7bda535 Mehrere Lösungen in einer Classfile 2015-11-25 10:41:57 +01:00
i13026 a27b4f9d3b Mehrere Lösungen in einer Classfile 2015-11-25 10:23:06 +01:00
i13026 e4374c06fd Mehrere Lösungen in einer Classfile 2015-11-25 09:41:26 +01:00
i13026 8b0005ecee AuoOverloadingTest vervollständigt 2015-11-25 08:00:50 +01:00
Florian Steurer 97e0e2fc72 unifyTest 2015-11-23 01:03:01 +01:00
Florian Steurer 7ff9554d78 application of adaptRules 2015-11-23 00:15:12 +01:00
Florian Steurer 4576efe3ec implemented step 4 (some cases still missing) 2015-11-23 00:12:08 +01:00
Florian Steurer e2ba4490b1 step 4 grundgerüst 2015-11-22 21:57:16 +01:00
Florian Steurer 6fd382580a Fixed AdaptSup 2015-11-22 15:58:10 +01:00
Florian Steurer 9552831d4e AdaptExt and Sup revisit 2015-11-22 15:54:18 +01:00
Florian Steurer 3f4f2cd27b adapt revisit 2015-11-22 15:26:17 +01:00
i13026 2958c52610 NewClass Statement 2015-11-18 18:10:29 +01:00
i13026 fc03a744fe Ünnötige Tests gelöscht
Tests die noch nicht laufen können Ignoriert
2015-11-17 17:35:17 +01:00
Florian Steurer be6a719433 adaptSup + tests 2015-11-15 18:39:22 +01:00
Florian Steurer c45c426011 unifier 2015-11-15 18:09:21 +01:00
Florian Steurer ae37dd6255 fc identifier from string to type 2015-11-15 18:08:46 +01:00
Florian Steurer 480c7dca61 adaptExt + tests 2015-11-15 15:06:34 +01:00
Florian Steurer e447e1cd46 adapt + tests 2015-11-15 14:39:08 +01:00
Florian Steurer 3739747eca adapt 2015-11-14 18:51:46 +01:00
Florian Steurer 82c0736fee adapt Rule 2015-11-13 23:24:22 +01:00
Florian Steurer 8a40acb73e application of unifiers 2015-11-13 23:17:14 +01:00
Florian Steurer fd5902f6dd stricter equality condition for typeParams 2015-11-13 22:49:26 +01:00
Florian Steurer fb82d8c3eb changed typeplaceholders 2015-11-13 22:45:30 +01:00
Florian Steurer 9f37139ab3 real immutability 2015-11-13 22:45:13 +01:00
JanUlrich ed246e0f88 Fehler in NewClass und Constructor beheben 2015-11-13 16:29:41 +01:00
JanUlrich c646a34745 Fehler durch Änderung von Unify beheben. Merge mit bytecode 2015-11-13 13:11:10 +01:00
JanUlrich b8c0d87056 Unify auf commit 144c31a4cb ändern 2015-11-13 12:55:34 +01:00
JanUlrich 4c908abede NewClassCreator 2015-11-13 12:23:45 +01:00
i13026 61891177a1 BytecodeTests erweitert
ASTFacotry überarbeitet
2015-11-12 14:50:27 +01:00
i13026 dc0cf0cd34 ExtendsVectorString erweitert 2015-11-11 11:11:50 +01:00
i13026 f18fcd2b12 ExtendsVecorStringTest teilweise in ASTBytecodeTest überführt 2015-11-10 19:28:47 +01:00
i13026 ecad9e138c BytecodeTest in SourceFileBytecodeTest umbenannt
ExtendsObjectTest von SourceFileBytecodeTest zu ASTBytecodeTest überführt
2015-11-10 18:26:29 +01:00
i13026 0c63695f7b ASTBytecodeTest erstellt 2015-11-10 17:54:27 +01:00
Florian Steurer c83697dedb Unfifier 2015-11-09 14:39:26 +01:00
i13026 54a11c8779 Mehrere Lösungen in einer Class file 2015-11-09 09:38:49 +01:00
Florian Steurer 01ef0e9385 organize imports 2015-11-08 22:25:58 +01:00
Florian Steurer c1e4fce67f reduce Ext Tests 2015-11-08 22:25:23 +01:00
Florian Steurer eeba9fb734 reduceSup Test 2015-11-08 22:21:28 +01:00
Florian Steurer 7ada9cbd47 reduce 2 Test 2015-11-08 21:41:24 +01:00
Florian Steurer 176ec7b707 subst rule interface 2015-11-08 21:30:17 +01:00
Florian Steurer 777a9b5beb reduce1 and reduceEq Tests 2015-11-08 21:23:20 +01:00
Florian Steurer e695429262 reduceUpLow test 2015-11-08 17:05:35 +01:00
Florian Steurer b3514a8375 reduceUp and reduceLow tests 2015-11-08 17:02:25 +01:00
Florian Steurer 4c6c77929f erase3 test 2015-11-08 16:42:57 +01:00
Florian Steurer 2eb11748ca erase1 and erase2 tests 2015-11-08 16:29:40 +01:00
Florian Steurer 1b1fae6b13 swap rule test 2015-11-07 20:37:29 +01:00
Florian Steurer 84641d4abf application of the rules 2015-11-07 18:03:21 +01:00
Florian Steurer a263ba5fd4 reduceSup 2015-11-07 16:49:20 +01:00
Florian Steurer 4765c2afe0 smarg and grarg tests 2015-11-07 16:21:17 +01:00
Florian Steurer e49c2a35de implemented grArg and smArg 2015-11-07 14:53:23 +01:00
Florian Steurer 28e0e8e94d visitor pattern for grarg smarg 2015-11-07 14:35:54 +01:00
Florian Steurer 6b709f0198 fc smaller greater tests 2015-11-07 13:57:54 +01:00
Florian Steurer b93f1dd376 fixed greater() 2015-11-07 11:47:54 +01:00
Florian Steurer c08a8fd347 reduceExt 2015-11-07 11:41:06 +01:00
Florian Steurer 2483044e0c rules 2015-11-07 10:57:17 +01:00
Florian Steurer a86b70e672 reduce1 regel 2015-11-06 21:02:43 +01:00
JanUlrich 0048d5f305 NewStatement bytecode 2015-11-06 18:27:47 +01:00
i13026 87e49a692a Vorbereitung für "Mehrere Lösungen in einer Classfile" 2015-11-06 16:42:22 +01:00
JanUlrich a221adb28c Merge branch 'bytecode' into refactoring 2015-11-06 15:19:19 +01:00
JanUlrich 1a0c76accf Anpassungen im Test 2015-11-06 15:18:43 +01:00
Florian Steurer 92d81ac097 rules 2015-11-01 22:12:41 +01:00
i13026 947d145cf1 New Instruction implementier, ArgumentList fehlt noch 2015-10-31 18:48:46 +01:00
JanUlrich 6619b73d80 Binary2 Test ändern 2015-10-30 16:37:12 +01:00
i13026 e9607e37b1 ASTFactory createClass setzt SuperType
GenericClass erhält richtigen SuperType
Tests für ? extends und ? super angelegt
2015-10-30 12:29:43 +01:00
i13026 64dce5d814 Parent von Class ist Sourcefile 2015-10-29 17:18:15 +01:00
JanUlrich 50916b5db2 SourceFile als Parent für Class.parserPostProcessing 2015-10-29 17:00:39 +01:00
JanUlrich bdbe20552e Tests zu Bytecodegenerierung anfügen 2015-10-29 15:16:19 +01:00
i13026 f077829d30 JUnit Test für Lokale Variabeln erstellt 2015-10-28 10:48:14 +01:00
i13026 ce52fd8904 ConsoleInterface an neue CompilerApi angepasst
RefType getBytecodeSignature  unterscheidet zwischen RefType und TypePlacholder
Abstrakte ByteCodeTest Klasse um getClassLoader erweitert
Alle BytecodeTypeTests angepasst
2015-10-27 15:14:52 +01:00
i13026 12093f2fc7 Signatur ist das gleiche wie Description 2015-10-27 13:27:00 +01:00
Florian Steurer 931fb01d74 finite closure 2015-10-25 11:12:36 +01:00
Florian Steurer 11fc7a4512 . 2015-10-24 20:32:05 +02:00
Florian Steurer 5f9452cfda commenting and rule application 2015-10-24 19:46:51 +02:00
Florian Steurer 4539faf241 hashcodes and work on Mpair 2015-10-24 19:05:48 +02:00
Florian Steurer 3d38ea2e08 hashcode, equals and compareTo 2015-10-24 18:53:11 +02:00
Florian Steurer b0153be1cd . 2015-10-24 17:47:46 +02:00
i13026 52be0a1af3 Overloading Test überarbeitet 2015-10-23 19:04:13 +02:00
JanUlrich 040a1f4088 Merge mit unify 2015-10-23 18:07:37 +02:00
i13026 0dcb36f49e JavaClassName hack entfernt 2015-10-23 16:30:07 +02:00
i13026 47361ca22c Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode
# Conflicts:
#	src/de/dhbwstuttgart/syntaxtree/Class.java
2015-10-23 16:26:25 +02:00
i13026 b99f1bc3c9 JavaClassName: Hack damit Object zu java.lang.Object wird. Muss unbedingt anders gelöst werden 2015-10-23 16:23:20 +02:00
JanUlrich 36a3aeddb3 main-Methode in .jav Files möglich 2015-10-23 16:22:44 +02:00
JanUlrich ca447fd44e Merge mit unify und bytecode 2015-10-23 15:14:18 +02:00
JanUlrich 05187aa49f Merge mit bytecode 2015-10-23 14:44:55 +02:00
JanUlrich c9546d9762 Merge branch 'bytecode' into unify 2015-10-23 14:13:31 +02:00
JanUlrich eda270d451 Nachträglich Fehler beheben 2015-10-23 14:13:17 +02:00
JanUlrich 356794d753 Merge branch 'bytecode' into unify 2015-10-23 13:57:02 +02:00
JanUlrich f16171a8f6 Object zu java.lang.Object als Superklasse von Class im Standardkonstruktor ändern 2015-10-23 11:48:35 +02:00
i13026 77c06225a6 Constructor ist von Type Void 2015-10-23 10:56:56 +02:00
i13026 fab73a4d62 ASTFactory.createClass gibt eine Class statt ClassGenerator zurück 2015-10-23 10:46:55 +02:00
i13026 422f3b4144 ASTFactory createClass 2015-10-23 10:43:48 +02:00
i13026 bfb00ac1d1 ClassGenerator hat eine Map von zusätzlichen Klassen die generiert werden müssen
MyCompiler und MyCompilerApi aufgeräumt
ASTFactory Klasse angefangen
2015-10-22 20:40:33 +02:00
JanUlrich 347b06ac68 Main Test anfügen 2015-10-22 16:46:24 +02:00
JanUlrich 66b37482db Support für eindimensionale Arrays von RefTypes angefügt 2015-10-22 16:46:06 +02:00
i13026 632c2ca508 Genericklassen für Superklassen, Fieldtypes und Methodenparameter werden generiert 2015-10-20 15:58:39 +02:00
i13026 bafffe26ad Generierung von Generic Klasse auskommentiert 2015-10-20 14:07:57 +02:00
Florian Steurer edf1d817d2 implemented equal for menge 2015-10-19 11:45:49 +02:00
Florian Steurer cfc6711897 unit tests for simple types 2015-10-19 09:34:44 +02:00
Florian Steurer 9e1f417280 factories, builder and first unit test 2015-10-18 15:13:28 +02:00
Florian Steurer 4fa160529d created notes 2015-10-18 13:47:17 +02:00
Florian Steurer 7484ace724 first call to unify 2015-10-18 12:51:07 +02:00
Florian Steurer bd8a62cda7 created unit test class 2015-10-17 19:04:32 +02:00
i13026 50dda3041f Beginn der Generierung der GenericKlasse, Problem ist der Konstruktor, dieser wird auf Objekt aufgerufen und nicht auf der SUperklasse 2015-10-16 15:15:30 +02:00
i13026 6a8590ab0d FreshWildcardType muss von ObjectType ableiten, damit der Unifikationsalgorithmus funktioniert 2015-10-16 13:22:08 +02:00
i13026 1a07c186a6 generateBytecode von Class gibt eine Menge an ByteCodeResults zurück, wird benötigt um zusätzliche Klassen anzulegen 2015-10-16 10:39:34 +02:00
i13026 3a18088801 Erste Änderung an RefType
Tests für Extends angelegt
2015-10-15 22:16:18 +02:00
i13026 0a17be3c4f Abstrakter Test für BytecodeTests
TypedVectorTest angelegt: funktoniert schon
OverloadingTest angelegt: Nächstes Ziel
2015-10-15 19:12:38 +02:00
i13026 4f1c02834d Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode 2015-10-15 17:46:20 +02:00
i13026 d6fb9ff2c7 ConditionTest angelegt
ForTest gefixed
2015-10-15 17:46:13 +02:00
JanUlrich 88b1c3e57c WriteLog anfügen 2015-10-15 16:28:10 +02:00
JanUlrich a541b353cd Änderungen an IFStmt 2015-10-15 16:15:13 +02:00
i13026 f23a341d72 Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode 2015-10-15 14:55:30 +02:00
JanUlrich e104b2e379 Test anfügen 2015-10-15 13:56:12 +02:00
i13026 bcbe82c64e Tests für verschiedene Statements angelegt
If, IfElse Implementiert
Fehlende Interface Implementierungen mit NotImplementedException hinzugefügt
2015-10-13 19:25:51 +02:00
JanUlrich eb3db718ad Neue Testfälle in bytecode 2015-09-29 18:18:06 +02:00
JanUlrich 29dea524a5 Experimenteller Status. Änderungen an ClassSignatur Generierung 2015-09-29 00:28:59 +02:00
JanUlrich 1371220249 Fehler in TypeDeplyment behoben 2015-09-28 16:35:01 +02:00
JanUlrich 46291a6056 Bug 23 gefixt. 2015-09-24 15:26:34 +02:00
Pluemicke Martin f2c7d3b6fa Matrix_lambda.jav Matrix_lambdaTest.java hinzugefuegt 2015-09-23 22:33:54 +02:00
Pluemicke Martin 02b17b1a8f Test2 in Test.java hinzugefuegt 2015-09-23 22:17:41 +02:00
JanUlrich 0906fa2e9e Test angefügt 2015-09-23 17:32:21 +02:00
JanUlrich 61a4bc3cd7 Fehler in Lambda2_2 gefixt 2015-09-23 17:22:01 +02:00
JanUlrich c5f0e73e50 Identity implementiert 2015-09-23 15:30:35 +02:00
JanUlrich 99a7510810 Runnable gefixt 2015-09-23 12:48:08 +02:00
Martin Plümicke c1532ece13 Merge branch 'refactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2015-09-23 10:50:51 +02:00
Martin Plümicke 84df9bd354 Id hinzugefuegt 2015-09-23 10:48:55 +02:00
JanUlrich 86e06a6e7a Erweitern des Bytecode Gen. 2015-09-22 18:43:36 +02:00
JanUlrich 296ffbe297 Fehler in FieldDeclaration behoben. Signaturen an Methoden und Klassen angefügt 2015-09-17 20:57:33 +02:00
JanUlrich a9611fdd90 Erster zusammengehackter Stand, bei dem Runnable.jav-Test funktioniert 2015-09-16 18:45:45 +02:00
JanUlrich bfe6b03605 Umstieg auf BCEL6 SourceCode. Einführen von DHBWInstructionFactory 2015-09-10 16:21:30 +02:00
JanUlrich ccd25ab865 Bytecode erweitert. BCEL6-SNAPSHOT eingebunden. 2015-09-02 17:11:32 +02:00
JanUlrich 64bed0c60d MethodCall implementiert 2015-08-27 16:36:19 +02:00
JanUlrich 133740d1f8 Merge branch 'bytecode' into refactoring 2015-08-27 13:37:45 +02:00
JanUlrich 636149d664 Merge mit Master 2015-08-27 13:37:41 +02:00
JanUlrich d0267aa960 Bytecode erweitert 2015-08-27 13:36:14 +02:00
JanUlrich 1964a64f94 Klassen für den BCELifier anfügen 2015-08-27 12:32:07 +02:00
JanUlrich 985f3e984c Fehler in Parser behoben 2015-08-26 15:08:04 +02:00
JanUlrich 2d8adb5c69 Beginn der Implementierung von Bytecode für Lambda Expression 2015-08-26 14:48:51 +02:00
JanUlrich 8d1b2c6b82 Unify Debuoutput angefügt 2015-08-04 11:06:18 +02:00
JanUlrich ae372cdd3b merge und Timer anfügen 2015-07-22 19:56:39 +02:00
JanUlrich 70b804fc4a Zeitmessung für Clone 2015-07-16 01:35:06 +02:00
Martin Plümicke fbc1bc5b5b Cloner durch Unify.deepClone in UndMenge.java ersetzt 2015-07-16 01:16:06 +02:00
JanUlrich 3601d11b0b Fehler in deepCopy behoben 2015-07-15 17:09:49 +02:00
JanUlrich 6321f1308d Nicht mehr im Subst, sondern vorm Subst klonen 2015-07-15 11:50:10 +02:00
JanUlrich c7ffabe0f0 Im Unify wird nur noch bei SUBST deepCopy angewendet. Timer implementiert zum ermitteln der Zeitaufwendungen der einzelnen Schritte im Algorithmus 2015-07-14 18:43:54 +02:00
JanUlrich e891551b4e Merge mit bytecode 2015-07-14 14:51:15 +02:00
JanUlrich 97cb020d45 Bytecode Tests anfügen 2015-07-14 14:49:46 +02:00
JanUlrich 44599246b2 FunVoidN einführen 2015-07-08 17:46:54 +02:00
JanUlrich 4f9b4c0e16 Merge mit Master 2015-07-08 16:54:39 +02:00
Fütterling, Franziska (WWI2012D) 172ea3fbee GenCode: Lambda theorethisch korrekt, hängt aber noch an einer
unbekannten NullPointerException
2015-07-08 16:43:10 +02:00
JanUlrich 2b12767764 BCEL 6.0 SNAPSHOT angefügt 2015-07-08 15:48:32 +02:00
Fütterling, Franziska (WWI2012D) 3111d51005 GenCode: Versuch LambdaExpression umzusetzen, scheitert aber bislang an
nicht importierbaren Klassen aus BCEL
2015-07-08 15:00:47 +02:00
JanUlrich 38176163d5 .log-Dateien zu gitignore hinzufügen. Filter in Unify verbessern 2015-07-08 14:23:29 +02:00
JanUlrich c3a8567e3f Filter in Unify zw. Schritt 4 und 5 einfügen 2015-07-08 10:37:26 +02:00
JanUlrich 59b574f040 Fehler in PostIncrement/UnaryExpression behoben 2015-06-26 19:42:25 +02:00
JanUlrich 442da87f48 Debug-Code einfügen für Karthesisches Produkt in Unify 2015-06-26 12:25:46 +02:00
Schubert, Julia (WWI2012D) d2f50069d2 NewArray implementiert, scheitert daran, dass der Parser keine Array
Initialisierung annimmt.
2015-06-25 23:05:51 +02:00
Fütterling, Franziska (WWI2012D) 03b0544131 GenCode: LongLit implementiert, aufgrund von Typinferenz-Problemen nicht
testbar
2015-06-25 16:20:51 +02:00
Fütterling, Franziska (WWI2012D) 5f6525db19 GenCode: FloatLit implementiert, aufgrund von Typeinferenz-Problemen
nicht testbar.
2015-06-25 16:12:18 +02:00
Fütterling, Franziska (WWI2012D) ea2aa91761 GenCode: DoubleLiteral implementiert. Aufgrund von Typinferenz-Problemen
kann ein erfolgreicher Test-Run nicht konsisten repliziert werden.
2015-06-25 16:01:24 +02:00
Fütterling, Franziska (WWI2012D) cef7c777b2 GenCode: StringLit erfolgreich getestet - Strings werden in dynamisch
in den Konstantenpool geschrieben und ausgelesen
2015-06-25 15:49:22 +02:00
Fütterling, Franziska (WWI2012D) d50206a519 GenCode: Assign kann nun zwischen Int und String switchen.
StringLit-Test ergab, dass es - wie befürchtet - Probleme mit der
korrekten Vergabe von Indizes gibt.
2015-06-25 15:35:13 +02:00
Fütterling, Franziska (WWI2012D) 5fbb4f0d61 GenCode: Reupload StringLiteral aufgrund von Merge-Problemen 2015-06-25 15:19:30 +02:00
Fütterling, Franziska (WWI2012D) b4d9cfbe0c GenCode: Reupload Assign Type-Switch wegen Mergeproblemen 2015-06-25 15:18:14 +02:00
Fikus, Evelyn (WWI2012D) 6dd922a263 Testcode umgeschrieben 2015-06-25 14:29:16 +02:00
Fütterling, Franziska (WWI2012D) c7bed0fa0e GenCode: PostIncrement umgesetzt, aufgrund von Problemen bei der
TypInferenz aber nicht testbar. Vermutlich muss der Counter/Index der
Variablen noch weiter angepasst werden.
2015-06-25 14:27:18 +02:00
Fütterling, Franziska (WWI2012D) 8bc2867eb7 GenCode für CharLiteral, momentan aufgrund einer Parser-NPE nicht
lauffähig
2015-06-23 20:28:36 +02:00
Fütterling, Franziska (WWI2012D) d028f7f14a GenCode: Assign ist jetzt dynamisch für mehrere Variablen - Anpassung
für verschiedene Typen potentiell nötig
2015-06-23 20:01:06 +02:00
Fütterling, Franziska (WWI2012D) c00e61eae6 Verbesserung von Assign: sollte jetzt auch mehrere Variablen korrekt
abspeichern - allerdings entsteht im class-File nur eine einzige.
Problem in IntLiteral etc.?
2015-06-23 16:54:22 +02:00
Schubert, Julia (WWI2012D) acdc36d23f BoolLiteral implementiert 2015-06-23 00:23:14 +02:00
Fütterling, Franziska (WWI2012D) 93f4257cdc Assign und LiteralInt enthalten eine funktionierende GenCode-Methode,
Anpassungen für mehrere Variablen evtl. nötig
2015-06-22 23:53:29 +02:00
Schubert, Julia (WWI2012D) fe960b3fe0 Object in void geändert in BoolLit 2015-06-22 16:55:11 +02:00
Fikus, Evelyn (WWI2012D) a901dd6b38 Merge branch 'bytecode' of
ssh://seminar@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into
bytecode
2015-06-22 16:51:52 +02:00
Fikus, Evelyn (WWI2012D) cd8b85cc41 Probleme beim Pull, Versuch zu Committen bevor pull 2015-06-22 16:51:13 +02:00
Fütterling, Franziska (WWI2012D) 2820e4e5c6 Merge branch 'bytecode' of
ssh://seminar@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into
bytecode
2015-06-22 16:49:59 +02:00
Fütterling, Franziska (WWI2012D) d9a08820e8 Idee zu Return createReturn 2015-06-22 16:47:19 +02:00
Fütterling, Franziska (WWI2012D) 1cd1aa7a50 Änderung an StringLitTest.jav -> jetzt return void 2015-06-22 16:42:03 +02:00
Schubert, Julia (WWI2012D) 39580fc15e Testcode für BoolLit geschrieben 2015-06-22 16:30:11 +02:00
Schubert, Julia (WWI2012D) 68aa427220 BCEL Test für BoolLit 2015-06-22 16:26:18 +02:00
Fikus, Evelyn (WWI2012D) 8da8eb7d28 Neuer Versuch StringLiteral 2015-06-22 16:22:12 +02:00
Fütterling, Franziska (WWI2012D) 5da4ed534d Erneuter Assign-Commit aufgrund von merge-Problemen 2015-06-22 16:14:45 +02:00
Fikus, Evelyn (WWI2012D) ad0e8643ec Update StringLiteral; Test läuft allerdings nicht durch 2015-06-22 15:18:11 +02:00
Fikus, Evelyn (WWI2012D) 614607e803 Weiterer bcel Versuch StringLiteral 2015-06-22 15:08:30 +02:00
Fikus, Evelyn (WWI2012D) 09a447cc48 Versuch bcel für StringLiteral 2015-06-22 14:49:22 +02:00
Fikus, Evelyn (WWI2012D) d96b36c5d1 Assign.java genByteCode Methode angefügt (noch leer) 2015-06-22 12:55:21 +02:00
Martin Plümicke 99c719251d Null eingefuegt 2015-06-18 12:34:09 +02:00
Pluemicke Martin 7530e01ea9 Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into bytecode 2015-06-18 11:19:00 +02:00
Pluemicke Martin 6a5876d10b kleine Aenderungen 2015-06-18 11:18:56 +02:00
Martin Plümicke c7a77c0646 Weitere Testfaelle 2015-06-18 11:17:42 +02:00
JanUlrich 24671ceca4 EmptyClass Test funktionsfähig 2015-06-17 12:03:54 +02:00
JanUlrich bfac3c8145 Fehler in SuperCall beheben. StandardKonstruktor enthält nun SuperCall 2015-06-17 11:08:50 +02:00
JanUlrich 2c4f735935 ConstraintType entfernt. Constructor erbt jetzt von Methode. Fehler in Constructor.pareserPostProcessing behoben 2015-06-16 22:08:17 +02:00
JanUlrich 302d7d05f3 Merge branch 'bytecode' into refactoring 2015-06-16 17:44:45 +02:00
JanUlrich 1c2ac73dbd Standardkonstruktor enthält nun SuperCall 2015-06-16 17:44:27 +02:00
JanUlrich 4191c8d8b2 Merge 2015-06-16 15:04:38 +02:00
Fikus, Evelyn (WWI2012D) c9f1dd2449 Überall genByteCode Methode deklarieren, sodass Fehler verschwinden.
Korrektur Method.java und Constructor.java
2015-06-16 14:58:27 +02:00
Fikus, Evelyn (WWI2012D) 253ba6518b Versuch, MethodGen in Method.java zu implementieren 2015-06-16 14:23:32 +02:00
JanUlrich 3be6aef821 Merge 2015-06-16 14:23:01 +02:00
JanUlrich 62a1a9b871 Constraint Type gelöscht 2015-06-16 14:22:13 +02:00
Fikus, Evelyn (WWI2012D) c6502600cc Weitere Überlegung im Bereich Constructor / Method 2015-06-16 13:53:32 +02:00
Fikus, Evelyn (WWI2012D) e9c6170d15 Iteration über Statements innerhalb method.java 2015-06-16 13:19:01 +02:00
Fikus, Evelyn (WWI2012D) 2fac549cf5 Zusätzliche Kommentare und geringfügige Änderungen in der Überlegung 2015-06-16 13:08:11 +02:00
Fikus, Evelyn (WWI2012D) 1d9f58b196 Notizen und Codeschnipsel GenByteCode 2015-06-16 11:55:29 +02:00
JanUlrich 76b575fedc Kommentar 2015-06-10 14:12:32 +02:00
JanUlrich aa5bb3c073 Fehler im Parser behoben: castexpression und primitive Typen entfernt 2015-06-10 13:17:06 +02:00
JanUlrich 21cf019ac4 Unnötige Typen gelöscht. char, int, bool, etc. Können vom Unify-Algorithmus nicht verwertet werden 2015-06-10 11:36:40 +02:00
JanUlrich 356a229573 ConstraintsSet überarbeitet 2015-06-03 14:10:34 +02:00
JanUlrich 6bb01f012f ConstraintsSet überarbeitet 2015-06-03 14:10:12 +02:00
JanUlrich e6606d08ee ConstraintPair erbt von Pair 2015-06-03 11:27:39 +02:00
stan f3a324fb38 genByteCode für Constructor implementiert. Unfertig 2015-05-27 15:57:15 +02:00
JanUlrich 6030682400 Test für Bytecode anfügen. Beispielhaft generateBytecode-Methode in MyCompiler implementiert 2015-05-27 12:53:47 +02:00
JanUlrich 8692a01c50 BCEL-Library anfügen und Compliance auf Java 8 erhöhen 2015-05-26 21:45:47 +02:00
JanUlrich 15e9fb44b8 Trennung von KomplexeMenge und COnstraintsSet. Experimenteller Zustand 2015-05-26 21:43:05 +02:00
JanUlrich 2b6ffdef11 Java Compliance auf JRE 8 erhöhen 2015-05-26 10:13:35 +02:00
JanUlrich a6d9fdcafd BCEL-Library zu /lib/ hinzufügen 2015-05-25 19:11:40 +02:00
JanUlrich 91360af27c Merge branch 'bytecode' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-05-25 18:47:34 +02:00
Fikus, Evelyn (WWI2012D) a94d7326b1 Kleiner Formfehler korrigiert 2015-05-22 13:54:46 +02:00
Fikus, Evelyn (WWI2012D) 57350e2095 Fertige class.java ByteCode Generierung 2015-05-22 13:50:43 +02:00
Fikus, Evelyn (WWI2012D) 2b62ac43e6 21.05.15 - Konferenz Call; Class.java GenByteCode Methode - Zusatz:
Rückgabewert sollte ByteCode sein; Entsprechend muss ähnlich
JavaCodeResult Klasse eine ByteCodeResult Klasse erstellt werden...
2015-05-21 17:10:04 +02:00
JanUlrich 19d0198d2a Unify Test 2015-05-20 15:20:56 +02:00
JanUlrich fcac7fb04f toString() für OderMenge implementieren 2015-05-20 15:20:25 +02:00
JanUlrich 035851ba79 Änderungen am Logger. + Test für Filte im Unify. 2015-05-20 14:59:28 +02:00
JanUlrich 4833bfd09b Cloning Library anfügen 2015-05-13 13:59:10 +02:00
JanUlrich 28a51e0ede Javadoc anfügen 2015-05-12 19:57:14 +02:00
JanUlrich 6fc412d949 Revert "Merge branch 'bytecode'"
This reverts commit 711c0d2f79, reversing
changes made to 2b47b8e5bf.
2015-05-12 19:54:34 +02:00
JanUlrich 711c0d2f79 Merge branch 'bytecode' 2015-05-12 19:50:52 +02:00
JanUlrich 2b47b8e5bf Javadoc generieren und Aufräumen: Sämtliche codegen-Methoden und Hilfsklassen zu Generierung von Bytecode löschen. Unnötige Tests entfernen. ANTLR-Package entfernen 2015-05-12 19:49:27 +02:00
JanUlrich ae40372a8b Encoding auf UTF-8 geändert 2015-05-12 14:57:12 +02:00
JanUlrich 76ee7bb549 Veraltete Javadoc gelöscht 2015-05-12 11:40:29 +02:00
JanUlrich f5ef7bd3f5 Merge branch 'master' into bytecode 2015-05-07 14:41:31 +02:00
JanUlrich 5e5a17b265 toString zu UndMenge hinzugefügt 2015-05-07 14:41:13 +02:00
JanUlrich d343c27edb Logger angepasst. MyCompiler.getAPI erfordert nun einen Logger als Parameter. Filterung im Unify eingefügt. 2015-05-07 01:01:39 +02:00
JanUlrich 1cb335b46b ConstraintsSet umgebaut in eine KomplexeMenge von Pairs 2015-04-28 15:27:16 +02:00
JanUlrich 7ba9688702 Menge eingeführt und dadurch Vector abgelöst. KomplexeMenge eingeführt, ConstraintSet baut nun darauf auf 2015-04-22 21:40:22 +02:00
JanUlrich 144c31a4cb Bei der Generierung der FiniteClosure werden nun Beziehungen zu Superklassen, welche Importiert wurden, korrekt angefügt 2015-04-08 21:23:28 +02:00
Martin Plümicke c080f452ae Bug 18: ? ext/sup ty1 = ? ext/sup ty2 wird reduziert zu ty1 = ty2 2015-04-01 01:28:15 +02:00
JanUlrich f66150a1e7 Testfälle angepasst. 2015-03-31 17:29:29 +02:00
JanUlrich 1d7074f1c6 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-03-31 16:45:54 +02:00
Martin Plümicke a2997fdd6b Bug 16: wieder zurueckgenommen, Zusammenhangskomponenten wieder raus 2015-03-31 16:45:22 +02:00
JanUlrich 565fd1ba0c bin-Verzeichnis auf gitignore setzen 2015-03-31 16:25:34 +02:00
JanUlrich af7d478b84 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-03-31 16:19:48 +02:00
JanUlrich 03753d68b9 Aufräumen 2015-03-31 15:24:30 +02:00
JanUlrich b2f742033b Aufräumen: Statt getTypeFor wird nun nur noch TYPE aufgerufen. Die Constraintbildung in der LambdaExpression wurde geändert. Siehe Bug #12 2015-03-31 12:37:45 +02:00
Martin Plümicke 67b6d29ce8 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-03-12 12:30:20 +01:00
Martin Plümicke 385423092a Fuer TPH <. Ty' hinzugefuegt: ? ext Ty <. Ty' 2015-03-12 12:29:54 +01:00
JanUlrich 2c6bce344d TYPE erstellt bei LambdaExpression nun zwei constraints, falls die Parameter/RetType nicht vom Typ ? extends sind. Dann werden die Constraints einmal mit dem eigentlichen Typ T und einem ? extends/super T -Typ generiert 2015-03-12 12:27:43 +01:00
JanUlrich c53eff4f2c Merge branch 'refactoring' 2015-03-11 16:37:00 +01:00
Martin Plümicke 8cc1c79c67 ? ext Ty <. TPH in Unify eingefuegt 2015-03-11 16:36:05 +01:00
JanUlrich 7f2d64e73b Änderung an der Constraint Erstellung für LambdaExpressions 2015-03-11 12:39:08 +01:00
JanUlrich 3b258c3880 Object Type implementieren 2015-03-11 11:54:42 +01:00
Martin Plümicke 40bfc79948 ObjectType als Supertype von RefType, GTV und TPH eingefuegt, einige Fehler muessen noch geloest werden 2015-03-10 22:48:29 +01:00
Pluemicke Martin 6a47dfaf58 nicht lauffaehige Version 2015-03-10 22:32:29 +01:00
JanUlrich 3d2dbc8709 ObjectType eingeführt. Es muss noch Unify angepasst werden 2015-03-10 12:38:18 +01:00
JanUlrich 324fb27b6d ObjectType eingeführt. Es muss noch Unify angepasst werden 2015-03-10 12:33:52 +01:00
Dr. Martin Pluemicke f2bc4f0ffa TPH <. ? super Ty reduziert auf TPH <. Ty eingefuegt, damit BUG 7 geloest 2015-03-05 16:37:45 +01:00
Dr. Martin Pluemicke 549640dfc4 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-03-05 13:58:50 +01:00
JanUlrich 90e4c3bc96 Doku erweitert 2015-03-05 13:56:42 +01:00
Dr. Martin Pluemicke 7889783e8a Unify Bugfix Bug 5 geloest und fuer TypVar <. RefType: ? extends Ty <. RefType eingefuegt 2015-03-05 13:55:21 +01:00
JanUlrich e8538be1c2 Fehler in Umwandlung von GTV zu TPH beheben 2015-03-04 13:50:09 +01:00
JanUlrich 1ec9c3f67f Fehler in Umwandlung von RefType zu GTV in BoGTV beheben 2015-03-03 18:24:14 +01:00
JanUlrich 618847bf4f Fehlende Umwandlung von RefType zu GTV in Wildcard-Types implementieren 2015-03-03 16:59:00 +01:00
JanUlrich 0674de12c6 Overloading-Algorithmus in Klasse MethodCall auslagern 2015-03-03 11:37:04 +01:00
JanUlrich 8e59e46d57 Overloading-Algorithmus in Klasse MethodCall auslagern 2015-03-03 11:34:42 +01:00
JanUlrich a8a7ad564b Super-Aufruf implementieren 2015-02-26 17:46:04 +01:00
JanUlrich 4fd30850b5 ThisCall und SuperCall anfügen 2015-02-26 17:41:29 +01:00
JanUlrich 37e55490e1 Fehler beheben. Hat FunN den Rückgabetyp void, so wird kein ? extends void generiert 2015-02-26 16:57:43 +01:00
JanUlrich 1941fa5d64 this()-Aufruf anfügen 2015-02-26 15:50:23 +01:00
JanUlrich 5455ba803e Fehler in TYPE-Methode von Constructor beheben 2015-02-25 18:51:48 +01:00
JanUlrich da70abf954 Tests anfügen. Probleme mit Constructor beheben. 2015-02-25 18:29:44 +01:00
JanUlrich 9e99a5b20b This()-Aufruf anfügen. Änderungen an Constructor vornehmen. Keine lauffähige Version 2015-02-25 16:34:29 +01:00
JanUlrich 9261518e5a Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-02-25 13:04:26 +01:00
Dr. Martin Pluemicke c315def167 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-02-25 12:05:05 +01:00
Dr. Martin Pluemicke 748a38833d Bug fix in Unify Zeile 1339 Typecast vom 1. aufs 2. Argument verschoben. 2015-02-25 12:04:13 +01:00
JanUlrich 20b1632319 Testfälle ausgebessert 2015-02-25 11:33:06 +01:00
JanUlrich 16dd89376c GTVDeclarationContext angefügt. Dadurch Fehler beim Umwandeln von GTZ in TPH behoben 2015-02-24 17:06:14 +01:00
JanUlrich dc7d23d699 Testfälle anfügen 2015-02-24 15:26:36 +01:00
JanUlrich d72a803027 Dokumentation angefangen 2015-02-24 15:26:19 +01:00
JanUlrich dc6cd6cdd0 FieldDeclaration wurde der Typ in der TYPE methode nicht angepasst. Fehler behoben 2015-02-24 15:25:56 +01:00
Martin Plümicke 4e61ba736d alle Faelle P.OperatorSmallerExtends eingefuegt 2015-02-17 23:23:02 +01:00
Pluemicke Martin acd20842e2 oderConstraints.filterWrongConstraints(unifier); oderConstraints.unifyUndConstraints(unifier); auskommentiert 2015-02-17 22:12:31 +01:00
Pluemicke c366ef05f5 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-02-11 14:41:55 +01:00
Pluemicke 6664b819d9 Zugrifssberechtigung 2015-02-11 14:41:27 +01:00
JanUlrich 621f1c860f Karthesisches Produkt wird leer, falls einer der Teilmengen leer ist 2015-02-11 14:35:37 +01:00
Martin Plümicke 7a61324c9f ? ext/super TPH <?/= RefType/GenType und RefType/GenType <?/= ? ext/super TPH eingefuegt nicht alle Faelle getestet 2015-02-08 19:19:30 +01:00
Martin Plümicke 267083fbb4 debug Ausgabe korriegiert! 2015-02-07 15:19:10 +01:00
JanUlrich fed7519f84 Tests anfügen 2015-02-06 15:41:24 +01:00
JanUlrich 0922b9e899 Änderungen an Testfiles und Logger 2015-02-06 15:41:01 +01:00
JanUlrich f9bfe6fb44 Test geändert 2015-02-03 15:58:04 +01:00
Martin Plümicke 57f35605f6 In Unify.subunify bei P.OperatorEqual() Wildcards loeschen 2015-02-03 14:01:04 +01:00
Martin Plümicke b4c0b17cf4 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-02-03 12:26:03 +01:00
Martin Plümicke 56f69727eb In Unify.greater1 alle Bounds einer BGTV als groesserer Typ hinzugefuegt 2015-02-03 12:25:45 +01:00
JanUlrich 8aa106b38a Falsche Übernahme von BoGTV im Konstruktor von Class beheben 2015-02-03 12:24:40 +01:00
JanUlrich de4cfa2656 BoGTV fügt keine Constraints mehr hinzu. Test angefügt 2015-02-03 11:20:05 +01:00
Martin Plümicke 69bd1510ec Unify.subunify Kommentare eingefuegt 2015-01-31 14:21:02 +01:00
Martin Plümicke 1b1a690212 Unify.subunify wildcards werden entfernt, wenn sie auf beiden Seiten identisch sind 2015-01-30 16:12:25 +01:00
JanUlrich a549843f05 GenTypeTest anfügen 2015-01-30 15:37:27 +01:00
Martin Plümicke 1369161f12 Wildcard Unifikation 2015-01-30 13:52:17 +01:00
JanUlrich 91b4ff4c2f Fehler in GenericVarTest beheben 2015-01-30 13:23:29 +01:00
JanUlrich 03d1727cbf Unnötige GenericVariables nicht mehr einfügen 2015-01-28 01:26:42 +01:00
JanUlrich a579bb964f Testfälle anfügen 2015-01-27 11:10:16 +01:00
JanUlrich 6e6908d460 Fehler in parserPostProcessing behoben 2015-01-23 16:49:09 +01:00
JanUlrich 99d3ecf030 Fehler behoben, Fehler behoben, Fehler behoben. 2015-01-23 15:28:15 +01:00
JanUlrich 615d2c633e Fehler beheben 2015-01-23 13:31:52 +01:00
JanUlrich c58d706c01 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-01-20 18:33:16 +01:00
JanUlrich f1171210bc Kleine Änderungen, Fehlerbehebung 2015-01-20 18:32:51 +01:00
Dr. Martin Pluemicke cbafe352c9 Kommentar in Unify fuer weitere Arbeiten eingefuegt 2015-01-20 18:24:58 +01:00
JanUlrich d7bb282d0f Fehler behoben 2015-01-20 16:56:53 +01:00
Dr. Martin Pluemicke ffdffa8371 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-01-20 14:40:57 +01:00
Dr. Martin Pluemicke e9b2564484 Unify.java: in subst rekursiver Aufruf fuer Wildcardargumente eingefuegt 2015-01-20 14:40:05 +01:00
JanUlrich 24caa58998 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-01-20 13:36:15 +01:00
JanUlrich 3a58694a02 Einsetzen von Generischen Variablen angepasst 2015-01-20 13:35:56 +01:00
Dr. Martin Pluemicke 9ebe0d3850 Merge branch 'refactoring' 2015-01-20 11:54:32 +01:00
Martin Plümicke 6c4090bc4b in Subst = in &= umgeaendert 2015-01-18 23:22:32 +01:00
Martin Plümicke 56c5ec7e18 Bug in subst in Unfify.java gepatched 2015-01-16 22:02:05 +01:00
JanUlrich 7d4009b6ae parser.jay Fehler beheben 2015-01-16 14:48:20 +01:00
Martin Plümicke b910584c29 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2015-01-16 14:04:49 +01:00
Martin Plümicke 6057bc72a5 jay.darwin aktualisiert 2015-01-16 14:03:29 +01:00
JanUlrich 7ef990ef08 merged 2015-01-04 23:29:56 +01:00
JanUlrich b44584bc7e Tests angefügt 2015-01-04 19:34:23 +01:00
JanUlrich f20b978b14 Kleine Anpassungen 2015-01-04 19:30:37 +01:00
Pluemicke Martin 18c9464a1e Pfad von forschung aus ResearchPapers angepasst 2015-01-02 16:21:20 +01:00
Martin Plümicke e49a8463b8 merge conlict in bin/.gitignore behoben 2015-01-02 16:13:03 +01:00
Martin Plümicke a22f8c98cf merge conlict in bin/.gitignore behoben 2015-01-02 15:59:22 +01:00
Martin Plümicke e8b03d5717 Pfad in Bytecode/Classfile angepasst 2015-01-02 15:54:59 +01:00
Martin Plümicke 5b9cabb3e1 Wildcards im Subst im Unify eingefuegt Kommentare 2014-12-05 17:47:34 +01:00
JanUlrich 66da1d2638 merge 2014-12-05 17:27:17 +01:00
Martin Plümicke 4046066b7c Wildcards im Subst im Unify eingefuegt 2014-12-05 17:25:46 +01:00
JanUlrich 09d1acab93 Testfälle angefügt 2014-12-05 17:11:22 +01:00
Martin Plümicke 9861fb2f3b Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2014-12-05 16:40:56 +01:00
Martin Plümicke aca4ee05a0 Bytecode ergaenzt 2014-12-05 16:38:32 +01:00
JanUlrich e6ca6fefa2 Fehler in Karthesischem Produkt behoben 2014-11-20 02:13:01 +01:00
JanUlrich d41d3293aa Debugausgaben eingeschränkt 2014-11-04 17:01:35 +01:00
JanUlrich c1947e0810 Merge mit Änderungen am Unify 2014-11-04 13:51:48 +01:00
JanUlrich 4401414b67 Anderen Logger angefügt 2014-11-04 13:47:31 +01:00
JanUlrich 1cb66d4f88 Umstellung auf anderen Logger 2014-11-04 13:47:05 +01:00
Martin Plümicke da70cad512 Unifyaufruf aufgeteilt in Zusammenhangskomponenten in Sourcefile.java 2014-11-03 10:40:28 +01:00
JanUlrich aeef4aed34 .classpath angepasst 2014-10-13 10:42:14 +02:00
JanUlrich 36efc62cc9 Merge branch 'refactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2014-10-13 10:39:34 +02:00
JanUlrich c62c31db6d Kleine Änderungen am Logger 2014-10-13 10:39:14 +02:00
Dr. Martin Pluemicke 3ae2d8cfa1 ANTLR Library hinzugefuegt 2014-10-09 18:05:15 +02:00
pl 80e286b05a Merge branch 'refactoring' of ssh://pl@gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2014-10-09 17:47:49 +02:00
JanUlrich b31f770fe3 Logger angefügt 2014-10-09 17:38:29 +02:00
JanUlrich 1141417c0b Weitere Aussonderung von Constraints durch Unify 2014-10-09 17:38:10 +02:00
JanUlrich 8723ced9b0 Merge branch 'refactoring' into bytecode 2014-10-09 13:54:55 +02:00
JanUlrich efa79da5d5 filterUndConstraints 2014-10-09 13:54:44 +02:00
JanUlrich 4e394ae12c Neuer Testfall angefügt 2014-10-09 12:01:41 +02:00
JanUlrich 26f35cfeb6 Logger angefügt 2014-10-09 12:01:16 +02:00
JanUlrich 2b33576488 Finite Closure ohne Subtypes. checkType statt TYPE 2014-10-08 19:00:17 +02:00
JanUlrich 51e0d96174 Reduziertes Testbeispiel angefügt 2014-10-07 17:47:59 +02:00
JanUlrich 383e5bd883 NullPointerException in Unify beseitigt 2014-10-07 17:47:23 +02:00
JanUlrich 81416b8bf4 Richtiger Import von Generischen Typen aus der JRE 2014-10-07 15:36:18 +02:00
JanUlrich 3db9b069c7 makeBasicAssumptions verbessert. Nimmt auch nun die Superklassen der BasicAssumptions auf 2014-10-07 10:47:52 +02:00
JanUlrich 37923779b1 In der FC_TTO werden keine T <. T Constraints mehr aufgenommen 2014-10-07 09:20:35 +02:00
JanUlrich 0fc7e18935 Merge branch 'antlr' into refactoring 2014-10-06 14:56:16 +02:00
JanUlrich ab20e2c5e8 FC enthält Supertklassen 2014-10-01 17:13:08 +02:00
JanUlrich 4c9d696905 FC enthält superklassen 2014-10-01 17:12:16 +02:00
Dr. Martin Pluemicke e9b7fdc139 Merge branch 'refactoring' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore into refactoring 2014-09-18 16:34:13 +02:00
Dr. Martin Pluemicke b74f25552e neu 2014-09-18 16:33:50 +02:00
JanUlrich d636d29ab5 Problem mit der Umwandlung von generischen Variablen zu TPH behoben (noch nicht vollständig) 2014-09-18 16:26:02 +02:00
JanUlrich 7abb1f8ad6 Antlr Test angefügt 2014-09-16 17:34:26 +02:00
JanUlrich 49917239c1 GenericVarDeclarationList extends SyntaxTreeNode 2014-09-16 17:34:04 +02:00
JanUlrich 18e7b68927 JavaParser fixed 2014-09-16 11:31:15 +02:00
JanUlrich 2c0ece66b9 Merge branch 'refactoring' into antlr 2014-09-15 23:38:00 +02:00
JanUlrich 199278ac8b ANTLR Test angepasst 2014-09-15 23:37:50 +02:00
JanUlrich 250b98d679 Antlr verschoben 2014-09-15 17:03:13 +02:00
JanUlrich 88a6559401 Antlr anfügen 2014-09-14 18:39:24 +02:00
JanUlrich 6505c985e0 Konstruktor von Type muss mit Elternelement im Syntaxbaum aufgerufen werden 2014-09-14 18:38:43 +02:00
JanUlrich ca8145e4a2 GenericTypeVar setParentClass entfernt 2014-09-10 23:32:36 +02:00
JanUlrich 35b12402c7 Merge branch 'refactoring' into antlr 2014-09-09 17:48:06 +02:00
JanUlrich 45ea59e7ad Fehler in get_ParaList behoben 2014-09-09 17:47:57 +02:00
JanUlrich 81d9d3ab64 Ant_build angepasst 2014-09-09 15:30:32 +02:00
JanUlrich 330451271e Kleine Änderungen 2014-09-09 14:32:53 +02:00
JanUlrich 583dfb23e3 Probleme mit GenericTypeVar behoben 2014-09-09 11:15:10 +02:00
JanUlrich 6858092ef1 Einführung von ConstraintType 2014-09-08 15:12:47 +02:00
JanUlrich 9f97bef6cd Umstrukturierung zu de.dhbwstuttgart-Packagenamen 2014-09-05 11:49:31 +02:00
JanUlrich c90f1404ab Große Umstrukturierung 2014-09-04 16:35:44 +02:00
JanUlrich 93a6070bd4 Änderungen an Testfiles 2014-09-03 16:15:04 +02:00
JanUlrich 3d88fb479b Testfile angepasst 2014-09-03 10:42:12 +02:00
JanUlrich 3232201843 Fehler in WildcardType.printJavaCode behoben 2014-09-02 18:55:54 +02:00
JanUlrich 37d33b7a31 JavaClassName implementiert 2014-09-02 18:49:19 +02:00
JanUlrich 01c6a934ed Projekt umstrukturierung 2014-09-02 11:07:16 +02:00
JanUlrich 585ca78de8 Tests angefügt 2014-09-02 10:34:06 +02:00
JanUlrich d6c75463ca Projektstruktur ändern 2014-09-02 10:33:54 +02:00
Martin Plümicke 60c515a40d Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2014-09-02 09:44:57 +02:00
Martin Plümicke b468fdf877 Test files angefuegt 2014-09-02 09:43:36 +02:00
JanUlrich 55d40d14ad UnaryExpr verändert 2014-08-28 19:05:57 +02:00
JanUlrich 25d61b703b JavaClassName eingeführt 2014-08-28 18:42:54 +02:00
JanUlrich bd74b24500 Fehler beseitigt 2014-08-28 18:42:40 +02:00
JanUlrich 5ea3d620dc Java8 ANTLR-Parser angegfügt 2014-08-22 13:10:48 +02:00
JanUlrich d39aecff4d PrintJavaCode in PostIncExpr fixed 2014-08-14 12:25:58 +02:00
JanUlrich e7034f82ce Kleine Verbesserungen 2014-08-11 14:35:33 +02:00
JanUlrich 0aa5c06b73 Wildcards werden nun auch geparst 2014-08-07 17:13:55 +02:00
JanUlrich 7ff5b6d9db makeBasicAssumptions fixed 2014-08-07 16:09:07 +02:00
JanUlrich 63a10f4775 Fehler behoben 2014-08-07 14:26:02 +02:00
JanUlrich b9dde7b015 Parser nimmt name statt simplename für Typ 2014-08-07 12:20:11 +02:00
JanUlrich 92408cfdcc Parser typename hinzugefügt 2014-08-07 12:11:18 +02:00
JanUlrich 25195440f0 Problem mit LocalVarDecl und setType behoben 2014-08-07 11:07:11 +02:00
JanUlrich eed860f43e Fehler in GTV2TPH behoben 2014-08-05 18:02:57 +02:00
JanUlrich 18b468547d RefTypes kontrollieren bei checkType nun auch Parameterliste 2014-08-05 17:57:23 +02:00
JanUlrich c35904d216 Test added 2014-08-05 16:58:26 +02:00
JanUlrich 0357dd0903 JavaCodeResult equals implementiert 2014-08-05 14:30:52 +02:00
Sascha Speidel 5c80215516 Andis letzter Stand 2014-08-05 14:24:58 +02:00
JanUlrich 69668434da Code aufgeräumt 2014-08-05 12:34:09 +02:00
JanUlrich 2925926e58 Einsetzen von GenericTypeVars an das Ende einer GenericTypeVarList verbessert 2014-07-31 15:15:33 +02:00
JanUlrich dbf493424e Fehler bei der Einsetzung von GenericVarDeclarations beheben 2014-07-23 17:24:08 +02:00
JanUlrich f51b5d5b7c Class fügt Assumptions von Paralist richtig hinzu 2014-07-17 20:17:59 +02:00
JanUlrich 038e65970c Tests anfügen 2014-07-16 18:40:03 +02:00
JanUlrich 42c47fbe86 Tests angefügt 2014-07-16 18:39:06 +02:00
JanUlrich 45d176aed2 Fehler beseitigen 2014-07-16 18:38:55 +02:00
JanUlrich 26d3a89fd9 Fixed insert Type 2014-07-16 16:50:21 +02:00
JanUlrich df67185b45 Fehler beim Umwandeln von Generischen Variablen zu TPH beseitigt 2014-07-16 16:40:49 +02:00
JanUlrich f059e0b9b8 Einsetzen von generischen Variablen verbessern 2014-07-16 14:35:12 +02:00
JanUlrich 694899e73f Einsetzen von generischen Variablen 2014-07-16 10:33:34 +02:00
JanUlrich 0327894686 Code aufgeräumt 2014-07-09 16:04:33 +02:00
JanUlrich bbb3cf76d9 Parser geändert 2014-07-09 15:07:40 +02:00
JanUlrich 053edc0f73 Merge branch 'master' into refactoring 2014-07-09 10:54:08 +02:00
JanUlrich 8c7d453472 gitignore update 2014-07-09 10:52:59 +02:00
JanUlrich 39bcd6702b Änderungen am Lexer 2014-07-09 10:52:23 +02:00
Martin Plümicke 8030b1edf9 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2014-07-09 10:49:55 +02:00
Martin Plümicke 97ec87a358 JLex geadded 2014-07-09 10:49:25 +02:00
JanUlrich d5258d2d09 Änderungen am Parser 2014-07-02 10:00:17 +02:00
JanUlrich 2ce0fd4dcd SourcePatchPoint eingeführt 2014-06-25 17:31:04 +02:00
JanUlrich edfa85df7f Einsetzen von Generics geändert. Unvollständiger Zustand 2014-06-25 17:30:31 +02:00
JanUlrich eec8e4d1a8 Generics werden eingesetzt. Unvollständiger Zustand 2014-06-20 11:18:45 +02:00
JanUlrich 1f55b81b02 Änderungen am TypeInsertSet. Momentan werden keine Generics eingesetzt 2014-06-19 19:40:13 +02:00
JanUlrich 370bb8913b TODOS bereinigt 2014-06-18 14:06:23 +02:00
JanUlrich 4000695736 BoundedGenerics werden nun auch mit einbezogen 2014-06-18 13:37:17 +02:00
JanUlrich 863f8ec2ec Problem mit Generischen Variabeln in Klassendeklarationen gelöst 2014-06-18 11:53:39 +02:00
JanUlrich 05f4dbbff3 GenericVarAssumption eingeführt 2014-06-18 11:30:14 +02:00
JanUlrich 27c4a61ed3 Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2014-06-18 09:06:25 +02:00
JanUlrich 5979835783 GenericVarAssumption eingeführt 2014-06-18 09:06:08 +02:00
JanUlrich 2151c4550b Backup 2014-06-10 20:23:01 +02:00
JanUlrich 4a67a4a58e Object wird standardmäßig importiert. TestFiles angefügt 2014-05-07 21:57:29 +02:00
JanUlrich c6ddc8036d Einsetzen von Generischen Variablen überarbeitet 2014-05-07 13:01:14 +02:00
JanUlrich ef641065e2 Backup 2014-05-07 09:36:31 +02:00
JanUlrich 5c6a61f2ef Testfiles added. Tests fixed. Operator TypeExpr fixed 2014-05-07 08:10:55 +02:00
JanUlrich ab4d26103e Tests angefügt 2014-04-28 17:21:27 +02:00
JanUlrich 6a98115361 Typen werden vor dem Unifizieren nochmals kontrolliert 2014-04-28 08:26:11 +02:00
JanUlrich 1a655943ed Test angefügt 2014-04-28 07:40:49 +02:00
JanUlrich 2511d95a9f getDescription von FormalParameter angepasst 2014-04-26 20:10:18 +02:00
JanUlrich 9aea618525 SyntaxTreeNode wird zum ermitteln der TIPs zusätzlich durchlaufen 2014-04-26 19:33:26 +02:00
JanUlrich 183d8f43ee Test angefügt. Neues Problem: Nicht alle Generischen Variablen werden eingesetzt 2014-04-26 18:30:25 +02:00
JanUlrich 64d01e8ee2 Einsetzen von generischen Typen gefixt 2014-04-26 17:41:53 +02:00
JanUlrich d053ce0b08 Test angefügt 2014-04-26 16:20:16 +02:00
JanUlrich fab7522def Fehler in Testcases behoben. RefTyp.hashCode() angefügt 2014-04-24 13:01:24 +02:00
JanUlrich e7db1e7494 Operator unterstützt jetzt auch Double und Float statt nur Integer als Typ 2014-04-24 12:42:10 +02:00
JanUlrich ce61fdf3c7 Bug-fixes; GenericTypeVar kann von mehreren Klassen per extends abhängen. 2014-04-24 01:53:35 +02:00
JanUlrich 36fd915248 weitere Testcases eingefügt 2014-04-23 17:59:59 +02:00
JanUlrich fd5aafb0eb Operator mit TypeExpr versehen 2014-04-23 17:59:39 +02:00
JanUlrich c9477705cc Typen in Parameterlisten von Lambda Ausdrücken werden nicht mehr eingesetzt 2014-04-23 15:19:56 +02:00
JanUlrich b2e79b35f3 Dateien vergessen 2014-04-23 14:36:50 +02:00
JanUlrich db4442628b Bugfix 2014-04-23 14:36:26 +02:00
JanUlrich eab2c7ef93 Neuimplementierung von automatischer Einsetzung der benötigten Generischen Variablen durch TypeInsertSet 2014-04-23 12:05:57 +02:00
JanUlrich 258c172f80 Modifikation am Parser. Auch Felder sind Generisc. 2014-04-16 17:34:35 +02:00
JanUlrich 1005dabacb GenerischeTypvariablen werden beim Einsetzen in den Quelltext mit eingesetzt 2014-04-16 16:02:16 +02:00
JanUlrich 87e4f2fd36 TypeinferenceException überarbeitet 2014-04-15 14:56:20 +02:00
JanUlrich 0345dceb8e Problem mit String Literal behoben 2014-04-15 12:07:42 +02:00
JanUlrich f0ef3017b9 Fixed Tests. Doppelte TypeAssumptions beseitigt 2014-04-14 18:05:24 +02:00
JanUlrich 61e9c953c9 fixed getChildren() 2014-04-09 15:54:20 +02:00
JanUlrich 5316b6ca51 Import Test funktioniert jetzt 2014-04-09 14:12:55 +02:00
JanUlrich 8d4213511d Backup-commit 2014-04-03 10:35:25 +02:00
JanUlrich 38f4a1351f MakeBasicAssumptionsFromJRE geändert 2014-04-01 21:38:53 +02:00
JanUlrich 8e7776dc4c GTV2TPH eingeführt. Beim Anfügen eines SingleConstraints werden GenericTypeVars nun durch Typeplaceholder ausgetauscht. 2014-03-28 18:36:08 +01:00
JanUlrich b432c74ec4 Fehler in SourceFile behoben 2014-03-27 16:51:57 +01:00
JanUlrich c65774492e Obsolete Klassen gelöscht. Alle Fehlermeldungen im src-Ordner behoben 2014-03-27 16:50:36 +01:00
JanUlrich 9784a10f84 Fehler beseitigt. wandleRefType2GenericVariables überarbeitet. getChildren()-Methode für alle Statements implementiert 2014-03-27 16:43:07 +01:00
JanUlrich b6e2d75174 FunNInterface N = 1-6 zu den BasicAssumptions hinzugefügt 2014-03-26 23:28:17 +01:00
JanUlrich 69af867293 Tests angefügt 2014-03-26 02:33:47 +01:00
JanUlrich 0e19e996c1 createTypeInsertPoint-Methode eingeführt 2014-03-25 04:41:07 +01:00
JanUlrich c738e5c0de FileOutputStream zu OutputStream geändert 2014-03-24 18:01:26 +01:00
Martin Plümicke 157c83d9a4 Anpassungen fuer jvmdisassembler 2014-03-24 15:32:13 +01:00
JanUlrich 9990892e5b Librarys pushen 2014-03-24 15:07:02 +01:00
JanUlrich fae741c658 Fehler in der TypeInsertSet.equals() methode behoben 2014-03-24 13:59:21 +01:00
JanUlrich 7031839f52 TypeInsertSet.equals() verbessert. TypinferenceResult.getTypeInsertPoints() liefert keine doppelten InsertSets mehr zurück 2014-03-21 16:34:16 +01:00
JanUlrich f16a9345eb Fehler in Overloading im Bezug auf FunNInterface behoben 2014-03-20 11:49:37 +01:00
JanUlrich ddb9ef6d7d Fehlerhaftes RefType erstellen von Klassen gefixt 2014-03-20 11:35:57 +01:00
JanUlrich 947be154ea Fehler behoben 2014-03-20 02:42:44 +01:00
JanUlrich 5b141bbb5d Merge mit master. LocalVarDecl.declType entfernt 2014-03-19 15:53:02 +01:00
JanUlrich 7defd01db8 Änderungen an typeReconstruction in SourceFile. Die Constraints aller Klassen einer SourceFile werden nun gemeinsam Unifiziert und jede Klasse aus dem SourceFile erhält das selbe ResultSet. Tests angefügt. 2014-03-19 15:14:50 +01:00
JanUlrich 38698d04fd ConstuctorAssumption angefügt 2014-03-18 20:19:13 +01:00
JanUlrich d4b9ea9a73 ConstuctorAssumption angefügt 2014-03-18 20:18:57 +01:00
JanUlrich 9d361072e3 Test angefügt 2014-03-18 14:26:07 +01:00
JanUlrich 2fb5413548 Parsen von typisierten Felddeklarationen ist jetzt möglich. 2014-03-18 14:04:31 +01:00
JanUlrich 59106a7e7b Methodenparameter können nun auch inferiert werden 2014-03-18 13:38:47 +01:00
JanUlrich 75f9a74c44 Parser tests angefügt 2014-03-17 20:05:12 +01:00
JanUlrich dbda805fa5 SyntaxTreeNode.equal verbessert 2014-03-17 17:55:55 +01:00
JanUlrich 94aae83ca8 SyntaxTreeNode.equals() implementiert 2014-03-14 16:34:25 +01:00
JanUlrich 40346b2a0b Neue Klasse für Interface eingeführt 2014-03-14 14:09:03 +01:00
JanUlrich 977e777878 Starte mit der Einführung von Interfaces 2014-03-13 01:21:52 +01:00
JanUlrich 8060278e3f Kleine Änderungen an Tests 2014-03-13 01:21:02 +01:00
JanUlrich d7e6a7848d Bytecodegenerierung angepasst. Tests erstellt 2014-03-12 18:28:30 +01:00
JanUlrich 931e90e7f2 Erster Bytecodegeneration-Test angefügt. codegen()-Methode angepasst 2014-03-12 16:32:50 +01:00
JanUlrich 5d57179364 SyntaxTreeNode.getDescription() angefügt 2014-03-12 15:27:26 +01:00
JanUlrich b29fa03782 ParameterInsertTest added 2014-03-10 15:56:17 +01:00
JanUlrich eef38bff42 MethodTypeInsertTest angefügt. TypeInsertTester verbessert 2014-03-09 14:12:48 +01:00
JanUlrich c5eb3a5711 MethodTypeInsertTest angefügt 2014-03-09 13:03:30 +01:00
JanUlrich 4786345f7b Felder (Field) müssen nun immer mit einem Offset initialisiert werden. Fehler behoben. Parser modifiziert. VariableTypeInsertTest läuft erfolgreich 2014-03-09 12:10:03 +01:00
JanUlrich 1872b8aac4 TypeInsertTests angefügt 2014-03-09 11:44:12 +01:00
JanUlrich 9ced1b4827 Funktion parse(sourceCode) angefügt. SourceFile enthält nicht mehr das Feld filename 2014-03-07 22:05:10 +01:00
JanUlrich a39a9273a1 Ä 2014-02-22 05:43:20 +01:00
JanUlrich b891ad4580 FunNMethode implementiert 2014-02-22 04:58:49 +01:00
JanUlrich 282b068552 Begeonnen mit Implementierung von getChildren() 2014-02-19 23:04:48 +01:00
JanUlrich e33b9fd76e weitere Fehler behoben 2014-02-19 17:32:43 +01:00
JanUlrich bf341ab4f3 createTypeAssumptions für Field generiert 2014-02-19 14:16:28 +01:00
JanUlrich e31725f255 Fehler in LocalVarAssumption behoben 2014-02-19 06:09:59 +01:00
JanUlrich 8d26f06092 Constructor implementiert 2014-02-19 05:20:54 +01:00
JanUlrich d397002960 Overloading an neue Assumptions angepasst 2014-02-18 17:47:40 +01:00
JanUlrich c242061541 TypeAssumptions überarbeitet. Neue AssumptionTypes angefügt. CType... Assumptions werden abgelöst 2014-02-14 17:31:55 +01:00
JanUlrich 95d7553482 InstVarDecl gelöscht. Weitere Verbesserungen. Keine Lauffähige Version 2014-02-12 22:10:33 +01:00
JanUlrich 605c554ffb parserPostProcessing implementiert 2014-02-12 02:12:12 +01:00
JanUlrich 8cbd22f562 SyntaxTreeNode angefügt. SourceFile steht nun nur noch für eine Java-Datei nicht mehr für mehrere. 2014-02-11 16:30:38 +01:00
JanUlrich 31473630f8 Backup 2014-02-11 02:47:39 +01:00
JanUlrich 7a556fbafb TPH.fresh() kann nicht mehr ohne die Übergabe eines TypeReplacementListeners erfolgen. Keine Lauffähige Version 2014-02-10 17:44:20 +01:00
JanUlrich 3cd6b2f792 Weitere obsolete Methoden entfernt. TypeInsertPoint angefügt 2014-02-10 04:25:14 +01:00
JanUlrich bda8dbe671 CTypeResultSet umbenannt und nicht gebrauchte Funktionen entfernt 2014-02-09 18:52:04 +01:00
JanUlrich 971fb4ad65 Starte mit Löschen alter Typeinferenzalgorithmen 2014-02-09 16:07:31 +01:00
JanUlrich 7ec923c4bb Stand vom 9.11.2013 angefügt 2014-02-05 13:38:34 +01:00
JanUlrich 218684dd24 Kopie aus dem CVS 2014-02-04 17:44:03 +01:00
JanUlrich 9626e0e14e gitignore added. CVS-Ordner ignorieren sowie class und package dateien 2014-02-04 17:42:14 +01:00
JanUlrich 64c652da71 Java und jav files 2013-10-18 13:33:46 +02:00
Martin Plümicke dd7d0edbfe Merge branch 'master' of ssh://gohorb.ba-horb.de/bahome/projekt/git/JavaCompilerCore 2013-01-01 02:57:01 +01:00
Martin Plümicke 47b5b2a288 1. BUG 15: TPH1 <. ? super TPH2 führt zu TPH1 <. TPH2 und zu Eq1 einzugefuegt 1. BUG 16: Unify in Zusammenhangskomponenten aufgeteit, muss wieder zurueckgenommen werden 2013-01-01 02:56:34 +01:00
2184 changed files with 449046 additions and 15888 deletions
-9
View File
@@ -1,9 +0,0 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf
# These are Windows script files and should use crlf
*.bat text eol=crlf
-9
View File
@@ -29,12 +29,3 @@ logFiles/**
src/main/java/de/dhbwstuttgart/parser/antlr/
src/main/java/de/dhbwstuttgart/sat/asp/parser/antlr/
#GRADLE
# Ignore Gradle project-specific cache directory
.gradle
# Ignore Gradle build output directory
build
+3
View File
@@ -0,0 +1,3 @@
NoOptParallel:
mvn -DskipTests package
cp target/JavaTXcompiler-0.1-jar-with-dependencies.jar target/JavaTXcompiler-0.1-jar-with-dependencies_NoOptParallel.jar
+11
View File
@@ -0,0 +1,11 @@
Stand: 24.5.21
bigRefactoring: Master-Brach
targetBytecode: Neuer Codegenerator mit generated generics Daniel
bigRefactoringUnifyComment: Dokumentation Unify, Martin
bytecodeGenericsSecond: Generated Generics, Ali, Martin
inferWildcards, Wildcards, Till
master, derzeit nicht genutzt
plugin, eigemntlicher Branch fuer Plugin-Basis, derzeit nicht aktuelle (aktuelle Version in simplifyRes
simplifyRes, Basis fuer Plugin, sollte auf Plugin gemerged werden, noch keine Packages, Michael
strucTypesNew, Struturelle Typen, alte Basis, arbeite derzeit niemand
Binary file not shown.
-53
View File
@@ -1,53 +0,0 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java application project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.6/userguide/building_java_projects.html
*/
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
antlr
application
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(19))
}
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit test framework.
testImplementation("junit:junit:4.13.2")
// This dependency is used by the application.
implementation("com.google.guava:guava:31.1-jre")
implementation("commons-io:commons-io:2.6")
implementation("org.reflections:reflections:0.9.11")
implementation("org.ow2.asm:asm:7.0")
//implementation("org.antlr:antlr4:4.11.1")
antlr("org.antlr:antlr4:4.8-1")
}
tasks.withType<JavaCompile> {
options.compilerArgs.add("--enable-preview")
}
tasks.withType<Test> {
jvmArgs("--enable-preview")
}
tasks.withType<JavaExec> {
jvmArgs("--enable-preview")
}
application {
// Define the main class for the application.
mainClass.set("de.dhbwstuttgart.App")
}
@@ -1,30 +0,0 @@
package de.dhbwstuttgart.bytecode;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr;
import de.dhbwstuttgart.syntaxtree.statement.Expression;
public abstract class AStatement implements IStatement {
protected Expression expr;
public AStatement(Expression expr) {
this.expr = expr;
}
@Override
public boolean isExprBinary() {
return (expr instanceof BinaryExpr);
}
@Override
public void genBCForRelOp(MethodVisitor mv,Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod) {
mv.visitInsn(Opcodes.ICONST_1);
mv.visitJumpInsn(Opcodes.GOTO, endLabel);
mv.visitLabel(branchLabel);
mv.visitInsn(Opcodes.ICONST_0);
mv.visitLabel(endLabel);
}
}
@@ -1,11 +0,0 @@
package de.dhbwstuttgart.bytecode;
import de.dhbwstuttgart.syntaxtree.statement.Expression;
public class ArgumentExpr extends AStatement {
public ArgumentExpr(Expression expr) {
super(expr);
}
}
@@ -1,258 +0,0 @@
package de.dhbwstuttgart.bytecode;
import java.util.List;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
import de.dhbwstuttgart.syntaxtree.statement.Assign;
import de.dhbwstuttgart.syntaxtree.statement.AssignToField;
import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr;
import de.dhbwstuttgart.syntaxtree.statement.Block;
import de.dhbwstuttgart.syntaxtree.statement.CastExpr;
import de.dhbwstuttgart.syntaxtree.statement.DoStmt;
import de.dhbwstuttgart.syntaxtree.statement.EmptyStmt;
import de.dhbwstuttgart.syntaxtree.statement.ExpressionReceiver;
import de.dhbwstuttgart.syntaxtree.statement.FieldVar;
import de.dhbwstuttgart.syntaxtree.statement.ForStmt;
import de.dhbwstuttgart.syntaxtree.statement.IfStmt;
import de.dhbwstuttgart.syntaxtree.statement.InstanceOf;
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
import de.dhbwstuttgart.syntaxtree.statement.Literal;
import de.dhbwstuttgart.syntaxtree.statement.LocalVar;
import de.dhbwstuttgart.syntaxtree.statement.LocalVarDecl;
import de.dhbwstuttgart.syntaxtree.statement.MethodCall;
import de.dhbwstuttgart.syntaxtree.statement.NewArray;
import de.dhbwstuttgart.syntaxtree.statement.NewClass;
import de.dhbwstuttgart.syntaxtree.statement.Return;
import de.dhbwstuttgart.syntaxtree.statement.ReturnVoid;
import de.dhbwstuttgart.syntaxtree.statement.StaticClassName;
import de.dhbwstuttgart.syntaxtree.statement.Super;
import de.dhbwstuttgart.syntaxtree.statement.SuperCall;
import de.dhbwstuttgart.syntaxtree.statement.This;
import de.dhbwstuttgart.syntaxtree.statement.UnaryExpr;
import de.dhbwstuttgart.syntaxtree.statement.WhileStmt;
public class ArgumentVisitor implements StatementVisitor {
private List<Boolean> argListMethCall;
private BytecodeGenMethod bytecodeGenMethod;
public ArgumentVisitor(List<Boolean> argListMethCall, BytecodeGenMethod bytecodeGenMethod) {
this.argListMethCall = argListMethCall;
this.bytecodeGenMethod = bytecodeGenMethod;
}
@Override
public void visit(ArgumentList argumentList) {
// TODO Auto-generated method stub
}
@Override
public void visit(LambdaExpression lambdaExpression) {
lambdaExpression.accept(bytecodeGenMethod);
// Zieltype des Lambas ist Funktionale Interface
// kann nie primitiv sein => un-/boxing wird hier nicht gebraucht
argListMethCall.remove(0);
}
@Override
public void visit(Assign assign) {
assign.accept(bytecodeGenMethod);
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(assign.getType()));
argListMethCall.remove(0);
}
@Override
public void visit(BinaryExpr binary) {
binary.accept(bytecodeGenMethod);
if(argListMethCall.get(0)) {
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(binary.getType()));
} else {
bytecodeGenMethod.doBoxing(bytecodeGenMethod.getResolver().getResolvedType(binary.getType()));
}
argListMethCall.remove(0);
}
@Override
public void visit(Block block) {
// TODO Auto-generated method stub
}
@Override
public void visit(CastExpr castExpr) {
castExpr.accept(bytecodeGenMethod);
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(castExpr.getType()));
argListMethCall.remove(0);
}
@Override
public void visit(EmptyStmt emptyStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(FieldVar fieldVar) {
fieldVar.accept(bytecodeGenMethod);
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(fieldVar.getType()));
argListMethCall.remove(0);
}
@Override
public void visit(ForStmt forStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(IfStmt ifStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(InstanceOf instanceOf) {
instanceOf.accept(bytecodeGenMethod);
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(instanceOf.getType()));
argListMethCall.remove(0);
}
@Override
public void visit(LocalVar localVar) {
localVar.accept(bytecodeGenMethod);
if(!bytecodeGenMethod.isBinaryExp) {
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(localVar.getType()));
}
argListMethCall.remove(0);
}
@Override
public void visit(LocalVarDecl localVarDecl) {
// TODO Auto-generated method stub
}
@Override
public void visit(MethodCall methodCall) {
methodCall.accept(bytecodeGenMethod);
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(methodCall.getType()));
argListMethCall.remove(0);
}
@Override
public void visit(NewClass methodCall) {
methodCall.accept(bytecodeGenMethod);
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(methodCall.getType()));
argListMethCall.remove(0);
}
@Override
public void visit(NewArray newArray) {
// TODO Auto-generated method stub
}
@Override
public void visit(Return aReturn) {
// TODO Auto-generated method stub
}
@Override
public void visit(ReturnVoid aReturn) {
// TODO Auto-generated method stub
}
@Override
public void visit(StaticClassName staticClassName) {
// TODO Auto-generated method stub
}
@Override
public void visit(Super aSuper) {
// TODO Auto-generated method stub
}
@Override
public void visit(This aThis) {
aThis.accept(bytecodeGenMethod);
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(aThis.getType()));
argListMethCall.remove(0);
}
@Override
public void visit(WhileStmt whileStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(DoStmt whileStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(AssignToField assignLeftSide) {
// TODO Auto-generated method stub
}
@Override
public void visit(AssignToLocal assignLeftSide) {
// TODO Auto-generated method stub
}
@Override
public void visit(SuperCall superCall) {
// TODO Auto-generated method stub
}
@Override
public void visit(ExpressionReceiver expressionReceiver) {
// TODO Auto-generated method stub
}
@Override
public void visit(UnaryExpr unaryExpr) {
unaryExpr.accept(bytecodeGenMethod);
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(unaryExpr.getType()));
argListMethCall.remove(0);
}
@Override
public void visit(Literal literal) {
literal.accept(bytecodeGenMethod);
if(argListMethCall.get(0))
bytecodeGenMethod.doUnboxing(bytecodeGenMethod.getResolver().getResolvedType(literal.getType()));
argListMethCall.remove(0);
}
}
@@ -1,11 +0,0 @@
package de.dhbwstuttgart.bytecode;
import de.dhbwstuttgart.syntaxtree.statement.Expression;
public class AssignStmt extends AStatement {
public AssignStmt(Expression rightSide) {
super(rightSide);
}
}
@@ -1,630 +0,0 @@
package de.dhbwstuttgart.bytecode;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import de.dhbwstuttgart.parser.scope.JavaClassName;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.FieldVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import de.dhbwstuttgart.bytecode.Exception.BytecodeGeneratorError;
import de.dhbwstuttgart.bytecode.descriptor.DescriptorToString;
import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor;
import de.dhbwstuttgart.bytecode.signature.Signature;
import de.dhbwstuttgart.bytecode.signature.TypeToSignature;
import de.dhbwstuttgart.bytecode.signature.TypeToString;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericGenratorResultForSourceFile;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericsGeneratorResult;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericsGeneratorResultForClass;
import de.dhbwstuttgart.bytecode.utilities.MethodUtility;
import de.dhbwstuttgart.bytecode.utilities.NormalConstructor;
import de.dhbwstuttgart.bytecode.utilities.NormalMethod;
import de.dhbwstuttgart.bytecode.utilities.Resolver;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
import de.dhbwstuttgart.syntaxtree.Constructor;
import de.dhbwstuttgart.syntaxtree.Field;
import de.dhbwstuttgart.syntaxtree.FormalParameter;
import de.dhbwstuttgart.syntaxtree.GenericDeclarationList;
import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
import de.dhbwstuttgart.syntaxtree.Method;
import de.dhbwstuttgart.syntaxtree.ParameterList;
import de.dhbwstuttgart.syntaxtree.SourceFile;
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
import de.dhbwstuttgart.syntaxtree.statement.Assign;
import de.dhbwstuttgart.syntaxtree.statement.AssignToField;
import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr;
import de.dhbwstuttgart.syntaxtree.statement.Block;
import de.dhbwstuttgart.syntaxtree.statement.CastExpr;
import de.dhbwstuttgart.syntaxtree.statement.DoStmt;
import de.dhbwstuttgart.syntaxtree.statement.EmptyStmt;
import de.dhbwstuttgart.syntaxtree.statement.ExpressionReceiver;
import de.dhbwstuttgart.syntaxtree.statement.FieldVar;
import de.dhbwstuttgart.syntaxtree.statement.ForStmt;
import de.dhbwstuttgart.syntaxtree.statement.IfStmt;
import de.dhbwstuttgart.syntaxtree.statement.InstanceOf;
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
import de.dhbwstuttgart.syntaxtree.statement.Literal;
import de.dhbwstuttgart.syntaxtree.statement.LocalVar;
import de.dhbwstuttgart.syntaxtree.statement.LocalVarDecl;
import de.dhbwstuttgart.syntaxtree.statement.MethodCall;
import de.dhbwstuttgart.syntaxtree.statement.NewArray;
import de.dhbwstuttgart.syntaxtree.statement.NewClass;
import de.dhbwstuttgart.syntaxtree.statement.Return;
import de.dhbwstuttgart.syntaxtree.statement.ReturnVoid;
import de.dhbwstuttgart.syntaxtree.statement.StaticClassName;
import de.dhbwstuttgart.syntaxtree.statement.Super;
import de.dhbwstuttgart.syntaxtree.statement.SuperCall;
import de.dhbwstuttgart.syntaxtree.statement.This;
import de.dhbwstuttgart.syntaxtree.statement.UnaryExpr;
import de.dhbwstuttgart.syntaxtree.statement.WhileStmt;
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.result.ResultSet;
public class BytecodeGen implements ASTVisitor {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
String type;
public static RefTypeOrTPHOrWildcardOrGeneric THISTYPE = null;
private JavaClassName className;
private String pkgName;
private boolean isInterface;
private Collection<ResultSet> listOfResultSets;
private ResultSet resultSet;
private SourceFile sf;
private File path;
private Optional<Constructor> fieldInitializations;
private int indexOfFirstParam = 0;
private String superClass;
private List<String> tphsClass;
// stores parameter, local vars and the next index on the local variable table,
// which use for aload_i, astore_i,...
HashMap<String, Integer> paramsAndLocals = new HashMap<>();
// stores generics and their bounds of class
HashMap<String, String> genericsAndBounds = new HashMap<>();
private int constructorPos = 0;
HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> methodParamsAndTypes = new HashMap<>();
byte[] bytecode;
HashMap<JavaClassName, byte[]> classFiles;
private final ArrayList<String> methodNameAndParamsT = new ArrayList<>();
private final ArrayList<String> fieldNameAndParamsT = new ArrayList<>();
private final ArrayList<String> fieldNameSignature = new ArrayList<>();
private List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles;
private GenericsGeneratorResultForClass generatedGenerics;
private Resolver resolver;
private final ClassLoader classLoader;
public BytecodeGen(HashMap<JavaClassName, byte[]> classFiles, Collection<ResultSet> listOfResultSets, List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles, SourceFile sf,
File path, ClassLoader classLoader) {
this.classFiles = classFiles;
this.listOfResultSets = listOfResultSets;
this.simplifyResultsForAllSourceFiles = simplifyResultsForAllSourceFiles;
this.sf = sf;
this.path = path;
this.pkgName = sf.getPkgName();
this.classLoader = classLoader;
}
@Override
public void visit(SourceFile sourceFile) {
for (ClassOrInterface cl : sourceFile.getClasses()) {
System.out.println("in Class: " + cl.getClassName().toString());
BytecodeGen classGen = new BytecodeGen(classFiles, listOfResultSets, simplifyResultsForAllSourceFiles, sf, path, classLoader);
cl.accept(classGen);
classGen.writeClass(cl.getClassName());
}
}
/**
* Associates the bytecode of the class that was build with the classWriter
* {@link #cw} with the class name in the map {@link #classFiles}
*
* @param name name of the class with which the bytecode is to be associated
*/
private void writeClass(JavaClassName name) {
bytecode = cw.toByteArray();
classFiles.put(name, bytecode);
}
public HashMap<JavaClassName, byte[]> getClassFiles() {
return classFiles;
}
@Override
public void visit(ClassOrInterface classOrInterface) {
className = classOrInterface.getClassName();
cw.visitSource(className.getClassName() + ".jav", null);
isInterface = (classOrInterface.getModifiers() & 512) == 512;
int acc = isInterface ? classOrInterface.getModifiers() + Opcodes.ACC_ABSTRACT
: classOrInterface.getModifiers() + Opcodes.ACC_SUPER;
fieldInitializations = classOrInterface.getfieldInitializations();
// resultSet = listOfResultSets.get(0);
boolean isVisited = false;
List<ResultSet> listOfResultSetsList = new ArrayList<>(listOfResultSets);
generatedGenerics = simplifyResultsForAllSourceFiles.stream().map(sr->sr.getSimplifyResultsByName(className)).findFirst().get();
for (int i = 0; i < listOfResultSetsList.size(); i++) {
//for (ResultSet rs : listOfResultSets) {
superClass = classOrInterface.getSuperClass().acceptTV(new TypeToDescriptor());
resultSet = listOfResultSetsList.get(i);
resolver = new Resolver(resultSet);
// tphExtractor.setResultSet(resultSet);
// Nur einmal ausführen!!
if (!isVisited) {
String sig = null;
/*
* if class has generics then creates signature Signature looks like:
* <E:Ljava/...>Superclass
*/
if (classOrInterface.getGenerics().iterator().hasNext() || classOrInterface.getSuperClass().acceptTV(new TypeToSignature()).contains("<")
|| !generatedGenerics.getClassConstraints().isEmpty()) {
List<GenericsGeneratorResult> consClass = generatedGenerics.getClassConstraints();
//
Signature signature = new Signature(classOrInterface, genericsAndBounds, consClass);
sig = signature.createSignatureForClassOrInterface();
System.out.println("Signature: => " + sig);
}
cw.visit(Opcodes.V1_8, acc, classOrInterface.getClassName().toString().replace(".", "/"), sig,
classOrInterface.getSuperClass().acceptTV(new TypeToDescriptor()), null);
isVisited = true;
}
for (Field f : classOrInterface.getFieldDecl()) {
f.accept(this);
}
for (Constructor c : classOrInterface.getConstructors()) {
c.accept(this);
}
for (Method m : classOrInterface.getMethods()) {
m.accept(this);
}
}
}
@Override
public void visit(Constructor field) {
// stores generics and their bounds of method
HashMap<String, String> genericsAndBoundsMethod = new HashMap<>();
field.getParameterList().accept(this);
String id = MethodUtility.createID(resolver, field);
if (methodNameAndParamsT.contains(id)) {
return;
}
methodNameAndParamsT.add(id);
System.out.println("Constructor: " + field.name + " , paramsType: " + id);
String desc = null;
boolean hasGen = false;
for (String paramName : methodParamsAndTypes.keySet()) {
String typeOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToSignature());
System.out.println(typeOfParam);
if (genericsAndBounds.containsKey(typeOfParam) || typeOfParam.contains("$") || typeOfParam.contains("<")) {
hasGen = true;
break;
}
}
String sig = null;
if (hasGen) {
List<GenericsGeneratorResult> constraints = generatedGenerics.getClassConstraints();
Signature signature = new Signature(genericsAndBounds,
methodParamsAndTypes, resultSet, constraints);
sig = signature.createSignatureForConstructor(field);
}
if (field.getParameterList().iterator().hasNext())
System.out.println(field.getParameterList().iterator().next().getType().acceptTV(new TypeToDescriptor()));
NormalConstructor constructor = new NormalConstructor(field, genericsAndBounds, hasGen);
desc = constructor.accept(new DescriptorToString(resultSet));
System.out.println("Constructor: " + field.getName() + " Sig: " + sig + " Desc: " + desc);
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", desc, sig, null);
mv.visitCode();
Block block = fieldInitializations.get().block;
constructorPos += 1;
BytecodeGenMethod gen = new BytecodeGenMethod(className, superClass, resultSet, field, mv, paramsAndLocals, cw,
genericsAndBoundsMethod, genericsAndBounds, isInterface, classFiles, sf, path, block, constructorPos, classLoader);
if (!field.getParameterList().iterator().hasNext()
&& !(field.block.statements.get(field.block.statements.size() - 1) instanceof ReturnVoid)) {
mv.visitInsn(Opcodes.RETURN);
}
mv.visitMaxs(0, 0);
mv.visitEnd();
}
@Override
public void visit(Method method) {
// TODO: check if the method is static => if static then the first param will be
// stored in pos 0
// else it will be stored in pos 1 and this will be stored in pos 0
String retType = resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
String id = MethodUtility.createID(resolver, method);
if (methodNameAndParamsT.contains(id)) {
return;
}
methodNameAndParamsT.add(id);
System.out.println("Method: " + method.name + " , paramsType: " + id);
// stores generics and their bounds of method
HashMap<String, String> genericsAndBoundsMethod = new HashMap<>();
method.getParameterList().accept(this);
String methDesc = null;
// Method getModifiers() ?
int acc = isInterface ? Opcodes.ACC_ABSTRACT : method.modifier;
System.out.println(acc);
/* Prüfe, ob die Rückgabe-Type der Methode eine Type-Variable ist */
boolean hasGenInParameterList = genericsAndBounds.containsKey(retType) || retType.contains("TPH ")
|| resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToSignature())
.contains("<");
/*
* Wenn die Rückgabe-Type eine Typ-variable ist, erzeuge direkt die Signature,
* wenn nicht, prüfe, ob einer der Parameter Typ-Variable als Typ hat
*/
if (!hasGenInParameterList) {
for (String paramName : methodParamsAndTypes.keySet()) {
String typeOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToDescriptor());
String sigOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToSignature());
if (genericsAndBounds.containsKey(typeOfParam) || typeOfParam.contains("TPH ")
|| sigOfParam.contains("<")) {
hasGenInParameterList = true;
break;
}
}
}
// TODO: Test if the return-type or any of the parameter is a parameterized
// type. (VP)
// then create the descriptor with the new syntax.
String sig = null;
/*
* method.getGenerics: <....> RT method(..)
*/
boolean hasGen = method.getGenerics().iterator().hasNext() || hasGenInParameterList;
/* if method has generics or return type is TPH, create signature */
// zwite operand muss weggelassen werden
if (hasGen || resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToString())
.equals("TPH")) {
List<GenericsGeneratorResult> constraints = generatedGenerics.getMethodConstraintsByID(id);
List<GenericsGeneratorResult> classConstraints = generatedGenerics.getClassConstraints();
Signature signature = new Signature(genericsAndBoundsMethod, genericsAndBounds,
methodParamsAndTypes, resultSet, constraints,classConstraints);
sig = signature.createSignatureForMethod(method);
}
System.out.println(method.getName() + " ==> " + sig);
NormalMethod meth = new NormalMethod(method, genericsAndBounds, genericsAndBoundsMethod, hasGen);
methDesc = meth.accept(new DescriptorToString(resultSet));
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC + acc, method.getName(), methDesc, sig, null);
mv.visitCode();
BytecodeGenMethod gen = new BytecodeGenMethod(className, superClass, resultSet, method, mv, paramsAndLocals, cw,
genericsAndBoundsMethod, genericsAndBounds, isInterface, classFiles, sf, path, classLoader);
mv.visitMaxs(0, 0);
mv.visitEnd();
}
@Override
public void visit(ParameterList formalParameters) {
paramsAndLocals = new HashMap<>();
methodParamsAndTypes = new HashMap<>();
Iterator<FormalParameter> itr = formalParameters.iterator();
int i = 1;
while (itr.hasNext()) {
FormalParameter fp = itr.next();
paramsAndLocals.put(fp.getName(), i);
methodParamsAndTypes.put(fp.getName(), resultSet.resolveType(fp.getType()).resolvedType);
fp.accept(this);
i++;
}
}
@Override
public void visit(FormalParameter formalParameter) {
formalParameter.getType().accept(this);
}
@Override
public void visit(RefType refType) {
type = "L" + refType.toString() + ";";
}
@Override
public void visit(SuperWildcardType superWildcardType) {
// TODO Auto-generated method stub
}
@Override
public void visit(TypePlaceholder typePlaceholder) {
// TODO Auto-generated method stub
}
@Override
public void visit(ExtendsWildcardType extendsWildcardType) {
// TODO Auto-generated method stub
}
@Override
public void visit(GenericRefType genericRefType) {
// TODO Auto-generated method stub
}
// ??
@Override
public void visit(FieldVar fieldVar) {
System.out.println("In FieldVar ---");
// cw.newField(fieldVar.receiver.toString(), fieldVar.fieldVarName.toString(), fieldVar.getType().toString());
FieldVisitor fv = cw.visitField(Opcodes.ACC_PRIVATE, fieldVar.fieldVarName, "L" + fieldVar.getType() + ";",
null, null);
fv.visitEnd();
}
@Override
public void visit(Field field) {
System.out.println("In Field ---");
String des = "L";
if (resultSet.resolveType(field.getType()).resolvedType instanceof TypePlaceholder) {
des += Type.getInternalName(Object.class);
} else {
des += resultSet.resolveType(field.getType()).resolvedType.acceptTV(new TypeToDescriptor());
}
des += ";";
System.out.println(des);
String sig = resultSet.resolveType(field.getType()).resolvedType.acceptTV(new TypeToSignature(generatedGenerics.getClassConstraints()));
System.out.println(sig);
if (sig.charAt(sig.length() - 1) != (";").charAt(0)) {
sig += ";";
}
String nameAndDesc = field.getName() + "%%" + des;
String nameAndSig = field.getName() + "%%" + sig;
if (fieldNameAndParamsT.contains(nameAndDesc)) {
if (fieldNameSignature.contains(nameAndSig)) {
return;
}
throw new BytecodeGeneratorError("Bytecode generation aborted due to duplicate field name&signature");
}
fieldNameAndParamsT.add(nameAndDesc);
fieldNameSignature.add(nameAndSig);
cw.visitField(field.modifier, field.getName(), des, sig, null);
}
@Override
public void visit(LambdaExpression lambdaExpression) {
// TODO Auto-generated method stub
}
@Override
public void visit(Assign assign) {
// TODO Auto-generated method stub
}
@Override
public void visit(BinaryExpr binary) {
}
@Override
public void visit(Block block) {
// TODO Auto-generated method stub
}
@Override
public void visit(CastExpr castExpr) {
// TODO Auto-generated method stub
}
@Override
public void visit(EmptyStmt emptyStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(ForStmt forStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(IfStmt ifStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(InstanceOf instanceOf) {
// TODO Auto-generated method stub
}
@Override
public void visit(LocalVar localVar) {
// TODO Auto-generated method stub
}
@Override
public void visit(LocalVarDecl localVarDecl) {
// TODO Auto-generated method stub
}
@Override
public void visit(MethodCall methodCall) {
// TODO Auto-generated method stub
}
@Override
public void visit(NewClass methodCall) {
// TODO Auto-generated method stub
}
@Override
public void visit(NewArray newArray) {
// TODO Auto-generated method stub
}
@Override
public void visit(Return aReturn) {
// TODO Auto-generated method stub
}
@Override
public void visit(ReturnVoid aReturn) {
// TODO Auto-generated method stub
}
@Override
public void visit(StaticClassName staticClassName) {
// TODO Auto-generated method stub
}
@Override
public void visit(Super aSuper) {
// TODO Auto-generated method stub
}
@Override
public void visit(This aThis) {
// TODO Auto-generated method stub
}
@Override
public void visit(WhileStmt whileStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(DoStmt whileStmt) {
// TODO Auto-generated method stub
}
// ???
@Override
public void visit(Literal literal) {
// TODO Auto-generated method stub
}
@Override
public void visit(ArgumentList argumentList) {
// TODO Auto-generated method stub
}
@Override
public void visit(GenericTypeVar genericTypeVar) {
// TODO Auto-generated method stub
}
@Override
public void visit(GenericDeclarationList genericTypeVars) {
// TODO Auto-generated method stub
}
@Override
public void visit(AssignToField assignLeftSide) {
// TODO Auto-generated method stub
}
@Override
public void visit(AssignToLocal assignLeftSide) {
// TODO Auto-generated method stub
}
@Override
public void visit(SuperCall superCall) {
}
@Override
public void visit(ExpressionReceiver expressionReceiver) {
// TODO Auto-generated method stub
}
@Override
public void visit(UnaryExpr unaryExpr) {
throw new NotImplementedException();
}
}
File diff suppressed because it is too large Load Diff
@@ -1,19 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.Exception;
/**
* @author fayez
*
*/
public class BytecodeGeneratorError extends RuntimeException {
/**
* @param message
*/
public BytecodeGeneratorError(String message) {
super(message);
}
}
@@ -1,25 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.Exception;
/**
* @author fayez
*
*/
public class NotFoundException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* @param message
*/
public NotFoundException(String message) {
super(message);
}
}
@@ -1,26 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.Exception;
/**
* @author fayez
*
*/
public class NotInCurrentPackageException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* @param message
*/
public NotInCurrentPackageException(String message) {
super(message);
}
}
@@ -1,9 +0,0 @@
package de.dhbwstuttgart.bytecode;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
public interface IStatement {
public boolean isExprBinary();
public void genBCForRelOp(MethodVisitor mv, Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod);
}
@@ -1,29 +0,0 @@
package de.dhbwstuttgart.bytecode;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import de.dhbwstuttgart.syntaxtree.statement.Expression;
import de.dhbwstuttgart.syntaxtree.statement.Statement;
public class IfStatement extends AStatement{
private Statement then_block;
private Statement else_block;
public IfStatement(Expression expr, Statement then_block, Statement else_block) {
super(expr);
this.then_block = then_block;
this.else_block = else_block;
}
@Override
public void genBCForRelOp(MethodVisitor mv,Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod) {
bytecodeGenMethod.isBinary(false);
this.then_block.accept(bytecodeGenMethod);
mv.visitLabel(branchLabel);
this.else_block.accept(bytecodeGenMethod);
}
}
@@ -1,26 +0,0 @@
package de.dhbwstuttgart.bytecode;
import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import de.dhbwstuttgart.syntaxtree.statement.Expression;
import de.dhbwstuttgart.syntaxtree.statement.Statement;
public class LoopStmt extends AStatement {
private Statement loopBlock;
public LoopStmt(Expression expr, Statement loopBlock) {
super(expr);
this.loopBlock = loopBlock;
}
@Override
public void genBCForRelOp(MethodVisitor mv,Label branchLabel, Label endLabel, BytecodeGenMethod bytecodeGenMethod) {
bytecodeGenMethod.isBinary(false);
this.loopBlock.accept(bytecodeGenMethod);
mv.visitJumpInsn(Opcodes.GOTO, endLabel);
mv.visitLabel(branchLabel);
}
}
@@ -1,14 +0,0 @@
package de.dhbwstuttgart.bytecode;
import org.objectweb.asm.MethodVisitor;
import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr;
import de.dhbwstuttgart.syntaxtree.statement.Expression;
public class ReturnStmt extends AStatement {
public ReturnStmt(Expression retexpr) {
super(retexpr);
}
}
@@ -1,269 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import de.dhbwstuttgart.bytecode.constraint.ExtendsConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint.Relation;
import de.dhbwstuttgart.bytecode.utilities.MethodAndTPH;
import de.dhbwstuttgart.bytecode.utilities.MethodUtility;
import de.dhbwstuttgart.bytecode.utilities.Resolver;
import de.dhbwstuttgart.syntaxtree.AbstractASTWalker;
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
import de.dhbwstuttgart.syntaxtree.Constructor;
import de.dhbwstuttgart.syntaxtree.Field;
import de.dhbwstuttgart.syntaxtree.FormalParameter;
import de.dhbwstuttgart.syntaxtree.Method;
import de.dhbwstuttgart.syntaxtree.ParameterList;
import de.dhbwstuttgart.syntaxtree.statement.LocalVar;
import de.dhbwstuttgart.syntaxtree.statement.LocalVarDecl;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.constraints.Constraint;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.constraints.Pair;
import de.dhbwstuttgart.typeinference.result.GenericInsertPair;
import de.dhbwstuttgart.typeinference.result.ResultPair;
import de.dhbwstuttgart.typeinference.result.ResultSet;
/**
* @author Fayez Abu Alia
*
*/
public class TPHExtractor extends AbstractASTWalker {
// Alle TPHs der Felder werden iKopf der Klasse definiert
// alle TPHs der Klasse: (TPH, is in Method?)
public final HashMap<String, Boolean> allTPHS = new HashMap<>();
public final List<String> tphsClass = new ArrayList<>();
MethodAndTPH methodAndTph;
Boolean inMethod = false;
boolean inLocalOrParamOrReturn = false;
public final ArrayList<MethodAndTPH> ListOfMethodsAndTph = new ArrayList<>();
// Alle Constraints in einer Menge (Und- & Oder-Constraints)
public Set<Pair> oldConstraints = new HashSet<>();
final ArrayList<ResultPair<TypePlaceholder, TypePlaceholder>> allPairs = new ArrayList<>();
public final ArrayList<TPHConstraint> allCons = new ArrayList<>();
private ResultSet resultSet;
private Resolver resolver;
public TPHExtractor() {
}
public void setResultSet(ResultSet resultSet) {
this.resultSet = resultSet;
this.resolver = new Resolver(resultSet);
}
public Resolver getResolver() {
return resolver;
}
// @Override
// public void visit(ClassOrInterface classOrInterface) {
// inMethod = false;
// classOrInterface.getfieldInitializations().ifPresent(c->c.block.accept(this));
// super.visit(classOrInterface);
// inMethod = true;
// }
@Override
public void visit(TypePlaceholder tph) {
if (resultSet.resolveType(tph).resolvedType instanceof TypePlaceholder) {
TypePlaceholder resolvedTPH = (TypePlaceholder) resultSet.resolveType(tph).resolvedType;
String tphName = resolvedTPH.getName();
if (inMethod && !tphsClass.contains(tphName)) {
ArrayList<String> tphs = null;
if (!(tphs = methodAndTph.getTphs()).contains(tphName)) {
methodAndTph.addTph(tphName);
}
if (inLocalOrParamOrReturn) {
if (!(tphs = methodAndTph.getLocalTphs()).contains(tphName)) {
tphs.add(tphName);
}
}
} else {
if (!tphsClass.contains(tphName)) {
tphsClass.add(tphName);
}
}
if (!allTPHS.containsKey(tphName)) {
allTPHS.put(tphName, inMethod);
}
// final List<TPHConstraint> cons = new ArrayList<>();
// resultSet.resolveType(tph).additionalGenerics.forEach(ag -> {
// TPHConstraint con = new ExtendsConstraint(ag.TA1.getName(), ag.TA2.getName(), Relation.EXTENDS);
// cons.add(con);
// });
//
// Map<TPHConstraint, Boolean> visitMap = new HashMap<>();
// for(TPHConstraint cc : cons) {
// visitMap.put(cc, false);
// }
//
// String left = resolvedTPH.getName();
// for (TPHConstraint cc : visitMap.keySet()) {
//
// if(visitMap.get(cc))
// continue;
//
// if (cc.getLeft().equals(left)) {
// allCons.add(cc);
// List<TPHConstraint> toVisit = getToVisitCons(cons,cc.getRight(), visitMap);
// }
// }
//resultSet.resolveType(tph).getAdditionalGenerics().forEach(ag -> {
resultSet.genIns.forEach(ag -> {
// if (ag.contains(resolvedTPH) /* && ag.TA1.equals(resolvedTPH) */ && !contains(allPairs, ag)) {
if (inMethod)
methodAndTph.getPairs().add(ag);
allPairs.add(ag);
TPHConstraint con = new ExtendsConstraint(ag.getLeft().getName(), ag.getRight().getName());
if(!containsConstraint(allCons,con))
allCons.add(con);
// }
});
} else if (resultSet.resolveType(tph).resolvedType instanceof RefType) {
RefType rt = (RefType) resultSet.resolveType(tph).resolvedType;
rt.accept(this);
}
}
private static boolean containsConstraint(ArrayList<TPHConstraint> allCons, TPHConstraint c) {
for(TPHConstraint con:allCons) {
if(c.getLeft().equals(con.getLeft()) && c.getRight().equals(con.getRight())) {
return true;
}
}
return false;
}
private List<TPHConstraint> getToVisitCons(List<TPHConstraint> cons, String right, Map<TPHConstraint, Boolean> visitMap) {
List<TPHConstraint> res = new ArrayList<>();
for(TPHConstraint cc : cons) {
if(cc.getLeft().equals(right)) {
res.add(cc);
if(visitMap.get(cc))
visitMap.replace(cc, false);
}
}
return res;
}
@Override
public void visit(GenericRefType genericRefType) {
String name = genericRefType.getParsedName();
if (inMethod) {
methodAndTph.addTph(name);
if (inLocalOrParamOrReturn)
methodAndTph.getLocalTphs().add(name);
}else {
tphsClass.add(name);
}
allTPHS.put(name, inMethod);
}
private boolean contains(ArrayList<GenericInsertPair> pairs, GenericInsertPair genPair) {
for (int i = 0; i < pairs.size(); ++i) {
GenericInsertPair p = pairs.get(i);
if (p.TA1.equals(genPair.TA1) && p.TA2.equals(genPair.TA2))
return true;
}
return false;
}
@Override
public void visit(Method method) {
inMethod = true;
String id = MethodUtility.createID(resolver,method);
Predicate<Pair> filterUndConstraints = cs -> ((cs.TA1 instanceof TypePlaceholder) && (cs.TA2 instanceof TypePlaceholder) &&
(resultSet.resolveType((TypePlaceholder)(cs.TA1)).resolvedType instanceof TypePlaceholder) &&
(resultSet.resolveType((TypePlaceholder)(cs.TA2)).resolvedType instanceof TypePlaceholder));
Function<ConstraintSet<Pair>, ConstraintSet<Pair>> filterConstrRemainingTVar =
csS -> {
ConstraintSet<Pair> ret = new ConstraintSet<>();
ret.addAllUndConstraint(
csS.getUndConstraints()
.stream().filter(filterUndConstraints)
.collect(Collectors.toCollection(Constraint<Pair>::new)));
csS.getOderConstraints()
.forEach(oConSSet -> { Set<Constraint<Pair>> setCons = new HashSet<>();
oConSSet.forEach(OConS -> { Constraint<Pair> newConsPair = new Constraint<Pair>();
newConsPair.isStatement = OConS.isStatement;
setCons.add(
OConS.stream()
.filter(filterUndConstraints)
.collect(Collectors.toCollection(() -> newConsPair)) );
} );
ret.addOderConstraint(setCons);} );
return ret;
};
ConstraintSet<Pair> filteredConstraints = filterConstrRemainingTVar.apply(method.getConstraints());
methodAndTph = new MethodAndTPH(id, filteredConstraints);
oldConstraints.addAll(filteredConstraints.getAll());
inLocalOrParamOrReturn = true;
method.getReturnType().accept(this);
method.getParameterList().accept(this);
inLocalOrParamOrReturn = false;
if(method.block != null)
method.block.accept(this);
inMethod = false;
ListOfMethodsAndTph.add(methodAndTph);
}
@Override
public void visit(Constructor cons) {
inMethod = false;
//super.visit(cons);
cons.getParameterList().accept(this);
if(cons.block != null)
cons.block.accept(this);
inMethod = true;
}
@Override
public void visit(LocalVarDecl localVarDecl) {
// inLocalOrParamOrReturn = inMethod;
super.visit(localVarDecl);
// inLocalOrParamOrReturn = false;
}
@Override
public void visit(LocalVar localVar) {
// inLocalOrParamOrReturn = inMethod;
super.visit(localVar);
// inLocalOrParamOrReturn = false;
}
@Override
public void visit(ParameterList formalParameters) {
inLocalOrParamOrReturn = inMethod;
super.visit(formalParameters);
inLocalOrParamOrReturn = false;
}
}
@@ -1,260 +0,0 @@
package de.dhbwstuttgart.bytecode.descriptor;
import java.util.HashMap;
import java.util.Iterator;
import de.dhbwstuttgart.bytecode.utilities.*;
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
import org.objectweb.asm.Type;
import de.dhbwstuttgart.syntaxtree.FormalParameter;
import de.dhbwstuttgart.syntaxtree.statement.Expression;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typeinference.result.ResultSet;
public class DescriptorToString implements DescriptorVisitor, CONSTANTS {
ResultSet resultSet;
public DescriptorToString() {
}
public DescriptorToString(ResultSet resultSet) {
this.resultSet = resultSet;
}
private String addReturnType(String desc, RefTypeOrTPHOrWildcardOrGeneric returnType, ResultSet resultSet) {
if(resultSet.resolveType(returnType).resolvedType.toString().equals(CONSTANTS.VOID)){
desc = desc + ")V";
}else {
desc = desc + ")" + "L"+resultSet.resolveType(returnType).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
}
return desc;
}
@Override
public String visit(NormalMethod method) {
String desc = "(";
Iterator<FormalParameter> itr = method.getParameterList().iterator();
while(itr.hasNext()) {
FormalParameter fp = itr.next();
// System.out.println(resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToSignature()));
// System.out.println("Parmetrisierte typ ? "+ ((RefType) fp.getType()).getParaList().size());
if(method.hasGen()) {
String fpDesc = fp.getType().acceptTV(new TypeToDescriptor());
if(method.getGenericsAndBoundsMethod().containsKey(fpDesc)) {
String bound = getBound(fpDesc, method.getGenericsAndBoundsMethod());
desc += "L"+bound+ ";";
}else if(method.getGenericsAndBounds().containsKey(fpDesc)){
String bound = getBound(fpDesc, method.getGenericsAndBounds());
desc += "L"+bound+ ";";
}else {
// desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
String resType = resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor());
if(resType.contains(CONSTANTS.TPH)/*resType.subSequence(0, 4).equals("TPH ")*/) {
// Bound ist immer Object
desc += "L"+Type.getInternalName(Object.class)+ ";";
} else {
// TODO::
if(method.getGenericsAndBounds().containsKey(resType)) {
String bound = getBound(resType, method.getGenericsAndBounds());
desc += "L"+bound+ ";";
}else if(method.getGenericsAndBoundsMethod().containsKey(resType)) {
String bound = getBound(resType, method.getGenericsAndBoundsMethod());
desc += "L"+bound+ ";";
} else {
desc += "L"+resType+ ";";
}
}
}
}
//TODO: generate a class java%% ... %%
else if(resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor()).contains(CONSTANTS.ANGLEBRACKET)){
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.toString().replace(".", "$$").replace(CONSTANTS.ANGLEBRACKET, "$$$").replace(">", "$$$")+ ";";
}
else {
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
}
}
if(resultSet.resolveType(method.getReturnType()).resolvedType.toString().equals(CONSTANTS.VOID)) {
desc += ")V";
}else {
if(method.hasGen()) {
String ret = method.getReturnType().acceptTV(new TypeToDescriptor());
if(method.getGenericsAndBoundsMethod().containsKey(ret)) {
desc += ")L"+method.getGenericsAndBoundsMethod().get(ret)+ ";";
}else if(method.getGenericsAndBounds().containsKey(ret)){
desc += ")L"+method.getGenericsAndBounds().get(ret)+ ";";
}else {
String resType = resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
if(resType.contains(CONSTANTS.TPH)/*resType.subSequence(0, 4).equals("TPH ")*/) {
// desc += ")" + "L"+method.getGenericsAndBoundsMethod().get(resType.substring(4)+"$")+ ";";
desc += ")" + "L"+Type.getInternalName(Object.class)+ ";";
} else {
// TODO::
if(method.getGenericsAndBounds().containsKey(resType)) {
String bound = getBound(resType, method.getGenericsAndBounds());
desc += ")L"+bound+ ";";
}else if(method.getGenericsAndBoundsMethod().containsKey(resType)) {
String bound = getBound(resType, method.getGenericsAndBoundsMethod());
desc += ")L"+bound+ ";";
} else {
desc += ")L"+resType+ ";";
}
// desc += ")" + "L"+resType+ ";";
}
}
}else {
desc += ")" + "L"+resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
}
}
// desc = addReturnType(desc,method.getReturnType(), resultSet);
return desc;
}
private String getBound(String fpDesc, HashMap<String, String> genericsAndBounds) {
String start = genericsAndBounds.get(fpDesc);
while(genericsAndBounds.containsKey(start)) {
start = genericsAndBounds.get(start);
}
return start;
}
@Override
public String visit(NormalConstructor constructor) {
String desc = "(";
Iterator<FormalParameter> itr = constructor.getParameterList().iterator();
while(itr.hasNext()) {
FormalParameter fp = itr.next();
if(constructor.hasGen()) {
// System.out.println("Cons has Gens");
String fpDesc = fp.getType().acceptTV(new TypeToDescriptor());
// System.out.println(fpDesc);
if(constructor.getGenericsAndBounds().containsKey(fpDesc)){
desc += "L"+constructor.getGenericsAndBounds().get(fpDesc)+ ";";
}else {
// desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
String resType = resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor());
if(resType.subSequence(0, 4).equals(CONSTANTS.TPH)) {
// Bound ist immer Object
desc += "L"+Type.getInternalName(Object.class)+ ";";
} else {
desc += "L"+resType+ ";";
}
}
}else {
// System.out.println("Cons has NO Gens");
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
}
}
desc = desc + ")V";
return desc;
}
//ToDo Etienne: ändern
@Override
public String visit(Lambda lambdaExpression) {
String desc = "(";
Iterator<FormalParameter> itr = lambdaExpression.getParams().iterator();
while(itr.hasNext()) {
FormalParameter fp = itr.next();
String d = resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor());
if(d.contains(CONSTANTS.TPH) ||d.contains(CONSTANTS.ANGLEBRACKET)) {
desc += "L"+Type.getInternalName(Object.class)+ ";";
}else {
desc = desc + "L"+ d + ";";
}
}
String retType = resultSet.resolveType(lambdaExpression.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
if(retType.contains(CONSTANTS.TPH)|| retType.contains(CONSTANTS.ANGLEBRACKET)){
desc += ")L"+Type.getInternalName(Object.class)+ ";";
}else {
desc = desc + ")"+"L"+retType+";";
}
return desc;
}
@Override
public String visit(SamMethod samMethod) {
String desc = "(";
Iterator<RefTypeOrTPHOrWildcardOrGeneric> itr = samMethod.getArgumentList().iterator();
while(itr.hasNext()) {
RefTypeOrTPHOrWildcardOrGeneric rt = itr.next();
String d = resultSet.resolveType(rt).resolvedType.acceptTV(new TypeToDescriptor());
if(d.contains(CONSTANTS.TPH) ||d.contains(CONSTANTS.ANGLEBRACKET)) {
desc += "L"+Type.getInternalName(Object.class)+ ";";
}else {
desc += "L"+ d + ";";
}
}
String retType = resultSet.resolveType(samMethod.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
if(retType.contains(CONSTANTS.TPH)|| retType.contains(CONSTANTS.ANGLEBRACKET)){
desc += ")L"+Type.getInternalName(Object.class)+ ";";
}else {
desc = desc + ")"+"L"+retType+";";
}
return desc;
}
@Override
public String visit(MethodFromMethodCall methodFromMethodCall) {
String desc = "(";
for(Expression e : methodFromMethodCall.getArgList().getArguments()) {
String d = resultSet.resolveType(e.getType()).resolvedType.acceptTV(new TypeToDescriptor());
if(d.contains(CONSTANTS.TPH) ||d.contains(CONSTANTS.ANGLEBRACKET) || methodFromMethodCall.getReceiverName().contains("$$")) {
desc += "L"+Type.getInternalName(Object.class)+ ";";
}else {
if(methodFromMethodCall.getGenericsAndBoundsMethod().containsKey(d)) {
desc += "L"+methodFromMethodCall.getGenericsAndBoundsMethod().get(d)+ ";";
}else if(methodFromMethodCall.getGenericsAndBounds().containsKey(d)) {
desc += "L"+methodFromMethodCall.getGenericsAndBounds().get(d)+ ";";
}else {
desc += "L"+resultSet.resolveType(e.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
}
}
}
String retType = resultSet.resolveType(methodFromMethodCall.getReturnType()).resolvedType.acceptTV(new TypeToDescriptor());
System.out.println("DescriptorToString retType = " + retType);
if(retType.equals(CONSTANTS.VOID)) {
desc += ")V";
}else if(retType.contains(CONSTANTS.TPH)|| retType.contains(CONSTANTS.ANGLEBRACKET) || methodFromMethodCall.getReceiverName().contains("$$")){
desc += ")L"+Type.getInternalName(Object.class)+ ";";
}else {
if(methodFromMethodCall.getGenericsAndBoundsMethod().containsKey(retType)) {
desc += ")L"+methodFromMethodCall.getGenericsAndBoundsMethod().get(retType)+ ";";
}else if(methodFromMethodCall.getGenericsAndBounds().containsKey(retType)){
desc += ")L"+methodFromMethodCall.getGenericsAndBounds().get(retType)+ ";";
}else {
desc += ")" + "L"+retType+ ";";
}
}
// desc = addReturnType(desc, methodFromMethodCall.getReturnType(), resultSet);
return desc;
}
@Override
public String createDescForFunN(ArgumentList argumentList, String returnType) {
Iterator<Expression> itr1 = argumentList.getArguments().iterator();
String methDesc = "(";
while(itr1.hasNext()) {
methDesc += "L" + Type.getInternalName(Object.class) + ";";
itr1.next();
}
if (returnType.equals(CONSTANTS.VOID)){
methDesc += ")V";
} else {
methDesc += ")L" + Type.getInternalName(Object.class) + ";";
}
return methDesc;
}
}
@@ -1,17 +0,0 @@
package de.dhbwstuttgart.bytecode.descriptor;
import de.dhbwstuttgart.bytecode.utilities.Lambda;
import de.dhbwstuttgart.bytecode.utilities.MethodFromMethodCall;
import de.dhbwstuttgart.bytecode.utilities.NormalConstructor;
import de.dhbwstuttgart.bytecode.utilities.NormalMethod;
import de.dhbwstuttgart.bytecode.utilities.SamMethod;
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
public interface DescriptorVisitor {
String visit(NormalMethod method);
String visit(NormalConstructor constructor);
String visit(Lambda lambdaExpression);
String visit(SamMethod samMethod);
String visit(MethodFromMethodCall methodFromMethodCall);
String createDescForFunN(ArgumentList argumentList, String returnType);
}
@@ -1,52 +0,0 @@
package de.dhbwstuttgart.bytecode.descriptor;
import de.dhbwstuttgart.bytecode.funN.FunNGenerator;
import de.dhbwstuttgart.bytecode.funN.FunNUtilities;
import de.dhbwstuttgart.syntaxtree.type.*;
public class TypeToDescriptor implements TypeVisitor<String>{
private final boolean specializedFunN;
public TypeToDescriptor(){ this(true); }
public TypeToDescriptor(boolean specializedFunN) { this.specializedFunN = specializedFunN; }
@Override
public String visit(RefType refType) {
if (refType.getName().toString().matches("Fun\\d+\\$\\$") && specializedFunN) {
FunNUtilities funNUtilities = FunNGenerator.getInstance();
return funNUtilities.getSpecializedDescriptor(funNUtilities.getArguments(refType.getParaList()), funNUtilities.getReturnType(refType.getParaList()));
}
return refType.getName().toString().replace(".", "/");
// String t = refType.getName().toString().replace(".", "/");
// return t.equals("Fun1")?(t+"$$"):t;
}
@Override
public String visit(SuperWildcardType superWildcardType) {
System.out.println("\nWILDCARD ="+superWildcardType.getInnerType().toString().replace(".", "/"));
//return superWildcardType.getInnerType().toString().replace(".", "/");
return superWildcardType.getInnerType().acceptTV(new TypeToDescriptor());
//throw new NotImplementedException();
}
@Override
public String visit(TypePlaceholder typePlaceholder) {
return typePlaceholder.toString().replace(".", "/");
}
@Override
public String visit(ExtendsWildcardType extendsWildcardType) {
System.out.println("\nWILDCARD extends ="+extendsWildcardType.getInnerType().toString().replace(".", "/"));
//return extendsWildcardType.getInnerType().toString().replace(".", "/");
return extendsWildcardType.getInnerType().acceptTV(new TypeToDescriptor());
//throw new NotImplementedException();
}
@Override
public String visit(GenericRefType genericRefType) {
return genericRefType.getParsedName().replace(".", "/");
}
}
@@ -1,149 +0,0 @@
package de.dhbwstuttgart.bytecode.funN;
import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor;
import de.dhbwstuttgart.bytecode.signature.TypeToSignature;
import de.dhbwstuttgart.bytecode.utilities.CONSTANTS;
import de.dhbwstuttgart.parser.scope.JavaClassName;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Type;
import java.io.File;
import java.io.FileOutputStream;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.objectweb.asm.Opcodes.*;
/**
* //ToDo beschreiben
*
* @since Studienarbeit Type Erasure
* @author etiennezink
*/
public class FunNGenerator implements FunNUtilities{
private static FunNGenerator funNGenerator = new FunNGenerator();
public static FunNGenerator getInstance(){
return funNGenerator;
}
private final String argumentGenericBase = "T";
private final String returnGeneric = "R";
private final String methodName = "apply";
private final int bytecodeVersion = V1_8;
private final String objectSuperType = Type.getInternalName(Object.class).replace('.','/');
private final RefType objectRefType = new RefType(new JavaClassName(objectSuperType), null);
private final String objectSignature = applySignature(objectRefType);
private String applyDescriptor(RefTypeOrTPHOrWildcardOrGeneric a) { return a.acceptTV(new TypeToDescriptor(true)); }
private String applySignature(RefTypeOrTPHOrWildcardOrGeneric a) { return a.acceptTV(new TypeToSignature(true)); }
private String applyNameDescriptor(RefTypeOrTPHOrWildcardOrGeneric a){ return a instanceof TypePlaceholder ? "LTPH;" : String.format("L%s;", applyDescriptor(a)); }
@Override
public byte[] generateSuperBytecode(int numberArguments) {
StringBuilder superFunNClassSignature = new StringBuilder("<");
StringBuilder superFunNMethodSignature = new StringBuilder("(");
StringBuilder superFunNMethodDescriptor = new StringBuilder("(");
for (int currentParameter = 1; currentParameter <= numberArguments; currentParameter++){
superFunNClassSignature.append(String.format("%s%d:%s",argumentGenericBase, currentParameter, objectSignature));
superFunNMethodSignature.append(String.format("T%s;", applySignature( new GenericRefType(argumentGenericBase + currentParameter, null))));
superFunNMethodDescriptor.append(objectSignature);
}
superFunNClassSignature.append(String.format("%s:%s>%s", returnGeneric, objectSignature, objectSignature));
superFunNMethodSignature.append(String.format(")T%s;", applySignature(new GenericRefType(returnGeneric, null))));
superFunNMethodDescriptor.append(String.format(")%s", objectSignature));
ClassWriter classWriter = new ClassWriter(0);
MethodVisitor methodVisitor;
classWriter.visit(bytecodeVersion, ACC_PUBLIC | ACC_ABSTRACT | ACC_INTERFACE, getSuperClassName(numberArguments), superFunNClassSignature.toString(), objectSuperType, null);
methodVisitor = classWriter.visitMethod(ACC_PUBLIC | ACC_ABSTRACT, methodName, superFunNMethodDescriptor.toString(), superFunNMethodSignature.toString(), null);
methodVisitor.visitEnd();
classWriter.visitEnd();
return classWriter.toByteArray();
}
@Override
public String getSuperClassName(int numberArguments) {
return String.format("Fun%d$$", numberArguments);
}
@Override
public byte[] generateSpecializedBytecode(List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes, RefTypeOrTPHOrWildcardOrGeneric returnType) {
List<RefTypeOrTPHOrWildcardOrGeneric> parameters = Stream
.concat(argumentTypes.stream(), Stream.of(returnType))
.collect(Collectors.toList());
RefType superFunN = new RefType(new JavaClassName(getSuperClassName(argumentTypes.size())), parameters , null);
StringBuilder funNClassSignature = new StringBuilder(objectSignature + (superFunN.acceptTV(new TypeToSignature(false))));
boolean containsGeneric = false;
String genericSignature = "<";
for (RefTypeOrTPHOrWildcardOrGeneric typeArgument : parameters) {
//ToDo Etienne: Refactor
if (typeArgument instanceof GenericRefType){
GenericRefType generic = (GenericRefType) typeArgument;
if(genericSignature.contains(generic.getParsedName())) continue;
genericSignature += String.format("%s:%s", generic.getParsedName(), applyDescriptor(generic));
containsGeneric = true;
} else if(typeArgument instanceof TypePlaceholder){
TypePlaceholder placeholder = (TypePlaceholder) typeArgument;
if(genericSignature.contains(applySignature(placeholder).substring(1))) continue;
genericSignature += String.format("%s:%s", applySignature(placeholder).substring(1), objectSignature);
containsGeneric = true;
}
}
genericSignature += ">";
if (containsGeneric) funNClassSignature.insert(0, genericSignature);
ClassWriter classWriter = new ClassWriter(0);
classWriter.visit(bytecodeVersion, ACC_PUBLIC | ACC_ABSTRACT | ACC_INTERFACE, getSpecializedClassName(argumentTypes, returnType), funNClassSignature.toString(), objectSuperType, new String[]{getSuperClassName(argumentTypes.size())});
classWriter.visitEnd();
return classWriter.toByteArray();
}
@Override
public String getSpecializedClassName(List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes, RefTypeOrTPHOrWildcardOrGeneric returnType) {
return String.format("Fun%d$$%s%s",
argumentTypes.size(),
argumentTypes
.stream()
.map(this::applyNameDescriptor)
.collect(Collectors.joining()),
applyNameDescriptor(returnType))
.replace('/', '$')
.replace(";", "$_$");
}
@Override
public String getSpecializedDescriptor(List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes, RefTypeOrTPHOrWildcardOrGeneric returnType) {
return applyDescriptor(new RefType(new JavaClassName(getSpecializedClassName(argumentTypes, returnType)), null));
}
@Override
public String getSpecializedSignature(List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes, RefTypeOrTPHOrWildcardOrGeneric returnType) {
return applySignature(new RefType(new JavaClassName(getSpecializedClassName(argumentTypes, returnType)), null));
}
@Override
public List<RefTypeOrTPHOrWildcardOrGeneric> getArguments(List<RefTypeOrTPHOrWildcardOrGeneric> list) {
return list
.stream()
.limit(Math.max(0, list.size() - 1))
.collect(Collectors.toList());
}
@Override
public RefTypeOrTPHOrWildcardOrGeneric getReturnType(List<RefTypeOrTPHOrWildcardOrGeneric> list) {
if(list.size() == 0)
throw new IndexOutOfBoundsException();
return list.get(list.size() - 1);
}
}
@@ -1,36 +0,0 @@
package de.dhbwstuttgart.bytecode.funN;
import de.dhbwstuttgart.bytecode.utilities.CONSTANTS;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import java.io.File;
import java.io.FileOutputStream;
import java.util.List;
public interface FunNUtilities {
byte[] generateSuperBytecode(int numberArguments);
String getSuperClassName(int numberArguments);
byte[] generateSpecializedBytecode(List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes, RefTypeOrTPHOrWildcardOrGeneric returnType);
String getSpecializedClassName(List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes, RefTypeOrTPHOrWildcardOrGeneric returnType);
String getSpecializedDescriptor(List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes, RefTypeOrTPHOrWildcardOrGeneric returnType);
String getSpecializedSignature(List<RefTypeOrTPHOrWildcardOrGeneric> argumentTypes, RefTypeOrTPHOrWildcardOrGeneric returnType);
List<RefTypeOrTPHOrWildcardOrGeneric> getArguments(List<RefTypeOrTPHOrWildcardOrGeneric> list);
RefTypeOrTPHOrWildcardOrGeneric getReturnType(List<RefTypeOrTPHOrWildcardOrGeneric> list);
@Deprecated
public static boolean writeClassFile(String className, byte[] bytecode, File directory) {
try (FileOutputStream output = new FileOutputStream(new File(directory , className + CONSTANTS.EXTENSIONCLASS))){
output.write(bytecode);
output.flush();
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
}
@@ -1,53 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.genericsGenerator;
import java.util.List;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.NameReplacementResult;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericsGeneratorResult;
/**
* This class represents the result of the constraints simplifier.
*
* @author fayez
*
*/
public class ConstraintsSimplierResult {
private List<GenericsGeneratorResult> genericsGenResults;
private List<NameReplacementResult> nameReplacementResults;
/**
* @param genericsGenResults
*/
public ConstraintsSimplierResult(List<GenericsGeneratorResult> genericsGenResults,
List<NameReplacementResult> nameReplacementResults) {
this.genericsGenResults = genericsGenResults;
this.setNameReplacementResults(nameReplacementResults);
}
/**
* @return the genericsGenResults
*/
public List<GenericsGeneratorResult> getGenericsGenResults() {
return genericsGenResults;
}
/**
* @param genericsGenResults the genericsGenResults to set
*/
public void setGenericsGenResults(List<GenericsGeneratorResult> genericsGenResults) {
this.genericsGenResults = genericsGenResults;
}
/**
* @return the nameReplacementResults
*/
public List<NameReplacementResult> getNameReplacementResults() {
return nameReplacementResults;
}
/**
* @param nameReplacementResults the nameReplacementResults to set
*/
public void setNameReplacementResults(List<NameReplacementResult> nameReplacementResults) {
this.nameReplacementResults = nameReplacementResults;
}
}
@@ -1,137 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.genericsGenerator;
import java.util.*;
import de.dhbwstuttgart.bytecode.TPHExtractor;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.*;
/**
* @author fayez
*
*/
public class ConstraintsSimplifier {
public static ConstraintsSimplierResult simplifyConstraints(final TPHExtractor tphExtractor, final List<GenericsGeneratorResult> genericsGeneratorResults, final List<String> tphsClass) {
List<TPHConstraint> allCons = tphExtractor.allCons;
List<TPHConstraint> equalCons = new ArrayList<>();
/* Step 1 */
List<ConstraintsWithSameLeftSide> foundCons = GenericsGeneratorUtility.findConstraintsWithLeftSameLeftSide(allCons);
if(!foundCons.isEmpty()) {
List<TPHConstraint> equalCons2 = new ArrayList<>();
GenericsGeneratorUtility.simplifyConstraintsWithSameLeftSide(foundCons,tphExtractor,tphsClass,equalCons2);
equalCons.addAll(equalCons2);
}
// if(!simpleCycles.isEmpty()) {
// handleSimpleCycles(allCons, simpleCycles,tphExtractor);
// equalCons.addAll(GenericsGeneratorUtility.getEqualConstraints(allCons));
// }
//
List<Cycle> cycles = findCycles(allCons);
if(!cycles.isEmpty()) {
handleCycle(genericsGeneratorResults, allCons, cycles,tphExtractor);
}
/* The right hand side of equal constraint is the new name in name replacement result */
List<NameReplacementResult> nameReplacementResults = GenericsGeneratorUtility.createNameReplacementResultsFromEqualConstraints(equalCons);
getEqualsFromNameReplacementResults(genericsGeneratorResults,nameReplacementResults);
ConstraintsSimplierResult result = new ConstraintsSimplierResult(genericsGeneratorResults, nameReplacementResults);
return result;
}
private static void getEqualsFromNameReplacementResults(List<GenericsGeneratorResult> genericsGeneratorResults,
List<NameReplacementResult> nameReplacementResults) {
genericsGeneratorResults.forEach(g->{
String tph = g.getConstraint().getLeft();
if (!nameReplacementResults.isEmpty()) {
collectAllEquals(nameReplacementResults, g, tph);
}
if (!nameReplacementResults.isEmpty()) {
collectAllEquals(nameReplacementResults, g);
}
});
}
private static void collectAllEquals(List<NameReplacementResult> nameReplacementResults, GenericsGeneratorResult g) {
Set<String> equalsTPHs = g.getEqualsTPHs();
Set<String> tphsToAdd = getAllEqualTphs(equalsTPHs, nameReplacementResults);
while (!tphsToAdd.isEmpty()){
equalsTPHs.addAll(tphsToAdd);
tphsToAdd = getAllEqualTphs(equalsTPHs, nameReplacementResults);
}
}
private static Set<String> getAllEqualTphs(Set<String> equalsTPHs, List<NameReplacementResult> nameReplacementResults) {
Set<String> tphsToAdd = new HashSet<>();
equalsTPHs.forEach(e->{
collectAllEquals(nameReplacementResults, tphsToAdd,e);
});
return tphsToAdd;
}
public static void collectAllEquals(List<NameReplacementResult> nameReplacementResults, Set<String> tphsToAdd,
String tph) {
List<NameReplacementResult> toRemoveList = new ArrayList<>();
Optional<NameReplacementResult> nameReplacementResult = nameReplacementResults.stream().filter(n->n.getName().equals(tph)).findFirst();
nameReplacementResult.ifPresent(toRemove->{
tphsToAdd.addAll(toRemove.getOldNames());
toRemoveList.add(toRemove);
});
if(!toRemoveList.isEmpty()){
nameReplacementResults.remove(toRemoveList.get(0));
toRemoveList.clear();
}
}
/**
* @param nameReplacementResults
* @param g
* @param tph
*/
public static void collectAllEquals(List<NameReplacementResult> nameReplacementResults, GenericsGeneratorResult g,
String tph) {
List<NameReplacementResult> toRemoveList = new ArrayList<>();
Optional<NameReplacementResult> nameReplacementResult = nameReplacementResults.stream().filter(n->n.getName().equals(tph)).findFirst();
nameReplacementResult.ifPresent(toRemove->{
g.getEqualsTPHs().addAll(toRemove.getOldNames());
toRemoveList.add(toRemove);
});
if(!toRemoveList.isEmpty()){
nameReplacementResults.remove(toRemoveList.get(0));
toRemoveList.clear();
}
}
/**
* @param genericsGeneratorResults
* @param allCons
* @param cycles
* @param tphExtractor
*/
public static void handleCycle(List<GenericsGeneratorResult> genericsGeneratorResults,
List<TPHConstraint> allCons, List<Cycle> cycles, TPHExtractor tphExtractor) {
GenericsGeneratorUtility.modifyRelationForConstraintsInCycle(cycles);
List<NameReplacementResult> nameReplacementResults = GenericsGeneratorUtility.substituteTPHSFormCycle(allCons, cycles,tphExtractor);
GenericsGeneratorUtility.createResults(genericsGeneratorResults,nameReplacementResults);
GenericsGeneratorUtility.removeEqualConstraints(allCons);
}
/**
* @param allCons
* @return
*/
public static List<Cycle> findCycles(List<TPHConstraint> allCons) {
/* find all cycles */
CyclesFinder cyclesFinder = new CyclesFinder(allCons);
List<Cycle> cycles = cyclesFinder.findCycles();
return cycles;
}
}
@@ -1,106 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.genericsGenerator;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint.Relation;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.Cycle;
/**
* @author fayez
*
*/
public class CyclesFinder {
private final List<TPHConstraint> allCons;
public CyclesFinder(List<TPHConstraint> allCons) {
this.allCons = allCons;
}
public List<Cycle> findCycles() {
List<TPHConstraint> vistedConstraints = new ArrayList<>(allCons.size());
List<Cycle> cycles = new ArrayList<>();
for (TPHConstraint constraint : allCons) {
if(constraint.getRel()==Relation.EQUAL)
continue;
if (!vistedConstraints.contains(constraint)) {
vistedConstraints.add(constraint);
checkConstraint(constraint, vistedConstraints, cycles);
}
}
return cycles;
}
private void checkConstraint(TPHConstraint constraint, List<TPHConstraint> vistedConstraints,
List<Cycle> cycles) {
List<String> tphsInRelation = new LinkedList<>();
List<TPHConstraint> maybeCycle = new ArrayList<>();
maybeCycle.add(constraint);
tphsInRelation.add(constraint.getLeft());
tphsInRelation.add(constraint.getRight());
Optional<TPHConstraint> nextConstraint = getConstraintInRelation(tphsInRelation, maybeCycle);
while (nextConstraint.isPresent()) {
if(containsInLongCycle(nextConstraint.get(), cycles)) {
break;
}
if (isCycle(tphsInRelation)) {
addAllToVisitedConstraints(vistedConstraints, maybeCycle);
Cycle cycle = new Cycle(maybeCycle);
cycles.add(cycle);
return;
}
nextConstraint = getConstraintInRelation(tphsInRelation, maybeCycle);
}
// addAllToVisitedConstraints(vistedConstraints, maybeCycle);
}
private boolean containsInLongCycle(TPHConstraint c, List<Cycle> cycles) {
for(Cycle cycle : cycles) {
if(cycle.containConstraint(c))
return true;
}
return false;
}
private void addAllToVisitedConstraints(List<TPHConstraint> vistedConstraints, List<TPHConstraint> maybeCycle) {
for (TPHConstraint con : maybeCycle) {
if (!vistedConstraints.contains(con))
vistedConstraints.add(con);
}
}
private Optional<TPHConstraint> getConstraintInRelation(List<String> tphsInRelation,
List<TPHConstraint> maybeCycle) {
TPHConstraint constraint = getConstraintByLeftSide(tphsInRelation.get(tphsInRelation.size()-1),maybeCycle);
Optional<TPHConstraint> nextConstraint = Optional.ofNullable(constraint);
if(nextConstraint.isPresent()) {
maybeCycle.add(constraint);
tphsInRelation.add(constraint.getRight());
}
return nextConstraint;
}
private TPHConstraint getConstraintByLeftSide(String left, List<TPHConstraint> maybeCycle) {
for(TPHConstraint constraint : allCons) {
if(constraint.getRel()==Relation.EQUAL)
continue;
if(maybeCycle.contains(constraint))
continue;
if(constraint.getLeft().equals(left))
return constraint;
}
return null;
}
private boolean isCycle(List<String> tphsInRelation) {
return tphsInRelation.get(0).equals(tphsInRelation.get(tphsInRelation.size() - 1));
}
}
@@ -1,732 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.genericsGenerator;
import java.util.*;
import de.dhbwstuttgart.bytecode.TPHExtractor;
import de.dhbwstuttgart.bytecode.constraint.ExtendsConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.*;
import de.dhbwstuttgart.bytecode.insertGenerics.ClassConstraint;
import de.dhbwstuttgart.bytecode.insertGenerics.FamilyOfGeneratedGenerics;
import de.dhbwstuttgart.bytecode.utilities.MethodAndTPH;
import de.dhbwstuttgart.bytecode.utilities.MethodUtility;
import de.dhbwstuttgart.bytecode.utilities.Resolver;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.parser.scope.JavaClassName;
import de.dhbwstuttgart.syntaxtree.ASTVisitor;
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
import de.dhbwstuttgart.syntaxtree.Constructor;
import de.dhbwstuttgart.syntaxtree.Field;
import de.dhbwstuttgart.syntaxtree.FormalParameter;
import de.dhbwstuttgart.syntaxtree.GenericDeclarationList;
import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
import de.dhbwstuttgart.syntaxtree.Method;
import de.dhbwstuttgart.syntaxtree.ParameterList;
import de.dhbwstuttgart.syntaxtree.SourceFile;
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
import de.dhbwstuttgart.syntaxtree.statement.Assign;
import de.dhbwstuttgart.syntaxtree.statement.AssignToField;
import de.dhbwstuttgart.syntaxtree.statement.BinaryExpr;
import de.dhbwstuttgart.syntaxtree.statement.Block;
import de.dhbwstuttgart.syntaxtree.statement.CastExpr;
import de.dhbwstuttgart.syntaxtree.statement.DoStmt;
import de.dhbwstuttgart.syntaxtree.statement.EmptyStmt;
import de.dhbwstuttgart.syntaxtree.statement.ExpressionReceiver;
import de.dhbwstuttgart.syntaxtree.statement.FieldVar;
import de.dhbwstuttgart.syntaxtree.statement.ForStmt;
import de.dhbwstuttgart.syntaxtree.statement.IfStmt;
import de.dhbwstuttgart.syntaxtree.statement.InstanceOf;
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
import de.dhbwstuttgart.syntaxtree.statement.Literal;
import de.dhbwstuttgart.syntaxtree.statement.LocalVar;
import de.dhbwstuttgart.syntaxtree.statement.LocalVarDecl;
import de.dhbwstuttgart.syntaxtree.statement.MethodCall;
import de.dhbwstuttgart.syntaxtree.statement.NewArray;
import de.dhbwstuttgart.syntaxtree.statement.NewClass;
import de.dhbwstuttgart.syntaxtree.statement.Return;
import de.dhbwstuttgart.syntaxtree.statement.ReturnVoid;
import de.dhbwstuttgart.syntaxtree.statement.StaticClassName;
import de.dhbwstuttgart.syntaxtree.statement.Super;
import de.dhbwstuttgart.syntaxtree.statement.SuperCall;
import de.dhbwstuttgart.syntaxtree.statement.This;
import de.dhbwstuttgart.syntaxtree.statement.UnaryExpr;
import de.dhbwstuttgart.syntaxtree.statement.WhileStmt;
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.result.ResultSet;
/**
* @author fayez
*
*/
public class GeneratedGenericsFinder implements ASTVisitor {
private final TPHExtractor tphExtractor = new TPHExtractor();
private Collection<ResultSet> listOfResultSets;
private SourceFile sf;
private List<String> tphsClass;
private GenericGenratorResultForSourceFile generatedGenericsForSF;//Ergebnis des GGenerics
private ResultSet resultSet;
private final List<String> methodNameAndParamsT = new ArrayList<>();
private FamilyOfGeneratedGenerics fogg;
private String pkgName;
private JavaClassName className;
private Resolver resolver;
/**
* @param sf
* @param listOfResultSets
*/
public GeneratedGenericsFinder(SourceFile sf, Collection<ResultSet> listOfResultSets) {
this.sf = sf;
this.listOfResultSets = listOfResultSets;
}
public GenericGenratorResultForSourceFile findGeneratedGenerics() {
sf.accept(this);
return generatedGenericsForSF;
}
/**
* returns the family of Generated Generics
* insbesondere fuer Testzwecke
*/
public FamilyOfGeneratedGenerics getFogg() {
return fogg;
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.
* SourceFile)
*/
@Override
public void visit(SourceFile sourceFile) {
pkgName = sf.getPkgName();
generatedGenericsForSF = new GenericGenratorResultForSourceFile(pkgName);
for (ClassOrInterface cl : sourceFile.getClasses()) {
cl.accept(this);
}
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.
* ClassOrInterface)
*/
@Override
public void visit(ClassOrInterface classOrInterface) {
className = classOrInterface.getClassName();
List<ResultSet> listOfResultSetsList = new ArrayList<>(listOfResultSets);
boolean isVisited = false;
ConstraintsSimplierResult simplifiedConstraints = null;
GenericsGeneratorResultForClass ggResult = null;
GenericsGeneratorResultForClass ggResultAlternative = null;
for (int i = 0; i < listOfResultSetsList.size(); i++) {
resultSet = listOfResultSetsList.get(i);
tphExtractor.setResultSet(resultSet);
resolver = new Resolver(resultSet);
classOrInterface.accept(tphExtractor);
//PL 2020-10-16: Ab hier GGenerics implementieren durch Ali
//Rueckgabe an generatedGenericsForSF
fogg = new FamilyOfGeneratedGenerics(tphExtractor, resultSet);
System.out.println("fogg.allConstraints: "+ fogg.allConstraints);
System.out.println("fogg.posOfTPHs: "+ fogg.posOfTPHs);
System.out.println("fogg.classConstraints: "+ fogg.classConstraints);
System.out.println("fogg.methodConstraintsWithPosition: "+ fogg.methodConstraintsWithPosition);
System.out.println(fogg);
///*
//Fayez Ansatz Anfang
tphsClass = tphExtractor.tphsClass;
//PL 2020-01-15
//Es muss ggResult aus fogg gebildet werden
simplifiedConstraints = GenericsGenerator.simplifyConstraints(tphExtractor, tphsClass);
if(!isVisited) {
ggResult = GenericsGenerator.generateConstraints(className, tphExtractor, tphsClass,simplifiedConstraints);
isVisited = true;
}
for(Method m : classOrInterface.getMethods()) {
addMethodConstraints(simplifiedConstraints, ggResult, m);
}
if(ggResult != null) { //Hinzufuegen von Fayez ggResult
generatedGenericsForSF.addGenericGeneratorResultClass(ggResult);
}
// Fayez Ansatz Ende
//*/
//Ali Ansatz Anfang
List<GenericsGeneratorResult> listOfClassCons = new ArrayList<>();
for(TPHConstraint clCons: fogg.classConstraints) {
// ExtendsConstraint ec = new ExtendsConstraint(clCons.getLeft(), clCons.getRight());
GenericsGeneratorResult ggR = new GenericsGeneratorResult(clCons, new HashSet<>());
listOfClassCons.add(ggR);
}
GenericGeneratorResultsForAllMethods ggRfaM = null;
List<MethodAndConstraints> listOfMethAndCons = new ArrayList<>();
for(String methID: fogg.methodConstraintsWithPosition.keySet()) {
List<GenericsGeneratorResult> listOfGGR = new ArrayList<>();
for(TPHConstraint methCons: fogg.methodConstraintsWithPosition.get(methID)) {
// ExtendsConstraint ec = new ExtendsConstraint(methCons.getLeft(),methCons.getRight());
GenericsGeneratorResult ggR = new GenericsGeneratorResult(methCons, new HashSet<>());
listOfGGR.add(ggR);
}
MethodAndConstraints mac = new MethodAndConstraints(methID, listOfGGR);
listOfMethAndCons.add(mac);
}
ggRfaM = new GenericGeneratorResultsForAllMethods(listOfMethAndCons);
ggResultAlternative = new GenericsGeneratorResultForClass(className, listOfClassCons, ggRfaM);
if(ggResultAlternative != null) {//hinzufuegen von Alis ggResult
//generatedGenericsForSF.addGenericGeneratorResultClass(ggResultAlternative);
System.out.println(generatedGenericsForSF);
}
System.out.println(ggResultAlternative);
//Ali Ansatz Ende
}
}
/**
* @param simplifiedConstraints
* @param ggResult
* @param m
*/
public void addMethodConstraints(ConstraintsSimplierResult simplifiedConstraints,
GenericsGeneratorResultForClass ggResult, Method m) {
String id = MethodUtility.createID(resolver, m);
boolean isInGGResult = (ggResult != null) && ggResult.contains(id);
if(methodNameAndParamsT.contains(id) || isInGGResult)
return;
methodNameAndParamsT.add(id);
Optional<MethodAndTPH> methodAndTPH = GenericsGeneratorUtility.getMethodAndTphs(tphExtractor.ListOfMethodsAndTph,id);
methodAndTPH.ifPresent(mt->{
MethodAndConstraints methodConstraints = GenericsGenerator.generateConstraintsForMethod(tphExtractor.allCons, mt , simplifiedConstraints, tphsClass);
ggResult.getMethodsAndTheirConstraints().getMethodsAndConstraints().add(methodConstraints);
});
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.
* Method)
*/
@Override
public void visit(Method method) {
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.
* ParameterList)
*/
@Override
public void visit(ParameterList formalParameters) {
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.
* Constructor)
*/
@Override
public void visit(Constructor field) {
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.ArgumentList)
*/
@Override
public void visit(ArgumentList argumentList) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.LambdaExpression)
*/
@Override
public void visit(LambdaExpression lambdaExpression) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.Assign)
*/
@Override
public void visit(Assign assign) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.BinaryExpr)
*/
@Override
public void visit(BinaryExpr binary) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.Block)
*/
@Override
public void visit(Block block) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.CastExpr)
*/
@Override
public void visit(CastExpr castExpr) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.EmptyStmt)
*/
@Override
public void visit(EmptyStmt emptyStmt) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.FieldVar)
*/
@Override
public void visit(FieldVar fieldVar) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.ForStmt)
*/
@Override
public void visit(ForStmt forStmt) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.IfStmt)
*/
@Override
public void visit(IfStmt ifStmt) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.InstanceOf)
*/
@Override
public void visit(InstanceOf instanceOf) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.LocalVar)
*/
@Override
public void visit(LocalVar localVar) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.LocalVarDecl)
*/
@Override
public void visit(LocalVarDecl localVarDecl) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.MethodCall)
*/
@Override
public void visit(MethodCall methodCall) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.NewClass)
*/
@Override
public void visit(NewClass methodCall) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.NewArray)
*/
@Override
public void visit(NewArray newArray) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.Return)
*/
@Override
public void visit(Return aReturn) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.ReturnVoid)
*/
@Override
public void visit(ReturnVoid aReturn) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.StaticClassName)
*/
@Override
public void visit(StaticClassName staticClassName) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.Super)
*/
@Override
public void visit(Super aSuper) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.This)
*/
@Override
public void visit(This aThis) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.WhileStmt)
*/
@Override
public void visit(WhileStmt whileStmt) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.DoStmt)
*/
@Override
public void visit(DoStmt whileStmt) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.AssignToField)
*/
@Override
public void visit(AssignToField assignLeftSide) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.parser.
* SyntaxTreeGenerator.AssignToLocal)
*/
@Override
public void visit(AssignToLocal assignLeftSide) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.SuperCall)
*/
@Override
public void visit(SuperCall superCall) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.ExpressionReceiver)
*/
@Override
public void visit(ExpressionReceiver expressionReceiver) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.UnaryExpr)
*/
@Override
public void visit(UnaryExpr unaryExpr) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see de.dhbwstuttgart.syntaxtree.StatementVisitor#visit(de.dhbwstuttgart.
* syntaxtree.statement.Literal)
*/
@Override
public void visit(Literal literal) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.
* GenericTypeVar)
*/
@Override
public void visit(GenericTypeVar genericTypeVar) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.
* FormalParameter)
*/
@Override
public void visit(FormalParameter formalParameter) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.
* GenericDeclarationList)
*/
@Override
public void visit(GenericDeclarationList genericTypeVars) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.
* Field)
*/
@Override
public void visit(Field field) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.type
* .RefType)
*/
@Override
public void visit(RefType refType) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.type
* .SuperWildcardType)
*/
@Override
public void visit(SuperWildcardType superWildcardType) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.type
* .TypePlaceholder)
*/
@Override
public void visit(TypePlaceholder typePlaceholder) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.type
* .ExtendsWildcardType)
*/
@Override
public void visit(ExtendsWildcardType extendsWildcardType) {
// TODO Auto-generated method stub
}
/*
* (non-Javadoc)
*
* @see
* de.dhbwstuttgart.syntaxtree.ASTVisitor#visit(de.dhbwstuttgart.syntaxtree.type
* .GenericRefType)
*/
@Override
public void visit(GenericRefType genericRefType) {
// TODO Auto-generated method stub
}
}
@@ -1,256 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.genericsGenerator;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.*;
import de.dhbwstuttgart.parser.scope.JavaClassName;
import org.objectweb.asm.Type;
import de.dhbwstuttgart.bytecode.TPHExtractor;
import de.dhbwstuttgart.bytecode.constraint.ExtendsConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.utilities.MethodAndTPH;
/**
* @author fayez
*
*/
public class GenericsGenerator {
/*TODO: When generating generics for a class if we have the following:
tphClass < tphMeth1 < tphMeth2
then we have to convert tphMeth1, tphMeth2 to tph class and generate the following
class constraints: tphClass < tphMeth1, tphMeth1 < tphMeth2, tphMeth2 < Object
*/
public static GenericsGeneratorResultForClass generateConstraints(final JavaClassName className, final TPHExtractor tphExtractor,
final List<String> tphsClass, final ConstraintsSimplierResult simplifiedConstraints) {
List<GenericsGeneratorResult> classConstraints = generateConstraintsForClass(tphExtractor,
simplifiedConstraints, tphsClass);
// GenericGeneratorResultsForAllMethods methodsAndConstraints = generateConstraintsForAllMethods(tphExtractor,
// simplifiedConstraints, tphsClass);
GenericGeneratorResultsForAllMethods methodsAndConstraints = new GenericGeneratorResultsForAllMethods(new ArrayList<>());
return new GenericsGeneratorResultForClass(className, classConstraints, methodsAndConstraints);
}
/**
* @param tphExtractor
* @param tphsClass
* @return
*/
public static ConstraintsSimplierResult simplifyConstraints(final TPHExtractor tphExtractor,
final List<String> tphsClass) {
final List<GenericsGeneratorResult> genericsGeneratorResults = new ArrayList<>();
ConstraintsSimplierResult simplifiedConstraints = ConstraintsSimplifier.simplifyConstraints(tphExtractor,
genericsGeneratorResults, tphsClass);
return simplifiedConstraints;
}
private static List<GenericsGeneratorResult> generateConstraintsForClass(final TPHExtractor tphExtractor,
final ConstraintsSimplierResult simplifiedConstraints, final List<String> tphsClass) {
final List<GenericsGeneratorResult> constraints = new ArrayList<>();
if (tphsClass.isEmpty())
return constraints;
final List<TPHConstraint> allCons = tphExtractor.allCons;
final Set<String> visitedTPHs = new HashSet<>();
final List<String> methodTPHs = tphExtractor.ListOfMethodsAndTph.stream().map(m -> m.getLocalTphs())
.flatMap(l -> l.stream()).collect(Collectors.toList());
createConstraintsForClassTphs(simplifiedConstraints, tphsClass, constraints, allCons, visitedTPHs, methodTPHs);
GenericsGeneratorUtility.addTPHsToClassTPHs(constraints, tphsClass);
GenericsGeneratorUtility.removeClassTPHsFromMethodTPHs(tphsClass, tphExtractor);
generateGGConstraintsForTPH(tphsClass, constraints, simplifiedConstraints);
return constraints;
}
private static void createConstraintsForClassTphs(ConstraintsSimplierResult simplifiedConstraints, List<String> tphsClass, List<GenericsGeneratorResult> constraints, List<TPHConstraint> allCons, Set<String> visitedTPHs, List<String> methodTPHs) {
List<String> classAndMethodTphs = new ArrayList<>(tphsClass);
classAndMethodTphs.addAll(methodTPHs);
for (String tph : tphsClass) {
if (visitedTPHs.contains(tph))
continue;
final LinkedList<String> tphsInRel = GenericsGeneratorUtility
.createLinkedListForTPHsInRelationClass(allCons, tphsClass, methodTPHs, visitedTPHs, tph);
generateConstraintsForClassFromList(tphsInRel,simplifiedConstraints,classAndMethodTphs,constraints);
}
}
private static void generateConstraintsForClassFromList(LinkedList<String> tphsInRel, ConstraintsSimplierResult simplifiedConstraints, List<String> classAndMethodTphs, List<GenericsGeneratorResult> constraints) {
if(tphsInRel.isEmpty())
return;
List<GenericsGeneratorResult> resultConstraints = new ArrayList<>();
String subType = tphsInRel.getFirst();
String superType = GenericsGeneratorUtility.getNextClassTph(classAndMethodTphs, tphsInRel);
int idxOfSuper = tphsInRel.indexOf(superType);
int size = tphsInRel.size();
while (size > 2 && idxOfSuper < size-1){
GenericsGeneratorResult genericsGeneratorResult = getGenericsGeneratorResultForClass(simplifiedConstraints, subType, superType);
constraints.add(genericsGeneratorResult);
tphsInRel = new LinkedList<>(tphsInRel.subList(idxOfSuper, size));
subType = tphsInRel.getFirst();
superType = GenericsGeneratorUtility.getNextClassTph(classAndMethodTphs, tphsInRel);
idxOfSuper = tphsInRel.indexOf(superType);
size = tphsInRel.size();
}
GenericsGeneratorResult genericsGeneratorResult = getGenericsGeneratorResultForClass(simplifiedConstraints, subType, superType);
constraints.add(genericsGeneratorResult);
}
private static GenericsGeneratorResult getGenericsGeneratorResultForClass(ConstraintsSimplierResult simplifiedConstraints, String subType, String superType) {
TPHConstraint constraint = new ExtendsConstraint(subType, superType);
Set<String> equalSet = GenericsGeneratorUtility
.createEqualSet(simplifiedConstraints.getNameReplacementResults(), subType);
return new GenericsGeneratorResult(constraint, equalSet);
}
/* TODO Remove this methoda*/
private static GenericsGeneratorResult generateGGResultForClass(LinkedList<String> tphsInRel,
ConstraintsSimplierResult simplifiedConstraints, List<String> tphsClass) {
String subType = tphsInRel.getFirst();
String superType = GenericsGeneratorUtility.getNextClassTph(tphsClass, tphsInRel);
TPHConstraint constraint = new ExtendsConstraint(subType, superType);
Set<String> equalSet = GenericsGeneratorUtility
.createEqualSet(simplifiedConstraints.getNameReplacementResults(), subType);
return new GenericsGeneratorResult(constraint, equalSet);
}
private static GenericGeneratorResultsForAllMethods generateConstraintsForAllMethods(
final TPHExtractor tphExtractor, ConstraintsSimplierResult simplifiedConstraints, List<String> tphsClass) {
final List<MethodAndConstraints> methodsAndConstraints = new ArrayList<>();
final GenericGeneratorResultsForAllMethods results = new GenericGeneratorResultsForAllMethods(
methodsAndConstraints);
tphExtractor.ListOfMethodsAndTph.forEach(m -> {
MethodAndConstraints methAndCons = generateConstraintsForMethod(tphExtractor.allCons, m,
simplifiedConstraints, tphsClass);
methodsAndConstraints.add(methAndCons);
});
return results;
}
public static MethodAndConstraints generateConstraintsForMethod(final List<TPHConstraint> allCons,
final MethodAndTPH m, final ConstraintsSimplierResult simplifiedConstraints, List<String> tphsClass) {
final List<String> localTphs = m.getLocalTphs();
List<GenericsGeneratorResult> constraints = new ArrayList<>();
MethodAndConstraints result = new MethodAndConstraints(m.getId(), constraints);
if (localTphs.isEmpty())
return result;
if (localTphs.size() == 1 && tphsClass.isEmpty()) {
generateGGConstraintsForTPH(localTphs, constraints, simplifiedConstraints);
return result;
}
final Set<String> visitedTPHs = new HashSet<>();
for (String tph : localTphs) {
if (visitedTPHs.contains(tph))
continue;
final LinkedList<String> tphsInRel = GenericsGeneratorUtility.createLinkedListForTPHsInRelation(allCons,
localTphs, tphsClass, visitedTPHs, tph);
if (!tphsInRel.isEmpty()) {
GenericsGeneratorUtility.removeNotLocalTphs(tphsInRel, localTphs, tphsClass);
if (!GenericsGeneratorUtility.isInResult(tphsInRel.getFirst(), constraints)) {
GenericsGeneratorResult constraint = generateGGResult(tphsInRel, simplifiedConstraints);
constraints.add(constraint);
}
}
}
generateGGConstraintsForTPH(localTphs, constraints, simplifiedConstraints);
return result;
}
private static void generateGGConstraintsForTPH(List<String> localTphs,
final List<GenericsGeneratorResult> constraints, final ConstraintsSimplierResult simplifiedConstraints) {
localTphs.forEach(tph -> {
boolean isInSimplifiedConstraints = GenericsGeneratorUtility.isTPHInGenericGeneratorResult(simplifiedConstraints.getGenericsGenResults(), tph);
if (isInSimplifiedConstraints) {
GenericsGeneratorResult ggResult = GenericsGeneratorUtility.getGenericGeneratorResult(simplifiedConstraints.getGenericsGenResults(), tph).get();
// GenericsGeneratorUtility.removeGenericGeneratorResult(simplifiedConstraints.getGenericsGenResults(),ggResult);
constraints.add(ggResult);
} else {
boolean isInConstraints = GenericsGeneratorUtility.isTPHInGenericGeneratorResult(constraints, tph);
if (!isInConstraints) {
GenericsGeneratorResult ggResult = generateGGResult(tph, simplifiedConstraints.getNameReplacementResults());
constraints.add(ggResult);
}
}
});
}
private static GenericsGeneratorResult generateGGResult(String tph,
List<NameReplacementResult> nameReplacementResults) {
String superType = Type.getInternalName(Object.class);
TPHConstraint constraint = new ExtendsConstraint(tph, superType);
Set<String> equalSet = GenericsGeneratorUtility.createEqualSet(nameReplacementResults, tph);
return new GenericsGeneratorResult(constraint, equalSet);
}
private static GenericsGeneratorResult generateGGResult(final LinkedList<String> tphsInRel,
final ConstraintsSimplierResult simplifiedConstraints) {
String subType = tphsInRel.getFirst();
if (tphsInRel.size() == 1) {
Optional<GenericsGeneratorResult> constraintFromSimplifiedCon = simplifiedConstraints
.getGenericsGenResults().stream().filter(g -> g.getConstraint().getLeft().equals(subType))
.findFirst();
if (constraintFromSimplifiedCon.isPresent())
return constraintFromSimplifiedCon.get();
}
String superType = tphsInRel.size() > 1 ? tphsInRel.getLast() : Type.getInternalName(Object.class);
TPHConstraint constraint = new ExtendsConstraint(subType, superType);
Set<String> equalSet = GenericsGeneratorUtility
.createEqualSet(simplifiedConstraints.getNameReplacementResults(), subType);
return new GenericsGeneratorResult(constraint, equalSet);
}
}
@@ -1,571 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.genericsGenerator;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.*;
import org.objectweb.asm.Type;
import de.dhbwstuttgart.bytecode.TPHExtractor;
import de.dhbwstuttgart.bytecode.constraint.EqualConstraint;
import de.dhbwstuttgart.bytecode.constraint.ExtendsConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint.Relation;
import de.dhbwstuttgart.bytecode.utilities.ConstraintsFinder;
import de.dhbwstuttgart.bytecode.utilities.MethodAndTPH;
import de.dhbwstuttgart.bytecode.utilities.NameReplacer;
/**
* @author fayez
*
*/
public class GenericsGeneratorUtility {
/**
* Returns a list of type placeholders names of a specified method
*
* @param methodID The id of the method ReturnTypeMethodName(ParameterTypes)
* @param listOfMethodsAndTph List of all methods
* @return a list of type placehoders names
*/
public static List<String> getMethodTPHS(String methodID, ArrayList<MethodAndTPH> listOfMethodsAndTph) {
return listOfMethodsAndTph.stream().filter(mt->mt.getId().equals(methodID)).findAny().get().getTphs();
}
/**
* Returns a reverse constraint of a specified constraint which is given by its left and right
* side
*
* @param allCons List of all constraints
* @param left The left side of the given constraint
* @param right The right side of the given constraint
* @return An Optional object which contains the reverse constraint if it is exist
*/
public static Optional<TPHConstraint> getReverseConstraint(List<TPHConstraint> allCons, String left, String right) {
return allCons.stream().filter(c->{
return c.getRight().equals(left) && c.getLeft().equals(right);
}).findAny();
}
/**
* Substitutes the old name by the new name in all constraints
*
* @param allCons List of all constraints
* @param oldName The name to be replaced
* @param newName The new name
*/
public static void substituteTPH(List<TPHConstraint> allCons, String oldName, String newName) {
allCons.stream()
.filter(c->c.getRel()==Relation.EXTENDS)
.forEach(c->{
if(c.getLeft().equals(oldName))
c.setLeft(newName);
if(c.getRight().equals(oldName))
c.setRight(newName);
});
}
public static List<ConstraintsWithSameLeftSide> findConstraintsWithLeftSameLeftSide(List<TPHConstraint> allCons) {
// finder looks for constraints that have the same left hand side
// and put them in a list
ConstraintsFinder finder = new ConstraintsFinder(allCons);
List<ConstraintsWithSameLeftSide> foundCons = finder.findConstraints();
return foundCons;
}
public static void simplifyConstraintsWithSameLeftSide(List<ConstraintsWithSameLeftSide> consWithSameLeftSide,
List<TPHConstraint> allCons, List<String> methodTPHS) {
List<TPHConstraint> eqCons = new ArrayList<>();
for (ConstraintsWithSameLeftSide list : consWithSameLeftSide) {
NameReplacementResult replRes = modifyNames(allCons, methodTPHS, list);
createEqualConstraintsForNames(replRes.getName(), replRes.getOldNames(),eqCons);
for (TPHConstraint c : allCons) {
if (c.getRel() == Relation.EQUAL && replRes.getName().equals(c.getRight())) {
eqCons.add(c);
}
}
updateEqualCons(replRes, eqCons);
TPHConstraint c = list.getConstraints().get(0);
allCons.removeAll(list.getConstraints());
allCons.add(c);
}
}
public static void simplifyConstraintsWithSameLeftSide(List<ConstraintsWithSameLeftSide> consWithSameLeftSide,
TPHExtractor tphExtractor, List<String> tphsClass, List<TPHConstraint> equalCons) {
List<TPHConstraint> allCons = tphExtractor.allCons;
for (ConstraintsWithSameLeftSide list : consWithSameLeftSide) {
if(!stillWithSameLeftSide(list))
continue;
NameReplacementResult replRes = modifyNames(allCons, list, tphExtractor.ListOfMethodsAndTph,tphsClass);
createEqualConstraintsForNames(replRes.getName(), replRes.getOldNames(),equalCons);
for (TPHConstraint c : allCons) {
if (c.getRel() == Relation.EQUAL && replRes.getName().equals(c.getRight())) {
equalCons.add(c);
}
}
updateEqualCons(replRes, equalCons);
TPHConstraint c = list.getConstraints().get(0);
allCons.removeAll(list.getConstraints());
removeConstraintsWithSameLeftAndRightSide(allCons);
allCons.add(c);
removeDuplicate(allCons);
}
consWithSameLeftSide.clear();
consWithSameLeftSide = findConstraintsWithLeftSameLeftSide(allCons);
if(!consWithSameLeftSide.isEmpty())
simplifyConstraintsWithSameLeftSide(consWithSameLeftSide,tphExtractor,tphsClass,equalCons);
}
private static void removeDuplicate(List<TPHConstraint> allCons) {
List<TPHConstraint> visited = new ArrayList<>();
List<Integer> toRemove = new ArrayList<>();
checkForDuplicate(allCons, visited, toRemove);
removeConstraintsByIndex(allCons, toRemove);
}
private static void removeConstraintsByIndex(List<TPHConstraint> allCons, List<Integer> toRemove) {
for(int index : toRemove)
allCons.remove(index);
}
private static void checkForDuplicate(List<TPHConstraint> allCons, List<TPHConstraint> visited, List<Integer> toRemove) {
for(int i = 0;i<allCons.size();++i){
markConstraintIfDuplicate(allCons, visited, toRemove, i);
}
}
private static void markConstraintIfDuplicate(List<TPHConstraint> allCons, List<TPHConstraint> visited, List<Integer> toRemove, int i) {
TPHConstraint constraint = allCons.get(i);
if(containsInList(visited,constraint.getLeft(),constraint.getRight())){
toRemove.add(i);
} else {
visited.add(constraint);
}
}
private static boolean containsInList(List<TPHConstraint> allConstraints, String left, String right) {
for(TPHConstraint constraint : allConstraints)
if(constraint.getLeft().equals(left) && constraint.getRight().equals(right))
return true;
return false;
}
private static void addNewConstraintsWithSameLeftSide(ConstraintsWithSameLeftSide constraintsWithSameLeftSide, List<TPHConstraint> allCons) {
allCons.forEach(c->{
if (constraintsWithSameLeftSide.getConstraints().get(0).getLeft().equals(c.getLeft())){
if(!constraintsWithSameLeftSide.getConstraints().contains(c))
constraintsWithSameLeftSide.getConstraints().add(c);
}
});
}
private static void checkForNewConstraintsWithSameLeftSide(List<ConstraintsWithSameLeftSide> consWithSameLeftSide, List<TPHConstraint> allCons) {
allCons.forEach(c->{
Optional<ConstraintsWithSameLeftSide> constraintsWithSameLeftSide = getConstraintsWithSameLeftSide(consWithSameLeftSide, c.getLeft());
constraintsWithSameLeftSide.ifPresent(cls->{
if(!cls.getConstraints().contains(c))
cls.getConstraints().add(c);
});
});
}
private static Optional<ConstraintsWithSameLeftSide> getConstraintsWithSameLeftSide(List<ConstraintsWithSameLeftSide> consWithSameLeftSide, String left) {
return consWithSameLeftSide.stream().filter(csl->isContainedInConsWithLeftSide(csl,left)).findAny();
}
private static boolean isContainedInConsWithLeftSide(ConstraintsWithSameLeftSide csl, String left) {
return csl.getConstraints().get(0).getLeft().equals(left);
}
private static boolean stillWithSameLeftSide(ConstraintsWithSameLeftSide constraints) {
removeUnvalidConstraints(constraints);
return constraints.getConstraints().size()>1;
}
private static void removeUnvalidConstraints(ConstraintsWithSameLeftSide constraints) {
List<TPHConstraint> toRemove = new ArrayList<>();
constraints.getConstraints().forEach(c->{
if(c.getLeft().equals(c.getRight()))
toRemove.add(c);
});
if(!toRemove.isEmpty())
constraints.getConstraints().removeAll(toRemove);
}
private static void removeConstraintsWithSameLeftAndRightSide(List<TPHConstraint> allCons) {
List<TPHConstraint> toRemove = new ArrayList<>();
allCons.forEach(c->{
if(c.getLeft().equals(c.getRight()))
toRemove.add(c);
});
allCons.removeAll(toRemove);
}
private static void createEqualConstraintsForNames(String name, List<String> equalNames, List<TPHConstraint> eqCons) {
// create an equal constraint for each value in repres
for (String eName : equalNames) {
EqualConstraint ec = new EqualConstraint(eName, name);
eqCons.add(ec);
}
}
/**
* @param allCons
* @param methodTPHS
* @param list
* @return
*/
public static NameReplacementResult modifyNames(List<TPHConstraint> allCons, List<String> methodTPHS,
ConstraintsWithSameLeftSide list) {
// generate a new name and replace the right hand side for each constraint
// in list with the new name
NameReplacer replacer = new NameReplacer(list.getConstraints(), allCons, methodTPHS);
// new name -> [all old names]
NameReplacementResult replRes = replacer.replaceNames();
return replRes;
}
public static NameReplacementResult modifyNames(List<TPHConstraint> allCons, ConstraintsWithSameLeftSide list, List<MethodAndTPH> methodAndTPHs, List<String> tphsClass) {
// generate a new name and replace the right hand side for each constraint
// in list with the new name
NameReplacer replacer = new NameReplacer(list.getConstraints(), allCons, methodAndTPHs, tphsClass);
// new name -> [all old names]
NameReplacementResult replRes = replacer.replaceNames();
return replRes;
}
public static void updateEqualCons(NameReplacementResult nameReplacementResult, List<TPHConstraint> eqCons) {
List<String> oldNames = nameReplacementResult.getOldNames();
String newName = nameReplacementResult.getName();
for (TPHConstraint c : eqCons) {
// if(oldNames.contains(c.getLeft()))
// c.setLeft(newName);
if (oldNames.contains(c.getRight()))
c.setRight(newName);
}
}
public static void modifyRelationForConstraintsInCycle(List<Cycle> cycles) {
cycles.stream().map(lc->lc.getConstraints()).flatMap(e->e.stream()).forEach(c->c.setRel(Relation.EQUAL));
}
public static List<NameReplacementResult> substituteTPHSFormCycle(List<TPHConstraint> allCons, List<Cycle> cycles, TPHExtractor tphExtractor) {
List<NameReplacementResult> results = new ArrayList<>();
cycles.forEach(lc->{
Set<String> names = getNamesFromCycle(lc);
String newName = names.stream().findFirst().get();
List<String> equalNames = new ArrayList<>(names);
Stream<ArrayList<String>> tphsOfMethods = tphExtractor.ListOfMethodsAndTph.stream().map(m->m.getTphs());
Stream<ArrayList<String>> localTphsOfMethods = tphExtractor.ListOfMethodsAndTph.stream().map(m->m.getLocalTphs());
replaceOldNames(newName, equalNames, tphsOfMethods);
replaceOldNames(newName, equalNames, localTphsOfMethods);
NameReplacementResult res = new NameReplacementResult(newName, equalNames);
results.add(res);
substituteAll(allCons,names,newName);
});
return results;
}
/**
* @param newName
* @param names
* @param tphsOfMethods
*/
public static void replaceOldNames(final String newName, final List<String> names, Stream<ArrayList<String>> tphsOfMethods) {
tphsOfMethods.forEach(tphsMethod->{
if(tphsMethod.removeAll(names))
tphsMethod.add(newName);
});
}
public static void substituteAll(List<TPHConstraint> allCons, Set<String> names, String newName) {
allCons.stream()
.filter(c-> c.getRel()==Relation.EXTENDS)
.forEach(c->{
if(names.contains(c.getLeft())) {
c.setLeft(newName);
} else if(names.contains(c.getRight())) {
c.setRight(newName);
}
});
}
public static Set<String> getNamesFromCycle(Cycle lc) {
Set<String> names = new HashSet<>();
lc.getConstraints().forEach(c->names.add(c.getLeft()));
return names;
}
public static void createResults(List<GenericsGeneratorResult> genericsGeneratorResults,
List<NameReplacementResult> nameReplacementResults) {
nameReplacementResults.forEach(n->{
Set<String> equals = new HashSet<>(n.getOldNames());
TPHConstraint cons = new ExtendsConstraint(n.getName(), Type.getInternalName(Object.class));
GenericsGeneratorResult ggRes = new GenericsGeneratorResult(cons, equals);
genericsGeneratorResults.add(ggRes);
});
}
public static void removeEqualConstraints(List<TPHConstraint> allCons) {
List<TPHConstraint> equalConstraints = getEqualConstraints(allCons);
allCons.removeAll(equalConstraints);
}
public static List<TPHConstraint> getEqualConstraints(List<TPHConstraint> allCons) {
return allCons.stream().filter(c->c.getRel()==Relation.EQUAL).collect(Collectors.toList());
}
public static List<NameReplacementResult> createNameReplacementResultsFromEqualConstraints(
List<TPHConstraint> equalCons) {
List<NameReplacementResult> nameReplacementResults = new ArrayList<>();
equalCons.forEach(c->{
if(isInNameReplacementResults(nameReplacementResults,c.getRight())) {
getNameReplacementByName(nameReplacementResults,c.getRight()).getOldNames().add(c.getLeft());
} else {
List<String> oldNames = new ArrayList<>();
oldNames.add(c.getLeft());
NameReplacementResult nrRes = new NameReplacementResult(c.getRight(), oldNames);
nameReplacementResults.add(nrRes);
}
});
return nameReplacementResults;
}
private static NameReplacementResult getNameReplacementByName(List<NameReplacementResult> nameReplacementResults,
String name) {
return nameReplacementResults.stream().filter(n->n.getName().equals(name)).findFirst().get();
}
public static boolean isInNameReplacementResults(List<NameReplacementResult> nameReplacementResults,String name){
if(nameReplacementResults.isEmpty())
return false;
return nameReplacementResults.stream().map(r->r.getName()).filter(n->name.equals(n)).findFirst().isPresent();
}
public static Optional<TPHConstraint> getConstraintByLeftSide(List<TPHConstraint> allCons, String tph) {
return allCons.stream().filter(c->c.getLeft().equals(tph)).findFirst();
}
public static Optional<TPHConstraint> getConstraintByRightSide(List<TPHConstraint> allCons, String tph) {
return allCons.stream().filter(c->c.getRight().equals(tph)).findFirst();
}
public static boolean isTPHInGenericGeneratorResult(final List<GenericsGeneratorResult> constraints, final String tph) {
return constraints.stream().filter(g->g.getConstraint().getLeft().equals(tph)).findFirst().isPresent();
}
/**
* @param allCons
* @param tphsMethod
* @param tphsClass
* @param visitedTPHs
* @param tph
* @return
*/
public static LinkedList<String> createLinkedListForTPHsInRelation(final List<TPHConstraint> allCons,
List<String> tphsMethod, List<String> tphsClass, final Set<String> visitedTPHs, String tph) {
final LinkedList<String> tphsInRel = new LinkedList<>();
List<String> tphsList = new ArrayList<>(tphsMethod);
tphsList.addAll(tphsClass);
boolean isNextSuperTypeFound = findNextSuperTyp(allCons,tphsList ,visitedTPHs, tph, tphsInRel);
if(!isNextSuperTypeFound)
findNextSubType(allCons, tphsList,visitedTPHs, tph, tphsInRel);
return tphsInRel;
}
public static boolean findNextSubType(List<TPHConstraint> allCons, List<String> tphsList, Set<String> visitedTPHs, String tph,
LinkedList<String> tphsInRel) {
Optional<TPHConstraint> con = getConstraintByRightSide(allCons, tph);
while (con.isPresent()) {
String left = con.get().getLeft();
String right = con.get().getRight();
addTPHsToListFromLeft(tphsInRel, left, right);
markAsVisited(visitedTPHs, left);
if(tphsList.contains(left))
return true;
con = getConstraintByRightSide(allCons, left);
}
return false;
}
public static void addTPHsToListFromLeft(LinkedList<String> tphsInRel, String left, String right) {
if (tphsInRel.isEmpty())
tphsInRel.add(right);
tphsInRel.addFirst(left);
}
/**
* @param allCons
* @param tphsList
* @param visitedTPHs
* @param tph
* @param tphsInRel
* @return
*/
public static boolean findNextSuperTyp(final List<TPHConstraint> allCons, List<String> tphsList, final Set<String> visitedTPHs, String tph,
final LinkedList<String> tphsInRel) {
Optional<TPHConstraint> con = getConstraintByLeftSide(allCons, tph);
markAsVisited(visitedTPHs, tph);
while (con.isPresent()) {
String left = con.get().getLeft();
String right = con.get().getRight();
addTPHsToList(tphsInRel, left, right);
if(tphsList.contains(right))
return true;
markAsVisited(visitedTPHs, right);
con = getConstraintByLeftSide(allCons, right);
}
return false;
}
public static void markAsVisited(Set<String> visitedTPHs, String left) {
visitedTPHs.add(left);
}
/**
* @param visitedTPHs
* @param right
* @param left
*/
public static void markAsVisited(final Set<String> visitedTPHs, String left, String right) {
visitedTPHs.add(left);
visitedTPHs.add(right);
}
/**
* @param tphsInRel
* @param right
* @param left
*/
public static void addTPHsToList(final LinkedList<String> tphsInRel, String left, String right) {
if (tphsInRel.isEmpty())
tphsInRel.add(left);
tphsInRel.add(right);
}
public static void removeNotLocalTphs(final LinkedList<String> tphsInRel, final List<String> localTphs,
List<String> tphsClass) {
while (!localTphs.contains(tphsInRel.peek())) {
tphsInRel.removeFirst();
}
String last = tphsInRel.peekLast();
while (!localTphs.contains(last) && !tphsClass.contains(last)) {
tphsInRel.removeLast();
last = tphsInRel.peekLast();
}
}
/**
* @param nameReplacementResults
* @param subType
* @return
*/
public static Set<String> createEqualSet(final List<NameReplacementResult> nameReplacementResults, String subType) {
Optional<NameReplacementResult> equals = nameReplacementResults.stream()
.filter(n -> n.getName().equals(subType)).findFirst();
Set<String> equalSet = equals.isPresent() ? new HashSet<>(equals.get().getOldNames()) : new HashSet<>();
return equalSet;
}
public static String getNextClassTph(List<String> tphsClass, LinkedList<String> tphsInRel) {
for(int i = 1;i<tphsInRel.size();++i) {
String next = tphsInRel.get(i);
if(tphsClass.contains(next))
return next;
}
return tphsInRel.getLast();
}
public static void addTPHsToClassTPHs(final List<GenericsGeneratorResult> constraints, final List<String> tphsClass) {
List<String> lefts = constraints.stream().map(r->r.getConstraint()).map(c->c.getLeft()).collect(Collectors.toList());
List<String> rights = constraints.stream().map(r->r.getConstraint()).map(c->c.getRight()).collect(Collectors.toList());
List<String> leftsAndRights = new ArrayList<>(lefts);
leftsAndRights.addAll(rights);
List<String> shouldBeClassTphs = leftsAndRights.stream().distinct().collect(Collectors.toList());
for(String tph : shouldBeClassTphs) {
if(!tphsClass.contains(tph))
tphsClass.add(tph);
}
}
public static void removeClassTPHsFromMethodTPHs(List<String> tphsClass, TPHExtractor tphExtractor) {
tphExtractor.ListOfMethodsAndTph.stream().map(m->m.getTphs()).forEach(tphs->{
tphs.removeAll(tphsClass);
});
tphExtractor.ListOfMethodsAndTph.stream().map(m->m.getLocalTphs()).forEach(tphs->{
tphs.removeAll(tphsClass);
});
}
public static LinkedList<String> createLinkedListForTPHsInRelationClass(List<TPHConstraint> allCons,
List<String> tphsClass, List<String> methodTPHs, Set<String> visitedTPHs, String tph) {
final LinkedList<String> tphsInRel = new LinkedList<>();
boolean isNextSuperTypeFound = findNextSuperTyp(allCons,tphsClass ,visitedTPHs, tph, tphsInRel);
if(!tphsInRel.isEmpty() && !isNextSuperTypeFound && !methodTPHs.contains(tphsInRel.getLast()))
findNextSubType(allCons, tphsClass,visitedTPHs, tph, tphsInRel);
return tphsInRel;
}
public static boolean isInResult(String first, List<GenericsGeneratorResult> constraints) {
return constraints.stream().map(r->r.getConstraint()).filter(c->c.getLeft().equals(first)).findFirst().isPresent();
}
public static Optional<GenericsGeneratorResult> getGenericGeneratorResult(List<GenericsGeneratorResult> list,
String tph) {
return list.stream().filter(g->g.getConstraint().getLeft().equals(tph)).findFirst();
}
public static void removeGenericGeneratorResult(List<GenericsGeneratorResult> genericsGenResults,
GenericsGeneratorResult ggResult) {
genericsGenResults.remove(ggResult);
}
public static Optional<MethodAndTPH> getMethodAndTphs(ArrayList<MethodAndTPH> listOfMethodsAndTph, String id) {
return listOfMethodsAndTph.stream().filter(m->m.getId().equals(id)).findFirst();
}
}
@@ -1,46 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.genericsGeneratorTypes;
import java.util.List;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
/**
* @author fayez
*
*/
public class Cycle {
private final List<TPHConstraint> constraints;
/**
* @param constraints
*/
public Cycle(List<TPHConstraint> constraints) {
this.constraints = constraints;
}
/**
* @return the constraints
*/
public List<TPHConstraint> getConstraints() {
return constraints;
}
public boolean containConstraint(TPHConstraint constraint) {
for(TPHConstraint c : constraints) {
if(c.equalConstraint(constraint))
return true;
}
return false;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
constraints.forEach(c->sb.append(c.getLeft()+" -> "));
sb.append(constraints.get(constraints.size()-1).getRight());
return sb.toString();
}
}
@@ -1,16 +0,0 @@
package de.dhbwstuttgart.bytecode.insertGenerics;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint.Relation;
public class ClassConstraint extends TPHConstraint {
//private TPHConstraint constraint;
public ClassConstraint(String left, String right, Relation rel) {
super(left, right, rel);
}
//besser?
/*public ClassConstraint(TPHConstraint constraint) {
this.constraint = constraint;
}*/
}
@@ -1,880 +0,0 @@
package de.dhbwstuttgart.bytecode.insertGenerics;
import de.dhbwstuttgart.bytecode.TPHExtractor;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint.Relation;
import de.dhbwstuttgart.bytecode.utilities.MethodAndTPH;
import java.util.*;
import java.util.function.Predicate;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.constraints.Constraint;
import de.dhbwstuttgart.typeinference.constraints.Pair;
import de.dhbwstuttgart.typeinference.result.ResultPair;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import de.dhbwstuttgart.typeinference.unify.model.PairOperator;
import org.objectweb.asm.Type;
public class FamilyOfGeneratedGenerics {
public List<TPHConstraint> allConstraints = new ArrayList<>();
// HashMap speichert ob TPH in einer Methode oder in der Klasse ist; und wenn es in der Methode ist, in welcher Methode
public HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTPHs = new HashMap<>();
public List<ClassConstraint> classConstraints = new ArrayList<>();
private HashMap<String, MethodAndTPH> mapMethodsAndTph = new HashMap<>();
public List<MethodConstraint> methodConstraints = new ArrayList<>();
public HashMap<String, List<MethodConstraint>> methodConstraintsWithPosition = new HashMap<>();
public ResultSet resSet;
public Set<Pair> oldCons = new HashSet<>();
private static final String objectType = Type.getInternalName(Object.class);
public FamilyOfGeneratedGenerics(TPHExtractor tphExtractor, ResultSet resultSet) {
this.resSet = resultSet;
this.oldCons = tphExtractor.oldConstraints;
this.allConstraints = tphExtractor.allCons;
this.posOfTPHs = positionConverter(tphExtractor.allTPHS, tphExtractor.ListOfMethodsAndTph);
this.classConstraints = getClassConstraints(allConstraints,posOfTPHs);
tphExtractor.ListOfMethodsAndTph.forEach(matph -> this.mapMethodsAndTph.put(matph.getId(), matph));
this.methodConstraints = getMethodConstraints(allConstraints,classConstraints,posOfTPHs, tphExtractor.ListOfMethodsAndTph);
this.methodConstraintsWithPosition = getMethodConstraintsWithPositionNew(allConstraints,classConstraints,posOfTPHs, tphExtractor.ListOfMethodsAndTph, resSet, oldCons);
}
public static List<ClassConstraint> getClassConstraints(List<TPHConstraint> cs, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs) { //Inputparameter List<TPHConstraint> constraintsSet weg
List<ClassConstraint> cs_cl = new ArrayList<>();
List<ClassConstraint> classConstraints1 = typeOfANodeOfAField(cs, posOfTphs);
for (ClassConstraint cons: classConstraints1) {
if (!checkForDuplicates(cons, cs_cl)) {
cs_cl.add(cons);
}
}
// if sth new is added to cs_cl, then do same step again
boolean addedToConstraintsListForCC2 = false;
do {
addedToConstraintsListForCC2 = false;
List<ClassConstraint> classConstraints2 = transitiveSubtypeForClassTypes(cs, cs_cl); // in Klammer classConstraints1 oder constraintsSet? beides eher
for (ClassConstraint cons: classConstraints2) {
if (!checkForDuplicates(cons, cs_cl)) {
cs_cl.add(cons);
addedToConstraintsListForCC2 = true;
}
}
} while (addedToConstraintsListForCC2);
List<ClassConstraint> classConstraints3 = hasNoSupertypeForClassTypes(cs_cl, posOfTphs);
for (ClassConstraint cons: classConstraints3) {
if (!checkForDuplicates(cons, cs_cl)) {
cs_cl.add(cons);
}
}
return cs_cl;
}
public List<MethodConstraint> getMethodConstraints(List<TPHConstraint> cs, List<ClassConstraint> cs_cl, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs, List<MethodAndTPH> listOfMethodsAndTph) {
List<MethodConstraint> cs_m = new ArrayList<>();
List<MethodConstraint> methodConstraints1 = typeOfTheMethodInClSigma(cs, posOfTphs);
for (MethodConstraint cons: methodConstraints1) {
if (!checkForDuplicates(cons, cs_m)) {
cs_m.add(cons);
}
}
// if sth new is added to cs_cl, then do same step again
boolean addedToConstraintsListForMC2 = false;
do {
addedToConstraintsListForMC2 = false;
List<MethodConstraint> methodConstraints2 = firstTransitiveSubtypeForMethodTypes(cs, cs_m);
for (MethodConstraint cons : methodConstraints2) {
if (!checkForDuplicates(cons, cs_m)) {
cs_m.add(cons);
addedToConstraintsListForMC2 = true;
}
}
} while (addedToConstraintsListForMC2);
// if sth new is added to cs_cl, then do same step again
boolean addedToConstraintsListForMC3 = false;
do {
addedToConstraintsListForMC3 = false;
List<MethodConstraint> methodConstraints3 = secondTransitiveSubtypeForMethodTypes(cs, cs_cl, cs_m);
for (MethodConstraint cons : methodConstraints3) {
if (!checkForDuplicates(cons, cs_m)) {
cs_m.add(cons);
addedToConstraintsListForMC3 = true;
}
}
} while (addedToConstraintsListForMC3);
List<MethodConstraint> methodConstraints4 = hasNoSupertypeForMethodTypes(cs, cs_m, posOfTphs, listOfMethodsAndTph);
for (MethodConstraint cons: methodConstraints4) {
if (!checkForDuplicates(cons, cs_m)) {
cs_m.add(cons);
}
}
List<MethodConstraint> methodConstraints5 = methodTypesWithoutClassTypes(cs_cl, cs_m);
cs_m = methodConstraints5;
return cs_m;
}
public HashMap<String, List<MethodConstraint>> getMethodConstraintsWithPosition(List<TPHConstraint> cs, List<ClassConstraint> cs_cl, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs, List<MethodAndTPH> listOfMethodsAndTph, ResultSet resSet, Set<Pair> oldCons) {
HashMap<String, List<MethodConstraint>> tempMethodConstraintsWithPosition = new HashMap<>();
for(MethodAndTPH method: listOfMethodsAndTph){
List<String> methodsAddedToHashMap = new ArrayList<>();
String currentMethod = method.getId();
boolean containsCurrentMethod = false;
if(!containsCurrentMethod) {
methodsAddedToHashMap.add(currentMethod);
containsCurrentMethod = true;
List<MethodConstraint> listOfThisMethod = new ArrayList<>();
HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTPHsForThisMethod = new HashMap<>();
for(String s: posOfTphs.keySet()) {
for(PairTphMethod pair: posOfTphs.get(s)) {
if(pair.snd == currentMethod && pair.snd != null) {
posOfTPHsForThisMethod.put(s,posOfTphs.get(s));
}
}
}
listOfThisMethod = getMethodConstraints(cs,cs_cl,posOfTPHsForThisMethod,listOfMethodsAndTph);
tempMethodConstraintsWithPosition.put(currentMethod, listOfThisMethod);
List<MethodConstraint> newMCList = firstLineMethodDefinition(cs, posOfTphs, method, resSet);
List<MethodConstraint> newMCList2 = secondLineMethodDefinition(cs, posOfTphs, method, resSet, oldCons);
System.out.println(newMCList);
System.out.println(newMCList2);
}
}
for(String curMeth: tempMethodConstraintsWithPosition.keySet()){
for(int i=0; i<tempMethodConstraintsWithPosition.get(curMeth).size(); i++) {
MethodConstraint currentMC = tempMethodConstraintsWithPosition.get(curMeth).get(i);
if(currentMC.getRight()!= objectType && !compareTphsOfConstraints(currentMC.getRight(), cs_cl) && !compareTphsOfConstraints(currentMC.getRight(), tempMethodConstraintsWithPosition.get(curMeth))) {
MethodConstraint mc = new MethodConstraint(currentMC.getRight(), objectType, Relation.EXTENDS);
tempMethodConstraintsWithPosition.get(curMeth).add(mc);
}
}
}
return tempMethodConstraintsWithPosition;
}
// Hilfsmethode um TPHs in den Methoden zu finden, die <. Object sein müssen
private static boolean compareTphsOfConstraints(String tph, List list) {
List<TPHConstraint> tempList = new ArrayList<>(list);
for(TPHConstraint tphC: tempList) {
if(tph == tphC.getLeft()) {
return true;
}
}
return false;
}
/**
* Def. FGG: erste Zeile von cs_cl
* {T < .T' | T is a type variable in a type of a node of a field}
*/
public static List<ClassConstraint> typeOfANodeOfAField(List<TPHConstraint> allConstraints, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs) {
//RuntimeException re = new RuntimeException("enthält EQUALS-Relation");
List<ClassConstraint> tempCC = new ArrayList<>();
for(TPHConstraint allCons: allConstraints){
if(posOfTphs.containsKey(allCons.getLeft()) && allCons.getRight()!=null && allCons.getRel()==Relation.EXTENDS) {
for(String tph: posOfTphs.keySet()) {
for(PairTphMethod pair: posOfTphs.get(tph)) {
if(tph == allCons.getLeft() && pair.fst == PositionFinder.Position.FIELD) {
ClassConstraint consToAdd = new ClassConstraint(tph, allCons.getRight(), allCons.getRel());
if (!checkForDuplicates(consToAdd, tempCC)) {
tempCC.add(consToAdd);
}
/*}else if(pair.fst == PositionFinder.Position.FIELD){
ClassConstraint consToAdd = new ClassConstraint(tph, objectType, Relation.EXTENDS);
if (!checkForDuplicates(consToAdd, tempCC)) {
tempCC.add(consToAdd);
}*/
}
}
}
}
/*else if (allCons.getRel() != Relation.EXTENDS) {
throw re;
}*/
}
return tempCC;
}
/**
* Def. FGG: zweite Zeile von cs_cl
* {T' <. T'' | \exists T: (T <. T') \in cs_cl, (T' <. T'') \in cs }
*/
public static List<ClassConstraint> transitiveSubtypeForClassTypes(List<TPHConstraint> allConstraints, List<ClassConstraint> cs_cl) {
List<ClassConstraint> tempCC = new ArrayList<>();
ClassConstraint consToAdd;
for(ClassConstraint cCons: cs_cl) {
if(cCons.getLeft() != null && cCons.getRel()==Relation.EXTENDS) {
for(TPHConstraint allCons: allConstraints) {
if(cCons.getRight() == allCons.getLeft() && allCons.getRight() != null && allCons.getRel()==Relation.EXTENDS){
consToAdd = new ClassConstraint(allCons.getLeft(), allCons.getRight(), allCons.getRel());
if (!checkForDuplicates(consToAdd, tempCC)) {
tempCC.add(consToAdd);
}
}
}
}
}
return tempCC;
}
/**
* Def. FGG: dritte Zeile von cs_cl
* {T <. Object | ((T is a type variable in a type of a node of a field
* or (\exists T~: (T~ <. T) \in cs_cl)) and (\existsnot T': T <. T') \in cs)}
*/
public static List<ClassConstraint> hasNoSupertypeForClassTypes(List<ClassConstraint> cs_cl, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs) {
List<ClassConstraint> tempCC= new ArrayList<>();
List<TPHConstraint> clCons = new ArrayList<>(cs_cl);
for(String tph: posOfTphs.keySet()) {
for(PairTphMethod pair: posOfTphs.get(tph)) {
boolean tvInField = pair.fst == PositionFinder.Position.FIELD;
boolean hasSmallerTVInClCons = hasSmallerTVInClCons(tph, cs_cl);
if ((tvInField || hasSmallerTVInClCons) &&
!checkUpperBound(clCons, tph)) {
ClassConstraint consToAdd = new ClassConstraint(tph, objectType, Relation.EXTENDS);
if (!checkForDuplicates(consToAdd, tempCC)) {
tempCC.add(consToAdd);
}
}
}
}
return tempCC;
}
public static boolean hasSmallerTVInClCons(String tph, List<ClassConstraint> cs_cl) {
for(ClassConstraint cC: cs_cl) {
if(tph == cC.getRight() && cC.getRel() == Relation.EXTENDS) {
return true;
}
}
return false;
}
/**
* Def. FGG: erste Zeile von cs_m
* {T < .T' | T is a type variable in a type of the method/constructor m in cl_\sigma, (T <. T') \in cs}
*/
public static List<MethodConstraint> typeOfTheMethodInClSigma(List<TPHConstraint> allConstraints, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs) { // cl_\sigma??
//TODO:
List<MethodConstraint> tempMC= new ArrayList<>();
for(TPHConstraint allCons: allConstraints){
if(posOfTphs.containsKey(allCons.getLeft()) && allCons.getRight()!=null && allCons.getRel()==Relation.EXTENDS) {
for(String tph: posOfTphs.keySet()) {
for(PairTphMethod pair: posOfTphs.get(tph)) {
if(tph == allCons.getLeft() && (pair.fst == PositionFinder.Position.METHOD || pair.fst == PositionFinder.Position.CONSTRUCTOR)) {
MethodConstraint consToAdd = new MethodConstraint(allCons.getLeft(), allCons.getRight(), allCons.getRel());
if (!checkForDuplicates(consToAdd, tempMC)) {
tempMC.add(consToAdd);
}
}
}
}
}
}
return tempMC;
}
/**
* Def. FGG: zweite Zeile von cs_m
* {R' <. S | (R <. R'), (S <. S') \in cs_m and (R',S) is in the transitive closure of cs}
*/
public List<MethodConstraint> firstTransitiveSubtypeForMethodTypes(List<TPHConstraint> allConstraints, List<MethodConstraint> cs_m) { //transitive closure of cs
//TODO:
List<MethodConstraint> tempMC= new ArrayList<>();
List<TPHConstraint> tcOfCs = buildTransitiveClosure(allConstraints);
for(MethodConstraint mC1 : cs_m) { //(R <. R')
for(MethodConstraint mC2 : cs_m) { //(S <. S')
String lSide = mC1.getRight(); //R'
String rSide = mC2.getLeft(); //S
for(TPHConstraint tphC : tcOfCs) {
if(tphC.getLeft().equals(lSide)&&tphC.getRight().equals(rSide)) { //is it (R',S)
MethodConstraint consToAdd = new MethodConstraint(lSide, rSide, tphC.getRel()); //create (R'<.S)
if (!checkForDuplicates(consToAdd, tempMC)) {
tempMC.add(consToAdd);
}
}
}
}
}
return tempMC;
}
/**
* Def. FGG: dritte Zeile von cs_m
* {R' <. S | (R <. R') \in cs_m, (S <. S') \in cs_cl and (R',S) is in the transitive closure of cs}
*/
public List<MethodConstraint> secondTransitiveSubtypeForMethodTypes(List<TPHConstraint> allConstraints, List<ClassConstraint> cs_cl, List<MethodConstraint> cs_m) {
//TODO:
List<MethodConstraint> tempMC= new ArrayList<>();
List<TPHConstraint> tcOfCs = buildTransitiveClosure(allConstraints);
for(ClassConstraint cC : cs_cl) {
for(MethodConstraint mC : cs_m) {
String leftSide = mC.getRight();
String rightSide = cC.getLeft();
for(TPHConstraint tphC : tcOfCs) {
if(tphC.getLeft().equals(leftSide)&&tphC.getRight().equals(rightSide)) {
MethodConstraint consToAdd = new MethodConstraint(tphC.getLeft(), tphC.getRight(), tphC.getRel());
if (!checkForDuplicates(consToAdd, tempMC)) {
tempMC.add(consToAdd);
}
}
}
}
}
return tempMC;
}
/**
* Def. FGG: vierte Zeile von cs_m
* {T <. Object | (T is a type variable in a type of a node of the method/constructor m in cl_\sigma),
* (\existsnot T': T <. T') \in cs)}
*/
public static List<MethodConstraint> hasNoSupertypeForMethodTypes(List<TPHConstraint> allConstraints, List<MethodConstraint> cs_m, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs, List<MethodAndTPH> listOfMethodsAndTph) {
//TODO:
List<MethodConstraint> tempMC= new ArrayList<>();
for(String tph: posOfTphs.keySet()) {
for(PairTphMethod pair: posOfTphs.get(tph)) {
for(TPHConstraint allCons: allConstraints) {
if((pair.fst.equals(PositionFinder.Position.METHOD) || pair.fst.equals(PositionFinder.Position.CONSTRUCTOR)) && !checkUpperBound(allConstraints,tph)) {
MethodConstraint consToAdd = new MethodConstraint(tph, objectType, Relation.EXTENDS);
if (!checkForDuplicates(consToAdd, tempMC)) {
tempMC.add(consToAdd);
}
}
}
List<TPHConstraint> tempMCObject1 = new ArrayList<>(cs_m);
String currentMethod = "";
for(MethodAndTPH mat: listOfMethodsAndTph) {
if(mat.getId().equals(pair.snd)) {
currentMethod = mat.getId();
}
for(TPHConstraint mc1: tempMCObject1) {
if(tph==mc1.getRight() && !checkUpperBound(tempMCObject1,tph)) {
MethodConstraint consToAdd = new MethodConstraint(tph, objectType, Relation.EXTENDS);
if (!checkForDuplicates(consToAdd, tempMC)) {
tempMC.add(consToAdd);
}
}
}
}
}
}
return tempMC;
}
/**
* nimm die Menge cs_cl aus cs_m raus
*/
public List<MethodConstraint> methodTypesWithoutClassTypes(List<ClassConstraint> cs_cl, List<MethodConstraint> cs_m) {
// erstelle Kopie der Liste cs_cl
List<TPHConstraint> tempCC = new ArrayList<>();
for(ClassConstraint cc: cs_cl) {
TPHConstraint tphC = new TPHConstraint(cc.getLeft(), cc.getRight(), cc.getRel());
tempCC.add(tphC);
}
// Transitive Hülle von cs_cl
List<TPHConstraint> tcOfCsCl = buildTransitiveClosure(tempCC);
List<TPHConstraint> tempMC = new ArrayList<>();
for(MethodConstraint mc: cs_m) {
TPHConstraint tphC = new TPHConstraint(mc.getLeft(), mc.getRight(), mc.getRel());
tempMC.add(tphC);
}
List<TPHConstraint> tempMC2 = new ArrayList<>();
tempMC2.addAll(tempMC);
List<MethodConstraint> tempMCToReturn = new ArrayList<>();
for(TPHConstraint cc: tcOfCsCl) {
for(TPHConstraint mc: tempMC) {
if(cc.getLeft().equals(mc.getLeft()) && cc.getRight().equals(mc.getRight())) {
tempMC2.remove(mc);
}
}
}
for(TPHConstraint tphC: tempMC2) {
MethodConstraint mCons = new MethodConstraint(tphC.getLeft(), tphC.getRight(), tphC.getRel());
tempMCToReturn.add(mCons);
}
return tempMCToReturn;
}
public static boolean checkForDuplicates(TPHConstraint constraint, List list) {
List<TPHConstraint> tempList = list;
boolean hasSame = false;
for (TPHConstraint tphC: tempList) {
hasSame = constraint.getLeft() == tphC.getLeft() &&
constraint.getRight() == tphC.getRight() &&
constraint.getRel() == tphC.getRel(); //constraint already in ArrayList if true
if (hasSame)
return true;
}
return false;
}
public List<TPHConstraint> buildTransitiveClosure(List list) {
List<TPHConstraint> iterList = new ArrayList<>(list);
List<TPHConstraint> runList = new ArrayList<>(list);
List<TPHConstraint> tcList = new ArrayList<>(list);
boolean addedConToList = false;
for (TPHConstraint cons: iterList) {
for (TPHConstraint cons2: runList) {
if(cons.getRight() == cons2.getLeft()) {
TPHConstraint consToAdd = new TPHConstraint(cons.getLeft(), cons2.getRight(), Relation.EXTENDS);
if (!checkForDuplicates(consToAdd,tcList)) {
tcList.add(consToAdd);
addedConToList = true;
if (addedConToList) {
return buildTransitiveClosure(tcList);
}
}
}
}
}
return tcList;
}
public static boolean checkUpperBound(List<TPHConstraint> cs, String tph) {
for(int i=0; i<cs.size(); i++) {
if(cs.get(i).getLeft() == tph) {
//has upper bound
return true;
}
}
return false;
}
public static HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> positionConverter(HashMap<String, Boolean> allTphs, List<MethodAndTPH> listOfMethodsAndTphs) {
HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> convertedPositions = new HashMap<>();
for(String tph: allTphs.keySet()) {
List<PairTphMethod<PositionFinder.Position, String>> currMeth = new ArrayList<>();
if(allTphs.get(tph)) { //if true, then tph is a method-TPH
for(MethodAndTPH methTph: listOfMethodsAndTphs) {
if (methTph.getTphs().contains(tph)) {
currMeth.add(new PairTphMethod<>(PositionFinder.Position.METHOD, methTph.getId()));
}
}
} else { // else it is in the class-TPH
currMeth.add(new PairTphMethod<>(PositionFinder.Position.FIELD, null));
}
convertedPositions.put(tph, currMeth);
}
return convertedPositions;
}
/* public PositionFinder.Position positionConverter(TPHExtractor tphExtractor) {
if(tphExtractor.allTPHS.keySet())
}*/
/* GeneratedGenericsFinder genGenFinder;
ConstraintsSimplierResult simplifiedConstraints = null;
GenericsGeneratorResultForClass ggResult = null;
Method m;
public void addMethodConstraints(List<MethodConstraint> cs_m) {
genGenFinder.addMethodConstraints(simplifiedConstraints, ggResult, m);
cs_m.add();
}
*/
public static List<MethodConstraint> firstLineMethodDefinition(List<TPHConstraint> allConstraints, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs, MethodAndTPH methodAndTPH, ResultSet resSet) {
List<MethodConstraint> tempMC= new ArrayList<>();
MethodAndTPH methAndTphs = methodAndTPH;
Set<Pair> undCons = methAndTphs.constraints.getUndConstraints();
List<Set<Constraint<Pair>>> orCons = methAndTphs.constraints.getOderConstraints();
Iterator<Pair> it = undCons.iterator();
while(it.hasNext()) {
Pair p = it.next();
String ta1 = ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA1)).resolvedType)).getName();
String ta2 = ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA2)).resolvedType)).getName();
Relation r = null;
if(p.GetOperator() == PairOperator.SMALLERDOT) {
r = Relation.EXTENDS;
} else if(p.GetOperator() == PairOperator.EQUALSDOT) {
r = Relation.EQUAL;
}
MethodConstraint mc = new MethodConstraint(ta1, ta2, r);
if(mc.getRel() == Relation.EXTENDS) {
if (!mc.getLeft().equals(mc.getRight())) { //eliminieren der Fälle wie AA<.AA
if(!checkForDuplicates(mc, tempMC)) {
tempMC.add(mc);
}
}
}
}
return tempMC;
}
public List<MethodConstraint> secondLineMethodDefinition(List<TPHConstraint> allConstraints, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs, MethodAndTPH methodAndTPH, ResultSet resSet, Set<Pair> oldCons) {
List<MethodConstraint> tempMC = new ArrayList<>(); //für Ergebnisse basierend auf der neuen Datenstruktur (Ali)
Set<Pair> tempSet = new HashSet<>(); //für Ergebnisse des ersten Teils der Bedinung basierend auf der alten Datenstruktur
Set<Pair> tempSet2 = new HashSet<>(); //für Ergebnisse des zweiten Teils der Bedingung basierend auf der alten Datenstruktur
Set<Pair> tcOfoldConsSet = buildTransitiveClosureForCP(oldCons, resSet);
List<TPHConstraint> tcOfCs = buildTransitiveClosure(allConstraints);
MethodAndTPH methAndTphs = methodAndTPH;
Set<Pair> undCons = methAndTphs.constraints.getUndConstraints();
List<Set<Constraint<Pair>>> orCons = methAndTphs.constraints.getOderConstraints();
List<HashMap<Relation, List<TPHConstraint>>> orConsListConverted = new ArrayList<>();
//gehe die OrConstraints der aktuellen Methode durch und teile nach Operator auf (
for(int i=0; i<orCons.size(); i++) {
List<TPHConstraint> orConsWithEQUAL = new ArrayList();
List<TPHConstraint> orConsWithEXTENDS = new ArrayList();
HashMap<Relation, List<TPHConstraint>> orConsInternal = new HashMap<>();
for(Constraint con: orCons.get(i)) {
Iterator<Pair> it = con.iterator();
while(it.hasNext()) {
Pair p = it.next();
Relation r = null;
if(p.GetOperator() == PairOperator.SMALLERDOT) {
r = Relation.EXTENDS;
orConsWithEXTENDS.add(new TPHConstraint(((TypePlaceholder) p.TA1).getName(), ((TypePlaceholder) p.TA2).getName(), r));
/*MethodConstraint mc = new MethodConstraint(((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA1)).resolvedType)).getName(), ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA2)).resolvedType)).getName(), r);
if(!checkForDuplicates(mc, tempMC)) {
tempMC.add(mc);
}*/
} else if(p.GetOperator() == PairOperator.EQUALSDOT) {
r = Relation.EQUAL;
orConsWithEQUAL.add(new TPHConstraint(((TypePlaceholder) p.TA1).getName(), ((TypePlaceholder) p.TA2).getName(), r));
/*MethodConstraint mc = new MethodConstraint(((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA1)).resolvedType)).getName(), ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA2)).resolvedType)).getName(), r);
if(!checkForDuplicates(mc, tempMC)) {
tempMC.add(mc);
}*/
}
}
}
orConsInternal.put(Relation.EXTENDS, orConsWithEXTENDS);
orConsInternal.put(Relation.EQUAL, orConsWithEQUAL);
orConsListConverted.add(orConsInternal);
}
// oldCons sind alle Und- und Oder-Constraints
// zunächst in meine Datenstruktur(Ali) konvertieren
List<Pair> oldConsList = new ArrayList<>(oldCons);
List<TPHConstraint> oldConsListConverted = new ArrayList<>();
for(Pair pair: oldConsList) {
Relation r = null;
if(pair.GetOperator() == PairOperator.SMALLERDOT) {
r = Relation.EXTENDS;
} else if(pair.GetOperator() == PairOperator.EQUALSDOT) {
r = Relation.EQUAL;
}
oldConsListConverted.add(new TPHConstraint(((TypePlaceholder) pair.TA1).getName(), ((TypePlaceholder) pair.TA2).getName(), r));
}
// Berechnung des zweiten Teils der Bedingung der Regel
for(int i=0; i<orCons.size(); i++) {
Constraint<Pair> extendsSet = new Constraint<Pair>();
Constraint<Pair> equalSet = new Constraint<Pair>();
//für jede einzelne OrConstraint-Menge gehe durch
for (Constraint con : orCons.get(i)) {
Iterator<Pair> it = con.iterator();
while (it.hasNext()) {
Pair p = it.next();
if (p.OperatorSmallerDot()) {
extendsSet.add(p);
} else if (p.OperatorEqual()) {
equalSet.add(p);
}
}
Iterator<Pair> itExtends2 = extendsSet.iterator();
while(itExtends2.hasNext()) {
Pair pairExtends2 = itExtends2.next();
Set<String> containedVars = new HashSet<>(methodAndTPH.getTphs());
String pairExtends2RHSName = ((TypePlaceholder)((resSet.resolveType((TypePlaceholder)pairExtends2.TA2)).resolvedType)).getName();
Iterator<Pair> itEqual2 = equalSet.iterator();
while (itEqual2.hasNext()) {
boolean transClo = false;
Pair pairEqual2 = itEqual2.next();
//TODO: Auf trans.FamilyOfGeneratedGenerics Huelle pruefen
Pair newPairOld = new Pair(pairExtends2.TA2, pairEqual2.TA1);
Pair newPair2 = new Pair(resSet.resolveType((TypePlaceholder) (pairExtends2.TA2)).resolvedType, resSet.resolveType((TypePlaceholder) (pairEqual2.TA1)).resolvedType, PairOperator.SMALLERDOT);
TPHConstraint newPairTPHConstraint = new TPHConstraint(newPair2);
if (tcOfCs.contains(newPairTPHConstraint)|| (newPairTPHConstraint.getLeft().equals(newPairTPHConstraint.getRight()))) {
transClo = true;
}
TypePlaceholder tphR = (TypePlaceholder) pairEqual2.TA2;
Iterator<Pair> itUndCons = undCons.iterator();
boolean rEqExRtilde = false;
while (itUndCons.hasNext()) {
Pair pairUndCons2 = itUndCons.next();
rEqExRtilde = rEqExRtilde || (tphR == pairUndCons2.TA1);
}
boolean isPairInTExTapostrophe = false;
for(Set<Constraint<Pair>> scp: orCons) {
Iterator<Constraint<Pair>> itSCP = scp.iterator();
while(itSCP.hasNext()) {
Constraint<Pair> cp = itSCP.next();
Iterator<Pair> itCP = cp.iterator();
while(itCP.hasNext()) {
Pair p = itCP.next();
if(p.OperatorSmallerDot()) {
isPairInTExTapostrophe = isPairInTExTapostrophe || tphR.equals(p.TA1);
}
}
}
}
if (transClo && (rEqExRtilde || isPairInTExTapostrophe)) {
if (!newPair2.TA1.equals(newPair2.TA2)) { //eliminieren der Fälle wie AA<.AA
if (!checkForDuplicatesForSets(newPair2, tempSet2)) {
tempSet2.add(newPair2);
}
}
if (!checkForDuplicatesForSets(pairExtends2, tempSet2)) {
tempSet2.add(pairExtends2);
}
}
else {
//containedVars.remove(((TypePlaceholder)newPair2.TA2).getName());
}
}
//String key = ((TypePlaceholder)((resSet.resolveType((TypePlaceholder)pairExtends2.TA2)).resolvedType)).getName();
//TODO: containedVars stimmt noch nicht. Ueberpruefen, ob ggf. mit den containedVars möglicherweise auch die anderen Faelle
// rEqExRtilde isPairInTExTapostrophe abgedeckt sind => ggf. integrieren
/*
posOfTphs.forEach((x,y) -> {
if (y.contains(new PairTphMethod<>(PositionFinder.Position.METHOD, methodAndTPH.getId()))) {
containedVars.add(x);
};
}
);
*/
//Referenzbeispiel Put.jav
if (containedVars.stream().filter(v -> tcOfCs.contains(new TPHConstraint(pairExtends2RHSName, v, Relation.EXTENDS)))
.count() > 0) {
System.out.println();
//tempSet2.add(pairExtends2);
}
if (posOfTphs.containsKey(pairExtends2RHSName)) {//Refrenzbeispiel TestVector.jav
if (posOfTphs.get(pairExtends2RHSName).contains(new PairTphMethod<>(PositionFinder.Position.METHOD, methodAndTPH.getId()))) {
tempSet2.add(pairExtends2);
}
}
}
}
}
// aus der alten Datenstruktur in die neue Datenstruktur (von Ali) für ersten Teil
Iterator<Pair> itTemp = tempSet.iterator();
while(itTemp.hasNext()) {
Pair p = itTemp.next();
String ta1 = ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA1)).resolvedType)).getName();
String ta2 = ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA2)).resolvedType)).getName();
Relation r = null;
if(p.GetOperator() == PairOperator.SMALLERDOT) {
r = Relation.EXTENDS;
} else if(p.GetOperator() == PairOperator.EQUALSDOT) {
r = Relation.EQUAL;
}
MethodConstraint mc = new MethodConstraint(ta1, ta2, r);
if(mc.getRel() == Relation.EXTENDS) {
if(!checkForDuplicates(mc, tempMC)) {
tempMC.add(mc);
}
}
}
// aus der alten Datenstruktur in die neue Datenstruktur (von Ali) für zweiten Teil
Iterator<Pair> itTemp2 = tempSet2.iterator();
while(itTemp2.hasNext()) {
Pair p = itTemp2.next();
String ta1 = ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA1)).resolvedType)).getName();
String ta2 = ((TypePlaceholder) (resSet.resolveType(((TypePlaceholder) p.TA2)).resolvedType)).getName();
Relation r = null;
if (p.GetOperator() == PairOperator.SMALLERDOT) {
r = Relation.EXTENDS;
} else if (p.GetOperator() == PairOperator.EQUALSDOT) {
r = Relation.EQUAL;
}
for(TPHConstraint tphCons: tcOfCs) {//TODO: hier werden Elemente der Trans. clo herausgenommen, aber die dazugehoerigen OrCons nicht.
if(ta1 == tphCons.getLeft() && ta2 == tphCons.getRight() && r==Relation.EXTENDS) {
MethodConstraint mc = new MethodConstraint(ta1, ta2, r);
if(!checkForDuplicates(mc, tempMC)) {
tempMC.add(mc);
}
}
}
}
return tempMC;
}
public static Set<Pair> buildTransitiveClosureForCP(Set constraint, ResultSet resSet) {
Set<Pair> iterSet = new HashSet<>(constraint);
Set<Pair> runSet = new HashSet<>(constraint);
Set<Pair> tcSet = new HashSet<>(constraint);
boolean addedConToList = false;
// for (TPHConstraint cons: iterList) {
Iterator<Pair> itIterSet = iterSet.iterator();
while(itIterSet.hasNext()) {
Pair pairIterSet = itIterSet.next();
// for (TPHConstraint cons2: runList) {
Iterator<Pair> itRunSet = runSet.iterator();
while (itRunSet.hasNext()) {
Pair pairRunSet = itRunSet.next();
// if(cons.getRight() == cons2.getLeft()) {
if(pairIterSet.TA2 == pairRunSet.TA1 && pairIterSet.OperatorSmallerDot() && pairRunSet.OperatorSmallerDot()) {
// TPHConstraint consToAdd = new TPHConstraint(cons.getLeft(), cons2.getRight(), Relation.EXTENDS);
Pair p = new Pair(resSet.resolveType((TypePlaceholder)(pairIterSet.TA1)).resolvedType, resSet.resolveType((TypePlaceholder)(pairRunSet.TA2)).resolvedType, PairOperator.SMALLERDOT);
// if (!checkForDuplicates(consToAdd,tcList)) {
if(!checkForDuplicatesForSets(p, tcSet)) {
// tcList.add(consToAdd);
tcSet.add(p);
addedConToList = true;
if (addedConToList) {
return buildTransitiveClosureForCP(tcSet, resSet);
}
}
}
}
}
System.out.println("tcSet: " + tcSet);
return tcSet;
}
public static boolean checkForDuplicatesForSets(Pair pair, Set set) {
Set<Pair> tempSet = set;
boolean hasSame = false;
// for (TPHConstraint tphC: tempList) {
Iterator<Pair> it = tempSet.iterator();
while (it.hasNext()) {
Pair p = it.next();
// hasSame = constraint.getLeft() == tphC.getLeft() &&
// constraint.getRight() == tphC.getRight() &&
// constraint.getRel() == tphC.getRel(); //constraint already in ArrayList if true
hasSame = pair.TA1 == p.TA1 &&
pair.TA2 == p.TA2 &&
pair.OperatorSmallerDot() && p.OperatorSmallerDot(); //constraint already in Set if true
if (hasSame)
return true;
}
return false;
}
public static List<MethodConstraint> hasNoSupertypeForMethodTypesNew(HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs, MethodAndTPH methodAndTPH, List<MethodConstraint> cs_m) {
List<MethodConstraint> tempMC = new ArrayList<>();
List<TPHConstraint> methCons = new ArrayList<>(cs_m);
MethodAndTPH methAndTphs = methodAndTPH;
for(String tph: posOfTphs.keySet()) {
for(int i=0; i<posOfTphs.get(tph).size(); i++)
if(posOfTphs.get(tph).get(i).fst == PositionFinder.Position.METHOD && posOfTphs.get(tph).get(i).snd == methAndTphs.getId() && !checkUpperBound(methCons,tph)) {
MethodConstraint mc2 = new MethodConstraint(tph, objectType, Relation.EXTENDS);
if (!checkForDuplicates(mc2, tempMC)) {
tempMC.add(mc2);
}
}
}
return tempMC;
}
public static List<MethodConstraint> methodTypesWithoutClassTypesNEW(List<String> tphsToCompute, List<MethodConstraint> cs_m) {
List<MethodConstraint> tempMC = new ArrayList<>(cs_m);
List<MethodConstraint> tempMC2 = new ArrayList<>(cs_m);
List<String> toRemove = new ArrayList<>();
for(String tph: tphsToCompute) {
for(TPHConstraint tphCons: tempMC) {
if(tphCons.getLeft() == tph) {
toRemove.add(tphCons.getRight());
tempMC2.remove(tphCons);
tempMC2 = methodTypesWithoutClassTypesNEW(toRemove,tempMC2);
}
}
}
return tempMC2;
}
public HashMap<String, List<MethodConstraint>> getMethodConstraintsWithPositionNew(List<TPHConstraint> cs, List<ClassConstraint> cs_cl, HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTphs, List<MethodAndTPH> listOfMethodsAndTph, ResultSet resSet, Set<Pair> oldCons) {
HashMap<String, List<MethodConstraint>> tempMethodConstraintsWithPosition = new HashMap<>();
List<MethodConstraint> newMCList = new ArrayList<>();
List<MethodConstraint> newMCList2 = new ArrayList<>();
List<MethodConstraint> hasNoSupType = new ArrayList<>();
List<MethodConstraint> mcWithoutCc = new ArrayList<>();
List<String> methodsAddedToHashMap = new ArrayList<>();
for(MethodAndTPH method: listOfMethodsAndTph){
String currentMethod = method.getId();
boolean containsCurrentMethod = false;
if(!containsCurrentMethod) {
methodsAddedToHashMap.add(currentMethod);
containsCurrentMethod = true;
List<MethodConstraint> listToAdd = new ArrayList<>();
HashMap<String, List<PairTphMethod<PositionFinder.Position, String>>> posOfTPHsForThisMethod = new HashMap<>();
for(String s: posOfTphs.keySet()) {
for(PairTphMethod pair: posOfTphs.get(s)) {
if(pair.snd == currentMethod && pair.snd != null) {
posOfTPHsForThisMethod.put(s,posOfTphs.get(s));
}
}
}
newMCList = firstLineMethodDefinition(cs, posOfTphs, method, resSet);
for(int i=0; i<newMCList.size(); i++) {
listToAdd.add(newMCList.get(i));
}
newMCList2 = secondLineMethodDefinition(cs, posOfTphs, method, resSet, oldCons);
for(int i=0; i<newMCList2.size(); i++) {
listToAdd.add(newMCList2.get(i));
}
/*if(!methodsAddedToHashMap.contains(currentMethod)) {
tempMethodConstraintsWithPosition.put(currentMethod, newMCList);
tempMethodConstraintsWithPosition.put(currentMethod, newMCList2);
}*/
hasNoSupType = hasNoSupertypeForMethodTypesNew(posOfTphs,method,listToAdd);
for (MethodConstraint cons: hasNoSupType) {
if (!checkForDuplicates(cons, listToAdd)) {
listToAdd.add(cons);
}
}
mcWithoutCc = listToAdd;
List<String> tphs = new ArrayList<>();
for(String tph: posOfTphs.keySet()) {
for (PairTphMethod p : posOfTphs.get(tph)) {
if(p.fst == PositionFinder.Position.FIELD) {
tphs.add(tph);
mcWithoutCc = methodTypesWithoutClassTypesNEW(tphs, listToAdd);
}
}
}
tempMethodConstraintsWithPosition.put(currentMethod, mcWithoutCc);
}
for(String curMeth: tempMethodConstraintsWithPosition.keySet()){
for(int i=0; i<tempMethodConstraintsWithPosition.get(curMeth).size(); i++) {
MethodConstraint currentMC = tempMethodConstraintsWithPosition.get(curMeth).get(i);
if(currentMC.getRight()!= objectType && !compareTphsOfConstraints(currentMC.getRight(), cs_cl) && !compareTphsOfConstraints(currentMC.getRight(), tempMethodConstraintsWithPosition.get(curMeth))) {
MethodConstraint mc = new MethodConstraint(currentMC.getRight(), objectType, Relation.EXTENDS);
tempMethodConstraintsWithPosition.get(curMeth).add(mc);
}
}
}
}
return tempMethodConstraintsWithPosition;
}
}
@@ -1,42 +0,0 @@
/*
package de.dhbwstuttgart.bytecode.gGenericsAli;
import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
*/
/**
* gets set of typed variable constraints with substitutions and the set of typed classes
* and returns the set of families of generated generics and the set of families of type variable mappings
*//*
public class GGenerics implements preGGenerics {
private TVarConstraints tVarCons;
private Substitutions subst;
private TClass typedClass;
public GGenerics(TVarConstraints tVarCons, Substitutions subst, TClass typedClass) throws IOException, ClassNotFoundException {
this.tVarCons = tVarCons;
this.subst = subst;
this.typedClass = typedClass;
}
List<File> input = new ArrayList<>();
List<File> classpath = new ArrayList<>();
JavaTXCompiler compiler = new JavaTXCompiler(input, classpath);
compiler.typeInference();
public List<ResultSet> getResultOfTypeInference() {
return null;
}
}
*/
@@ -1,10 +0,0 @@
package de.dhbwstuttgart.bytecode.insertGenerics;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint.Relation;
public class MethodConstraint extends TPHConstraint {
public MethodConstraint(String left, String right, Relation rel) {
super(left, right, rel);
}
}
@@ -1,47 +0,0 @@
package de.dhbwstuttgart.bytecode.insertGenerics;
import java.util.Objects;
/** A generic class for pairs.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public class PairMethodAndConstraint<A, B> {
public final A fst;
public final B snd;
public PairMethodAndConstraint(A fst, B snd) {
this.fst = fst;
this.snd = snd;
}
public String toString() {
return "PairTphMethod[" + fst + "," + snd + "]";
}
public boolean equals(Object other) {
return
other instanceof PairMethodAndConstraint<?,?> &&
Objects.equals(fst, ((PairMethodAndConstraint<?,?>)other).fst) &&
Objects.equals(snd, ((PairMethodAndConstraint<?,?>)other).snd);
}
public int hashCode() {
if (fst == null) return (snd == null) ? 0 : snd.hashCode() + 1;
else if (snd == null) return fst.hashCode() + 2;
else return fst.hashCode() * 17 + snd.hashCode();
}
public static <A,B> PairMethodAndConstraint<A,B> of(A a, B b) {
return new PairMethodAndConstraint<>(a,b);
}
public PairMethodAndConstraint add(A fst, B snd){
return new PairMethodAndConstraint<>(fst,snd);
}
}
@@ -1,43 +0,0 @@
package de.dhbwstuttgart.bytecode.insertGenerics;
import java.util.Objects;
/** A generic class for pairs.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public class PairTphMethod<A, B> {
public final A fst;
public final B snd;
public PairTphMethod(A fst, B snd) {
this.fst = fst;
this.snd = snd;
}
public String toString() {
return "PairTphMethod[" + fst + "," + snd + "]";
}
public boolean equals(Object other) {
return
other instanceof PairTphMethod<?,?> &&
Objects.equals(fst, ((PairTphMethod<?,?>)other).fst) &&
Objects.equals(snd, ((PairTphMethod<?,?>)other).snd);
}
public int hashCode() {
if (fst == null) return (snd == null) ? 0 : snd.hashCode() + 1;
else if (snd == null) return fst.hashCode() + 2;
else return fst.hashCode() * 17 + snd.hashCode();
}
public static <A,B> PairTphMethod<A,B> of(A a, B b) {
return new PairTphMethod<>(a,b);
}
}
@@ -1,79 +0,0 @@
package de.dhbwstuttgart.bytecode.insertGenerics;
import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import java.util.HashMap;
import java.util.Set;
public class PositionFinder{
static HashMap<String, PairTphMethod<Position, String>> posOfTphs = new HashMap<String, PairTphMethod<Position, String>>();
static PairTphMethod<Position, String> whichMethod; // gibt an, in welcher Methode sich TPH befindet (Position.METHOD, id_of_method)
public enum Position{
METHOD,
CONSTRUCTOR,
FIELD
}
public static HashMap<String, PairTphMethod<Position, String>> getPositionOfTPH(SourceFile sf, Set<String> tphs) {
new Walker().visit(sf);
for (String tph: posOfTphs.keySet()) {
System.out.println(tph + " " + posOfTphs.get(tph));
}
return null;
}
public static void putPositionInMethod(String tph, String methodId) {
posOfTphs.put(tph, new PairTphMethod<>(Position.METHOD, methodId));
}
public static void putPositionInField(String tph) {
posOfTphs.put(tph, new PairTphMethod<>(Position.FIELD, null));
}
public static void putPositionInConstructor(String tph, String id) {
posOfTphs.put(tph, new PairTphMethod<>(Position.CONSTRUCTOR, id));
}
static class Walker extends AbstractASTWalker{
Boolean inMethod = false;
Boolean inConstructor = false;
@Override
public void visit(TypePlaceholder tph) {
if (inMethod) {
if (inConstructor) {
// System.out.println(tph);
// putPositionInConstructor(tph.getName(),);
}
// System.out.println(tph);
// putPositionInMethod(tph.getName(),);
} else {
putPositionInField(tph.getName());
}
}
@Override
public void visit(Field field) {
super.visit(field);
}
@Override
public void visit(Method method) {
inMethod = true;
super.visit(method);
}
@Override
public void visit(Constructor cons) {
inConstructor = true;
super.visit(cons);
}
}
}
@@ -1,9 +0,0 @@
package de.dhbwstuttgart.bytecode.insertGenerics;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import java.util.List;
interface preGGenerics {
public List<ResultSet> getResultOfTypeInference();
}
@@ -1,379 +0,0 @@
package de.dhbwstuttgart.bytecode.signature;
import java.util.*;
import org.objectweb.asm.Type;
import org.objectweb.asm.signature.SignatureVisitor;
import org.objectweb.asm.signature.SignatureWriter;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericsGeneratorResult;
import de.dhbwstuttgart.syntaxtree.ClassOrInterface;
import de.dhbwstuttgart.syntaxtree.Constructor;
import de.dhbwstuttgart.syntaxtree.GenericTypeVar;
import de.dhbwstuttgart.syntaxtree.Method;
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.result.ResultSet;
public class Signature {
private static final char SUPER_CHAR = '-';
private static final char EXTENDS_CHAR = '+';
private static final String SPECIAL_CHAR_FOR_FUN = "$$";
private static final String SPECIAL_CHAR = "$";
private ClassOrInterface classOrInterface;
private HashMap<String, String> genericsAndBounds;
private HashMap<String, String> genericsAndBoundsMethod;
private final SignatureWriter sw = new SignatureWriter();;
private Constructor constructor;
private Method method;
private HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> methodParamsAndTypes;
private ResultSet resultSet;
private Map<TPHConstraint, Set<String>> methodConstraints;
private List<GenericsGeneratorResult> consClass;
private List<GenericsGeneratorResult> constraints;
// public Signature(ClassOrInterface classOrInterface, HashMap<String, String> genericsAndBounds,
// List<TPHConstraint> consClass) {
// this.classOrInterface = classOrInterface;
// this.genericsAndBounds = genericsAndBounds;
// this.consClass = consClass;
// sw = new SignatureWriter();
// createSignatureForClassOrInterface();
// }
public Signature(HashMap<String, String> genericsAndBounds,
HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> methodParamsAndTypes, ResultSet resultSet,
List<GenericsGeneratorResult> constraints) {
//this.constructor = constructor;
this.genericsAndBounds = genericsAndBounds;
this.methodParamsAndTypes = methodParamsAndTypes;
this.resultSet = resultSet;
this.constraints = constraints;
}
public Signature(int numberOfParams) {
createSignatureForFunN(numberOfParams);
}
public Signature(int numberOfParams, String to, String[] paramTypes) {
createSignatureForFunN(numberOfParams, to, paramTypes);
}
public Signature(ClassOrInterface classOrInterface, HashMap<String, String> genericsAndBounds,
List<GenericsGeneratorResult> consClass) {
this.classOrInterface = classOrInterface;
this.genericsAndBounds = genericsAndBounds;
this.consClass = consClass;
}
public Signature(HashMap<String, String> genericsAndBoundsMethod,
HashMap<String, String> genericsAndBounds,
HashMap<String, RefTypeOrTPHOrWildcardOrGeneric> methodParamsAndTypes, ResultSet resultSet,
List<GenericsGeneratorResult> constraints,List<GenericsGeneratorResult> consClass) {
this.genericsAndBoundsMethod = genericsAndBoundsMethod;
this.genericsAndBounds = genericsAndBounds;
this.methodParamsAndTypes = methodParamsAndTypes;
this.resultSet = resultSet;
this.constraints = constraints;
this.consClass = consClass;
}
public String createSignatureForConstructor(Constructor constructor) {
visitParams();
sw.visitReturnType().visitBaseType('V');
return sw.toString();
}
public String createSignatureForMethod(Method method) {
defineGenerics(method);
String ret = resultSet.resolveType(method.getReturnType()).resolvedType.acceptTV(new TypeToSignature());
visitParams();
visitReturnType(method, ret);
return sw.toString();
}
/**
* @param method
* @param ret
*/
private void visitReturnType(Method method, String ret) {
if (ret.equals("V")) {
sw.visitReturnType().visitBaseType('V');
} else {
RefTypeOrTPHOrWildcardOrGeneric returnType = method.getReturnType();
SignatureVisitor sv = sw.visitReturnType();
doVisitParamsOrReturn(returnType, sv);
}
}
/**
*
*/
private void visitParams() {
for (String paramName : methodParamsAndTypes.keySet()) {
RefTypeOrTPHOrWildcardOrGeneric t = methodParamsAndTypes.get(paramName);
SignatureVisitor sv = sw.visitParameterType();
doVisitParamsOrReturn(t, sv);
}
}
/**
*
* @param method
*/
private void defineGenerics(Method method) {
method.getGenerics().forEach(g -> {
visitTypeVarsAndTheirBounds(g, genericsAndBoundsMethod);
});
defineGenericsFromConstraints(constraints,genericsAndBoundsMethod);
}
private void createSignatureForFunN(int numberOfParams, String to, String[] paramTypes) {
defineTypeVariablesForParametersOfFunN(numberOfParams);
sw.visitFormalTypeParameter("R");
visitClassBound(to);
// TODO: prüfe ob Return-Type = void,
sw.visitSuperclass().visitClassType(Type.getInternalName(Object.class));
sw.visitEnd();
}
private void createSignatureForFunN(int numberOfParams) {
defineTypeVariablesForParametersOfFunN(numberOfParams);
sw.visitFormalTypeParameter("R");
// getBounds vom Return-Type
sw.visitClassBound().visitClassType(Type.getInternalName(Object.class));
sw.visitClassBound().visitEnd();
// TODO: prüfe ob Return-Type = void,
sw.visitSuperclass().visitClassType(Type.getInternalName(Object.class));
sw.visitEnd();
}
private void defineTypeVariablesForParametersOfFunN(int numberOfParams) {
for (int i = 0; i < numberOfParams; i++) {
int j = i + 1;
sw.visitFormalTypeParameter("T" + j);
// getBounds von Params
sw.visitClassBound().visitClassType(Type.getInternalName(Object.class));
sw.visitClassBound().visitEnd();
}
}
/**
* Visits parameter type or return type with {@link SignatureVisitor} to create
* the method signature
*
* @param t type of parameter or return type
* @param sv true if t is type of parameter
*/
private void doVisitParamsOrReturn(RefTypeOrTPHOrWildcardOrGeneric t, SignatureVisitor sv) {
String type = t.acceptTV(new TypeToString());
switch (type) {
case "RT":
String sig = t.acceptTV(new TypeToSignature(constraints));
sv.visitClassType(sig.substring(1, sig.length()));
break;
case "GRT":
GenericRefType g = (GenericRefType) t;
sv.visitTypeVariable(g.acceptTV(new TypeToSignature(constraints)));
break;
case "TPH":
RefTypeOrTPHOrWildcardOrGeneric r = resultSet.resolveType(t).resolvedType;
// der Fall wenn der Typ eine Interface ist, muss betrachtet werden
// Deswegen muss in ResutSet noch enthalten werden, ob die Type eine
// Interface oder eine Klasse ist.
// das braucht man nicht es reicht: sv.visitTypeVariable(r.acceptTV(new
// TypeToSignature())
//
String sig2 = r.acceptTV(new TypeToSignature(constraints));
if (r instanceof GenericRefType) {
sv.visitTypeVariable(sig2);
} else if (!(r instanceof TypePlaceholder)) {
if (sig2.contains(SPECIAL_CHAR_FOR_FUN)) {
sv.visitInterface().visitClassType(sig2.substring(1));
} else {
// Kann zwischen GenericRefType und RefType nicht unterscheiden
// Deswegen wird immer geprüft, ob der Name in Generic Maps liegt
String n = sig2.substring(1, sig2.length() - 1);
// if(genericsAndBoundsMethod.containsKey(n) || genericsAndBounds.containsKey(n)) {
// sv.visitTypeVariable(n);
// } else {
sv.visitClassType(n);
sv.visitEnd();
// }
// sv.visitClassType(n);
}
} else {
String realName = sig2.substring(1, sig2.length() - 1);
String toVisit = realName+SPECIAL_CHAR;
if(!genericsAndBounds.containsKey(toVisit)) {
Optional<GenericsGeneratorResult> equalTPH = getEqualTPHFromClassConstraints(consClass, realName);
if(equalTPH.isPresent()){
toVisit = equalTPH.get().getConstraint().getLeft() + SPECIAL_CHAR;
} else {
toVisit = getEqualTPH(constraints, realName) + SPECIAL_CHAR;
}
}
sv.visitTypeVariable(toVisit);
}
break;
case "SWC":
SuperWildcardType swc = (SuperWildcardType) t;
String sigInner = swc.getInnerType().acceptTV(new TypeToSignature(constraints));
int length = sigInner.length();
visitWildCard(sv, sigInner, length, swc.getInnerType(), SUPER_CHAR);
break;
case "EWC":
ExtendsWildcardType ewc = (ExtendsWildcardType) t;
String esigInner = ewc.getInnerType().acceptTV(new TypeToSignature(constraints));
int lengthEWCSig = esigInner.length();
visitWildCard(sv, esigInner, lengthEWCSig, ewc.getInnerType(), EXTENDS_CHAR);
break;
default:
// if (!sv)
// sv.visitBaseType('V');
break;
}
}
private void visitWildCard(SignatureVisitor sv, String sigInner, int length, RefTypeOrTPHOrWildcardOrGeneric innerType, char superOrExtendsChar) {
if (innerType instanceof TypePlaceholder) {
sv.visitTypeArgument(superOrExtendsChar).visitTypeVariable(sigInner.substring(1, length));
} else if (innerType instanceof RefType) {
checkInnerSignatureOfWildCard(sv, sigInner, length, superOrExtendsChar);
} else {
sv.visitTypeArgument(superOrExtendsChar).visitTypeVariable(sigInner.substring(1));
}
}
private void checkInnerSignatureOfWildCard(SignatureVisitor sv, String sigInner, int length, char superOrExtendsChar) {
if (sigInner.contains(SPECIAL_CHAR_FOR_FUN)) {
sv.visitTypeArgument(superOrExtendsChar).visitInterface().visitClassType(sigInner.substring(1, length));
} else {
sv.visitTypeArgument(superOrExtendsChar).visitClassType(sigInner.substring(1, length));
}
}
private Optional<GenericsGeneratorResult> getEqualTPHFromClassConstraints(List<GenericsGeneratorResult> consClass, String tph) {
return consClass.stream()
.filter(c -> c.getConstraint().getLeft().equals(tph) || c.getEqualsTPHs().contains(tph))
.findFirst();
}
private String getEqualTPH(List<GenericsGeneratorResult> constraints2, String tph) {
return constraints2.stream()
.filter(c -> c.getConstraint().getLeft().equals(tph) || c.getEqualsTPHs().contains(tph))
.findFirst().get().getConstraint().getLeft();
}
/**
* Creates signature for class or interface with {@link SignatureWriter}
* Signature looks like: <typevaliables (K:Ljava/lang/Object
* "Bounds")>superclass
*/
public String createSignatureForClassOrInterface() {
defineTypeVariablesForClassOrInterface();
defineGenericsFromConstraints(consClass,genericsAndBounds);
String sClass = classOrInterface.getSuperClass().acceptTV(new TypeToSignature());
sw.visitSuperclass().visitClassType(sClass.substring(1, sClass.length() - 1));
sw.visitEnd();
return sw.toString();
}
private void defineTypeVariablesForClassOrInterface() {
Iterator<GenericTypeVar> itr = classOrInterface.getGenerics().iterator();
while (itr.hasNext()) {
GenericTypeVar g = itr.next();
visitTypeVarsAndTheirBounds(g, genericsAndBounds);
}
}
/**
* @param genericsAndBounds2
*
*/
private void defineGenericsFromConstraints(List<GenericsGeneratorResult> constraints, HashMap<String,String> genericsAndBounds2) {
constraints.forEach(c -> {
String typeVariable = c.getConstraint().getLeft() + SPECIAL_CHAR;
sw.visitFormalTypeParameter(typeVariable);
String bound = c.getConstraint().getRight();
bound = checkBound(bound);
genericsAndBounds2.put(typeVariable, bound);
});
}
/**
* @param bound
* @return
*/
private String checkBound(String bound) {
if (bound.equals(Type.getInternalName(Object.class))) {
visitClassBound(bound);
} else {
bound += SPECIAL_CHAR;
sw.visitClassBound().visitTypeVariable(bound);
}
return bound;
}
/**
* @param bound
*/
private void visitClassBound(String bound) {
sw.visitClassBound().visitClassType(bound);
sw.visitClassBound().visitEnd();
}
/**
* Get bounds of type variable
*
* @param g type variable
* @param genAndBounds
*/
private void visitTypeVarsAndTheirBounds(GenericTypeVar g, HashMap<String, String> genAndBounds) {
sw.visitFormalTypeParameter(g.getName());
Iterator<? extends RefTypeOrTPHOrWildcardOrGeneric> bItr = g.getBounds().iterator();
while (bItr.hasNext()) {
RefTypeOrTPHOrWildcardOrGeneric b = bItr.next();
String boundDesc = b.acceptTV(new TypeToDescriptor());
// Ensure that <...> extends java.lang.Object OR ...
if (b instanceof GenericRefType) {
sw.visitClassBound().visitTypeVariable(boundDesc);
} else {
visitClassBound(boundDesc);
}
genAndBounds.put(g.getName(), boundDesc);
}
}
@Override
public String toString() {
if(sw == null)
return super.toString();
return sw.toString();
}
}
@@ -1,115 +0,0 @@
package de.dhbwstuttgart.bytecode.signature;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import de.dhbwstuttgart.bytecode.funN.FunNGenerator;
import de.dhbwstuttgart.bytecode.funN.FunNUtilities;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericsGeneratorResult;
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.syntaxtree.type.TypeVisitor;
public class TypeToSignature implements TypeVisitor<String> {
private List<GenericsGeneratorResult> constraints;
private final boolean specializedFunN;
public TypeToSignature() { this(new ArrayList<>(), true); }
public TypeToSignature(boolean specializedFunN) { this(new ArrayList<>(), specializedFunN); }
public TypeToSignature(List<GenericsGeneratorResult> constraints) {
this(constraints, true);
}
public TypeToSignature(List<GenericsGeneratorResult> constraints, boolean specializedFunN){
this.constraints = constraints;
this.specializedFunN = specializedFunN;
}
@Override
public String visit(RefType refType) {
if(refType.getName().toString().equals("void"))
return "V";
if (refType.getName().toString().matches("Fun\\d+\\$\\$") && specializedFunN){
FunNUtilities funNUtilities = FunNGenerator.getInstance();
return funNUtilities.getSpecializedSignature(funNUtilities.getArguments(refType.getParaList()), funNUtilities.getReturnType(refType.getParaList()));
}
// return refType.toString().replace(".", "/");
String params = "";
if(refType.getParaList().size()>0){
params += "<";
Iterator<RefTypeOrTPHOrWildcardOrGeneric> it = refType.getParaList().iterator();
while(it.hasNext()){
RefTypeOrTPHOrWildcardOrGeneric param = it.next();
// if(param instanceof TypePlaceholder) {
// params += "T" + ((TypePlaceholder) param).getName() + "$";
// } else if(param instanceof ExtendsWildcardType) {
// params += "+" + ((ExtendsWildcardType) param).getInnerType().acceptTV(new TypeToSignature());
// } else if(param instanceof SuperWildcardType) {
// params += "-" + ((SuperWildcardType) param).getInnerType().acceptTV(new TypeToSignature());
// } else {
// params += "L"+param.toString().replace(".", "/");
// }
params += param.acceptTV(new TypeToSignature(constraints));
if(param instanceof TypePlaceholder)
params += ";";
}
params += ">";
}
// String t = refType.getName().toString().replace(".", "/");
// return t.equals("Fun1")?t+"$$"+params+";":t+params+";";
return "L"+refType.getName().toString().replace(".", "/") + params+";";
}
@Override
public String visit(SuperWildcardType superWildcardType) {
// throw new NotImplementedException();
String sig = "-" + superWildcardType.getInnerType().acceptTV(new TypeToSignature(constraints));
if(superWildcardType.getInnerType() instanceof TypePlaceholder)
sig += ";";
return sig;
}
@Override
public String visit(TypePlaceholder typePlaceholder) {
// return typePlaceholder.toString().replace(".", "/");
String name = typePlaceholder.getName();
if(!constraints.isEmpty()){
Optional<GenericsGeneratorResult> equalName = getEqualTPHFromClassConstraints(constraints, name);
if(equalName.isPresent())
name = equalName.get().getConstraint().getLeft();
}
return "T" + name + "$";
}
@Override
public String visit(ExtendsWildcardType extendsWildcardType) {
// throw new NotImplementedException();
String sig = "+" + extendsWildcardType.getInnerType().acceptTV(new TypeToSignature(constraints));
if(extendsWildcardType.getInnerType() instanceof TypePlaceholder)
sig += ";";
return sig;
}
@Override
public String visit(GenericRefType genericRefType) {
return genericRefType.getParsedName().replace(".", "/");
}
private Optional<GenericsGeneratorResult> getEqualTPHFromClassConstraints(List<GenericsGeneratorResult> listOfConstraints, String tph) {
return listOfConstraints.stream()
.filter(c -> c.getConstraint().getLeft().equals(tph) || c.getEqualsTPHs().contains(tph))
.findFirst();
}
}
@@ -1,38 +0,0 @@
package de.dhbwstuttgart.bytecode.signature;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
import de.dhbwstuttgart.syntaxtree.type.GenericRefType;
import de.dhbwstuttgart.syntaxtree.type.RefType;
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.syntaxtree.type.TypeVisitor;
public class TypeToString implements TypeVisitor<String>{
@Override
public String visit(RefType refType) {
return "RT";
}
@Override
public String visit(SuperWildcardType superWildcardType) {
return "SWC";
}
@Override
public String visit(TypePlaceholder typePlaceholder) {
return "TPH";
}
@Override
public String visit(ExtendsWildcardType extendsWildcardType) {
return "EWC";
}
@Override
public String visit(GenericRefType genericRefType) {
return "GRT";
}
}
@@ -1,50 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.simplifyRes;
import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
/**
* The simplify results of a source file (package)
*
* @author fayez
*
*/
public class GenericGenratorResultForSourceFile {
private String pkgName;
private final List<GenericsGeneratorResultForClass> genericGeneratorResultForAllClasses = new ArrayList<>();
/**
* @param pkgName
*/
public GenericGenratorResultForSourceFile(String pkgName) {
this.pkgName = pkgName;
}
public List<GenericsGeneratorResultForClass> getGenericGeneratorResultForAllClasses() {
return genericGeneratorResultForAllClasses;
}
/**
* Appends the simplify results of a class to simplifyResForSF
*
* @param sResClass simplify results of a class to added
*/
public void addGenericGeneratorResultClass(GenericsGeneratorResultForClass sResClass) {
genericGeneratorResultForAllClasses.add(sResClass);
}
public GenericsGeneratorResultForClass getSimplifyResultsByName(String pkgName, String name) {
for (int i = 0; i < genericGeneratorResultForAllClasses.size(); i++) {
GenericsGeneratorResultForClass genericsGeneratorResult = genericGeneratorResultForAllClasses.get(i);
if (genericsGeneratorResult.getClassName().equals(name)) {
return genericsGeneratorResult;
}
}
return new GenericsGeneratorResultForClass(name);
}
}
@@ -1,75 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.simplifyRes;
import java.util.Collections;
import java.util.List;
import com.google.common.base.Optional;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericGeneratorResultsForAllMethods;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericsGeneratorResult;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.MethodAndConstraints;
/**
* @author fayez
*
*/
public class GenericsGeneratorResultForClass {
private final String className;
private final List<GenericsGeneratorResult> classConstraints;
private final GenericGeneratorResultsForAllMethods methodsAndTheirConstraints;
public GenericsGeneratorResultForClass(String className) {
this(className, Collections.emptyList(), new GenericGeneratorResultsForAllMethods());
}
/**
* @param className
* @param classConstraints
* @param methodsAndTheirConstraints
*/
public GenericsGeneratorResultForClass(String className, List<GenericsGeneratorResult> classConstraints,
GenericGeneratorResultsForAllMethods methodsAndTheirConstraints) {
this.className = className;
this.classConstraints = classConstraints;
this.methodsAndTheirConstraints = methodsAndTheirConstraints;
}
/**
* @return the className
*/
public String getClassName() {
return className;
}
/**
* @return the classConstraints
*/
public List<GenericsGeneratorResult> getClassConstraints() {
return classConstraints;
}
/**
* @return the methodsAndTheirConstraints
*/
public GenericGeneratorResultsForAllMethods getMethodsAndTheirConstraints() {
return methodsAndTheirConstraints;
}
public boolean contains(String id) {
return methodsAndTheirConstraints.getMethodsAndConstraints().stream().map(mc -> mc.getMethodID())
.anyMatch(i -> i.equals(id));
}
public List<GenericsGeneratorResult> getMethodConstraintsByID(String id) {
java.util.Optional<MethodAndConstraints> methodAndConstraints = methodsAndTheirConstraints.getMethodsAndConstraints().stream().filter(mc -> mc.getMethodID().equals(id))
.findFirst();
return methodAndConstraints.isPresent() ? methodAndConstraints.get().getConstraints() : Collections.emptyList();
}
}
@@ -1,94 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import de.dhbwstuttgart.bytecode.signature.Signature;
import de.dhbwstuttgart.syntaxtree.FormalParameter;
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
import de.dhbwstuttgart.syntaxtree.statement.Expression;
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.signature.SignatureVisitor;
import org.objectweb.asm.signature.SignatureWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Iterator;
public class ByteCodeForFunNGenerator {
public static void generateBCForFunN(LambdaExpression lambdaExpression, String methDesc, File path) {
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
SignatureWriter methSig = new SignatureWriter();
int numberOfParams = 0;
SignatureVisitor paramVisitor = methSig.visitParameterType();
Iterator<FormalParameter> itr = lambdaExpression.params.iterator();
while (itr.hasNext()) {
numberOfParams++;
// getBounds
paramVisitor.visitTypeVariable(CONSTANTS.T + numberOfParams);
itr.next();
}
methSig.visitReturnType().visitTypeVariable(CONSTANTS.R);
// ")"+lam.getReturn.getBounds
Signature sig = new Signature(numberOfParams);
String name = CONSTANTS.FUN + numberOfParams + CONSTANTS.$$;
classWriter.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC+Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT, name, sig.toString(),
Type.getInternalName(Object.class), null);
MethodVisitor mvApply = classWriter.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT, "apply", methDesc,
methSig.toString(), null);
mvApply.visitEnd();
writeClassFile(classWriter.toByteArray(), name, path);
}
public static void generateBCForFunN(ArgumentList argumentList, String methDesc, File path) {
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
SignatureWriter methSig = new SignatureWriter();
int numberOfParams = 0;
SignatureVisitor paramVisitor = methSig.visitParameterType();
Iterator<Expression> itr1 = argumentList.getArguments().iterator();
while(itr1.hasNext()) {
numberOfParams++;
// getBounds
paramVisitor.visitTypeVariable(CONSTANTS.T + numberOfParams);
itr1.next();
}
methSig.visitReturnType().visitTypeVariable(CONSTANTS.R);
// ")"+lam.getReturn.getBounds
Signature sig = new Signature(numberOfParams);
String name = CONSTANTS.FUN + numberOfParams + CONSTANTS.$$;
classWriter.visit(Opcodes.V1_8, Opcodes.ACC_PUBLIC+Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT, name, sig.toString(),
Type.getInternalName(Object.class), null);
MethodVisitor mvApply = classWriter.visitMethod(Opcodes.ACC_PUBLIC + Opcodes.ACC_ABSTRACT, "apply", methDesc,
methSig.toString(), null);
mvApply.visitEnd();
writeClassFile(classWriter.toByteArray(), name, path);
}
public static void writeClassFile(byte[] bytecode, String name, File path) {
FileOutputStream output;
try {
System.out.println("generating " + name + ".class file...");
output = new FileOutputStream(
new File(path , name + CONSTANTS.EXTENSIONCLASS));
output.write(bytecode);
output.close();
System.out.println(name + ".class file generated");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
@@ -1,22 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
public interface CONSTANTS {
String VOID = "void";
String TPH = "TPH ";
String ANGLEBRACKET = "<";
String FUN = "Fun";
String EXTENSIONCLASS = ".class";
String $$ = "$$";
String T = "T";
String R = "R";
String DESUGAREDMETHODNAME = "lambda$new$";
String REFTYPE_BYTE = "java/lang/Byte";
String REFTYPE_SHORT = "java/lang/Short";
String REFTYPE_INTEGER = "java/lang/Integer";
String REFTYPE_LONG = "java/lang/Long";
String REFTYPE_DOUBLE = "java/lang/Double";
String REFTYPE_FLOAT = "java/lang/Float";
String REFTYPE_STRING = "java/lang/String";
String TO_STRING = "toString";
}
@@ -1,53 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import java.util.ArrayList;
import java.util.List;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint.Relation;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.ConstraintsWithSameLeftSide;
public class ConstraintsFinder {
private List<TPHConstraint> allConstaints;
public ConstraintsFinder(List<TPHConstraint> allConstaints) {
this.allConstaints = allConstaints;
}
public List<ConstraintsWithSameLeftSide> findConstraints() {
List<ConstraintsWithSameLeftSide> result = new ArrayList<>();
List<TPHConstraint> visitedCons = new ArrayList<>();
for(TPHConstraint c : allConstaints) {
if(c.getRel() == Relation.EXTENDS) {
// get constraints with the same left side
List<TPHConstraint> cons = getConstraints(c,visitedCons);
if(cons.size()>1) {
ConstraintsWithSameLeftSide consWithSameLeftSide = new ConstraintsWithSameLeftSide(cons);
result.add(consWithSameLeftSide);
}
}
}
return result;
}
private List<TPHConstraint> getConstraints(TPHConstraint c, List<TPHConstraint> visitedCons) {
List<TPHConstraint> res = new ArrayList<>();
for(TPHConstraint cons : allConstaints) {
if(!isVisited(cons,visitedCons) && cons.getLeft().equals(c.getLeft())) {
res.add(cons);
visitedCons.add(cons);
}
}
return res;
}
private boolean isVisited(TPHConstraint cons, List<TPHConstraint> visitedCons) {
for(TPHConstraint c : visitedCons) {
if(c.getLeft().equals(cons.getLeft()) && c.getRight().equals(cons.getRight()))
return true;
}
return false;
}
}
@@ -1,243 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import de.dhbwstuttgart.syntaxtree.statement.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
import de.dhbwstuttgart.syntaxtree.FormalParameter;
import de.dhbwstuttgart.syntaxtree.ParameterList;
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
import de.dhbwstuttgart.syntaxtree.statement.Literal;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
public class KindOfLambda implements StatementVisitor{
private ParameterList params;
private boolean isInstanceCapturingLambda = false;
private List<RefTypeOrTPHOrWildcardOrGeneric> argumentList = new ArrayList<>();
private ArrayList<String> usedVars = new ArrayList<>();
private ArrayList<String> varsFromInnerLambdas = new ArrayList<>();
private boolean thisUsed = false;
private ArrayList<String> definedLocals = new ArrayList<>();
public KindOfLambda(LambdaExpression lambdaExpression) {
this.params = lambdaExpression.params;
lambdaExpression.methodBody.accept(this);
}
public ArrayList<String> getUsedVars() {
return usedVars;
}
public boolean isInstanceCapturingLambda() {
return this.isInstanceCapturingLambda;
}
public List<RefTypeOrTPHOrWildcardOrGeneric> getArgumentList() {
return argumentList;
}
public boolean isThisUsed() {
return thisUsed;
}
@Override
public void visit(ArgumentList argumentList) {
argumentList.getArguments().forEach(a->a.accept(this));
}
@Override
public void visit(LambdaExpression lambdaExpression) {
lambdaExpression.params.getFormalparalist().forEach(p->varsFromInnerLambdas.add(p.getName()));
lambdaExpression.methodBody.accept(this);
}
@Override
public void visit(Assign assign) {
assign.rightSide.accept(this);
}
@Override
public void visit(BinaryExpr binary) {
binary.lexpr.accept(this);
binary.rexpr.accept(this);
}
@Override
public void visit(Block block) {
for(Statement stmt : block.getStatements()) {
stmt.accept(this);
}
}
@Override
public void visit(CastExpr castExpr) {
// TODO Auto-generated method stub
}
@Override
public void visit(EmptyStmt emptyStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(FieldVar fieldVar) {
fieldVar.receiver.accept(this);
}
@Override
public void visit(ForStmt forStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(IfStmt ifStmt) {
ifStmt.expr.accept(this);
ifStmt.then_block.accept(this);
ifStmt.else_block.accept(this);
}
@Override
public void visit(InstanceOf instanceOf) {
// TODO Auto-generated method stub
}
@Override
public void visit(LocalVar localVar) {
boolean addVar = !contain(params, localVar.name) && !definedLocals.contains(localVar.name) &&
!varsFromInnerLambdas.contains(localVar.name) && !usedVars.contains(localVar.name);
if(addVar) {
argumentList.add(localVar.getType());
if(thisUsed) {
usedVars.add(1, localVar.name);
} else {
usedVars.add(0, localVar.name);
}
if(!isInstanceCapturingLambda)
isInstanceCapturingLambda=true;
}
}
private boolean contain(ParameterList params2, String name) {
Iterator<FormalParameter> itr = params2.iterator();
while(itr.hasNext()) {
FormalParameter fp = itr.next();
if(fp.getName().equals(name))
return true;
}
return false;
}
@Override
public void visit(LocalVarDecl localVarDecl) {
definedLocals.add(localVarDecl.getName());
}
@Override
public void visit(MethodCall methodCall) {
methodCall.receiver.accept(this);
methodCall.arglist.accept(this);
}
@Override
public void visit(NewClass methodCall) {
methodCall.receiver.accept(this);
methodCall.arglist.accept(this);
}
@Override
public void visit(NewArray newArray) {
// TODO Auto-generated method stub
}
@Override
public void visit(ExpressionReceiver receiver) {
receiver.expr.accept(this);
}
@Override
public void visit(UnaryExpr unaryExpr) {
}
@Override
public void visit(Return aReturn) {
aReturn.retexpr.accept(this);
}
@Override
public void visit(ReturnVoid aReturn) {
// TODO Auto-generated method stub
}
@Override
public void visit(StaticClassName staticClassName) {
// TODO Auto-generated method stub
}
@Override
public void visit(Super aSuper) {
// TODO Auto-generated method stub
}
@Override
public void visit(This aThis) {
if(!thisUsed) {
thisUsed = true;
this.argumentList.add(0,aThis.getType());
}
if(!isInstanceCapturingLambda) {
this.isInstanceCapturingLambda = true;
}
}
@Override
public void visit(WhileStmt whileStmt) {
whileStmt.expr.accept(this);
whileStmt.loopBlock.accept(this);
}
@Override
public void visit(DoStmt whileStmt) {
// TODO Auto-generated method stub
}
@Override
public void visit(Literal literal) {
// TODO Auto-generated method stub
}
@Override
public void visit(AssignToField assignLeftSide) {
// TODO Auto-generated method stub
}
@Override
public void visit(AssignToLocal assignLeftSide) {
// TODO Auto-generated method stub
}
@Override
public void visit(SuperCall superCall) {
// TODO Auto-generated method stub
}
}
@@ -1,26 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
import de.dhbwstuttgart.syntaxtree.ParameterList;
import de.dhbwstuttgart.syntaxtree.statement.LambdaExpression;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
public class Lambda {
private LambdaExpression lambdaExpression;
public Lambda(LambdaExpression lambdaExpression) {
this.lambdaExpression = lambdaExpression;
}
public ParameterList getParams() {
return lambdaExpression.params;
}
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
return lambdaExpression.getReturnType();
}
public String accept(DescriptorVisitor descVisitor) {
return descVisitor.visit(this);
}
}
@@ -1,59 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import java.util.ArrayList;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import de.dhbwstuttgart.typeinference.constraints.ConstraintSet;
import de.dhbwstuttgart.typeinference.constraints.Pair;
import de.dhbwstuttgart.typeinference.result.GenericInsertPair;
import de.dhbwstuttgart.typeinference.result.ResultPair;
public class MethodAndTPH {
private String id;
private final ArrayList<String> tphs = new ArrayList<>();
//private final ArrayList<GenericInsertPair> pairs = new ArrayList<>();
private final ArrayList<ResultPair<TypePlaceholder, TypePlaceholder>> pairs = new ArrayList<>();
// tphs of local variables and parameters
private final ArrayList<String> localTphs = new ArrayList<>();
/*
* its Constraints
* eingefuegt PL 2021-02-15
*/
public final ConstraintSet constraints;
public MethodAndTPH(String name, ConstraintSet<Pair> constraints) {
this.id = name;
this.constraints = constraints;
}
public void addTph(String tph) {
tphs.add(tph);
}
public ArrayList<String> getTphs() {
return tphs;
}
// public ArrayList<GenericInsertPair> getPairs(){
// return pairs;
// }
public ArrayList<ResultPair<TypePlaceholder, TypePlaceholder>> getPairs(){
return pairs;
}
public String getId() {
return id;
}
public ArrayList<String> getLocalTphs() {
return localTphs;
}
@Override
public String toString() {
return id;
}
}
@@ -1,244 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.utilities;
import de.dhbwstuttgart.bytecode.Exception.NotInCurrentPackageException;
import de.dhbwstuttgart.bytecode.descriptor.DescriptorToString;
import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor;
import de.dhbwstuttgart.bytecode.signature.TypeToSignature;
import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.statement.Expression;
import de.dhbwstuttgart.syntaxtree.statement.MethodCall;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typeinference.result.ResultSet;
import javassist.NotFoundException;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import java.io.File;
import java.util.*;
/**
* @author fayez
*
*/
public class MethodCallHelper {
private MethodCall methCall;
private SourceFile sourceFile;
private ResultSet resultSet;
private File path;
/**
* @param methCall
* @param sourceFile
* @param resultSet
* @param path TODO
*/
public MethodCallHelper(MethodCall methCall, SourceFile sourceFile, ResultSet resultSet, File path) {
this.methCall = methCall;
this.sourceFile = sourceFile;
this.resultSet = resultSet;
this.path = path;
}
public String getResolvedType(RefTypeOrTPHOrWildcardOrGeneric type) {
return resultSet.resolveType(type).resolvedType.acceptTV(new TypeToDescriptor());
}
public boolean isInCurrPkg(String className) {
for (ClassOrInterface cl : sourceFile.KlassenVektor) {
if (className.equals(cl.getClassName().toString()))
return true;
}
return false;
}
public String getSuperClass(String className) throws NotInCurrentPackageException {
for (ClassOrInterface cl : sourceFile.getClasses()) {
if (className.equals(cl.getClassName().toString())) {
return cl.getSuperClass().getName().toString();
}
}
throw new NotInCurrentPackageException("Class " + className + " is not in the current package.");
}
public ClassOrInterface getClassFromCurrPkg(String className) throws NotInCurrentPackageException {
for (ClassOrInterface cl : sourceFile.KlassenVektor) {
if (className.equals(cl.getClassName().toString()))
return cl;
}
throw new NotInCurrentPackageException("Class of " + className + " is not in the current package.");
}
public String getDesc(String className) throws NotInCurrentPackageException, NotFoundException {
String name = methCall.name;
ClassOrInterface clazz = getClassFromCurrPkg(className);
String retType = getResolvedType(methCall.getType());
ArrayList<String> params = getTypes(methCall.arglist.getArguments());
Map<String, String> genAndBoundsClass = getGenericsAndBounds(clazz.getGenerics());
modifyGenAndBounds(genAndBoundsClass);
for (Method m : clazz.getMethods()) {
if (name.equals(m.getName()) && retType.equals(getResolvedType(m.getReturnType()))) {
ArrayList<String> paramsOfM = getTypes(m.getParameterList());
if(areEquals(params,paramsOfM)) {
Map<String, String> genAndBoundsMethod = getGenericsAndBoundsMethod(m.getGenerics());
modifyGenAndBounds(genAndBoundsMethod);
boolean hasGen = hasGen(m, genAndBoundsClass);
NormalMethod nm = new NormalMethod(m, (HashMap<String, String>) genAndBoundsClass,
(HashMap<String, String>) genAndBoundsMethod, hasGen);
return nm.accept(new DescriptorToString(resultSet));
}
}
}
throw new NotFoundException("Method " + name + " is not found");
}
private boolean areEquals(ArrayList<String> params, ArrayList<String> paramsOfM) {
if(params.size() != paramsOfM.size())
return false;
for(String t : params) {
for(String t2 : paramsOfM) {
if(!t.equals(t2))
return false;
}
}
return true;
}
private ArrayList<String> getTypes(ParameterList parameterList) {
Iterator<FormalParameter> itr = parameterList.iterator();
ArrayList<String> typeList = new ArrayList<>();
while (itr.hasNext()) {
FormalParameter fp = itr.next();
String t = getResolvedType(fp.getType());
typeList.add(t);
}
return typeList;
}
private ArrayList<String> getTypes(List<Expression> arguments) {
ArrayList<String> types = new ArrayList<>();
for(int i = 0; i<arguments.size(); ++i) {
String t = getResolvedType(arguments.get(i).getType());
types.add(t);
}
return types;
}
private boolean hasGen(Method m, Map<String, String> genericsAndBounds) {
String retType = resultSet.resolveType(m.getReturnType()).resolvedType.acceptTV(new TypeToSignature());
/*Prüfe, ob die Rückgabe-Type der Methode eine Type-Variable ist*/
boolean hasGenInParameterList = genericsAndBounds.containsKey(retType) || retType.contains("TPH ") || retType.contains("<");
Map<String,RefTypeOrTPHOrWildcardOrGeneric> methodParamsAndTypes = new HashMap<>();
Iterator<FormalParameter> itr = m.getParameterList().iterator();
while(itr.hasNext()) {
FormalParameter fp = itr.next();
methodParamsAndTypes.put(fp.getName(), resultSet.resolveType(fp.getType()).resolvedType);
}
/*Wenn die Rückgabe-Type eine Typ-variable ist, erzeuge direkt die Signature, wenn nicht,
* prüfe, ob einer der Parameter Typ-Variable als Typ hat*/
if(!hasGenInParameterList) {
for(String paramName : methodParamsAndTypes.keySet()) {
String typeOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToDescriptor());
String sigOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToSignature());
if(genericsAndBounds.containsKey(typeOfParam)||typeOfParam.contains("TPH ")||sigOfParam.contains("<")) {
hasGenInParameterList = true;
break;
}
}
}
return m.getGenerics().iterator().hasNext() || hasGenInParameterList;
}
private Map<String, String> getGenericsAndBoundsMethod(Iterable<? extends GenericTypeVar> generics) {
Map<String, String> genAndBounds = new HashMap<>();
Iterator<? extends GenericTypeVar> itr = generics.iterator();
while (itr.hasNext()) {
GenericTypeVar gtv = itr.next();
getBoundsOfTypeVar(gtv, genAndBounds);
}
return genAndBounds;
}
private void modifyGenAndBounds(Map<String, String> genAndBoundsClass) {
List<String> visited = new ArrayList<>(genAndBoundsClass.size());
Map<String, String> toReplace = new HashMap<>();
for (String tv : genAndBoundsClass.keySet()) {
if (visited.contains(tv))
continue;
List<String> types = new LinkedList<>();
String bound = genAndBoundsClass.get(tv);
types.add(tv);
visited.add(tv);
boolean doReplace = false;
while (genAndBoundsClass.keySet().contains(bound)) {
doReplace = true;
types.add(bound);
visited.add(bound);
bound = genAndBoundsClass.get(bound);
}
if (doReplace) {
for (String tt : types) {
toReplace.put(tt, bound);
}
}
}
for (String key : toReplace.keySet()) {
genAndBoundsClass.replace(key, toReplace.get(key));
}
}
private Map<String, String> getGenericsAndBounds(GenericDeclarationList generics) {
Map<String, String> genAndBounds = new HashMap<>();
Iterator<GenericTypeVar> itr = generics.iterator();
while (itr.hasNext()) {
GenericTypeVar gtv = itr.next();
getBoundsOfTypeVar(gtv, genAndBounds);
}
return genAndBounds;
}
private void getBoundsOfTypeVar(GenericTypeVar g, Map<String, String> genAndBounds) {
Iterator<? extends RefTypeOrTPHOrWildcardOrGeneric> bItr = g.getBounds().iterator();
while (bItr.hasNext()) {
RefTypeOrTPHOrWildcardOrGeneric b = bItr.next();
String boundDesc = b.acceptTV(new TypeToDescriptor());
genAndBounds.put(g.getName(), boundDesc);
}
}
public void generateBCForFunN(String methodDescriptor) {
ByteCodeForFunNGenerator.generateBCForFunN(methCall.arglist,methodDescriptor,path);
}
public String getDescriptorOfApplyMethod(String methodCallType) {
return new DescriptorToString().createDescForFunN(methCall.arglist, methodCallType);
}
/**
* @param methodCall
*/
public void createCheckCast(MethodCall methodCall, MethodVisitor mv) {
String checkCast = getResolvedType(methodCall.getType());
if(!checkCast.contains("TPH ")) {
int pos = checkCast.length();
if(checkCast.contains("<"))
pos = checkCast.indexOf("<");
mv.visitTypeInsn(Opcodes.CHECKCAST,checkCast.substring(0,pos));
}
}
}
@@ -1,50 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import java.util.HashMap;
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
import de.dhbwstuttgart.syntaxtree.statement.ArgumentList;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
public class MethodFromMethodCall {
private ArgumentList argList;
private RefTypeOrTPHOrWildcardOrGeneric returnType;
private String receiverName;
private HashMap<String, String> genericsAndBoundsMethod;
private HashMap<String,String> genericsAndBounds;
public MethodFromMethodCall(ArgumentList argList,RefTypeOrTPHOrWildcardOrGeneric returnType,
String receiverName, HashMap<String, String> genericsAndBoundsMethod,
HashMap<String,String> genericsAndBounds) {
this.argList = argList;
this.returnType = returnType;
this.receiverName = receiverName;
this.genericsAndBoundsMethod = genericsAndBoundsMethod;
this.genericsAndBounds = genericsAndBounds;
}
public ArgumentList getArgList() {
return argList;
}
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
return returnType;
}
public String getReceiverName() {
return receiverName;
}
public HashMap<String, String> getGenericsAndBoundsMethod(){
return genericsAndBoundsMethod;
}
public HashMap<String,String> getGenericsAndBounds(){
return genericsAndBounds;
}
public String accept(DescriptorVisitor descVisitor) {
return descVisitor.visit(this);
}
}
@@ -1,34 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.utilities;
import java.util.Iterator;
import de.dhbwstuttgart.syntaxtree.FormalParameter;
import de.dhbwstuttgart.syntaxtree.Method;
/**
* @author fayez
*
*/
public class MethodUtility {
/**
* Creates an ID for a method
*
* @param resolver type Resolver
* @param method for which the ID will be generated
* @return ID for the given method.
* ID = ReturntypeMethodname(Parametertypes)
*/
public static String createID(Resolver resolver, Method method) {
String id = resolver.getResolvedType(method.getReturnType()) + method.name + "(";
Iterator<FormalParameter> itr = method.getParameterList().iterator();
while (itr.hasNext()) {
FormalParameter fp = itr.next();
id += resolver.getResolvedType(fp.getType());
}
id += ")";
return id;
}
}
@@ -1,145 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.NameReplacementResult;
import de.dhbwstuttgart.syntaxtree.factory.NameGenerator;
public class NameReplacer {
//TODO rename
private List<TPHConstraint> constraints;
private List<TPHConstraint> allConstraints;
private List<MethodAndTPH> methodAndTPHs;
// TODO rename into tphClass
private List<String> tphs;
private List<String> localTphs;
public NameReplacer(List<TPHConstraint> constraints, List<TPHConstraint> allConstraints,List<String> tphs, ArrayList<String> localTphs) {
super();
this.constraints = constraints;
this.allConstraints = allConstraints;
this.tphs = tphs;
this.localTphs = localTphs;
}
public NameReplacer(List<TPHConstraint> constraints, List<TPHConstraint> allConstraints,List<String> tphs) {
super();
this.constraints = constraints;
this.allConstraints = allConstraints;
this.tphs = tphs;
}
public NameReplacer(List<TPHConstraint> constraints, List<TPHConstraint> allConstraints) {
this.constraints = constraints;
this.allConstraints = allConstraints;
}
public NameReplacer(List<TPHConstraint> constraints, List<TPHConstraint> allConstraints, List<MethodAndTPH> methodAndTPHs,
List<String> tphsClass) {
this.constraints = constraints;
this.allConstraints = allConstraints;
this.methodAndTPHs = methodAndTPHs;
this.tphs = tphsClass;
}
public NameReplacementResult replaceNames() {
String newName = NameGenerator.makeNewName();
List<String> names = new ArrayList<>();
substituteRightSidesWithNewName(newName, names);
substituteNamesInAllConstraints(newName, names);
Stream<ArrayList<String>> tphsOfMethods = methodAndTPHs.stream().map(m->m.getTphs());
Stream<ArrayList<String>> localTphsOfMethods = methodAndTPHs.stream().map(m->m.getLocalTphs());
replaceOldNames(newName, names, tphsOfMethods);
replaceOldNames(newName, names, localTphsOfMethods);
if(tphs.removeAll(names))
tphs.add(newName);
NameReplacementResult res = new NameReplacementResult(newName, names);
return res;
}
/**
* @param newName
* @param names
* @param tphsOfMethods
*/
public void replaceOldNames(final String newName, final List<String> names, Stream<ArrayList<String>> tphsOfMethods) {
tphsOfMethods.forEach(tphsMethod->{
if(tphsMethod.removeAll(names))
tphsMethod.add(newName);
});
}
public NameReplacementResult replaceNamesLocal() {
String newName = NameGenerator.makeNewName();
List<String> names = new ArrayList<>();
substituteRightSidesWithNewName(newName, names);
substituteNamesInAllConstraints(newName, names);
tphs.removeAll(names);
tphs.add(newName);
NameReplacementResult res = new NameReplacementResult(newName, names);
return res;
}
/**
* @param newName
* @param names
*/
public void substituteNamesInAllConstraints(String newName, List<String> names) {
for(TPHConstraint cons : allConstraints) {
if(names.contains(cons.getLeft()))
cons.setLeft(newName);
if(names.contains(cons.getRight()))
cons.setRight(newName);
}
}
/**
* @param newName
* @param names
*/
public void substituteRightSidesWithNewName(String newName, List<String> names) {
for(TPHConstraint cons : constraints) {
names.add(cons.getRight());
cons.setRight(newName);
}
}
public Map<String, List<String>> replaceNamesWithLocals() {
String newName = NameGenerator.makeNewName();
ArrayList<String> names = new ArrayList<>();
for(TPHConstraint cons : constraints) {
names.add(cons.getRight());
cons.setRight(newName);
}
for(TPHConstraint cons : allConstraints) {
if(names.contains(cons.getLeft()))
cons.setLeft(newName);
if(names.contains(cons.getRight()))
cons.setRight(newName);
}
tphs.removeAll(names);
tphs.add(newName);
localTphs.removeAll(names);
localTphs.add(newName);
HashMap<String, List<String>> res = new HashMap<>();
res.put(newName, names);
return res;
}
}
@@ -1,40 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import java.util.HashMap;
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
import de.dhbwstuttgart.syntaxtree.Constructor;
import de.dhbwstuttgart.syntaxtree.ParameterList;
public class NormalConstructor {
private Constructor constructor;
private HashMap<String, String> genericsAndBounds;
private boolean hasGenerics;
public NormalConstructor(Constructor constructor, boolean hasGenerics) {
this.constructor = constructor;
this.hasGenerics = hasGenerics;
}
public NormalConstructor(Constructor constructor, HashMap<String, String> genericsAndBounds, boolean hasGenerics) {
this.constructor = constructor;
this.genericsAndBounds = genericsAndBounds;
this.hasGenerics = hasGenerics;
}
public HashMap<String, String> getGenericsAndBounds() {
return genericsAndBounds;
}
public boolean hasGen() {
return hasGenerics;
}
public ParameterList getParameterList() {
return constructor.getParameterList();
}
public String accept(DescriptorVisitor descVisitor) {
return descVisitor.visit(this);
}
}
@@ -1,56 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import java.util.HashMap;
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
import de.dhbwstuttgart.syntaxtree.Method;
import de.dhbwstuttgart.syntaxtree.ParameterList;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
public class NormalMethod {
private Method method;
private HashMap<String, String> genericsAndBounds;
private HashMap<String, String> genericsAndBoundsMethod;
private boolean hasGenerics;
public NormalMethod(Method method, boolean hasGenerics) {
this.method = method;
this.hasGenerics = hasGenerics;
}
public NormalMethod(Method method, HashMap<String, String> genericsAndBounds,
HashMap<String, String> genericsAndBoundsMethod,boolean hasGenerics) {
this.method = method;
this.genericsAndBounds = genericsAndBounds;
this.genericsAndBoundsMethod = genericsAndBoundsMethod;
this.hasGenerics = hasGenerics;
}
public Method getMethod() {
return method;
}
public ParameterList getParameterList() {
return method.getParameterList();
}
public HashMap<String, String> getGenericsAndBounds(){
return genericsAndBounds;
}
public HashMap<String, String> getGenericsAndBoundsMethod(){
return genericsAndBoundsMethod;
}
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
return method.getReturnType();
}
public boolean hasGen() {
return this.hasGenerics;
}
public String accept(DescriptorVisitor descVisitor) {
return descVisitor.visit(this);
}
}
@@ -1,33 +0,0 @@
/**
*
*/
package de.dhbwstuttgart.bytecode.utilities;
import de.dhbwstuttgart.bytecode.descriptor.TypeToDescriptor;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.typeinference.result.ResultSet;
/**
* @author fayez
*
*/
public class Resolver {
private ResultSet resultSet;
/**
* @param resultSet
*/
public Resolver(ResultSet resultSet) {
this.resultSet = resultSet;
}
public String getResolvedType(RefTypeOrTPHOrWildcardOrGeneric type) {
return resultSet.resolveType(type).resolvedType.acceptTV(new TypeToDescriptor());
}
//ToDo Etienne: Check ob benötigt
public RefTypeOrTPHOrWildcardOrGeneric resolve(RefTypeOrTPHOrWildcardOrGeneric type) {
return resultSet.resolveType(type).resolvedType;
}
}
@@ -1,32 +0,0 @@
package de.dhbwstuttgart.bytecode.utilities;
import java.util.List;
import de.dhbwstuttgart.bytecode.descriptor.DescriptorVisitor;
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
public class SamMethod {
private List<RefTypeOrTPHOrWildcardOrGeneric> argumentList;
private RefTypeOrTPHOrWildcardOrGeneric returnType;
public SamMethod(List<RefTypeOrTPHOrWildcardOrGeneric> argumentList, RefTypeOrTPHOrWildcardOrGeneric returnType) {
this.argumentList = argumentList;
this.returnType = returnType;
}
public List<RefTypeOrTPHOrWildcardOrGeneric> getArgumentList() {
return argumentList;
}
public RefTypeOrTPHOrWildcardOrGeneric getReturnType() {
return returnType;
}
public String accept(DescriptorVisitor descVisitor) {
return descVisitor.visit(this);
}
}
@@ -1,16 +0,0 @@
package de.dhbwstuttgart.target;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class ByteArrayClassLoader extends ClassLoader {
public Class loadClass(byte[] code) {
return this.defineClass(null, code, 0, code.length);
}
public Class loadClass(Path path) throws IOException {
var code = Files.readAllBytes(path);
return this.defineClass(null, code, 0, code.length);
}
}
@@ -1,727 +0,0 @@
package de.dhbwstuttgart.target.generate;
import com.google.j2objc.annotations.LoopTranslation;
import de.dhbwstuttgart.bytecode.funN.FunNGenerator;
import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.parser.NullToken;
import de.dhbwstuttgart.syntaxtree.*;
import de.dhbwstuttgart.syntaxtree.factory.ASTFactory;
import de.dhbwstuttgart.syntaxtree.statement.*;
import de.dhbwstuttgart.syntaxtree.type.*;
import de.dhbwstuttgart.target.tree.*;
import de.dhbwstuttgart.target.tree.expression.TargetBlock;
import de.dhbwstuttgart.target.tree.expression.TargetExpression;
import de.dhbwstuttgart.target.tree.type.*;
import de.dhbwstuttgart.typeinference.result.*;
import de.dhbwstuttgart.target.ByteArrayClassLoader;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class ASTToTargetAST {
static RefType OBJECT = ASTFactory.createObjectType(); // TODO It would be better if I could call this directly but the hashcode seems to change
protected List<Sigma> all;
protected Sigma sigma;
protected ClassOrInterface currentClass; // TODO This is only needed because of SuperCall, maybe there's a better way?
private class Sigma {
Map<Method, Set<ResultPair<?, ?>>> computedGenericsOfMethods = new HashMap<>();
Map<Method, Set<TypePlaceholder>> usedTPHsOfMethods = new HashMap<>();
Map<ClassOrInterface, Set<ResultPair<?, ?>>> computedGenericsOfClasses = new HashMap<>();
Set<PairTPHsmallerTPH> simplifiedConstraints = new HashSet<>();
Map<TypePlaceholder, RefTypeOrTPHOrWildcardOrGeneric> concreteTypes = new HashMap<>();
Map<TypePlaceholder, TypePlaceholder> equality = new HashMap<>();
Sigma(ResultSet constraints) {
ASTToTargetAST.this.sigma = this;
Set<List<TypePlaceholder>> equalitySet = new HashSet<>();
Map<TypePlaceholder, List<TypePlaceholder>> unified = new HashMap<>();
for (var constraint : constraints.results) {
if (constraint instanceof PairTPHEqualTPH p) {
if (unified.containsKey(p.getLeft())) {
var equals = unified.get(p.getLeft());
equals.add(p.getRight());
unified.put(p.getLeft(), equals);
} else if (unified.containsKey(p.getRight())) {
var equals = unified.get(p.getRight());
equals.add(p.getLeft());
unified.put(p.getRight(), equals);
} else {
List<TypePlaceholder> equals = new ArrayList<>();
equals.add(p.getLeft());
equals.add(p.getRight());
unified.put(p.getLeft(), equals);
unified.put(p.getRight(), equals);
equalitySet.add(equals);
}
}
}
for (var constraint : constraints.results) {
if (constraint instanceof PairTPHsmallerTPH p) {
var left = p.left;
var right = p.right;
if (unified.containsKey(left))
left = unified.get(left).get(0);
if (unified.containsKey(right))
right = unified.get(right).get(0);
simplifiedConstraints.add(new PairTPHsmallerTPH(left, right));
}
}
System.out.println("Simplified constraints: " + simplifiedConstraints);
for (var equality : equalitySet) {
var first = equality.get(0);
for (var i = 1; i < equality.size(); i++)
this.equality.put(equality.get(i), first);
}
for (var constraint : constraints.results) {
if (constraint instanceof PairTPHequalRefTypeOrWildcardType p) {
concreteTypes.put(this.equality.getOrDefault(p.left, p.left), p.right);
}
}
}
void findTypeVariables(RefTypeOrTPHOrWildcardOrGeneric type, Set<TypePlaceholder> typeVariables) {
if (type instanceof TypePlaceholder tph) {
tph = equality.getOrDefault(tph, tph);
if (concreteTypes.containsKey(tph)) {
findTypeVariables(concreteTypes.get(tph), typeVariables);
return;
}
typeVariables.add(tph);
} else if (type instanceof RefType refType) {
for (var t : refType.getParaList())
findTypeVariables(t, typeVariables);
}
}
boolean hasBound(TypePlaceholder name, Set<ResultPair<?, ?>> generics) {
return generics.stream().anyMatch(generic -> generic.getLeft().equals(name));
}
boolean containsRelation(Set<ResultPair<?, ?>> result, PairTPHsmallerTPH pair) {
// Check if both the right and the left are already part of a relation
var containsLeft = false;
for (var pair2 : result) {
if (pair2.getLeft().equals(pair.left)) {
containsLeft = true;
break;
}
}
var containsRight = false;
for (var pair2 : result) {
if (pair2.getRight().equals(pair.right)) {
containsRight = true;
break;
}
}
return containsLeft && containsRight;
}
// Family of generated Generics
Set<ResultPair<?, ?>> generics(ClassOrInterface owner, Method method) {
if (computedGenericsOfMethods.containsKey(method))
return computedGenericsOfMethods.get(method);
Set<ResultPair<?, ?>> result = new HashSet<>();
computedGenericsOfMethods.put(method, result);
var genericsOfClass = generics(owner);
var simplifiedConstraints = new HashSet<>(this.simplifiedConstraints);
HashSet<TypePlaceholder> typeVariables = new HashSet<>();
HashSet<TypePlaceholder> typeVariablesOfFields = new HashSet<>();
HashSet<TypePlaceholder> allTypeVariables = new HashSet<>();
for (var field : owner.getFieldDecl()) {
findTypeVariables(field.getType(), typeVariablesOfFields);
}
//findTypeVariables(method.getReturnType(), typeVariables);
for (var arg : method.getParameterList().getFormalparalist()) {
findTypeVariables(arg.getType(), typeVariables);
}
method.block.accept(new TracingStatementVisitor() {
@Override
public void visit(LocalVarDecl localVarDecl) {
findTypeVariables(localVarDecl.getType(), typeVariables);
}
@Override
public void visit(MethodCall methodCall) {
super.visit(methodCall);
findTypeVariables(methodCall.getType(), typeVariables);
}
@Override
public void visit(Assign assign) {}
});
// Type variables with bounds that are also type variables of the method
for (var typeVariable : new HashSet<>(typeVariables)) {
for (var pair : simplifiedConstraints) {
if (pair.left.equals(typeVariable) && typeVariables.contains(pair.right)) {
result.add(new PairTPHsmallerTPH(pair.left, equality.getOrDefault(pair.right, pair.right)));
typeVariables.add(pair.right);
}
}
}
var visitedMethods = new HashSet<Method>();
method.block.accept(new TracingStatementVisitor() {
@Override
public void visit(MethodCall methodCall) {
super.visit(methodCall);
if (methodCall.receiver instanceof ExpressionReceiver expressionReceiver) {
if (expressionReceiver.expr instanceof This) {
var optMethod = findMethod(owner, methodCall.name, methodCall.getArgumentList());
if (optMethod.isEmpty()) return;
var method = optMethod.get();
if (visitedMethods.contains(method)) return;
visitedMethods.add(method);
var generics = generics(owner, method);
Set<ResultPair<?, ?>> all = new HashSet<>(generics);
// Reflexive and Transitive closure
HashSet<ResultPair<?, ?>> toAdd = new HashSet<>();
int sizeBefore;
do {
sizeBefore = all.size();
toAdd.clear();
for (var g1 : all) {
for (var g2 : all) {
if (g1 instanceof PairTPHsmallerTPH pair) {
if (g2.getLeft().equals(pair.getLeft()) && generics.stream().anyMatch(generic -> generic.getLeft().equals(pair.getRight())))
toAdd.add(new PairTPHsmallerTPH((TypePlaceholder) g1.getLeft(), (TypePlaceholder) g2.getRight()));
}
}
}
all.addAll(toAdd);
} while (sizeBefore < all.size());
for (var generic : all) {
toAdd.add(new PairTPHsmallerTPH((TypePlaceholder) generic.getLeft(), (TypePlaceholder) generic.getLeft()));
}
all.addAll(toAdd);
HashSet<PairTPHsmallerTPH> newPairs = new HashSet<>();
// Loop from hell
outer:
for (var tph : typeVariables) {
for (var generic : all) {
if (!(generic.getRight() instanceof TypePlaceholder type))
continue;
for (var pair : simplifiedConstraints) {
if (!(pair.left.equals(tph) && pair.right.equals(generic.getLeft())))
continue;
for (var tph2 : typeVariables) {
for (var pair2 : simplifiedConstraints) {
if (!(pair2.right.equals(tph2) && pair2.left.equals(type)))
continue;
if (tph.equals(tph2)) continue;
var newPair = new PairTPHsmallerTPH(tph, tph2);
newPairs.add(newPair);
if (!containsRelation(result, newPair))
result.add(newPair);
continue outer;
}
}
}
}
}
simplifiedConstraints.addAll(newPairs);
}
}
}
});
// Type variables with bounds that are also type variables of fields
for (var typeVariable : new HashSet<>(typeVariables)) {
for (var pair : simplifiedConstraints) {
if (pair.left.equals(typeVariable) && typeVariablesOfFields.contains(pair.right)) {
result.add(new PairTPHsmallerTPH(pair.left, equality.getOrDefault(pair.right, pair.right)));
typeVariables.add(pair.right);
}
}
}
// All unbounded type variables
outer:
for (var typeVariable : typeVariables) {
for (var pair : simplifiedConstraints) {
if (pair.left.equals(typeVariable) && typeVariables.contains(pair.right))
continue outer;
}
if (!hasBound(typeVariable, genericsOfClass))
result.add(new PairTPHequalRefTypeOrWildcardType(typeVariable, OBJECT));
}
// All unbounded bounds
outer:
for (var pair : simplifiedConstraints) {
for (var pair2 : simplifiedConstraints) {
if (pair.right.equals(pair2.left))
continue outer;
}
if (!hasBound(pair.right, genericsOfClass) && typeVariables.contains(pair.right))
result.add(new PairTPHequalRefTypeOrWildcardType(pair.right, OBJECT));
}
eliminateCyclesAndInfima(result);
System.out.println(method.name + ": " + result);
Set<TypePlaceholder> allUsedTPHs = new HashSet<>();
allUsedTPHs.addAll(typeVariables);
allUsedTPHs.addAll(typeVariablesOfFields);
usedTPHsOfMethods.put(method, allUsedTPHs);
return result;
}
void findAllBounds(RefTypeOrTPHOrWildcardOrGeneric type, Set<ResultPair<?, ?>> generics) {
if (type instanceof TypePlaceholder tph) {
tph = equality.getOrDefault(tph, tph);
var concreteType = concreteTypes.get(tph);
if (concreteType != null) {
findAllBounds(concreteType, generics);
return;
}
for (var rsp : simplifiedConstraints) {
var left = equality.getOrDefault(rsp.left, rsp.left);
var right = equality.getOrDefault(rsp.right, rsp.right);
if (left.equals(tph)) {
var pair = new PairTPHsmallerTPH(tph, right);
if (!generics.contains(pair)) {
generics.add(pair);
findAllBounds(right, generics);
}
return;
}
}
generics.add(new PairTPHequalRefTypeOrWildcardType(tph, OBJECT));
} else if (type instanceof RefType refType) {
refType.getParaList().forEach(t -> findAllBounds(t, generics));
}
}
Set<ResultPair<?, ?>> generics(ClassOrInterface classOrInterface) {
if (computedGenericsOfClasses.containsKey(classOrInterface))
return computedGenericsOfClasses.get(classOrInterface);
Set<ResultPair<?, ?>> result = new HashSet<>();
for (var field : classOrInterface.getFieldDecl()) {
findAllBounds(field.getType(), result);
}
computedGenericsOfClasses.put(classOrInterface, result);
eliminateCyclesAndInfima(result);
eliminateInnerTypeVariables(classOrInterface, result);
equalizeTypeVariables(result);
System.out.println("Class " + classOrInterface.getClassName().getClassName() + ": " + result);
return result;
}
void equalizeTypeVariables(Set<ResultPair<?, ?>> input) {
for (var pair : new HashSet<>(input)) {
if (pair instanceof PairTPHsmallerTPH ptph) {
if (ptph.left.getVariance() == 1 && ptph.right.getVariance() == -1) {
equality.put(ptph.left, ptph.right);
input.remove(ptph);
for (var pair2 : new HashSet<>(input)) {
if (pair2 instanceof PairTPHsmallerTPH ptph2 && ptph2.right.equals(ptph.left)) {
input.remove(pair2);
input.add(new PairTPHsmallerTPH(ptph2.left, ptph.right));
}
}
}
}
}
}
void findTphs(RefTypeOrTPHOrWildcardOrGeneric type, Set<TypePlaceholder> tphs) {
if (type instanceof RefType refType) {
refType.getParaList().forEach(t -> findTphs(t, tphs));
} else if (type instanceof TypePlaceholder tph) {
tph = equality.getOrDefault(tph, tph);
var concreteType = concreteTypes.get(tph);
if (concreteType != null) {
findTphs(concreteType, tphs);
return;
}
tphs.add(tph);
}
}
void eliminateInnerTypeVariables(ClassOrInterface classOrInterface, Set<ResultPair<?, ?>> input) {
Set<TypePlaceholder> referenced = new HashSet<>();
for (var field : classOrInterface.getFieldDecl()) {
findTphs(field.getType(), referenced);
}
for (var method : classOrInterface.getMethods()) {
generics(classOrInterface, method);
referenced.addAll(usedTPHsOfMethods.get(method));
}
var oldInput = new HashSet<>(input);
for (var pair : oldInput) {
if (!referenced.contains(pair.getLeft())) {
input.remove(pair);
for (var pair2 : oldInput) {
if (pair2.getRight().equals(pair.getLeft())) {
input.remove(pair2);
if (pair instanceof PairTPHsmallerTPH)
input.add(new PairTPHsmallerTPH((TypePlaceholder) pair2.getLeft(), (TypePlaceholder) pair.getRight()));
else
input.add(new PairTPHequalRefTypeOrWildcardType((TypePlaceholder) pair2.getLeft(), pair.getRight()));
}
}
}
}
}
void eliminateCyclesAndInfima(Set<ResultPair<?, ?>> input) {
// Eliminate cycles
var cycles = findCycles(input);
for (var cycle : cycles) {
var newTph = TypePlaceholder.fresh(new NullToken());
input.add(new PairTPHequalRefTypeOrWildcardType(newTph, OBJECT));
cycle.add(cycle.get(0)); // Make it a complete cycle
for (var i = 0; i < cycle.size() - 1; i++) {
var left = cycle.get(i);
var right = cycle.get(i + 1);
var pair = new PairTPHsmallerTPH(left, right);
input.remove(pair);
equality.put(left, newTph);
}
}
// Eliminate infima
var foundInfima = false;
do {
foundInfima = false;
for (var constraint : new HashSet<>(input)) {
var left = (TypePlaceholder) constraint.getLeft();
Set<PairTPHsmallerTPH> infima = new HashSet<>();
for (var pair : input) {
if (pair instanceof PairTPHsmallerTPH stph)
if (pair.getLeft().equals(constraint.getLeft()))
infima.add(stph);
}
if (infima.size() > 1) {
foundInfima = true;
var newTph = TypePlaceholder.fresh(new NullToken());
input.add(new PairTPHsmallerTPH(left, newTph));
input.removeAll(infima);
for (var infimum : infima) {
equality.put(infimum.right, newTph);
new HashSet<>(input).forEach(pair -> {
if (pair.getLeft().equals(infimum.right)) {
input.remove(pair);
if (pair instanceof PairTPHsmallerTPH stph) {
input.add(new PairTPHsmallerTPH(newTph, stph.right));
} else if (pair instanceof PairTPHequalRefTypeOrWildcardType rtph) {
input.add(new PairTPHequalRefTypeOrWildcardType(newTph, rtph.getRight()));
}
} else if (pair.getRight().equals(infimum.right)) {
input.remove(pair);
if (pair instanceof PairTPHsmallerTPH stph) {
input.add(new PairTPHsmallerTPH(stph.left, newTph));
}
}
});
}
}
}
} while (foundInfima);
}
TargetType get(TypePlaceholder tph) {
if (equality.containsKey(tph)) {
return get(equality.get(tph));
}
var type = concreteTypes.get(tph);
if (type == null) return new TargetGenericType(tph.getName());
return convert(type);
}
}
protected ByteArrayClassLoader classLoader;
protected SourceFile sourceFile;
public ASTToTargetAST(List<ResultSet> resultSets) {
this(resultSets, null, new ByteArrayClassLoader());
}
public ASTToTargetAST(List<ResultSet> resultSets, SourceFile sourceFile, ByteArrayClassLoader classLoader) {
this.classLoader = classLoader;
this.sourceFile = sourceFile;
all = new ArrayList<>();
for (var set : resultSets) {
all.add(new Sigma(set));
}
this.sigma = all.get(0);
}
static Set<TypePlaceholder> allNodes(Set<ResultPair<?, ?>> input) {
return input.stream()
.filter(pair -> pair instanceof PairTPHsmallerTPH)
.flatMap(pair -> Stream.of((TypePlaceholder) pair.getLeft(), (TypePlaceholder) pair.getRight())).collect(Collectors.toSet());
}
static Set<TypePlaceholder> outgoingEdgesOf(TypePlaceholder tph, Set<ResultPair<?, ?>> input) {
return input.stream()
.filter(pair -> pair instanceof PairTPHsmallerTPH && pair.getLeft().equals(tph))
.map(pair -> (TypePlaceholder) pair.getRight()).collect(Collectors.toSet());
}
static boolean containsEdge(TypePlaceholder a, TypePlaceholder b, Set<ResultPair<?, ?>> input) {
return input.stream().anyMatch(pair -> pair.getLeft().equals(a) && pair.getRight().equals(b));
}
// Tiernan simple cycles algorithm
// Adapted from https://github.com/jgrapht/jgrapht/blob/master/jgrapht-core/src/main/java/org/jgrapht/alg/cycle/TiernanSimpleCycles.java
static Set<List<TypePlaceholder>> findCycles(Set<ResultPair<?, ?>> input) {
Map<TypePlaceholder, Integer> indices = new HashMap<>();
List<TypePlaceholder> path = new ArrayList<>();
Set<TypePlaceholder> pathSet = new HashSet<>();
Map<TypePlaceholder, Set<TypePlaceholder>> blocked = new HashMap<>();
Set<List<TypePlaceholder>> cycles = new HashSet<>();
int index = 0;
for (var tph : allNodes(input)) {
blocked.put(tph, new HashSet<>());
indices.put(tph, index++);
}
var vertexIterator = allNodes(input).iterator();
if (!vertexIterator.hasNext()) return cycles;
TypePlaceholder startOfPath = null;
TypePlaceholder endOfPath = vertexIterator.next();
TypePlaceholder temp = null;
int endIndex = 0;
boolean extensionFound = false;
path.add(endOfPath);
pathSet.add(endOfPath);
while (true) {
do {
extensionFound = false;
for (TypePlaceholder n : outgoingEdgesOf(endOfPath, input)) {
int cmp = indices.get(n).compareTo(indices.get(path.get(0)));
if ((cmp > 0) && !pathSet.contains(n) && !blocked.get(endOfPath).contains(n)) {
path.add(n);
pathSet.add(n);
endOfPath = n;
extensionFound = true;
break;
}
}
} while (extensionFound);
startOfPath = path.get(0);
if (containsEdge(endOfPath, startOfPath, input)) {
List<TypePlaceholder> cycle = new ArrayList<>(path);
cycles.add(cycle);
}
if (path.size() > 1) {
blocked.get(endOfPath).clear();
endIndex = path.size() - 1;
path.remove(endIndex);
pathSet.remove(endOfPath);
--endIndex;
temp = endOfPath;
endOfPath = path.get(endIndex);
blocked.get(endOfPath).add(temp);
continue;
}
if (vertexIterator.hasNext()) {
path.clear();
pathSet.clear();
endOfPath = vertexIterator.next();
path.add(endOfPath);
pathSet.add(endOfPath);
for (TypePlaceholder tph : blocked.keySet()) {
blocked.get(tph).clear();
}
continue;
}
break;
}
return cycles;
}
Optional<Method> findMethod(ClassOrInterface owner, String name, ArgumentList argumentList) {
return owner.getMethods().stream().filter(
m -> m.name.equals(name) && parameterEquals(m.getParameterList(), argumentList)
).findFirst();
}
boolean parameterEquals(ParameterList parameterList, ArgumentList argumentList) {
var pars = parameterList.getFormalparalist();
var arguments = argumentList.getArguments();
if (pars.size() != arguments.size())
return false;
for (var i = 0; i < pars.size(); i++) {
var type1 = convert(pars.get(i).getType());
var type2 = convert(arguments.get(i).getType());
if (type2 instanceof TargetGenericType && type1 instanceof TargetGenericType)
return true;
if (!type1.equals(type2)) return false;
}
return true;
}
Set<TargetGeneric> convert(Set<ResultPair<?, ?>> result) {
return result.stream().map(p -> {
if (p instanceof PairTPHsmallerTPH pair) {
return new TargetGeneric(pair.left.getName(), new TargetGenericType(pair.right.getName()));
} else if (p instanceof PairTPHequalRefTypeOrWildcardType pair) {
return new TargetGeneric(pair.left.getName(), convert(pair.right));
} else {
throw new IllegalArgumentException();
}
}).collect(Collectors.toSet());
}
public TargetClass convert(ClassOrInterface input) {
currentClass = input;
TargetBlock fieldInitializer = null;
if (input.getfieldInitializations().isPresent())
fieldInitializer = convert(input.getfieldInitializations().get().block);
TargetBlock finalFieldInitializer = fieldInitializer;
return new TargetClass(input.getModifiers(), input.getClassName().toString(), convert(input.getSuperClass()),
convert(sigma.generics(input)),
input.getSuperInterfaces().stream().map(this::convert).toList(),
input.getConstructors().stream().map(constructor -> this.convert(constructor, finalFieldInitializer)).flatMap(List::stream).toList(),
input.getFieldDecl().stream().map(this::convert).toList(),
input.getMethods().stream().map(this::convert).flatMap(List::stream).toList()
);
}
private List<MethodParameter> convert(ParameterList input) {
return input.getFormalparalist().stream()
.map(param -> new MethodParameter(convert(param.getType()), param.getName())).toList();
}
private List<TargetConstructor> convert(Constructor input, TargetBlock fieldInitializer) {
sigma = all.get(0);
List<TargetConstructor> result = new ArrayList<>();
Set<List<MethodParameter>> parameterSet = new HashSet<>();
for (var s : all) {
sigma = s;
var generics = sigma.generics(currentClass, input);
List<MethodParameter> params = convert(input.getParameterList());
if (parameterSet.stream().noneMatch(p -> p.equals(params))) {
result.add(new TargetConstructor(input.modifier, convert(generics), params, convert(input.block), fieldInitializer));
parameterSet.add(params);
}
}
return result;
}
private List<TargetMethod> convert(Method input) {
sigma = all.get(0);
List<TargetMethod> result = new ArrayList<>();
Set<List<MethodParameter>> parameterSet = new HashSet<>();
for (var s : all) {
sigma = s;
var generics = sigma.generics(currentClass, input);
List<MethodParameter> params = convert(input.getParameterList());
if (parameterSet.stream().noneMatch(p -> p.equals(params))) {
result.add(new TargetMethod(
input.modifier,
input.name, convert(generics), params,
convert(input.getReturnType()),
convert(input.block)
));
parameterSet.add(params);
}
}
return result;
}
protected TargetBlock convert(Block block) {
return new TargetBlock(block.statements.stream().map(this::convert).toList());
}
protected TargetExpression convert(Expression expr) {
var converter = new StatementToTargetExpression(this);
expr.accept(converter);
return converter.result;
}
private TargetField convert(Field input) {
return new TargetField(
input.modifier,
convert(input.getType()),
input.getName()
);
}
private final Set<Integer> usedFunN = new HashSet<>();
protected TargetType convert(RefTypeOrTPHOrWildcardOrGeneric input) {
return input.acceptTV(new TypeVisitor<>() {
@Override
public TargetType visit(RefType refType) {
var name = refType.getName().toString();
if (name.equals("void")) return null;
var params = refType.getParaList().stream().map(ASTToTargetAST.this::convert).toList();
if (name.matches("Fun\\d\\$\\$")) { // TODO This seems like a bad idea
if (!usedFunN.contains(params.size() - 1)) {
usedFunN.add(params.size() - 1);
classLoader.loadClass(FunNGenerator.getInstance().generateSuperBytecode(params.size() - 1));
}
return new TargetFunNType(params.size() - 1, params);
}
return new TargetRefType(name, params);
}
@Override
public TargetType visit(SuperWildcardType superWildcardType) {
return new TargetSuperWildcard(convert(superWildcardType.getInnerType()));
}
@Override
public TargetType visit(TypePlaceholder typePlaceholder) {
return sigma.get(typePlaceholder);
}
@Override
public TargetType visit(ExtendsWildcardType extendsWildcardType) {
return new TargetExtendsWildcard(convert(extendsWildcardType.getInnerType()));
}
@Override
public TargetType visit(GenericRefType genericRefType) {
return new TargetGenericType(genericRefType.getParsedName());
}
});
}
}
@@ -1,50 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class BinaryTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/BinaryInMeth.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("BinaryInMeth");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void test() throws Exception {
Method m2 = classToTest.getDeclaredMethod("m2", Integer.class,Integer.class);
Integer res = (Integer) m2.invoke(instanceOfClass, 2,3);
assertEquals(new Integer(6), res);
}
@Test
public void testM3() throws Exception {
Method m3 = classToTest.getDeclaredMethod("m3", Integer.class);
Integer res = (Integer) m3.invoke(instanceOfClass, 2);
assertEquals(new Integer(4), res);
}
}
@@ -1,37 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class ClassGenLamTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/ClassGenLam.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("ClassGenLam");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
}
-44
View File
@@ -1,44 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class FacTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Fac.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Fac");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testInteger() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method getFac = classToTest.getDeclaredMethod("getFac", Integer.class);
Integer result = (Integer) getFac.invoke(instanceOfClass,3);
assertEquals(result, new Integer(6));
}
}
@@ -1,58 +0,0 @@
package bytecode;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class FacultyTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Faculty.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Faculty");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
Method getFact = classToTest.getDeclaredMethod("getFact", Integer.class);
// Field fact = classToTest.getDeclaredField("fact");
// Class<?> lambda = m.invoke(instanceOfClass).getClass();
// Class<?> lambda = fact.getType();
// System.out.println(fact.getType().getName());
// Method apply = lambda.getMethod("apply", Object.class);
// System.out.println(lambda.getMethods()[0]);
// System.out.println(instanceOfClass.toString());
// // Damit man auf die Methode zugreifen kann
// apply.setAccessible(true);
// Field value
// Object fieldVal = fact.get(instanceOfClass);
Integer i = 3;
// Method applyFromField = fieldVal.getClass().getDeclaredMethod("apply", Object.class);
// applyFromField.setAccessible(true);
// Integer result = (Integer) apply.invoke(lambda,i);
Integer result = (Integer) getFact.invoke(instanceOfClass,i);
assertEquals(new Integer(6), result);
}
}
-43
View File
@@ -1,43 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Field;
import org.junit.BeforeClass;
import org.junit.Test;
import java.net.URL;
import java.net.URLClassLoader;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class FieldTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Field.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Field");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void test() {
Field[] fields = classToTest.getFields();
assertEquals(1, fields.length);
}
}
@@ -1,52 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class FieldTph2Test {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/FieldTph2.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("FieldTph2");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void test() throws Exception {
Field a = classToTest.getDeclaredField("a");
a.setAccessible(true);
Method m2 = classToTest.getDeclaredMethod("m2", Object.class);
m2.invoke(instanceOfClass, 1);
Method m = classToTest.getDeclaredMethod("m", Object.class);
Object result = m.invoke(instanceOfClass, 1);
assertEquals(1,result);
}
}
@@ -1,50 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class FieldTphConsMethTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/FieldTphConsMeth.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("FieldTphConsMeth");
}
@Test
public void test() throws Exception {
instanceOfClass = classToTest.getConstructor(Object.class).newInstance("C");
Field a = classToTest.getDeclaredField("a");
a.setAccessible(true);
Method m = classToTest.getDeclaredMethod("id", Object.class);
Object result = m.invoke(instanceOfClass, 42);
assertEquals(42,result);
assertEquals("C", a.get(instanceOfClass));
}
}
@@ -1,66 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class FieldTphMMethTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
private static Object instanceOfClass2;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/FieldTphMMeth.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("FieldTphMMeth");
instanceOfClass = classToTest.getConstructor(Object.class,Object.class,Boolean.class).newInstance("C",42,true);
instanceOfClass2 = classToTest.getConstructor(Object.class,Object.class,Boolean.class).newInstance("C",42,false);
}
@Test
public void testM() throws Exception {
Method m = classToTest.getDeclaredMethod("m", Object.class,Object.class,Boolean.class);
Object result = m.invoke(instanceOfClass, "C",42,false);
assertEquals(42,result);
}
@Test
public void testWithTrue() throws Exception {
Field a = classToTest.getDeclaredField("a");
a.setAccessible(true);
assertEquals("C", a.get(instanceOfClass));
}
@Test
public void testWithFalse() throws Exception {
Field a = classToTest.getDeclaredField("a");
a.setAccessible(true);
assertEquals(42, a.get(instanceOfClass2));
}
}
-30
View File
@@ -1,30 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class GenTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static String pathToClassFile;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Gen.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
}
}
@@ -1,140 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class GreaterEqualTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/GreaterEqual.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("File://"+pathToClassFile)});
classToTest = loader.loadClass("GreaterEqual");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testName() {
assertEquals("GreaterEqual", classToTest.getName());
}
@Test
public void testIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Integer.class, Integer.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 7, 5);
assertTrue(result);
}
@Test
public void testIntegers2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Integer.class, Integer.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 5, 7);
assertFalse(result);
}
@Test
public void testEqIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Integer.class, Integer.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 5, 5);
assertTrue(result);
}
@Test
public void testLongs() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Long.class, Long.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 10L,7L);
assertTrue(result);
}
@Test
public void testFloats() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Float.class, Float.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 5F,7F);
assertFalse(result);
}
@Test
public void testDoubles() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Double.class, Double.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 5.0,7.0);
assertFalse(result);
}
@Test
public void testLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Long.class, Integer.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 15L,7);
assertTrue(result);
}
@Test
public void testFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Float.class, Integer.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 5F,7);
assertFalse(result);
}
@Test
public void testDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Double.class, Integer.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 25.0,17);
assertTrue(result);
}
@Test
public void testFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Float.class, Long.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 75F,70L);
assertTrue(result);
}
@Test
public void testDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Double.class, Long.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 5.0,7L);
assertFalse(result);
}
@Test
public void testEqDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Double.class, Float.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 7.0,7F);
assertTrue(result);
}
@Test
public void testDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Double.class, Float.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 15.0,7F);
assertTrue(result);
}
@Test
public void testDoubleFloat3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gE = classToTest.getDeclaredMethod("gE", Double.class, Float.class);
Boolean result = (Boolean) gE.invoke(instanceOfClass, 9.0,17F);
assertFalse(result);
}
}
@@ -1,139 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class GreaterThanTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/GreaterThan.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("File://"+pathToClassFile)});
classToTest = loader.loadClass("GreaterThan");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testName() {
assertEquals("GreaterThan", classToTest.getName());
}
public void testIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Integer.class, Integer.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 7, 5);
assertTrue(result);
}
@Test
public void testIntegers2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Integer.class, Integer.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 5, 7);
assertFalse(result);
}
@Test
public void testEqIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Integer.class, Integer.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 5, 5);
assertFalse(result);
}
@Test
public void testLongs() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Long.class, Long.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 10L,7L);
assertTrue(result);
}@Test
public void testFloats() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Float.class, Float.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 5F,7F);
assertFalse(result);
}
@Test
public void testDoubles() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Double.class, Double.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 5.0,7.0);
assertFalse(result);
}
@Test
public void testLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Long.class, Integer.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 15L,7);
assertTrue(result);
}
@Test
public void testFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Float.class, Integer.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 5F,7);
assertFalse(result);
}
@Test
public void testDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Double.class, Integer.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 25.0,17);
assertTrue(result);
}
@Test
public void testFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Float.class, Long.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 75F,70L);
assertTrue(result);
}
@Test
public void testDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Double.class, Long.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 5.0,7L);
assertFalse(result);
}
@Test
public void testEqDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Double.class, Float.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 7.0,7F);
assertFalse(result);
}
@Test
public void testDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Double.class, Float.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 15.0,7F);
assertTrue(result);
}
@Test
public void testDoubleFloat3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method gT = classToTest.getDeclaredMethod("gT", Double.class, Float.class);
Boolean result = (Boolean) gT.invoke(instanceOfClass, 9.0,17F);
assertFalse(result);
}
}
-39
View File
@@ -1,39 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Field;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import de.dhbwstuttgart.core.JavaTXCompiler;
import org.junit.Test;
public class IdTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void test() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Id.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Id");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
}
-37
View File
@@ -1,37 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class InfTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Inf.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Inf");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
}
-193
View File
@@ -1,193 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Stack;
import java.util.Vector;
import java.util.stream.Collectors;
import org.junit.BeforeClass;
import org.junit.Test;
import com.google.common.collect.Lists;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericGenratorResultForSourceFile;
import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.typeinference.result.ResultSet;
public class InheritTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static Class<?> classToTestAA, classToTestBB, classToTestCC, classToTestDD;
private static String pathToClassFile = System.getProperty("user.dir")+"/resources/bytecode/javFiles/";;
//private static String pathToClassFile1 = System.getProperty("user.dir") + "/resources/testBytecode/generatedBC/";
private static Object instanceOfClass;
private static Object instanceOfClassAA, instanceOfClassBB, instanceOfClassCC, instanceOfClassDD;
private static HashMap<ArrayList<String>, Method> hm = new HashMap<>();
private static List<ResultSet> typeinferenceResult;
private static List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/AA.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
List<ResultSet> typeinferenceResult = compiler.typeInference();
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTestAA = loader.loadClass("AA");
instanceOfClassAA = classToTestAA.getDeclaredConstructor().newInstance();
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/BB.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
typeinferenceResult = compiler.typeInference();
simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
classToTestBB = loader.loadClass("BB");
instanceOfClassBB = classToTestBB.getDeclaredConstructor().newInstance();
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/CC.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
typeinferenceResult = compiler.typeInference();
simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
classToTestCC = loader.loadClass("CC");
instanceOfClassCC = classToTestCC.getDeclaredConstructor().newInstance();
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/DD.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
typeinferenceResult = compiler.typeInference();
simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
classToTestDD = loader.loadClass("DD");
instanceOfClassDD = classToTestDD.getDeclaredConstructor().newInstance();
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Inherit.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
typeinferenceResult = compiler.typeInference();
simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
classToTest = loader.loadClass("Inherit");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testInheritClassName() {
assertEquals("Inherit", classToTest.getName());
}
@Test
public void testAAName() {
assertEquals("AA", classToTestAA.getName());
}
@Test
public void testBBName() {
assertEquals("BB", classToTestBB.getName());
}
@Test
public void testCCName() {
assertEquals("CC", classToTestCC.getName());
}
@Test
public void testDDName() {
assertEquals("DD", classToTestDD.getName());
}
@Test
public void testmainAA() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m = classToTestAA.getDeclaredMethod("m", Integer.class);
assertEquals(m.invoke(instanceOfClassAA, 5), "AA");
Method main = classToTest.getDeclaredMethod("main", classToTestAA, Integer.class);
assertEquals(main.invoke(instanceOfClass, instanceOfClassAA, 5), "AA");
}
@Test
public void testmainBB() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m = classToTestAA.getDeclaredMethod("m", Integer.class);
assertEquals(m.invoke(instanceOfClassBB, 5), "AA");
Method main = classToTest.getDeclaredMethod("main", classToTestAA, Integer.class);
assertEquals(main.invoke(instanceOfClass, instanceOfClassBB, 5), "AA");
}
@Test
public void testmainCC() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m = classToTestCC.getDeclaredMethod("m", Integer.class);
assertEquals(m.invoke(instanceOfClassCC, 5), "CC");
Method main = classToTest.getDeclaredMethod("main", classToTestCC, Integer.class);
assertEquals(main.invoke(instanceOfClass, instanceOfClassCC, 5), "CC");
}
@Test
public void testmainDD() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m = classToTestCC.getDeclaredMethod("m", Integer.class);
assertEquals(m.invoke(instanceOfClassDD, 5), "CC");
Method main = classToTest.getDeclaredMethod("main", classToTestCC, Integer.class);
assertEquals(main.invoke(instanceOfClass, instanceOfClassDD, 5), "CC");
}
@Test
public void testmainVectorAA() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m = classToTestAA.getDeclaredMethod("m", Integer.class);
assertEquals(m.invoke(instanceOfClassAA, 5), "AA");
Vector v = new Vector<>();
v.add(instanceOfClassAA);
Method main = classToTest.getDeclaredMethod("main", Vector.class, Integer.class);
assertEquals(main.invoke(instanceOfClass, v, 5), "AA");
}
@Test
public void testmainVectorBB() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m = classToTestAA.getDeclaredMethod("m", Integer.class);
assertEquals(m.invoke(instanceOfClassBB, 5), "AA");
Vector v = new Vector<>();
v.add(instanceOfClassBB);
Method main = classToTest.getDeclaredMethod("main", Vector.class, Integer.class);
assertEquals(main.invoke(instanceOfClass, v, 5), "AA");
}
@Test
public void testmainVectorCC() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m = classToTestCC.getDeclaredMethod("m", Integer.class);
assertEquals(m.invoke(instanceOfClassCC, 5), "CC");
Vector v = new Vector<>();
v.add(instanceOfClassCC);
Method main = classToTest.getDeclaredMethod("main", Vector.class, Integer.class);
assertEquals(main.invoke(instanceOfClass, v, 5), "CC");
}
@Test
public void testmainVectorDD() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m = classToTestCC.getDeclaredMethod("m", Integer.class);
assertEquals(m.invoke(instanceOfClassDD, 5), "CC");
Vector v = new Vector<>();
v.add(instanceOfClassDD);
Method main = classToTest.getDeclaredMethod("main", Vector.class, Integer.class);
assertEquals(main.invoke(instanceOfClass, v, 5), "CC");
}
}
@@ -1,211 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Stack;
import java.util.Vector;
import java.util.stream.Collectors;
import org.junit.BeforeClass;
import org.junit.Test;
import com.google.common.collect.Lists;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericGenratorResultForSourceFile;
import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.typeinference.result.ResultSet;
public class InheritTest2 {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static Class<?> classToTestAA, classToTestBB, classToTestCC, classToTestDD;
private static String pathToClassFile = System.getProperty("user.dir")+"/resources/bytecode/javFiles/";;
//private static String pathToClassFile1 = System.getProperty("user.dir") + "/resources/testBytecode/generatedBC/";
private static Object instanceOfClass;
private static Object instanceOfClassAA, instanceOfClassBB, instanceOfClassCC, instanceOfClassDD;
private static HashMap<ArrayList<String>, Method> hm = new HashMap<>();
private static List<ResultSet> typeinferenceResult;
private static List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/AA.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
List<ResultSet> typeinferenceResult = compiler.typeInference();
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTestAA = loader.loadClass("AA");
instanceOfClassAA = classToTestAA.getDeclaredConstructor().newInstance();
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/BB.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
typeinferenceResult = compiler.typeInference();
simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
classToTestBB = loader.loadClass("BB");
instanceOfClassBB = classToTestBB.getDeclaredConstructor().newInstance();
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/CC.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
typeinferenceResult = compiler.typeInference();
simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
classToTestCC = loader.loadClass("CC");
instanceOfClassCC = classToTestCC.getDeclaredConstructor().newInstance();
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/DD.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
typeinferenceResult = compiler.typeInference();
simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
classToTestDD = loader.loadClass("DD");
instanceOfClassDD = classToTestDD.getDeclaredConstructor().newInstance();
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Inherit2.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
typeinferenceResult = compiler.typeInference();
simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
classToTest = loader.loadClass("Inherit2");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testInheritClassName() {
assertEquals("Inherit2", classToTest.getName());
}
@Test
public void testAAName() {
assertEquals("AA", classToTestAA.getName());
}
@Test
public void testBBName() {
assertEquals("BB", classToTestBB.getName());
}
@Test
public void testCCName() {
assertEquals("CC", classToTestCC.getName());
}
@Test
public void testDDName() {
assertEquals("DD", classToTestDD.getName());
}
@Test
public void testmainAA() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m2 = classToTestAA.getDeclaredMethod("m2", classToTestAA);
assertEquals(m2.invoke(instanceOfClassAA, instanceOfClassAA), "AA");
Method main = classToTest.getDeclaredMethod("main", classToTestAA);
assertEquals(main.invoke(instanceOfClass, instanceOfClassAA), "AA");
}
@Test
public void testmainBB() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m2 = classToTestAA.getDeclaredMethod("m2", classToTestAA);
assertEquals(m2.invoke(instanceOfClassAA, instanceOfClassAA), "AA");
Method main = classToTest.getDeclaredMethod("main", classToTestAA);
assertEquals(main.invoke(instanceOfClass, instanceOfClassBB), "AA");
}
@Test
public void testmainCC() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m2 = classToTestCC.getDeclaredMethod("m2", classToTestCC);
assertEquals(m2.invoke(instanceOfClassCC, instanceOfClassCC), "CC");
Method main = classToTest.getDeclaredMethod("main", classToTestCC);
assertEquals(main.invoke(instanceOfClass, instanceOfClassCC), "CC");
}
@Test
public void testmainDD() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m2 = classToTestCC.getDeclaredMethod("m2", classToTestCC);
assertEquals(m2.invoke(instanceOfClassCC, instanceOfClassCC), "CC");
Method main = classToTest.getDeclaredMethod("main", classToTestCC);
assertEquals(main.invoke(instanceOfClass, instanceOfClassDD), "CC");
}
//PL 2020-05-12: Die folgenden Test funktionieren erst, wenn Generics im Bytecode implementiert sind
@Test
public void testmainVectorAA() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m2 = classToTestAA.getDeclaredMethod("m2", classToTestAA);
assertEquals(m2.invoke(instanceOfClassAA, instanceOfClassAA), "AA");
Vector v = new Vector<>();
v.add(instanceOfClassAA);
Method main = classToTest.getDeclaredMethod("main", Vector.class);
try {
assertEquals(main.invoke(instanceOfClass, v), "AA");
}
catch (java.lang.reflect.InvocationTargetException e) {
testmainVectorCC();
}
}
@Test
public void testmainVectorBB() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m2 = classToTestAA.getDeclaredMethod("m2", classToTestAA);
assertEquals(m2.invoke(instanceOfClassAA, instanceOfClassAA), "AA");
Vector v = new Vector<>();
v.add(instanceOfClassBB);
Method main = classToTest.getDeclaredMethod("main", Vector.class);
try {
assertEquals(main.invoke(instanceOfClass, v), "AA");
}
catch (java.lang.reflect.InvocationTargetException e) {
testmainVectorCC();
}
}
@Test
public void testmainVectorCC() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m2 = classToTestCC.getDeclaredMethod("m2", classToTestCC);
assertEquals(m2.invoke(instanceOfClassCC, instanceOfClassCC), "CC");
Vector v = new Vector<>();
v.add(instanceOfClassCC);
Method main = classToTest.getDeclaredMethod("main", Vector.class);
String erg;
assertEquals(erg= (String) main.invoke(instanceOfClass, v),
erg.equals("CC")? "CC": "AA");
}
@Test
public void testmainVectorDD() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, InstantiationException, MalformedURLException, ClassNotFoundException, NoSuchFieldException {
Method m2 = classToTestCC.getDeclaredMethod("m2", classToTestCC);
assertEquals(m2.invoke(instanceOfClassCC, instanceOfClassCC), "CC");
Vector v = new Vector<>();
v.add(instanceOfClassDD);
Method main = classToTest.getDeclaredMethod("main", Vector.class);
String erg;
assertEquals(erg= (String) main.invoke(instanceOfClass, v),
erg.equals("CC")? "CC": "AA");
}
}
@@ -1,37 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class KompTphTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/KompTph.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("KompTph");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
}
@@ -1,43 +0,0 @@
/**
*
*/
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
/**
* @author fayez
*
*/
public class LambdaCapturetest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/LambdaCapture.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("LambdaCapture");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
}
@@ -1,50 +0,0 @@
package bytecode;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class LambdaTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Lambda.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Lambda");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
Method m = classToTest.getDeclaredMethod("m");
Class<?> lambda = m.invoke(instanceOfClass).getClass();
Method apply = lambda.getMethod("apply", Object.class);
// Damit man auf die Methode zugreifen kann
apply.setAccessible(true);
Integer i = 77;
System.out.println(m.invoke(instanceOfClass).toString());
Integer result = (Integer) apply.invoke(m.invoke(instanceOfClass), i);
assertEquals(i, result);
}
}
@@ -1,47 +0,0 @@
package bytecode;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class LambdaVoidTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Lambda.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Lambda");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
Method m = classToTest.getDeclaredMethod("m");
Class<?> lambda = m.invoke(instanceOfClass).getClass();
Method apply = lambda.getMethod("apply", Object.class);
// Damit man auf die Methode zugreifen kann
apply.setAccessible(true);
Integer i = 77;
apply.invoke(m.invoke(instanceOfClass), i);
}
}
@@ -1,133 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class LessEqualTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/LessEqual.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("LessEqual");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testName() {
assertEquals("LessEqual", classToTest.getName());
}
@Test
public void testIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Integer.class, Integer.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5,7);
assertTrue(result);
}
@Test
public void testEqualIntegers() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Integer.class, Integer.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5,5);
assertTrue(result);
}
@Test
public void testLongs() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Long.class, Long.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5L,7L);
assertTrue(result);
}@Test
public void testFloats() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Float.class, Float.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5F,7F);
assertTrue(result);
}
@Test
public void testDoubles() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Double.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7.0);
assertTrue(result);
}
@Test
public void testLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Long.class, Integer.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5L,7);
assertTrue(result);
}
@Test
public void testFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Float.class, Integer.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5F,7);
assertTrue(result);
}
@Test
public void testDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Integer.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7);
assertTrue(result);
}
@Test
public void testFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Float.class, Long.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5F,7L);
assertTrue(result);
}
@Test
public void testDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Long.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7L);
assertTrue(result);
}
@Test
public void testEqDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Float.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 7.0,7F);
assertTrue(result);
}
@Test
public void testDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Float.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 5.0,7F);
assertTrue(result);
}
@Test
public void testDoubleFloat3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessEqual = classToTest.getDeclaredMethod("lessEqual", Double.class, Float.class);
Boolean result = (Boolean) lessEqual.invoke(instanceOfClass, 9.0,7F);
assertFalse(result);
}
}
@@ -1,141 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class LessThanTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/LessThan.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("LessThan");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testClassName() {
assertEquals("LessThan", classToTest.getName());
}
@Test
public void testLessThanInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Integer.class,Integer.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5, 7);
assertTrue(result);
}
@Test
public void testLessThanInt2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Integer.class, Integer.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7, 5);
assertFalse(result);
}
@Test
public void testLessThanInt3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Integer.class, Integer.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5, 5);
assertFalse(result);
}
@Test
public void testLessThanLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class,Long.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5L, 7L);
assertTrue(result);
}
@Test
public void testLessThanLong2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class, Long.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7L, 5L);
assertFalse(result);
}
@Test
public void testLessThanLong3() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class, Long.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 5L, 5L);
assertFalse(result);
}
@Test
public void testLessThanFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Float.class, Float.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7F, 5F);
assertFalse(result);
}
@Test
public void testLessThanDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Double.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5.0);
assertFalse(result);
}
@Test
public void testLessThanLongInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Long.class, Integer.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7L, 5);
assertFalse(result);
}
@Test
public void testLessThanFloatInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Float.class, Integer.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7F, 5);
assertFalse(result);
}
@Test
public void testLessThanDoubleInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Integer.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5);
assertFalse(result);
}
@Test
public void testLessThanFloatLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Float.class, Long.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7F, 5L);
assertFalse(result);
}
@Test
public void testLessThanDoubleLong() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Long.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5L);
assertFalse(result);
}
@Test
public void testLessThanDoubleFloat() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method lessThan = classToTest.getDeclaredMethod("lessThan", Double.class, Float.class);
Boolean result = (Boolean) lessThan.invoke(instanceOfClass, 7.0, 5F);
assertFalse(result);
}
}
@@ -1,102 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Vector;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class MatrixOpTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass_m1;
private static Object instanceOfClass_m2;
private static Object instanceOfClass_m3;
@Test
public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, IOException, InstantiationException, NoSuchFieldException {
path = System.getProperty("user.dir") + "/resources/bytecode/javFiles/MatrixOP.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir") + "/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[]{new URL("file://" + pathToClassFile)});
classToTest = loader.loadClass("MatrixOP");
Vector<Vector<Integer>> vv = new Vector<Vector<Integer>>();
Vector<Integer> v1 = new Vector<Integer>();
v1.addElement(2);
v1.addElement(2);
Vector<Integer> v2 = new Vector<Integer>();
v2.addElement(3);
v2.addElement(3);
//Matrix m1 = new Matrix();
//m1.addElement(v1);
//m1.addElement(v2);
vv.addElement(v1);
vv.addElement(v2);
instanceOfClass_m1 = classToTest.getDeclaredConstructor(Vector.class).newInstance(vv); //Matrix m1 = new Matrix(vv);
Vector<Vector<Integer>> vv1 = new Vector<Vector<Integer>>();
Vector<Integer> v3 = new Vector<Integer>();
v3.addElement(2);
v3.addElement(2);
Vector<Integer> v4 = new Vector<Integer>();
v4.addElement(3);
v4.addElement(3);
//Matrix m2 = new Matrix();
//m2.addElement(v3);
//m2.addElement(v4);
vv1.addElement(v3);
vv1.addElement(v4);
instanceOfClass_m2 = classToTest.getDeclaredConstructor(Vector.class).newInstance(vv1);//Matrix m2 = new Matrix(vv1);
//Matrix m3 = m1.mul(vv1);
// Method mul = classToTest.getDeclaredMethod("mul", Vector.class);
// Object result = mul.invoke(instanceOfClass_m1, instanceOfClass_m2);
Field mul = classToTest.getField("mul");
mul.setAccessible(true);
Class<?> lambda = mul.get(instanceOfClass_m1).getClass();
Method apply = lambda.getMethod("apply", Object.class, Object.class);
// Damit man auf die Methode zugreifen kann
apply.setAccessible(true);
Object result = apply.invoke(mul.get(instanceOfClass_m1), instanceOfClass_m1, instanceOfClass_m2);
System.out.println(instanceOfClass_m1.toString() + " * " + instanceOfClass_m2.toString() + " = " + result.toString());
Vector<Vector<Integer>> res = new Vector<Vector<Integer>>();
Vector<Integer> v5 = new Vector<Integer>();
v5.addElement(10);
v5.addElement(10);
Vector<Integer> v6 = new Vector<Integer>();
v6.addElement(15);
v6.addElement(15);
//Matrix m2 = new Matrix();
//m2.addElement(v3);
//m2.addElement(v4);
res.addElement(v5);
res.addElement(v6);
instanceOfClass_m3 = classToTest.getDeclaredConstructor(Vector.class).newInstance(res);
assertEquals(result, instanceOfClass_m3);
}
}
@@ -1,90 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Vector;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class MatrixTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass_m1;
private static Object instanceOfClass_m2;
private static Object instanceOfClass_m3;
@Test
public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, IOException, InstantiationException {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Matrix.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Matrix");
Vector<Vector<Integer>> vv = new Vector<Vector<Integer>>();
Vector<Integer> v1 = new Vector<Integer> ();
v1.addElement(2);
v1.addElement(2);
Vector<Integer> v2 = new Vector<Integer> ();
v2.addElement(3);
v2.addElement(3);
//Matrix m1 = new Matrix();
//m1.addElement(v1);
//m1.addElement(v2);
vv.addElement(v1);
vv.addElement(v2);
instanceOfClass_m1 = classToTest.getDeclaredConstructor(Vector.class).newInstance(vv); //Matrix m1 = new Matrix(vv);
Vector<Vector<Integer>> vv1 = new Vector<Vector<Integer>>();
Vector<Integer> v3 = new Vector<Integer> ();
v3.addElement(2);
v3.addElement(2);
Vector<Integer> v4 = new Vector<Integer> ();
v4.addElement(3);
v4.addElement(3);
//Matrix m2 = new Matrix();
//m2.addElement(v3);
//m2.addElement(v4);
vv1.addElement(v3);
vv1.addElement(v4);
instanceOfClass_m2 = classToTest.getDeclaredConstructor(Vector.class).newInstance(vv1);//Matrix m2 = new Matrix(vv1);
//Matrix m3 = m1.mul(vv1);
Method mul = classToTest.getDeclaredMethod("mul", Vector.class);
Object result = mul.invoke(instanceOfClass_m1, instanceOfClass_m2);
System.out.println(instanceOfClass_m1.toString() + " * " + instanceOfClass_m2.toString() + " = " + result.toString());
Vector<Vector<Integer>> res = new Vector<Vector<Integer>>();
Vector<Integer> v5 = new Vector<Integer> ();
v5.addElement(10);
v5.addElement(10);
Vector<Integer> v6 = new Vector<Integer> ();
v6.addElement(15);
v6.addElement(15);
//Matrix m2 = new Matrix();
//m2.addElement(v3);
//m2.addElement(v4);
res.addElement(v5);
res.addElement(v6);
instanceOfClass_m3 = classToTest.getDeclaredConstructor(Vector.class).newInstance(res);
assertEquals(result, instanceOfClass_m3);
}
}
-41
View File
@@ -1,41 +0,0 @@
package bytecode;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class MergeTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Merge.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
// pathToClassFile = System.getProperty("user.dir")+"/testBytecode/generatedBC/";
// loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
// classToTest = loader.loadClass("Merge");
//instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
//Method m = classToTest.getDeclaredMethod("m");
//Object result = m.invoke(instanceOfClass);
//assertEquals(result.getClass(), loader.loadClass("Apply"));
}
}
@@ -1,69 +0,0 @@
package bytecode;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.function.Function;
import general.TestCleanUp;
import org.junit.*;
import de.dhbwstuttgart.core.JavaTXCompiler;
import static org.junit.Assert.*;
/**
* //ToDo Etienne: Beschreiben
*
* @since Studienarbeit Type Erasure
* @author etiennezink
*/
public class OLFun2Test {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static Class<?> classFun1IntInt;
private static Class<?> classFun1DoubleDouble;
private static Class<?> classFun1StringString;
private static String generatedByteCodeDirectory = System.getProperty("user.dir") + "/src/test/resources/testBytecode/generatedBC/";
//ToDo Etienne: Nach Anpassung des Bytecode die Tests hinzufügen
//ToDo Etienne: Aufruf von m testen
@BeforeClass
public static void setUp() throws Exception {
path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/OLFun2.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(generatedByteCodeDirectory);
loader = new URLClassLoader(new URL[] {new URL("file://"+generatedByteCodeDirectory)});
classToTest = loader.loadClass("OLFun2");
classFun1IntInt = loader.loadClass("Fun1$$Ljava$lang$Integer$_$Ljava$lang$Integer$_$");
classFun1DoubleDouble = loader.loadClass("Fun1$$Ljava$lang$Double$_$Ljava$lang$Double$_$");
classFun1StringString = loader.loadClass("Fun1$$Ljava$lang$String$_$Ljava$lang$String$_$");
}
@Test
public void mExistsWithInteger() throws Exception{
Method m = classToTest.getDeclaredMethod("m", classFun1IntInt);
assertNotNull(m);
}
@Test
public void mExistsWithDouble() throws Exception{
Method m = classToTest.getDeclaredMethod("m", classFun1DoubleDouble);
assertNotNull(m);
}
@Test
public void mExistsWithString() throws Exception{
Method m = classToTest.getDeclaredMethod("m", classFun1StringString);
assertNotNull(m);
}
//@AfterClass
public static void cleanUp(){
TestCleanUp.cleanUpDirectory(new File(generatedByteCodeDirectory), f -> f.getName().contains(".class"));
}
}
-68
View File
@@ -1,68 +0,0 @@
package bytecode;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import general.TestCleanUp;
import org.junit.*;
import de.dhbwstuttgart.core.JavaTXCompiler;
import static org.junit.Assert.*;
/**
* //ToDo Etienne: Beschreiben
*
* @since Studienarbeit Type Erasure
* @author etiennezink
*/
public class OLFunTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static Class<?> classFun1IntInt;
private static Class<?> classFun1DoubleDouble;
private static Class<?> classFun1StringString;
private static String generatedByteCodeDirectory = System.getProperty("user.dir") + "/src/test/resources/testBytecode/generatedBC/";
//ToDo Etienne: Nach Anpassung des Bytecode die Tests hinzufügen
//ToDo Etienne: Aufruf von m testen
@BeforeClass
public static void setUp() throws Exception {
path = System.getProperty("user.dir")+"/src/test/resources/bytecode/javFiles/OLFun.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(generatedByteCodeDirectory);
loader = new URLClassLoader(new URL[] {new URL("file://"+generatedByteCodeDirectory)});
classToTest = loader.loadClass("OLFun");
classFun1IntInt = loader.loadClass("Fun1$$Ljava$lang$Integer$_$Ljava$lang$Integer$_$");
classFun1DoubleDouble = loader.loadClass("Fun1$$Ljava$lang$Double$_$Ljava$lang$Double$_$");
classFun1StringString = loader.loadClass("Fun1$$Ljava$lang$String$_$Ljava$lang$String$_$");
}
@Test
public void mExistsWithInteger() throws Exception{
Method m = classToTest.getDeclaredMethod("m", classFun1IntInt ,Integer.class);
assertNotNull(m);
}
@Test
public void mExistsWithDouble() throws Exception{
Method m = classToTest.getDeclaredMethod("m", classFun1DoubleDouble ,Double.class);
assertNotNull(m);
}
@Test
public void mExistsWithString() throws Exception{
Method m = classToTest.getDeclaredMethod("m", classFun1StringString ,String.class);
assertNotNull(m);
}
//@AfterClass
public static void cleanUp(){
TestCleanUp.cleanUpDirectory(new File(generatedByteCodeDirectory), f -> f.getName().contains(".class"));
}
}
-97
View File
@@ -1,97 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.List;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericGenratorResultForSourceFile;
import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.typeinference.result.ResultSet;
public class OLTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static Class<?> classToTest1;
private static String pathToClassFile;
private static Object instanceOfClass;
private static Object instanceOfClass1;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/OL.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
List<ResultSet> typeinferenceResult = compiler.typeInference();
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("OL");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
classToTest1 = loader.loadClass("OLMain");
instanceOfClass1 = classToTest1.getDeclaredConstructor().newInstance();
}
@Test
public void testOLClassName() {
assertEquals("OL", classToTest.getName());
}
@Test
public void testmInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("m", Integer.class);
Integer result = (Integer) m.invoke(instanceOfClass, 5);
assertEquals(new Integer(10), result);
}
@Test
public void testmDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("m", Double.class);
Double result = (Double) m.invoke(instanceOfClass, 5.0);
assertEquals(new Double(10.0), result);
}
@Test
public void testmString() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("m", String.class);
String result = (String) m.invoke(instanceOfClass, "xxx");
assertEquals("xxxxxx", result);
}
@Test
public void testOLMainClassName() {
assertEquals("OLMain", classToTest1.getName());
}
@Test
public void testmainInt() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method main = classToTest1.getDeclaredMethod("main", Integer.class);
Integer result = (Integer) main.invoke(instanceOfClass1, 5);
assertEquals(new Integer(10), result);
}
@Test
public void testmainDouble() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method main = classToTest1.getDeclaredMethod("main", Double.class);
Double result = (Double) main.invoke(instanceOfClass1, 5.0);
assertEquals(new Double(10.0), result);
}
@Test
public void testmainString() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method main = classToTest1.getDeclaredMethod("main", String.class);
String result = (String) main.invoke(instanceOfClass1, "xxx");
assertEquals("xxxxxx", result);
}
}
-61
View File
@@ -1,61 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import org.objectweb.asm.Opcodes;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class OpTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Op.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Op");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testAddString() throws NoSuchMethodException, SecurityException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException, InstantiationException {
Method m = classToTest.getDeclaredMethod("m", String.class,String.class);
String result = (String) m.invoke(instanceOfClass, "Byte","Code");
assertEquals("ByteCode", result);
}
@Test
public void testAddInt() throws NoSuchMethodException, SecurityException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException, InstantiationException {
Method m = classToTest.getDeclaredMethod("m", Integer.class,Integer.class);
Integer result = (Integer) m.invoke(instanceOfClass, 7,3);
assertEquals(new Integer(10), result);
}
}
@@ -1,51 +0,0 @@
package bytecode;
import de.dhbwstuttgart.core.JavaTXCompiler;
import org.junit.BeforeClass;
import org.junit.Test;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import static org.junit.Assert.assertEquals;
public class OverloadingSortingTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
private static Class<?> classOL2;
private static Object instanceOfClassOL2;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Sorting.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
// loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
// classToTest = loader.loadClass("Sorting");
// instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
// @Test
// public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
// Method meth = classToTest.getDeclaredMethod("merge", classToTest);
// }
//
// @Test
// public void test2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
// Method meth = classToTest.getDeclaredMethod("test", classOL2);
// String res = (String) meth.invoke(instanceOfClass, instanceOfClassOL2);
// assertEquals("Overloading2", res);
// }
}
@@ -1,57 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class OverloadingTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
private static Class<?> classOL2;
private static Object instanceOfClassOL2;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Overloading.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Overloading");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
classOL2 = loader.loadClass("Overloading2");
instanceOfClassOL2 = classOL2.getDeclaredConstructor().newInstance();
}
@Test
public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method meth = classToTest.getDeclaredMethod("test", classToTest);
String res = (String) meth.invoke(instanceOfClass, instanceOfClass);
assertEquals("Overloading", res);
}
@Test
public void test2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method meth = classToTest.getDeclaredMethod("test", classOL2);
String res = (String) meth.invoke(instanceOfClass, instanceOfClassOL2);
assertEquals("Overloading2", res);
}
}
-53
View File
@@ -1,53 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class PlusTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Plus.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Plus");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testAddInt() throws NoSuchMethodException, SecurityException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException, InstantiationException {
Method addInt = classToTest.getDeclaredMethod("m", Integer.class,Integer.class);
Number result = (Number) addInt.invoke(instanceOfClass, 7,3);
assertEquals(10, result);
}
@Test
public void testAddString() throws NoSuchMethodException, SecurityException, IllegalAccessException,
IllegalArgumentException, InvocationTargetException, InstantiationException {
Method addString = classToTest.getDeclaredMethod("m", String.class,String.class);
String result = (String) addString.invoke(instanceOfClass, "Byte","Code");
assertEquals("ByteCode", result);
}
}
@@ -1,65 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class PostIncTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/PostIncDec.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("PostIncDec");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testM1() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("m");
Integer res = (Integer) m.invoke(instanceOfClass);
assertEquals(new Integer(1), res);
}
@Test
public void testM2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("m2");
Integer res = (Integer) m.invoke(instanceOfClass);
assertEquals(new Integer(0), res);
}
@Test
public void testD1() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("d");
Integer res = (Integer) m.invoke(instanceOfClass);
assertEquals(new Integer(-1), res);
}
@Test
public void testD2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("d2");
Integer res = (Integer) m.invoke(instanceOfClass);
assertEquals(new Integer(0), res);
}
}
@@ -1,65 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class PreIncTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/PreInc.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://" + pathToClassFile)});
classToTest = loader.loadClass("PreInc");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testM() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("m");
Integer res = (Integer) m.invoke(instanceOfClass);
assertEquals(new Integer(1), res);
}
@Test
public void testM2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("m2");
Integer res = (Integer) m.invoke(instanceOfClass);
assertEquals(new Integer(1), res);
}
@Test
public void testD() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("d");
Integer res = (Integer) m.invoke(instanceOfClass);
assertEquals(new Integer(-1), res);
}
@Test
public void testD2() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("d2");
Integer res = (Integer) m.invoke(instanceOfClass);
assertEquals(new Integer(-1), res);
}
}
-86
View File
@@ -1,86 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.List;
import java.util.Stack;
import java.util.Vector;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericGenratorResultForSourceFile;
import de.dhbwstuttgart.core.JavaTXCompiler;
import de.dhbwstuttgart.typeinference.result.ResultSet;
public class PutTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static Class<?> classToTest1;
private static String pathToClassFile;
private static Object instanceOfClass;
private static Object instanceOfClass1;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Put.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
List<ResultSet> typeinferenceResult = compiler.typeInference();
List<GenericGenratorResultForSourceFile> simplifyResultsForAllSourceFiles = compiler.getGeneratedGenericResultsForAllSourceFiles(typeinferenceResult);
compiler.generateBytecode(new File(pathToClassFile),typeinferenceResult,simplifyResultsForAllSourceFiles);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Put");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void testPutClassName() {
assertEquals("Put", classToTest.getName());
}
@Test
public void testPutElementVector() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("putElement", Object.class, Vector.class);
Vector<Integer> v_invoke = new Vector<>();
m.invoke(instanceOfClass, 5, v_invoke);
Vector<Integer> v = new Vector<>();
v.add(5);
assertEquals(v, v_invoke);
}
@Test
public void testPutElementStack() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("putElement", Object.class, Stack.class);
Stack<Integer> s_invoke = new Stack<>();
m.invoke(instanceOfClass, 5, s_invoke);
assertEquals(new Integer(5), s_invoke.pop());
}
@Test
public void testMainVector() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("main", Object.class, Vector.class);
Vector<Integer> v_invoke = new Vector<>();
m.invoke(instanceOfClass, 6, v_invoke);
Vector<Integer> v = new Vector<>();
v.add(6);
assertEquals(v, v_invoke);
}
@Test
public void testMainStack() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("main", Object.class, Stack.class);
Stack<Integer> s_invoke = new Stack<>();
m.invoke(instanceOfClass, 6, s_invoke);
assertEquals(new Integer(6), s_invoke.pop());
}
}
@@ -1,44 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class RelOpsTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/RelOps.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("RelOps");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void test() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method m = classToTest.getDeclaredMethod("m", Integer.class,Integer.class);
Boolean result = (Boolean) m.invoke(instanceOfClass, 7,3);
assertFalse(result);
}
}
@@ -1,38 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class SimpleCycleTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateGen() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/SimpleCycle.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("SimpleCycle");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
}
@@ -1,52 +0,0 @@
package bytecode;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class SortingTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@Test
public void generateBC() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Sorting.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
compiler.generateBytecode(System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/");
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Sorting");
/*
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
Method m = classToTest.getDeclaredMethod("m");
Class<?> lambda = m.invoke(instanceOfClass).getClass();
Method apply = lambda.getMethod("apply", Object.class);
// Damit man auf die Methode zugreifen kann
apply.setAccessible(true);
Integer i = 77;
Integer result = (Integer) apply.invoke(m.invoke(instanceOfClass), i);
assertEquals(77, result);
*/
}
}
@@ -1,27 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class SubMatTest {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static String pathToClassFile;
@Test
public void test() throws ClassNotFoundException, IOException {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/SubMatrix.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
}
}
-69
View File
@@ -1,69 +0,0 @@
package bytecode;
import static org.junit.Assert.*;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.BeforeClass;
import org.junit.Test;
import de.dhbwstuttgart.core.JavaTXCompiler;
public class Tph2Test {
private static String path;
private static File fileToTest;
private static JavaTXCompiler compiler;
private static ClassLoader loader;
private static Class<?> classToTest;
private static String pathToClassFile;
private static Object instanceOfClass;
@BeforeClass
public static void setUpBeforeClass() throws Exception {
path = System.getProperty("user.dir")+"/resources/bytecode/javFiles/Tph2.jav";
fileToTest = new File(path);
compiler = new JavaTXCompiler(fileToTest);
pathToClassFile = System.getProperty("user.dir")+"/resources/testBytecode/generatedBC/";
compiler.generateBytecode(pathToClassFile);
loader = new URLClassLoader(new URL[] {new URL("file://"+pathToClassFile)});
classToTest = loader.loadClass("Tph2");
instanceOfClass = classToTest.getDeclaredConstructor().newInstance();
}
@Test
public void test1() throws Exception {
Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class);
Object result = m.invoke(instanceOfClass, 1,2);
assertEquals(1,result);
}
@Test
public void test2() throws Exception {
Method m = classToTest.getDeclaredMethod("m", Object.class, Object.class);
Object result = m.invoke(instanceOfClass, "sss",2);
assertEquals("sss",result);
}
@Test
public void test3() throws Exception {
Method m = classToTest.getDeclaredMethod("m2", Object.class, Object.class);
Object result = m.invoke(instanceOfClass, 1,2);
assertEquals(2,result);
}
@Test
public void test4() throws Exception {
Method m = classToTest.getDeclaredMethod("m2", Object.class, Object.class);
Object result = m.invoke(instanceOfClass, 1,"xxx");
assertEquals("xxx",result);
}
}

Some files were not shown because too many files have changed in this diff Show More