GetParent Function that finds the first previous state of a state and returns it. Used for trie where there is only one parent.
(state int, at map[int]map[uint8]int)
| 97 | // GetParent Function that finds the first previous state of a state and returns it. |
| 98 | // Used for trie where there is only one parent. |
| 99 | func GetParent(state int, at map[int]map[uint8]int) (uint8, int) { |
| 100 | for beginState, transitions := range at { |
| 101 | for c, endState := range transitions { |
| 102 | if endState == state { |
| 103 | return c, beginState |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | return 0, 0 //unreachable |
| 108 | } |
| 109 | |
| 110 | // CreateNewState Automaton function for creating a new state 'state'. |
| 111 | func CreateNewState(state int, at map[int]map[uint8]int) { |
no outgoing calls
no test coverage detected