Class WithinScopeBasicSymbolsResolver

  • Direct Known Subclasses:
    OOWithinScopeBasicSymbolsResolver

    public class WithinScopeBasicSymbolsResolver
    extends java.lang.Object
    contains 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.
    • Constructor Detail

      • WithinScopeBasicSymbolsResolver

        public WithinScopeBasicSymbolsResolver()
    • 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)
      • 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
      • 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 future

        Error considered internal, as the Exception should not have been thrown.

      • init

        public static void init()
      • reset

        public static void reset()