Zwischenstand 2
This commit is contained in:
parent
ede8ad6d03
commit
1080d8e52e
@ -85,7 +85,6 @@ public class ConstructInterfaces {
|
||||
|
||||
GenericTypeName typeName = new GenericTypeName( context,name);
|
||||
GenericRefType typeVar = new GenericRefType(typeName, new NullToken());
|
||||
|
||||
formalParameters.add(new FormalParameter(name,typeVar , new NullToken() ));
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,10 @@ public class Interface {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("interface %s < %s > { \n %s \n %s } \n \n " , strucType , generics, fields.toString() , methods.toString());
|
||||
String res = String.format("interface %s < %s > { \n %s \n %s } \n \n " , strucType , generics, fields.toString() , methods.toString());
|
||||
res = res.replace("[" , "");
|
||||
res = res.replace("]" , "");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
7
src/de/dhbwstuttgart/strucTypes6/Main.java
Normal file
7
src/de/dhbwstuttgart/strucTypes6/Main.java
Normal file
@ -0,0 +1,7 @@
|
||||
package de.dhbwstuttgart.strucTypes6;
|
||||
|
||||
/**
|
||||
* Created by sebastian on 11.05.17.
|
||||
*/
|
||||
public class Main {
|
||||
}
|
26
test/javFiles/testX.jav
Normal file
26
test/javFiles/testX.jav
Normal file
@ -0,0 +1,26 @@
|
||||
class Main {
|
||||
main () { return new MyInteger(); }
|
||||
}
|
||||
|
||||
|
||||
class A {
|
||||
mt(x,y,z) { return x.sub(y); }
|
||||
}
|
||||
|
||||
interface TVar_5 < TVar_16, TVar_15 > {
|
||||
TVar_16 add ( TVar_15 x);
|
||||
TVar_16 sub ( TVar_15 x);
|
||||
}
|
||||
|
||||
|
||||
class MyInteger implements TVar_5<MyInteger,MyInteger> {
|
||||
|
||||
MyInteger add( MyInteger x ) {
|
||||
return x;
|
||||
}
|
||||
|
||||
MyInteger sub( MyInteger x ) {
|
||||
return x;
|
||||
}
|
||||
|
||||
}
|
@ -10,12 +10,17 @@ class A {
|
||||
mt(x,y,z) { return x.sub(y).add(z); }
|
||||
}
|
||||
|
||||
interface if1<A,B> {
|
||||
interface TVar_5 < TVar_16, TVar_15 > {
|
||||
|
||||
}
|
||||
TVar_16 add ( TVar_15 x);
|
||||
|
||||
|
||||
class MyInteger {
|
||||
}
|
||||
|
||||
|
||||
class MyInteger implements TVar_5<MyInteger,MyInteger> {
|
||||
|
||||
MyInteger add( MyInteger x );
|
||||
|
||||
}
|
||||
|
||||
|
@ -57,10 +57,9 @@ public class ConvertTest {
|
||||
ClassOrInterface aClass = sf.getClasses().get(1);
|
||||
|
||||
|
||||
Set<ClassOrInterface> typeinfo = new HashSet<>();
|
||||
ConstraintSet<Constraint> constraints = sf.getClasses().get(0).getConstraints(new TypeInferenceInformation(typeinfo));
|
||||
ConstraintSet cs = constraints;
|
||||
|
||||
//Set<ClassOrInterface> typeinfo = new HashSet<>();
|
||||
//ConstraintSet<Constraint> constraints = sf.getClasses().get(0).getConstraints(new TypeInferenceInformation(typeinfo));
|
||||
//ConstraintSet cs = constraints;
|
||||
|
||||
|
||||
AssumptionMap assumptionMap = new AssumptionMap();
|
||||
|
11
test/strucTypes5/ConvertTest2.jav
Normal file
11
test/strucTypes5/ConvertTest2.jav
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
interface if1<A,B> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -17,10 +17,12 @@ public class JavaTXCompilerTest {
|
||||
@Test
|
||||
public void test() throws IOException, ClassNotFoundException {
|
||||
JavaTXCompiler compiler = new JavaTXCompiler();
|
||||
compiler.parse(new File(rootDirectory+"Methods.jav"));
|
||||
compiler.parse(new File(rootDirectory+"testX.jav"));
|
||||
//compiler.parse(new File(rootDirectory+"Generics.jav"));
|
||||
//compiler.parse(new File(rootDirectory+"MethodsEasy.jav"));
|
||||
//compiler.parse(new File(rootDirectory+"Lambda.jav"));
|
||||
compiler.typeInference();
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user