Library

DFA · Regular

A C comment, /* … */

Exactly one block comment: x stands for any other character. The trap is */ inside the body — after a *, a / ends the comment, another * keeps the possibility open, anything else falls back to the body.

startslashbodystardone/*x, /**x/
The machine as drawn — 5 states, 8 transitions.Every word up to length 5, one row per length in shortlex order, inked where it is accepted.

The author’s examples, run

/**/ → accept/*x*/ → accept/*x**/ → accept/*/x*/ → accept/***x*/ → accept/*x*/x → reject/*/ → reject/*x*x → reject