forked from JavaTX/JavaCompilerCore
added funN
This commit is contained in:
parent
14e00913e8
commit
88726ccb70
@ -4,6 +4,7 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.unify.model.ExtendsType;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.FunNType;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.PlaceholderType;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.SimpleType;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.SuperType;
|
||||
@ -49,6 +50,9 @@ public interface IFiniteClosure {
|
||||
public Set<Type> grArg(PlaceholderType type);
|
||||
public Set<Type> smArg(PlaceholderType type);
|
||||
|
||||
public Set<Type> grArg(FunNType type);
|
||||
public Set<Type> smArg(FunNType type);
|
||||
|
||||
public Optional<Type> getGenericType(String typeName);
|
||||
public Set<Type> getAllTypesByName(String typeName);
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.exceptions.NotImplementedException;
|
||||
import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
|
||||
import de.dhbwstuttgart.typeinference.unify.interfaces.IUnify;
|
||||
import de.dhbwstuttgart.typeinference.unify.model.MPair.PairOperator;
|
||||
@ -193,6 +194,11 @@ public class FiniteClosure implements IFiniteClosure {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Type> grArg(FunNType type) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Type> grArg(ExtendsType type) {
|
||||
if(!inheritanceGraph.containsKey(type.getExtendedType()))
|
||||
@ -249,7 +255,13 @@ public class FiniteClosure implements IFiniteClosure {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Set<Type> smArg(FunNType type) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Type> smArg(ExtendsType type) {
|
||||
if(!inheritanceGraph.containsKey(type.getExtendedType()))
|
||||
return new HashSet<Type>();
|
||||
|
34
src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java
Normal file
34
src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java
Normal file
@ -0,0 +1,34 @@
|
||||
package de.dhbwstuttgart.typeinference.unify.model;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import de.dhbwstuttgart.typeinference.unify.interfaces.IFiniteClosure;
|
||||
|
||||
public class FunNType extends Type {
|
||||
|
||||
public FunNType(TypeParams p) {
|
||||
super("FuN", p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type setTypeParams(TypeParams newTp) {
|
||||
return new FunNType(newTp);
|
||||
}
|
||||
|
||||
@Override
|
||||
Set<Type> smArg(IFiniteClosure fc) {
|
||||
return fc.smArg(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
Set<Type> grArg(IFiniteClosure fc) {
|
||||
return fc.grArg(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
Type apply(Unifier unif) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user