added source codes for finite automata extension