five-tuple definition
A=(Q, Sigma, delta, q0, F)
Q -- a finite set of states
Sigma -- a finite set of input symbols
delta -- transition function
q0 -- start state
F -- a set of accepting states
example -- quoted string with escape
input: ", \, c(any other character)
states:
Start -- see the beginning "
End -- see the end " -- Accept state
Body -- In the middle of string
Escape -- See the escape \, expect the "
transition diagram
| State | Input " | Escape \ | Any Other Character |
| Start | End | Escape | Body |
| Body | End | Escape | Body |
| Escape | Body | Body | error |
| | | | |
Transition diagram
Start (")-->End
Start (c)--> Body (")-->End
Start (\)--> Escape (") -->Body
Escape (\) -->Body
Escape <--(\) Body
Body (c)--> Body
Transition diagram