I would recommend making your design as data-driven as possible; to describe your FSM in data as much as possible.
I implemented a DFA as a two-dimensional table of states and next-states and made a simple iterative motor that read input and changed states according to this table.
This is what the table looked like (fasm):
dfa_chars db '=','<','>','!','/',',','*','(',')','{','}','+','-',' ',';',TAB, CR, LF; N, A
dfa db $07,$04,$05,$06,$0a,$10,$11,$12,$13,$14,$15,$16,$17,$00,$18,$00,$0b,$1d,$08,$09; 0 WS
db $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$0b,$1d,$01,$01; 1 //
db $02,$02,$02,$02,$02,$02,$03,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02; 2 /*
db $02,$02,$02,$02,$1d,$02,$03,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02; 3 /**
db $19,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20,$20; 4 <
db $1a,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21,$21; 5 >
db $1b,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22,$22; 6 !
db $1c,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23,$23; 7 =
db $24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$24,$08,$24; 8 N
db $25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$25,$09,$09; 9 A+N
db $26,$26,$26,$26,$01,$26,$02,$26,$26,$26,$26,$26,$26,$26,$26,$26,$26,$26,$26,$26; a /
db $27,$27,$27,$27,$27,$27,$27,$27,$27,$27,$27,$27,$27,$27,$27,$27,$27,$1d,$27,$27; b CR