Code aufgeräumt.

This commit is contained in:
Michael Uhl 2019-05-14 21:43:32 +02:00
parent 1f20fecfee
commit 3d0d11adb7
2 changed files with 0 additions and 44 deletions

View File

@ -1,39 +0,0 @@
package de.dhbwstuttgart.typeinference.result;
import java.util.HashMap;
import java.util.Map;
import org.antlr.v4.runtime.Token;
import com.google.common.collect.HashBasedTable;
import com.google.common.collect.Table;
public class ResultPairMap {
private Table<Token, String, ResultPair<?,?>> indexMap = HashBasedTable.create();
private Map<Token, ResultPair<?, ?>> inner = new HashMap<>();
public static final ResultPairMap RESULT_PAIRS = new ResultPairMap();
private ResultPairMap() {
// Nothing to do here.
}
public void put(Token tkn, ResultPair<?, ?> resultPair) {
inner.put(tkn, resultPair);
}
public void put(Token tkn, String insertString, ResultPair<?, ?> resultPair) {
indexMap.put(tkn, insertString.trim(), resultPair);
inner.put(tkn, resultPair);
}
public ResultPair<?,?> get(Token tkn, String insertString) {
return inner.get(tkn);
}
public void clear() {
inner.clear();
indexMap.clear();
}
}

View File

@ -2,7 +2,6 @@ package de.dhbwstuttgart.typeinference.result;
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;
import de.dhbwstuttgart.exceptions.NotImplementedException;
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
@ -12,8 +11,6 @@ import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
import static de.dhbwstuttgart.typeinference.result.ResultPairMap.RESULT_PAIRS;
@SuppressWarnings("rawtypes")
public class ResultSet {
@ -91,8 +88,6 @@ class Resolver implements ResultSetVisitor {
}
for(ResultPair<?,?> resultPair : result.results){
currentPair = resultPair;
RESULT_PAIRS.put(resultPair.getLeft().getOffset(), resultPair);
RESULT_PAIRS.put(resultPair.getRight().getOffset(), resultPair);
resultPair.accept(this);
}
if(resolved==null){//TPH kommt nicht im Result vor: