Parser based on at most 3 state table driven DFA table (designed for between 1->3 regular states + terminus, which is always the 0 state), for 8bit symbol sets (such as UTF8 or ASCII)

These have 2 bit table entries.

Hierarchy (View Summary)

Constructors

Methods

Constructors

  • Construct the DFA table with a maximum state count, which allows limited length arrays.

    Parameters

    • maximumState: number = 3

      The maximum state value, shouldn't be more than 3.

    Returns 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