Next | Tricks of the Wizards | 179 |
%machine = ( START => { DEFAULT=> [ \&say_hello, MAIN, ], }, MAIN => { group => [ \&cmd_group, MAIN], quit => [ \&cmd_quit, MAIN], post => [ \&cmd_post, HEADER], ... }, HEADER =>{ BLANK => [ \&article_save_header, BODY], DOT => [ undef, ARTICLE_FINISH ], DEFAULT=> [ \&store_line, HEADER ], ... );
Associated with each state is a transition table
Keys in transition table represent input conditions
Next | Copyright © 2003 M. J. Dominus |