Reputation: 159
I am in compilers class and the professor just threw at us how to convert regex to nfa's without any method or rules. Is there a methodical way to approach the problem? I find it hard to deal with why all the epsilons exist and how do i construct an nfa given regex. Thank you for any help.
Upvotes: 1
Views: 677
Reputation: 4954
You could use a Thompson NFA. See the article by Russ Cox. It is made in the C language.
Upvotes: 1