tt(parser/rules/pattern): Patterns define the regular expressions that can be
matched. All patterns start at tt(pattern_ws) and consist of:
        verb(
    pattern_ws:
        pattern opt_ws mode_block
    ;
        )
    Following the recognition of a pattern, the scanner is reset to its
tt(block) mode, allowing it to recognize a bf(C++) action block. Blocks are
defined link(here)(BLOCKS).

The following patterns are defined (more extensive descriptions follow):
    itemization(
    itt(EOF_PATTERN)  - recognized by the lexer, matching tt(<<EOF>>). 
    itt(STRING) - recognized by the lexer, matching a literal string.
    itt(SECTION_DELIMITER) - recognized by the lexer. The tt(%%) sequence in
        fact ends the rule section 
    itt(character_class): a self-defined or predefined character class like
        tt([a-c]) or tt([[alpha]]).
    itt(plain_characters): any plain character, like tt(a) in tt(ape).
    itt(ESCAPE_SEQUENCE): characters defined by escape sequences, like
        tt(\x2a). To the parser they are plain characters. 
    itt('.'): the any-character-but-newline matching pattern.
    itt(pattern pattern): two patterns immediately following each other. These
two patterns have the precedence of tt(CHARACTER), and are combined 
left-associatively.
    itt(pattern '|' pattern)  Two alternative continuations.
    itt(pattern multiplier): multipliers are tt(*, +) and tt(?).
    itt('(' incParen pattern ')' decParen) a pattern nested in parentheses
    itt(pattern '{' start_interval_m  interval '}' regex_block_m) a repetition
        using curly braces (an interval repetition)
    itt(pattern '/' pattern) a lookahead pattern ($ is handled by the scanner)
    )

tt(Pattern) objects contain (and offer, through the members tt(begin) and
tt(end)) index values in the tt(States::d_states) of tt(State) objects. The
value returned by tt(Pattern::begin()) is the index of the first tt(State)
defining the pattern, the value returned by tt(Pattern::end()) is the index
of the last (so: tt(State::FINAL)) tt(State) of the pattern (cf. figure
ref(PATTERN)).

    figure(images/pattern)(Pattern objects)(PATTERN)

tt(Pattern) objects also have a tt(d_lopData) data member, which is a pointer
to an internally used tt(LopData) struct. This data member is only used with
LOP-patterns, and is covered in section ref(LOPPATTERN).

tt(parser/rules/pattern): the following descriptions of the working of some
basic patterns illustrate how the vector of tt(State) objects in tt(States) is
filled. Based on this description other pattern's implementations should be
evident.

A basic pattern is the plain character (tt(parser/inc/regexoreof:
_single_char), processed by the tt(Pattern::rawText) factory function). The
plain character pattern is processed as follows:
    itemization(
    it() First the indices of two free tt(State) vector locations are
requested (see link(the tt(next2) description)(STATESNEXTTWO) in the
link(tt(States) clas)(STATES)).
    it() The tt(State) at the first state index is then set to a state
containing the plain character, linking to the next free state which has been
initialized to the tt(FINAL) state by tt(States::next2).
    it() Then s tt(Pattern), storing the begin and end tt(State) indices, is
returned (cf. figure ref(PATTERNVALPLAIN)).
    )

    figure(images/patternvalplain)(A plain character pattern)(PATTERNVALPLAIN)

label(PATTERNVALOR)
label(CONCAT)

Concatenation of two patterns always produces a free tt(State) that can be
returned by, e.g., tt(State::nex2). The states, defining a pattern, 
therefore, do not have to be consecutively stored in the tt(States)'s vector
of tt(State) objects (see figure ref(CONCATFIG)).

    itemization(
    it() Concatenation starts with two tt(SemVal) objects.
    it() The tt(SemVal) objects are downcast to,
resp. a tt(lhs PatternVal) and a tt(rhs PatternVal).
    it() With lookahead patterns, the tt(lhs) pattern may be an em(accepting
state). I.e., once the full pattern has been recognized only the lhs is
actually matched. E.g., after recognizing tt(a/b) tt(a) is returned as
matched, as tt(a) is the accepting pattern. When concatenating the lhs's end
state disappears and is replaced by the rhs's begin state. Therefore:
    it() The rhs's begin state's accepting flag is set to the lhs's end
state's accepting flag.
    it() The tt(lhs.end()) state is assigned the value of the tt(rhs.begin())
state
    it() The tt(rhs.begin()) state is marked as free
    it() A new tt(Pattern) is returned, having its
tt(begin) index set to tt(lhs.begin()) and its tt(end) idex set to
tt(rhs.end()). 
    )

    figure(images/concatfig)(Concatenating Patterns)(CONCATFIG)














