Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can use Brzozowski's derivatives of regular expressions[1] to lazily get a state machine from a RE. I made a simple FSM using a trampoline function[2] to imitate a kind of table-drive GOTO design.[3]

[1] "Derivatives of Regular Expressions", Janusz A. Brzozowski https://dl.acm.org/doi/10.1145/321239.321249

[2] https://en.wikipedia.org/wiki/Trampoline_(computing)#High-le...

[3] http://joypy.osdn.io/notebooks/Derivatives_of_Regular_Expres...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: