Constraints generieren. Fehler beheben
This commit is contained in:
parent
5fab817154
commit
92c284a04b
@ -23,18 +23,12 @@ import de.dhbwstuttgart.syntaxtree.statement.Block;
|
|||||||
public class Method extends Field implements IItemWithOffset
|
public class Method extends Field implements IItemWithOffset
|
||||||
{
|
{
|
||||||
private Block block;
|
private Block block;
|
||||||
private ParameterList parameterlist = new ParameterList(null, new NullToken());
|
private ParameterList parameterlist = new ParameterList(new ArrayList<>(), new NullToken());
|
||||||
private ExceptionList exceptionlist;
|
private ExceptionList exceptionlist;
|
||||||
private String name;
|
|
||||||
|
|
||||||
private List<String> types_in_parameterlist = new ArrayList<>();
|
|
||||||
private int modifiers;
|
|
||||||
private ParameterList parameterList;
|
|
||||||
|
|
||||||
public Method(String name, RefTypeOrTPH returnType, int modifiers, ParameterList parameterList, Block block,
|
public Method(String name, RefTypeOrTPH returnType, int modifiers, ParameterList parameterList, Block block,
|
||||||
GenericDeclarationList gtvDeclarations, Token offset) {
|
GenericDeclarationList gtvDeclarations, Token offset) {
|
||||||
super(name, returnType, modifiers, offset);
|
super(name, returnType, modifiers, offset);
|
||||||
this.name = name;
|
|
||||||
this.parameterlist = parameterList;
|
this.parameterlist = parameterList;
|
||||||
this.block = block;
|
this.block = block;
|
||||||
}
|
}
|
||||||
@ -47,6 +41,6 @@ public class Method extends Field implements IItemWithOffset
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ParameterList getParameterList() {
|
public ParameterList getParameterList() {
|
||||||
return parameterList;
|
return parameterlist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,6 +38,7 @@ public class MethodCall extends Statement
|
|||||||
methodConstraints.addConstraint(m.getArgTypes().get(i),
|
methodConstraints.addConstraint(m.getArgTypes().get(i),
|
||||||
arglist.getArguments().get(i).getType());
|
arglist.getArguments().get(i).getType());
|
||||||
}
|
}
|
||||||
|
overloading.addConstraint(methodConstraints);
|
||||||
}
|
}
|
||||||
ret.add(overloading);
|
ret.add(overloading);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
package de.dhbwstuttgart.typeinference;
|
package de.dhbwstuttgart.typeinference;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
|
|
||||||
public class OderConstraint extends OderMenge<Pair>{
|
public class OderConstraint extends OderMenge<Pair>{
|
||||||
private Set<UndConstraint> oderConstraintPairs;
|
private Set<UndConstraint> oderConstraintPairs;
|
||||||
|
|
||||||
public OderConstraint(){
|
public OderConstraint(){
|
||||||
oderConstraintPairs = new TreeSet<>();
|
oderConstraintPairs = new HashSet<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package de.dhbwstuttgart.typeinference;
|
package de.dhbwstuttgart.typeinference;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.*;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.TreeSet;
|
|
||||||
import java.util.Vector;
|
|
||||||
|
|
||||||
import de.dhbwstuttgart.exceptions.DebugException;
|
import de.dhbwstuttgart.exceptions.DebugException;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPH;
|
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPH;
|
||||||
@ -16,7 +13,7 @@ import de.dhbwstuttgart.typeinference.unify.Unifikationsalgorithmus;
|
|||||||
*/
|
*/
|
||||||
public class UndConstraint extends UndMenge<Pair> {
|
public class UndConstraint extends UndMenge<Pair> {
|
||||||
|
|
||||||
Set<EinzelElement<Pair>> set = new TreeSet<>();
|
Set<EinzelElement<Pair>> set = new HashSet<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<? extends KomplexeMenge<Pair>> getSet() {
|
public Set<? extends KomplexeMenge<Pair>> getSet() {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
class Methods {
|
class Methods {
|
||||||
mt4(a,b,c) { return a.add(b).sub(c) ; }
|
mt4(a,b,c) { return a.mt3(b).mt3(c) ; }
|
||||||
|
|
||||||
mt3(a) {return a.add(); }
|
mt3(a) {return a.add(); }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user