Class AssemblyNumericSymbols
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionchoose
(String name, AddressSpace space) Choose a symbol with the given name, using the space as a hintChoose any symbol with the given namechooseBySpace
(String name, AddressSpace space) Choose a label with the given name in the given spacestatic AssemblyNumericSymbols
Get symbols for the given equate and label mapsstatic AssemblyNumericSymbols
fromLanguage
(Language language) Get symbols from a language, when no program is availablestatic AssemblyNumericSymbols
fromProgram
(Program program) Get symbols from a program (and its language)getSuggestions
(String got, AddressSpace space, int max) Suggest up to max symbols having the given prefix, using space as a hintsuggestAny
(String got, int max) Suggest up to max symbols having the given prefixsuggestBySpace
(String got, AddressSpace space, int max) Suggest up to max symbols from the given space having the given prefix
-
Field Details
-
EMPTY
-
equates
-
labels
-
labelsBySpace
-
-
Method Details
-
fromLanguage
Get symbols from a language, when no program is available- Parameters:
language
- the language- Returns:
- the symbols
-
fromProgram
Get symbols from a program (and its language)TODO: It might be nice to cache these and use a listener to keep the maps up to date. Will depend on interactive performance.
- Parameters:
program
- the program- Returns:
- the symbols
-
forMaps
public static AssemblyNumericSymbols forMaps(Map<String, Set<Long>> equates, Map<String, Set<Address>> labels) Get symbols for the given equate and label maps- Parameters:
equates
- the equateslabels
- the labels- Returns:
- the symbols
-
chooseAll
Choose any symbol with the given nameThis will check equates first, then labels. If an equate is found, its value is returned. If a label is found, its addressable word offset is returned.
- Parameters:
name
- the name- Returns:
- the value, or null
-
chooseBySpace
Choose a label with the given name in the given space- Parameters:
name
- the namespace
- the address space- Returns:
- the addressable word offset of the found label, or null
-
choose
Choose a symbol with the given name, using the space as a hintIf a space is not given, or if that space is the constant space, then this will choose from all symbols, via
chooseAll(String)
. If a space is given, and it is not the constant space, then this will choose from symbols in the given space, viachooseBySpace(String, AddressSpace)
.- Parameters:
name
- the namespace
- the address space, or null- Returns:
- the equate value, or label addressable word offset, or null
-
suggestAny
Suggest up to max symbols having the given prefix- Parameters:
got
- the prefixmax
- the maximum number of symbols to suggest- Returns:
- the collection of symbol names
-
suggestBySpace
Suggest up to max symbols from the given space having the given prefix- Parameters:
got
- the prefixspace
- the address spacemax
- the maximum number of symbols to suggest- Returns:
- the collection of symbol names
-
getSuggestions
Suggest up to max symbols having the given prefix, using space as a hintAs in
chooseAll(String)
, if space is null or the constant space, then this will suggest from all symbols, viasuggestAny(String, int)
. If space is given, and it is not the constant space, then this will suggest from symbols in the given space, viasuggestBySpace(String, AddressSpace, int)
.- Parameters:
got
- the prefixspace
- the space, or nullmax
- the maximum number of symbols to suggest- Returns:
- the collection of symbol names
-