jakesgordon / javascript-state-machine

A javascript finite state machine library
MIT License
8.69k stars 964 forks source link

Create a state machine from a string (e.g, regular expression) #189

Open pleger opened 4 years ago

pleger commented 4 years ago

Hi, In the first place, your work is amazing (in particular, visualization).

I am wondering if it is possible to create the state machine from a string, eg.

let myFSM = new StateMachine("(a|b) -> (c)+");

where the second state is (a|b) and the events a or b are required to reach this state.

Thanks a lot, Paul