Package de.monticore.types3.util
Class WithinScopeBasicSymbolsResolver
- java.lang.Object
-
- de.monticore.types3.util.WithinScopeBasicSymbolsResolver
-
- Direct Known Subclasses:
OOWithinScopeBasicSymbolsResolver
public class WithinScopeBasicSymbolsResolver extends java.lang.Objectcontains the code to derive / synthesize the type of a single name. Names may contain a qualifier, e.g., a.b.c with a.b being a qualifier and a.b.c being a type would resolved, a.b.c with a.b being a type and c being a type within a.b would NOT be resolved.
-
-
Field Summary
Fields Modifier and Type Field Description protected static WithinScopeBasicSymbolsResolverdelegate
-
Constructor Summary
Constructors Constructor Description WithinScopeBasicSymbolsResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected java.util.Optional<SymTypeExpression>_resolveNameAsExpr(IBasicSymbolsScope enclosingScope, java.lang.String name)protected java.util.Optional<SymTypeExpression>_resolveType(IBasicSymbolsScope enclosingScope, java.lang.String name)protected static WithinScopeBasicSymbolsResolvergetDelegate()protected java.util.function.Predicate<FunctionSymbol>getFunctionPredicate()used to filter function symbols this is an extension point to, e.g., filter out constructors in OO-Symbolsprotected java.util.function.Predicate<TypeSymbol>getTypePredicate()used to filter type symbols this is NOT used to filter type variables this is an extension pointprotected java.util.function.Predicate<TypeVarSymbol>getTypeVarPredicate()used to filter type variable symbols this is an extension pointprotected java.util.function.Predicate<VariableSymbol>getVariablePredicate()used to filter variable symbols this is an extension pointstatic voidinit()protected booleanisNameWithQualifier(java.lang.String name)static voidreset()protected java.util.List<SymTypeOfFunction>resolveFunctionsWithoutSuperTypes(IBasicSymbolsScope enclosingScope, java.lang.String name)resolves functions based on scopes without regards to types, e.g.static java.util.Optional<SymTypeExpression>resolveNameAsExpr(IBasicSymbolsScope enclosingScope, java.lang.String name)resolves the name as an expression (variable or function)protected <T> java.util.Optional<T>resolverHotfix(java.util.function.Supplier<java.util.Optional<T>> s)workaround for Resolver throwing Exceptions...static java.util.Optional<SymTypeExpression>resolveType(IBasicSymbolsScope enclosingScope, java.lang.String name)protected java.util.Optional<SymTypeExpression>resolveVariableWithoutSuperTypes(IBasicSymbolsScope enclosingScope, java.lang.String name)resolves a variable based on scopes without regards to types, e.g., without adding symbols from supertypes of type scopes.protected static voidsetDelegate(WithinScopeBasicSymbolsResolver newDelegate)voidsetTypeContextCalculator(TypeContextCalculator typeCtxCalc)Deprecated, for removal: This API element is subject to removal in a future version.is now a static delegatevoidsetWithinTypeBasicSymbolsResolver(WithinTypeBasicSymbolsResolver withinTypeResolver)Deprecated, for removal: This API element is subject to removal in a future version.is now a static delegatejava.util.Optional<SymTypeExpression>typeOfNameAsExpr(IBasicSymbolsScope enclosingScope, java.lang.String name)Deprecated, for removal: This API element is subject to removal in a future version.java.util.Optional<SymTypeExpression>typeOfNameAsTypeId(IBasicSymbolsScope enclosingScope, java.lang.String name)Deprecated, for removal: This API element is subject to removal in a future version.
-
-
-
Field Detail
-
delegate
protected static WithinScopeBasicSymbolsResolver delegate
-
-
Method Detail
-
setWithinTypeBasicSymbolsResolver
@Deprecated(forRemoval=true) public void setWithinTypeBasicSymbolsResolver(WithinTypeBasicSymbolsResolver withinTypeResolver)
Deprecated, for removal: This API element is subject to removal in a future version.is now a static delegate
-
setTypeContextCalculator
@Deprecated(forRemoval=true) public void setTypeContextCalculator(TypeContextCalculator typeCtxCalc)
Deprecated, for removal: This API element is subject to removal in a future version.is now a static delegate
-
resolveNameAsExpr
public static java.util.Optional<SymTypeExpression> resolveNameAsExpr(IBasicSymbolsScope enclosingScope, java.lang.String name)
resolves the name as an expression (variable or function)
-
_resolveNameAsExpr
protected java.util.Optional<SymTypeExpression> _resolveNameAsExpr(IBasicSymbolsScope enclosingScope, java.lang.String name)
-
typeOfNameAsExpr
@Deprecated(forRemoval=true) public java.util.Optional<SymTypeExpression> typeOfNameAsExpr(IBasicSymbolsScope enclosingScope, java.lang.String name)
Deprecated, for removal: This API element is subject to removal in a future version.
-
resolveVariableWithoutSuperTypes
protected java.util.Optional<SymTypeExpression> resolveVariableWithoutSuperTypes(IBasicSymbolsScope enclosingScope, java.lang.String name)
resolves a variable based on scopes without regards to types, e.g., without adding symbols from supertypes of type scopes. This is an extension point to add custom variables not in the symTab.
-
resolveFunctionsWithoutSuperTypes
protected java.util.List<SymTypeOfFunction> resolveFunctionsWithoutSuperTypes(IBasicSymbolsScope enclosingScope, java.lang.String name)
resolves functions based on scopes without regards to types, e.g. without adding symbols from supertypes of type scopes. This is an extension point to add custom functions not in the symTab.
-
getFunctionPredicate
protected java.util.function.Predicate<FunctionSymbol> getFunctionPredicate()
used to filter function symbols this is an extension point to, e.g., filter out constructors in OO-Symbols
-
getVariablePredicate
protected java.util.function.Predicate<VariableSymbol> getVariablePredicate()
used to filter variable symbols this is an extension point
-
resolveType
public static java.util.Optional<SymTypeExpression> resolveType(IBasicSymbolsScope enclosingScope, java.lang.String name)
-
_resolveType
protected java.util.Optional<SymTypeExpression> _resolveType(IBasicSymbolsScope enclosingScope, java.lang.String name)
-
typeOfNameAsTypeId
@Deprecated(forRemoval=true) public java.util.Optional<SymTypeExpression> typeOfNameAsTypeId(IBasicSymbolsScope enclosingScope, java.lang.String name)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getTypePredicate
protected java.util.function.Predicate<TypeSymbol> getTypePredicate()
used to filter type symbols this is NOT used to filter type variables this is an extension point
-
getTypeVarPredicate
protected java.util.function.Predicate<TypeVarSymbol> getTypeVarPredicate()
used to filter type variable symbols this is an extension point
-
isNameWithQualifier
protected boolean isNameWithQualifier(java.lang.String name)
- Returns:
- true for "a.b", false for "a"
-
resolverHotfix
protected <T> java.util.Optional<T> resolverHotfix(java.util.function.Supplier<java.util.Optional<T>> s)
workaround for Resolver throwing Exceptions... note: Exception is not supposed to happen, thus, never rely on this(!) Error being logged (here) some error should be logged, though. This method is to be removed in the futureError considered internal, as the Exception should not have been thrown.
-
init
public static void init()
-
reset
public static void reset()
-
setDelegate
protected static void setDelegate(WithinScopeBasicSymbolsResolver newDelegate)
-
getDelegate
protected static WithinScopeBasicSymbolsResolver getDelegate()
-
-