I want to write a lexical parser for regular text. So i need to detect following tokens:
1) Word 2) Number 3) dot and other punctuation 4) "..." "!?" "!!!" and so on
I think that is not trivial to write "if else" condition for each item. So is there any finite state machine generators for c#? I know ANTLR and other but while i will try to learn how to work with these tools i can write my own "ifelse" FSM.
i hope to found something like:
FiniteStateMachine.AddTokenDefinition(":)","smile");
FiniteStateMachine.AddTokenDefinition(".","dot");
FiniteStateMachine.ParseText(text);