how to build simple FSM using generators ?

Discussion in 'Python' started by Joh, Sep 8, 2004.

  1. Joh

    Joh Guest

    hello,

    i've readed "Charming Python: Generator-based state machines"
    www-106.ibm.com/developerworks/ linux/library/l-pygen.html , but i
    still can not get the point on how using generator for FSM

    i'm interested in a very simple FSM which would be able to recognize
    consecutive sequence of texts, please can someone give me a hint on
    how to do this using yield ?

    by now, my fsm is something like, having a "previous state", iterating
    in a while 1 loop, advancing "previous state" to recognized word and
    if len(recognized all words) is matched then a sequence had been
    recognized, whatever else re-init FSM ;
    but can not understand how could yield help me...

    thx.
     
    Joh, Sep 8, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    24
    Views:
    1,000
    Mike Treseler
    Jul 29, 2005
  2. Joh
    Replies:
    2
    Views:
    372
  3. Replies:
    2
    Views:
    671
    Martin Thompson
    Jun 27, 2007
  4. Eric des Courtis
    Replies:
    10
    Views:
    1,656
    Lowell Gilbert
    Mar 11, 2008
  5. Replies:
    7
    Views:
    200
    Ian Kelly
    Sep 12, 2012
Loading...

Share This Page