DFA based parser to match an integer, or an unsigned integer.

Hierarchy (View Summary)

Constructors

Properties

Methods

Constructors

Properties

Instance: default = ...

Methods

  • Get the value of a given state for a given value.

    Useful for using this for mappings. Will cause an exception if out of bounds.

    Parameters

    • value: number

      The byte value to lookup.

    • state: number

      The state to get the value for.

    Returns number

  • Match a signed integer and returned the updated cursor position or undefined if no match is found

    Parameters

    • input: Uint8Array

      The input buffer to match against.

    • cursor: number

      The cursor to test the match against.

    • endCursor: number

      The end point to look at in the buffer.

    Returns undefined | number

    The end of the match or undefined if none found.

  • Match an unsigned integer and return the updated cursor position or undefined if no match is found

    Parameters

    • input: Uint8Array

      The input buffer to match against.

    • cursor: number

      The cursor to test the match against.

    • endCursor: number

      The end point to look at in the buffer.

    Returns undefined | number

    The end of the match or undefined if none found.