Package org.ek9lang.compiler.search
Class SymbolSearch
java.lang.Object
org.ek9lang.compiler.search.SymbolSearch
- Direct Known Subclasses:
AnySymbolSearch
,AnyTypeSymbolSearch
,FunctionSymbolSearch
,MethodSymbolSearch
,TemplateFunctionSymbolSearch
,TemplateTypeSymbolSearch
,TypeSymbolSearch
To be used to search for symbols in a Symbol table.
-
Constructor Summary
ModifierConstructorDescriptionSymbolSearch
(String name) protected
SymbolSearch
(String name, Optional<ISymbol> ofTypeOrReturn) SymbolSearch
(String newName, SymbolSearch from) Create a new search from an existing search with a new search name.protected
SymbolSearch
(String name, ISymbol ofTypeOrReturn) SymbolSearch
(SymbolSearch from) Clone from Symbol search into a new instance.SymbolSearch
(ISymbol exampleSymbolToMatch) Use a symbol to populate the search. -
Method Summary
Modifier and TypeMethodDescriptionaddTypeParameter
(Optional<ISymbol> parameter) Add a type parameter to the search.addTypeParameter
(ISymbol parameter) Add a parameter to the search parameters.protected void
cloneIntoSearchSymbol
(SymbolSearch symbolSearch) Creates a new Symbol from the name in the search and the module name.getName()
Get the parameters being used in this search.Provide a list of valid search types if multiple supported.boolean
Is this sort of type search, TYPE, FUNCTION or TEMPLATE versions of those.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.boolean
setExampleSymbolToMatch
(ISymbol exampleSymbolToMatch) setLimitToBlocks
(boolean limitToBlocks) setOfTypeOrReturn
(Optional<ISymbol> ofTypeOrReturn) What type of symbol is being searched for or its return type.setOfTypeOrReturn
(ISymbol ofTypeOrReturn) setSearchType
(ISymbol.SymbolCategory searchType) setTypeParameters
(List<ISymbol> typeParameters) Set any parameters that might be needed as part of this search.setVetoSearchTypes
(List<ISymbol.SymbolCategory> vetoSearchTypes) toString()
-
Constructor Details
-
SymbolSearch
Clone from Symbol search into a new instance. -
SymbolSearch
Use a symbol to populate the search. -
SymbolSearch
Create a new search from an existing search with a new search name. -
SymbolSearch
-
SymbolSearch
-
SymbolSearch
-
-
Method Details
-
cloneIntoSearchSymbol
-
isCategoryAcceptable
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
Provide a list of valid search types if multiple supported. -
setVetoSearchTypes
-
isLimitToBlocks
public boolean isLimitToBlocks() -
setLimitToBlocks
-
setExampleSymbolToMatch
-
getOfTypeOrReturn
-
setOfTypeOrReturn
-
setOfTypeOrReturn
What type of symbol is being searched for or its return type. -
getTypeParameters
Get the parameters being used in this search. -
setTypeParameters
Set any parameters that might be needed as part of this search. -
addTypeParameter
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
Add a type parameter to the search. -
getSearchType
-
setSearchType
-
getAsSymbol
Creates a new Symbol from the name in the search and the module name. -
getName
-
toString
-