Class SymTypeFreeVariableReplaceVisitor
- java.lang.Object
-
- de.monticore.types3.util.SymTypeDeepCloneVisitor
-
- de.monticore.types3.generics.util.SymTypeFreeVariableReplaceVisitor
-
- All Implemented Interfaces:
ISymTypeVisitor
public class SymTypeFreeVariableReplaceVisitor extends SymTypeDeepCloneVisitor
Replaces type variables, that are free in the given enclosing scope, with inference variables. Returns both, the new type, and a map from the replaced variables to the replacement. Usage: calculate(symType, enclosingScope)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSymTypeFreeVariableReplaceVisitor.Resultjust a pair
-
Field Summary
Fields Modifier and Type Field Description protected IBasicSymbolsScopeenclosingScopeprotected java.util.Map<SymTypeVariable,SymTypeInferenceVariable>replaceMapMap for replacing Type Variables-
Fields inherited from class de.monticore.types3.util.SymTypeDeepCloneVisitor
transformedSymTypes
-
-
Constructor Summary
Constructors Constructor Description SymTypeFreeVariableReplaceVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SymTypeFreeVariableReplaceVisitor.Resultcalculate(SymTypeExpression symType, IBasicSymbolsScope enclosingScope)protected IBasicSymbolsScopegetEnclosingScope()protected java.util.Map<SymTypeVariable,SymTypeInferenceVariable>getReplaceMap()voidsetEnclosingScope(IBasicSymbolsScope enclosingScope)voidsetReplaceMap(java.util.Map<SymTypeVariable,SymTypeInferenceVariable> replaceMap)voidvisit(SymTypeVariable typeVar)-
Methods inherited from class de.monticore.types3.util.SymTypeDeepCloneVisitor
applyToCollection, applyToCollection, calculate, getTransformedSymType, getTransformedSymTypes, popTransformedSubSymType, pushTransformedSymType, reset, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
-
-
-
Field Detail
-
replaceMap
protected java.util.Map<SymTypeVariable,SymTypeInferenceVariable> replaceMap
Map for replacing Type Variables
-
enclosingScope
protected IBasicSymbolsScope enclosingScope
-
-
Method Detail
-
getReplaceMap
protected java.util.Map<SymTypeVariable,SymTypeInferenceVariable> getReplaceMap()
-
setReplaceMap
public void setReplaceMap(java.util.Map<SymTypeVariable,SymTypeInferenceVariable> replaceMap)
-
getEnclosingScope
protected IBasicSymbolsScope getEnclosingScope()
-
setEnclosingScope
public void setEnclosingScope(IBasicSymbolsScope enclosingScope)
-
visit
public void visit(SymTypeVariable typeVar)
- Specified by:
visitin interfaceISymTypeVisitor- Overrides:
visitin classSymTypeDeepCloneVisitor
-
calculate
public SymTypeFreeVariableReplaceVisitor.Result calculate(SymTypeExpression symType, IBasicSymbolsScope enclosingScope)
-
-