Man!! do you know what are you trying to do?? if you go for automata programs then you would not be far from building a compiler...