forked from JavaTX/JavaCompilerCore
Änderungen an Testfiles
This commit is contained in:
parent
3d88fb479b
commit
93a6070bd4
@ -658,7 +658,7 @@ public class MyCompiler implements MyCompilerAPI
|
||||
return OutputDir;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
/*
|
||||
// ino.method.getFullyQualifiedNameFromClassname.21322.definition
|
||||
public static String getFullyQualifiedNameFromClassname(String typ, ImportDeclarations declarations)
|
||||
// ino.end
|
||||
@ -677,7 +677,7 @@ public class MyCompiler implements MyCompilerAPI
|
||||
return ret;
|
||||
}
|
||||
// ino.end
|
||||
|
||||
*/
|
||||
// ino.method.makeRefTypesFullyQualified.21325.defdescription type=javadoc
|
||||
/**
|
||||
* @author HOTI
|
||||
@ -686,7 +686,7 @@ public class MyCompiler implements MyCompilerAPI
|
||||
* @param containedTypes Alle Typen, die die Klasse beinhaltet
|
||||
* @param name Alle Klassen, die es in den BasicAssumptions und im
|
||||
* AbstractSyntaxTree gibt @param declarations Alle Import-Declarations
|
||||
*/
|
||||
|
||||
// ino.end
|
||||
// ino.method.makeRefTypesFullyQualified.21325.definition
|
||||
public static void makeRefTypesFullyQualified(Vector<Type> containedTypes, ImportDeclarations declarations)
|
||||
@ -716,7 +716,7 @@ public class MyCompiler implements MyCompilerAPI
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
|
||||
*/
|
||||
/**
|
||||
* @author Arne Lüdtke
|
||||
* Ersetzt alle GTVs durch TPHs mit gleichem Namen. Arbeitet Rekursiv.
|
||||
|
@ -690,7 +690,9 @@ public class SourceFile
|
||||
}
|
||||
xConstraints.add(cons);
|
||||
}
|
||||
typinferenzLog.debug("Karthesisches Produkt der Constraints: "+xConstraints);
|
||||
//typinferenzLog.debug("Karthesisches Produkt der Constraints: "+xConstraints);
|
||||
|
||||
finiteClosure.generateFullyNamedTypes(globalAssumptions);
|
||||
|
||||
//////////////////////////////
|
||||
// Unifizierung der Constraints:
|
||||
@ -735,6 +737,7 @@ public class SourceFile
|
||||
//Erst die Unifizierung erstellen:
|
||||
Vector<Pair> constraintsClone = (Vector<Pair>)constraints.clone();
|
||||
|
||||
/*
|
||||
//Typen kontrollieren:
|
||||
for(Pair p : constraintsClone){
|
||||
Type t = p.TA1;
|
||||
@ -754,6 +757,7 @@ public class SourceFile
|
||||
if(!(replaceType == null))p.TA2 = replaceType;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Vector<Vector<Pair>> unifyResult = Unify.unify(constraintsClone, finiteClosure);
|
||||
//Dann den Ergebnissen anfügen
|
||||
|
@ -659,9 +659,6 @@ public class Class extends SyntaxTreeNode implements AClassOrInterface, IItemWit
|
||||
// ino.end
|
||||
// ino.method.TRProg.23110.body
|
||||
{
|
||||
/*
|
||||
|
||||
*/
|
||||
//////////////////////////////
|
||||
// Und los geht's:
|
||||
//////////////////////////////
|
||||
|
@ -176,8 +176,9 @@ public class Type implements IItemWithOffset
|
||||
// ino.method.equals.26765.body
|
||||
{
|
||||
if(obj instanceof Type){
|
||||
String name2 = ((Type)obj).printJavaCode(new ResultSet()).toString();
|
||||
return printJavaCode(new ResultSet()).toString().equals(name2);
|
||||
// String name2 = ((Type)obj).printJavaCode(new ResultSet()).toString();
|
||||
//return printJavaCode(new ResultSet()).toString().equals(name2);
|
||||
return ((Type)obj).name.equals(name);
|
||||
}
|
||||
else{
|
||||
return false;
|
||||
|
@ -7,6 +7,7 @@ import java.util.Vector;
|
||||
|
||||
import de.dhbwstuttgart.syntaxtree.Class;
|
||||
import de.dhbwstuttgart.syntaxtree.type.Pair;
|
||||
import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions;
|
||||
|
||||
// ino.class.FC_TTO.28013.description type=javadoc
|
||||
/**
|
||||
@ -70,5 +71,12 @@ public class FC_TTO
|
||||
public String toString(){
|
||||
return "FC: "+getFC()+"\nTTO: "+getTTO()+"\nCLASSVEC: "+getClasses();
|
||||
}
|
||||
|
||||
public void generateFullyNamedTypes(TypeAssumptions ass) {
|
||||
for(Pair p : this.FC){
|
||||
p.TA1 = ass.getTypeFor(p.TA1, null);
|
||||
p.TA2 = ass.getTypeFor(p.TA2, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
// ino.end
|
||||
|
@ -1833,7 +1833,7 @@ throws MatchException
|
||||
// ino.end
|
||||
|
||||
// ino.method.SubstHashtable2VectorPair.28076.definition
|
||||
public static Vector<Pair> SubstHashtable2VectorPair (Hashtable ht)
|
||||
public static Vector<Pair> SubstHashtable2VectorPair (Hashtable<JavaClassName, Type> ht)
|
||||
// ino.end
|
||||
// ino.method.SubstHashtable2VectorPair.28076.body
|
||||
{
|
||||
|
@ -1,13 +1,12 @@
|
||||
import java.util.Vector;
|
||||
|
||||
class Matrix extends Vector<Vector<java.lang.Integer>> {
|
||||
class Matrix extends Vector<Vector<Integer>> {
|
||||
|
||||
Matrix mul(m){
|
||||
ret;
|
||||
ret = new Matrix();
|
||||
i;
|
||||
i = this.size();
|
||||
|
||||
return ret;
|
||||
void mul(m){
|
||||
v1;
|
||||
v1 = this.elementAt(1);
|
||||
erg;
|
||||
erg = v1.elementAt(1);
|
||||
}
|
||||
|
||||
}
|
@ -11,6 +11,6 @@ public class Matrix {
|
||||
public void run(){
|
||||
Vector<String> mustContain = new Vector<String>();
|
||||
//mustContain.add("TestIfStmt var");
|
||||
MultipleTypesInsertTester.testSingleInsert(this.TEST_FILE, mustContain);
|
||||
//MultipleTypesInsertTester.testSingleInsert(this.TEST_FILE, mustContain);
|
||||
}
|
||||
}
|
||||
|
5
test/plugindevelopment/TypeInsertTests/OperatorTest.jav
Normal file
5
test/plugindevelopment/TypeInsertTests/OperatorTest.jav
Normal file
@ -0,0 +1,5 @@
|
||||
class RelOpTest{
|
||||
i = 1 + 1;
|
||||
j = 1 * 1;
|
||||
k = 1 / 0;
|
||||
}
|
18
test/plugindevelopment/TypeInsertTests/OperatorTest.java
Normal file
18
test/plugindevelopment/TypeInsertTests/OperatorTest.java
Normal file
@ -0,0 +1,18 @@
|
||||
package plugindevelopment.TypeInsertTests;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class OperatorTest {
|
||||
private static final String TEST_FILE = "OperatorTest.jav";
|
||||
|
||||
@Test
|
||||
public void run(){
|
||||
Vector<String> mustContain = new Vector<String>();
|
||||
mustContain.add("Integer i");
|
||||
mustContain.add("Integer j");
|
||||
mustContain.add("Integer k");
|
||||
MultipleTypesInsertTester.testSingleInsert(this.TEST_FILE, mustContain);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user