say i wanted to match a string to a regular expression, but i was only
given the string one character at a time.
one way to do this would be to evaluate the most recently submitted
character along with every previously submitted character, however,
that way seems like it would be unnecessarily inefficient.
another way i can see of doing this would be to have a function that
can access the previous state and return the state that the new
character would put it in. this state could then be tested to see if
it was an accept state, and if it was, it'd accept.
the later method - the one that returns the current state - is the one
i want to use. however, i'm not really sure how to go about doing it.
any ideas?
is there some library or package that includes this functionality, or
will i have to implement it, myself?