Class SymbolSearch

java.lang.Object
org.ek9lang.compiler.search.SymbolSearch
Direct Known Subclasses:
AnySymbolSearch, AnyTypeSymbolSearch, FunctionSymbolSearch, MethodSymbolSearch, TemplateFunctionSymbolSearch, TemplateTypeSymbolSearch, TypeSymbolSearch

public class SymbolSearch extends Object
To be used to search for symbols in a Symbol table.
  • Constructor Details

    • SymbolSearch

      public SymbolSearch(SymbolSearch from)
      Clone from Symbol search into a new instance.
    • SymbolSearch

      public SymbolSearch(ISymbol exampleSymbolToMatch)
      Use a symbol to populate the search.
    • SymbolSearch

      public SymbolSearch(String newName, SymbolSearch from)
      Create a new search from an existing search with a new search name.
    • SymbolSearch

      public SymbolSearch(String name)
    • SymbolSearch

      protected SymbolSearch(String name, Optional<ISymbol> ofTypeOrReturn)
    • SymbolSearch

      protected SymbolSearch(String name, ISymbol ofTypeOrReturn)
  • Method Details

    • cloneIntoSearchSymbol

      protected void cloneIntoSearchSymbol(SymbolSearch symbolSearch)
    • isCategoryAcceptable

      public boolean isCategoryAcceptable(ISymbol.SymbolCategory category)
      Uses the search type and any vetos to see if the category passed in is a match on the search.
    • isAnyValidTypeSearch

      public boolean isAnyValidTypeSearch()
      Is this sort of type search, TYPE, FUNCTION or TEMPLATE versions of those.
    • getValidSearchTypes

      public List<ISymbol.SymbolCategory> getValidSearchTypes()
      Provide a list of valid search types if multiple supported.
    • setVetoSearchTypes

      public SymbolSearch setVetoSearchTypes(List<ISymbol.SymbolCategory> vetoSearchTypes)
    • isLimitToBlocks

      public boolean isLimitToBlocks()
    • setLimitToBlocks

      public SymbolSearch setLimitToBlocks(boolean limitToBlocks)
    • setExampleSymbolToMatch

      public SymbolSearch setExampleSymbolToMatch(ISymbol exampleSymbolToMatch)
    • getOfTypeOrReturn

      public Optional<ISymbol> getOfTypeOrReturn()
    • setOfTypeOrReturn

      public SymbolSearch setOfTypeOrReturn(ISymbol ofTypeOrReturn)
    • setOfTypeOrReturn

      public SymbolSearch setOfTypeOrReturn(Optional<ISymbol> ofTypeOrReturn)
      What type of symbol is being searched for or its return type.
    • getTypeParameters

      public List<ISymbol> getTypeParameters()
      Get the parameters being used in this search.
    • setTypeParameters

      public SymbolSearch setTypeParameters(List<ISymbol> typeParameters)
      Set any parameters that might be needed as part of this search.
    • addTypeParameter

      public SymbolSearch addTypeParameter(ISymbol parameter)
      Add a parameter to the search parameters. This is the 'type' symbol - i.e. Integer or whatever. It is not a variable that 'has' a type.
    • addTypeParameter

      public SymbolSearch addTypeParameter(Optional<ISymbol> parameter)
      Add a type parameter to the search.
    • getSearchType

      public ISymbol.SymbolCategory getSearchType()
    • setSearchType

      public SymbolSearch setSearchType(ISymbol.SymbolCategory searchType)
    • getAsSymbol

      public Optional<ISymbol> getAsSymbol()
      Creates a new Symbol from the name in the search and the module name.
    • getName

      public String getName()
    • toString

      public String toString()
      Overrides:
      toString in class Object