forked from JavaTX/JavaCompilerCore
Code aufgeräumt.
This commit is contained in:
parent
1f20fecfee
commit
3d0d11adb7
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
@ -2,7 +2,6 @@ package de.dhbwstuttgart.typeinference.result;
|
|||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
import de.dhbwstuttgart.exceptions.NotImplementedException;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.ExtendsWildcardType;
|
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.SuperWildcardType;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
import de.dhbwstuttgart.syntaxtree.type.TypePlaceholder;
|
||||||
|
|
||||||
import static de.dhbwstuttgart.typeinference.result.ResultPairMap.RESULT_PAIRS;
|
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
@SuppressWarnings("rawtypes")
|
||||||
public class ResultSet {
|
public class ResultSet {
|
||||||
|
|
||||||
@ -91,8 +88,6 @@ class Resolver implements ResultSetVisitor {
|
|||||||
}
|
}
|
||||||
for(ResultPair<?,?> resultPair : result.results){
|
for(ResultPair<?,?> resultPair : result.results){
|
||||||
currentPair = resultPair;
|
currentPair = resultPair;
|
||||||
RESULT_PAIRS.put(resultPair.getLeft().getOffset(), resultPair);
|
|
||||||
RESULT_PAIRS.put(resultPair.getRight().getOffset(), resultPair);
|
|
||||||
resultPair.accept(this);
|
resultPair.accept(this);
|
||||||
}
|
}
|
||||||
if(resolved==null){//TPH kommt nicht im Result vor:
|
if(resolved==null){//TPH kommt nicht im Result vor:
|
||||||
|
Loading…
Reference in New Issue
Block a user