forked from JavaTX/JavaCompilerCore
.
This commit is contained in:
parent
5f9452cfda
commit
11fc7a4512
@ -14,13 +14,15 @@
|
||||
/*
|
||||
* Test b <. a, a <. b
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
- Transitiven Abschluss von FC bilden um schneller Subtypen bestimmen zu können
|
||||
- Problem: 2 FCs für Pairs und MPairs durch das Mapping
|
||||
- Equals der Typen schreiben um instanceof Prüfungen zu vermeiden
|
||||
|
||||
- Refactoring der Klassen Menge und Pair erlaubt?
|
||||
|
||||
SPEED UP
|
||||
- Anwendungsreihenfolge der Regeln (wahrscheinlichste zuerst, evtl ist nach regel 1 regel 2 nie möglich etc...)
|
||||
|
5
src/de/dhbwstuttgart/typeinference/IPair.java
Normal file
5
src/de/dhbwstuttgart/typeinference/IPair.java
Normal file
@ -0,0 +1,5 @@
|
||||
package de.dhbwstuttgart.typeinference;
|
||||
|
||||
public interface IPair {
|
||||
|
||||
}
|
@ -31,7 +31,7 @@ import de.dhbwstuttgart.syntaxtree.type.WildcardType;
|
||||
// Klasse, die ein Paar in der Menge Eq speichern kann
|
||||
// ino.end
|
||||
// ino.class.Pair.26540.declaration
|
||||
public class Pair implements Serializable, DeepCloneable
|
||||
public class Pair implements IPair, Serializable, DeepCloneable
|
||||
// ino.end
|
||||
// ino.class.Pair.26540.body
|
||||
{
|
||||
|
@ -1,5 +1,7 @@
|
||||
package de.dhbwstuttgart.typeinference.unify.interfaces;
|
||||
|
||||
public interface IFiniteClosure {
|
||||
import de.dhbwstuttgart.typeinference.IPair;
|
||||
|
||||
public interface IFiniteClosure<T extends IPair> {
|
||||
|
||||
}
|
||||
|
@ -1,11 +1,7 @@
|
||||
package de.dhbwstuttgart.typeinference.unifynew;
|
||||
|
||||
import java.util.AbstractQueue;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Queue;
|
||||
import java.util.Set;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.Menge;
|
||||
|
@ -1,7 +1,13 @@
|
||||
package de.dhbwstuttgart.typinference.unify.model;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.IPair;
|
||||
import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
|
||||
|
||||
public class FiniteClosure implements IFiniteClosure {
|
||||
|
||||
public class FiniteClosure<T extends IPair> implements IFiniteClosure<T> {
|
||||
|
||||
public FiniteClosure(Set<T> pairs) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
package de.dhbwstuttgart.typinference.unify.model;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.IPair;
|
||||
import de.dhbwstuttgart.typeinference.Pair.PairOperator;
|
||||
|
||||
public class MPair {
|
||||
public class MPair implements IPair {
|
||||
|
||||
private MType type1;
|
||||
private MType type2;
|
||||
|
38
src/de/dhbwstuttgart/typinference/unify/model/Node.java
Normal file
38
src/de/dhbwstuttgart/typinference/unify/model/Node.java
Normal file
@ -0,0 +1,38 @@
|
||||
package de.dhbwstuttgart.typinference.unify.model;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class Node<T> {
|
||||
private T content;
|
||||
|
||||
private HashSet<Node<T>> predecessors = new HashSet<>();
|
||||
private HashSet<Node<T>> descendants = new HashSet<>();
|
||||
|
||||
public Node(T content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public void AddDescendant(Node<T> descendant) {
|
||||
descendants.add(descendant);
|
||||
}
|
||||
|
||||
public void AddPredecessor(Node<T> predecessor) {
|
||||
predecessors.add(predecessor);
|
||||
predecessor.AddDescendant(this);
|
||||
}
|
||||
|
||||
public T getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public Set<Node<T>> getPredecessors() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Set<Node<T>> getDescendants() {
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user