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
This commit is contained in:
AluAli 2020-10-22 22:13:05 +02:00
parent 1d7c894f39
commit f6154b8f2c
6 changed files with 167 additions and 89 deletions

View File

@ -1,89 +0,0 @@
package de.dhbwstuttgart.bytecode.gGenericsAli;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint.Relation;
import de.dhbwstuttgart.bytecode.genericsGenerator.ConstraintsSimplierResult;
import de.dhbwstuttgart.bytecode.genericsGenerator.GeneratedGenericsFinder;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericsGeneratorResultForClass;
import de.dhbwstuttgart.syntaxtree.Method;
import java.util.List;
public class FamilyOfGeneratedGenerics { // extends TPHConstraint?
// private final TPHExtractor tphExtractor = new TPHExtractor();
private final List<TPHConstraint> cs;
public FamilyOfGeneratedGenerics(List<TPHConstraint> cs) {
this.cs = cs;
}
List<ClassConstraints> cs_cl;
List<MethodConstraints> cs_m;
public Type getLeftSideOfConstraint(TPHConstraint constraint) {
Type leftSideType = null;
if(!(getRelationOfConstraint(constraint) == Relation.EXTENDS) {
continue;
} else {
leftSideType = constraint.getLeft();
}
return leftSideType;
}
public Type getRightSideOfConstraint(TPHConstraint constraint) {
Type rightSideType = null;
if(!(getRelationOfConstraint(constraint) == Relation.EXTENDS)) {
continue;
} else {
rightSideType = constraint.getRight();
}
return rightSideType;
}
public Relation getRelationOfConstraint(TPHConstraint constraint) {
//TODO: get relation (EXTENDS or EQUAL)
return constraint.getRel();
}
public void addConstraintToClassConstraint(List<TPHConstraint> constraintsSet) {
//TODO: Regeln
for(TPHConstraint cons: constraintsSet){
cs_cl =
}
}
public void addConstraintToMethodConstraint(List<Constraints> constraintsSet) {
//TODO: Regeln
/*for(Constraint cons: constraintsSet){
cs_m =
}*/
}
GeneratedGenericsFinder genGenFinder;
ConstraintsSimplierResult simplifiedConstraints = null;
GenericsGeneratorResultForClass ggResult = null;
Method m;
public void addMethodConstraints(List<MethodConstraints> cs_m) {
genGenFinder.addMethodConstraints(simplifiedConstraints, ggResult, m);
cs_m.add();
}
}

View File

@ -0,0 +1,4 @@
package de.dhbwstuttgart.bytecode.gGenericsAli;
public class ClassConstraint {
}

View File

@ -0,0 +1,159 @@
package de.dhbwstuttgart.bytecode.gGenericsAli;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint;
import de.dhbwstuttgart.bytecode.constraint.TPHConstraint.Relation;
import de.dhbwstuttgart.bytecode.genericsGenerator.ConstraintsSimplierResult;
import de.dhbwstuttgart.bytecode.genericsGenerator.GeneratedGenericsFinder;
import de.dhbwstuttgart.bytecode.genericsGeneratorTypes.GenericsGeneratorResultForClass;
import de.dhbwstuttgart.syntaxtree.Method;
import java.util.List;
public class FamilyOfGeneratedGenerics { // extends TPHConstraint?
// private final TPHExtractor tphExtractor = new TPHExtractor();
private final List<TPHConstraint> cs;
public FamilyOfGeneratedGenerics(List<TPHConstraint> cs) {
this.cs = cs;
}
List<ClassConstraint> cs_cl;
List<MethodConstraint> cs_m;
/*public Type getLeftSideOfConstraint(TPHConstraint constraint) {
Type leftSideType = null;
if(!(getRelationOfConstraint(constraint) == Relation.EXTENDS)) {
continue;
} else {
leftSideType = constraint.getLeft();
}
return leftSideType;
}*/
public String getLeftSideOfConstraint(TPHConstraint constraint) {
if(constraint.getRel() == Relation.EXTENDS)
return constraint.getLeft();
}
/*public Type getRightSideOfConstraint(TPHConstraint constraint) {
Type rightSideType = null;
if(!(getRelationOfConstraint(constraint) == Relation.EXTENDS)) {
continue;
} else {
rightSideType = constraint.getRight();
}
return rightSideType;
}*/
public String getRightSideOfConstraint(TPHConstraint constraint) {
if(constraint.getRel() == Relation.EXTENDS)
return constraint.getRight();
}
/*public Relation getRelationOfConstraint(TPHConstraint constraint) {
return constraint.getRel();
}*/
public void addConstraintToClassConstraint(List<TPHConstraint> constraintsSet) {
//TODO: Regeln
for(TPHConstraint cons: constraintsSet){
cs_cl =
}
}
public void addConstraintToMethodConstraint(List<TPHConstraint> constraintsSet) {
//TODO: Regeln
for(TPHConstraint cons: constraintsSet){
cs_m =
}
}
/**
* Def. FGG: erste Zeile von cs_cl
* {T < .T' | T is a type variable in a type of a node of a field}
*/
public List<ClassConstraint> typeOfANodeOfAField() {
//TODO:
}
/**
* Def. FGG: zweite Zeile von cs_cl
* {T' <. T'' | \exists T: (T <. T') \in cs_cl, (T' <. T'') \in cs }
*/
public List<ClassConstraint> transitiveSubtypeForClass() {
//TODO:
}
/**
* 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 List<ClassConstraint> hasNoSupertypeForClassTypes() {
}
/**
* 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 List<MethodConstraint> typeOfTheMethodInClSigma() {
}
/**
* 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() {
}
/**
* 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() {
}
/**
* 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 List<MethodConstraint> hasNoSupertypeForMethodTypes() {
}
/**
* nimm die Menge cs_cl aus cs_m raus
*/
public List<MethodConstraint> methodTypesWithoutClassTypes() {
}
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();
}
}

View File

@ -0,0 +1,4 @@
package de.dhbwstuttgart.bytecode.gGenericsAli;
public class MethodConstraint {
}