Re: I need help building a data structure for a state diagram

2009-05-25 Thread Paul McGuire
On May 24, 1:16 pm, Matthew Wilson m...@tplus1.com wrote: I'm working on a really simple workflow for my bug tracker.  I want filed bugs to start in an UNSTARTED status.  From there, they can go to STARTED. I just wrote an article for the April issue of Python Magazine on how to add embedded

I need help building a data structure for a state diagram

2009-05-24 Thread Matthew Wilson
I'm working on a really simple workflow for my bug tracker. I want filed bugs to start in an UNSTARTED status. From there, they can go to STARTED. From STARTED, bugs can go to FINISHED or ABANDONED. I know I can easily hard-code this stuff into some if-clauses, but I expect to need to add a

Re: I need help building a data structure for a state diagram

2009-05-24 Thread Tim Chase
I'm working on a really simple workflow for my bug tracker. I want filed bugs to start in an UNSTARTED status. From there, they can go to STARTED. From STARTED, bugs can go to FINISHED or ABANDONED. I know I can easily hard-code this stuff into some if-clauses, but I expect to need to add a

Re: I need help building a data structure for a state diagram

2009-05-24 Thread Kay Schluehr
On 24 Mai, 20:16, Matthew Wilson m...@tplus1.com wrote: I'm working on a really simple workflow for my bug tracker.  I want filed bugs to start in an UNSTARTED status.  From there, they can go to STARTED. From STARTED, bugs can go to FINISHED or ABANDONED. I know I can easily hard-code this

Re: I need help building a data structure for a state diagram

2009-05-24 Thread Matthew Wilson
On Sun 24 May 2009 03:42:01 PM EDT, Kay Schluehr wrote: General answer: you can encode finite state machines as grammars. States as non-terminals and transition labels as terminals: UNSTARTED: 'start' STARTED STARTED: 'ok' FINISHED | 'cancel' ABANDONED ABANDONED: 'done' FINISHED: 'done'

Re: I need help building a data structure for a state diagram

2009-05-24 Thread Kay Schluehr
On 25 Mai, 01:46, Matthew Wilson m...@tplus1.com wrote: On Sun 24 May 2009 03:42:01 PM EDT, Kay Schluehr wrote: General answer: you can encode finite state machines as grammars. States as non-terminals and transition labels as terminals: UNSTARTED: 'start' STARTED STARTED: 'ok'