Library

DFA · Regular

A C integer literal: decimal, octal or hex

A leading 0 means octal, 0x means hexadecimal, any other digit means decimal. The symbols are classes: 0, 7 for the digits 1–7, 9 for 8 and 9, x, and f for the letters a–f. A lone 0 is a valid octal literal, which is why “zero” is accepting.

szerodecocthxhex07, 90, 7, 90, 70, 7x0, 7, 9, f0, 7, 9, f
The machine as drawn — 6 states, 19 transitions.Every word up to length 3, one row per length in shortlex order, inked where it is accepted.

The author’s examples, run

0 → accept0x79f → accept0x07f90 → accept0x709079 → acceptx → reject7x79f → reject7x07f90 → reject7x709079 → reject