class Kleene::DFA

def matches_at_offset(input, input_start_offset)

Returns an array of matches found in the input string, each of which begins at the offset input_start_offset
def matches_at_offset(input, input_start_offset)
  reset_current_state
  matches = []
  (input_start_offset...input.size).each do |offset|
    token = input[offset]
    handle_token!(token, offset)
    if accept?
      matches << MatchRef.new(input, input_start_offset..offset)
    end
  end
  matches
end