Class AssemblyStringTerminal

All Implemented Interfaces:
Comparable<AssemblySymbol>

public class AssemblyStringTerminal extends AssemblyTerminal
A terminal that accepts only a particular string
  • Field Details

  • Constructor Details

    • AssemblyStringTerminal

      public AssemblyStringTerminal(String str, VarnodeSymbol defsym)
      Construct a terminal that accepts only the given string
      Parameters:
      str - the string to accept
  • Method Details

    • toString

      public String toString()
      Specified by:
      toString in class AssemblySymbol
    • match

      public Collection<AssemblyParseToken> 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 got, 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:
      got - the remaining contents of the input buffer
      symbols - the program symbols, if applicable
      Returns:
      a, possibly empty, collection of suggestions
    • takesOperandIndex

      public boolean takesOperandIndex()
      Description copied from class: AssemblySymbol
      Check if this symbol consumes an operand index of its constructor
      Overrides:
      takesOperandIndex in class AssemblySymbol
      Returns:
      true if the symbol represents an operand
    • getDefiningSymbol

      public VarnodeSymbol getDefiningSymbol()
    • getString

      public String getString()
    • isWhiteSpace

      public boolean isWhiteSpace()