GetTransition Returns ending state for transition σ(fromState,overChar), '-1' if there is none.
(fromState int, overChar uint8, at map[int]map[uint8]int)
| 119 | |
| 120 | // GetTransition Returns ending state for transition σ(fromState,overChar), '-1' if there is none. |
| 121 | func GetTransition(fromState int, overChar uint8, at map[int]map[uint8]int) (toState int) { |
| 122 | if !StateExists(fromState, at) { |
| 123 | return -1 |
| 124 | } |
| 125 | toState, ok := at[fromState][overChar] |
| 126 | if !ok { |
| 127 | return -1 |
| 128 | } |
| 129 | return toState |
| 130 | } |
| 131 | |
| 132 | // StateExists Checks if state 'state' exists. Returns 'true' if it does, 'false' otherwise. |
| 133 | func StateExists(state int, at map[int]map[uint8]int) bool { |
no test coverage detected