Singular DFAs

There are three DFAs which exist primarily as arithmetic or algebraic constructs without any primary practical application. They are the following:

\\Nothing

matches solely the lexeme of zero-length. If one of a lexer’s patterns is \Nothing, then it will inavitably stall as soon as no other pattern matches: it accepts nothing without proceeding in the input stream.

\\Empty

matches never at all. A lexer containing nothing but this pattern will inavitably trigger a match failure.

\\Universe

matches all possible lexemes, even the lexeme of zero length. A lexer with this pattern will consume the complete input stream at once and ignore any other pattern.

../_images/state-machine-singular-dfas.svg

Fig. 15 Elementary DFAs consisting of an initial state and an acceptance states.

Figure Elementary DFAs consisting of an initial state and an acceptance states. displays the three singular DFAs. \Universe is implemented as an arbitrary repetition of \Any. The range of \Any is determined by the number of bytes associated with a lexatom.