The tt(States) class object holds all the states defining all patterns
(tt(d_states)). When a new pattern is requested the member tt(next) or
tt(next2) can be invoked to retrieve the next or next two free states. Since
concatenating pattern produces free states (cf. the description of the
link(pattern concatenation)(CONCAT)) a vector of free state indices is
maintained by the tt(States) class as well (tt(d_free)).

label(STATESNEXTTWO)
The member tt(next2) returns a pair of free state indices, the second state
index refers to a tt(State) that has been initialized to the end-of-pattern
state: its state type is tt(State::FINAL) and its two successor (next)
fields are set to 0, indicating that there is no continuation from this state.

Patterns consisting of multiple states (like the pattern tt(ab), consisting of
the state holding tt(a) and the state holding tt(b)) are stored in a
linked-list like structure, defined in the tt(States)'s tt(d_state)
vector. Its representation is as follows (cf. figure ref(STATECATFIG):

itemization(
    it() The tt(next1()) member of the state containing the tt(a) pattern
returns the index of the state containing the tt(b) pattern.
    it() The tt(next1()) member of the state containing the tt(b) pattern
returns the index of the final state
    it() The final state's tt(next1) and tt(next2) members return 0
    it() Except for the pattern using the tt(|)-operator (tt(pattern |
pattern)) all tt(next2) members return 0. The implementation of the
tt(|)-operator is described link(here)(PATTERNVALOR).
    )

    figure(images/statecat)(Catenating States)(STATECATFIG)
