Class AssemblyFixedNumericTerminal

  • All Implemented Interfaces:
    java.lang.Comparable<AssemblySymbol>

    public class AssemblyFixedNumericTerminal
    extends AssemblyNumericTerminal
    A terminal that accepts only a particular numeric value This is different from a fixed string, because it will accept any encoding of the given numeric value.
    • Constructor Detail

      • AssemblyFixedNumericTerminal

        public AssemblyFixedNumericTerminal​(long val)
        Construct a terminal that accepts only the given numeric value
        Parameters:
        val - the value to accept
    • Method Detail

      • getSuggestions

        public java.util.Collection<java.lang.String> getSuggestions​(java.lang.String got,
                                                                     java.util.Map<java.lang.String,​java.lang.Long> labels)
        Description copied from class: AssemblyTerminal
        Provide a collection of strings that this terminal would have accepted
        Overrides:
        getSuggestions in class AssemblyNumericTerminal
        Parameters:
        got - the remaining contents of the input buffer
        labels - the program labels, if applicable
        Returns:
        a, possibly empty, collection of suggestions
      • match

        public java.util.Collection<AssemblyParseNumericToken> match​(java.lang.String buffer,
                                                                     int pos,
                                                                     AssemblyGrammar grammar,
                                                                     java.util.Map<java.lang.String,​java.lang.Long> labels)
        Description copied from class: AssemblyTerminal
        Attempt to match a token from the input buffer starting at a given position
        Overrides:
        match in class AssemblyNumericTerminal
        Parameters:
        buffer - the input buffer
        pos - the cursor position in the buffer
        grammar - the grammar containing this terminal
        labels - the program labels, if applicable
        Returns:
        the matched token, or null