Package ghidra.app.plugin.assembler.sleigh.symbol

# Class AssemblyStringMapTerminal

java.lang.Object
ghidra.app.plugin.assembler.sleigh.symbol.AssemblySymbol
ghidra.app.plugin.assembler.sleigh.symbol.AssemblyTerminal
ghidra.app.plugin.assembler.sleigh.symbol.AssemblyStringMapTerminal

All Implemented Interfaces:
  `Comparable<AssemblySymbol>`

public class AssemblyStringMapTerminal extends AssemblyTerminal
A terminal that accepts only a particular set of strings, mapping each to a numeric value

See Also:
  - `NameSymbol`
  - `VarnodeListSymbol`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final org.apache.commons.collections4.MultiValuedMap<String,Integer>`
  `map`

  ### Fields inherited from class ghidra.app.plugin.assembler.sleigh.symbol.AssemblySymbol

  `name`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AssemblyStringMapTerminal(String name, org.apache.commons.collections4.MultiValuedMap<String,Integer> map)`
  Construct a terminal with the given name, accepting only the keys of a given map

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Collection<String>`
  `getSuggestions(String string, AssemblyNumericSymbols symbols)`
  Provide a collection of strings that this terminal would have accepted
  `Collection<AssemblyParseNumericToken>`
  `match(String buffer, int pos, AssemblyGrammar grammar, AssemblyNumericSymbols symbols)`
  Attempt to match a token from the input buffer starting at a given position
  `String`
  `toString()`

  ### Methods inherited from class ghidra.app.plugin.assembler.sleigh.symbol.AssemblySymbol

  `compareTo, equals, getName, hashCode, takesOperandIndex`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### map

    protected final org.apache.commons.collections4.MultiValuedMap<String,Integer> map

- ## Constructor Details

  - ### AssemblyStringMapTerminal

    public AssemblyStringMapTerminal(String name, org.apache.commons.collections4.MultiValuedMap<String,Integer> map)
    Construct a terminal with the given name, accepting only the keys of a given map
    Parameters:
      `name` - the name
      `map` - the map from display text to token value

- ## Method Details

  - ### match

    public Collection<AssemblyParseNumericToken> match(String buffer, int pos, AssemblyGrammar grammar, AssemblyNumericSymbols symbols)
    Description copied from class: `AssemblyTerminal`
    Attempt to match a token from the input buffer starting at a given position
    Specified by:
      `match` in class `AssemblyTerminal`
    Parameters:
      `buffer` - the input buffer
      `pos` - the cursor position in the buffer
      `grammar` - the grammar containing this terminal
      `symbols` - symbols from the program, suitable for use as numeric terminals
    Returns:
      the matched token, or null

  - ### getSuggestions

    public Collection<String> getSuggestions(String string, AssemblyNumericSymbols symbols)
    Description copied from class: `AssemblyTerminal`
    Provide a collection of strings that this terminal would have accepted
    Specified by:
      `getSuggestions` in class `AssemblyTerminal`
    Parameters:
      `string` - the remaining contents of the input buffer
      `symbols` - the program symbols, if applicable
    Returns:
      a, possibly empty, collection of suggestions

  - ### toString

    public String toString()
    Specified by:
      `toString` in class `AssemblySymbol`