A finite state machine with no cycles.
FIXME - document this. currently it's only used in nomacs.py.
Methods
|
|
__init__ add apply reset state
|
|
__init__
|
__init__ ( self )
|
|
add
|
add (
self,
s,
v,
)
Add a string pattern and a value to return if that pattern is
matched. |
|
apply
|
apply ( self, tok )
If applying tok results in an acceptance, return the accept
value. If rejected, raise a ValueError. Else return None
(internal state is preserved across multiple calls to apply). |
|
reset
|
reset ( self )
Move the state machine back into the start state. |
|
state
|
state ( self )
Returns the current state of the state machine. |
|