fperrad@OSDC.fr2009
SMC The State Machine Compiler (40 ’)
François Perrad
francois.perrad@gadz.org
SMC The State Machine Compiler (40 ) Franois Perrad - - PowerPoint PPT Presentation
SMC The State Machine Compiler (40 ) Franois Perrad francois.perrad@gadz.org fperrad@OSDC.fr2009 The State Machine Compiler Introduction Basic concepts Advanced concepts More features A case study : a Telephone
fperrad@OSDC.fr2009
francois.perrad@gadz.org
fperrad@OSDC.fr2009
Introduction Basic concepts Advanced concepts More features A case study : a Telephone Conclusion
fperrad@OSDC.fr2009
fperrad@OSDC.fr2009
Moore Mealy Grafcet UML = Harel statechart
fperrad@OSDC.fr2009
fperrad@OSDC.fr2009
Introduction Basic concepts Advanced concepts More features A case study : a Telephone Conclusion
fperrad@OSDC.fr2009
A input source .sm (yacc-like syntax) A output source (readable) in your
Currently 14 target languages :
An Object Oriented design :
A small RunTime Library
fperrad@OSDC.fr2009
// State Idle { // Trans Next State Actions Run Running {} }
fperrad@OSDC.fr2009
// State Idle { // Trans Next State Actions Timeout Idle {} }
fperrad@OSDC.fr2009
// State Idle { // Trans Next State Actions Timeout nil {} }
fperrad@OSDC.fr2009
// State Idle { // Trans Run // Next State Running // Actions { StopTimer("Idle"); DoWork(); } }
fperrad@OSDC.fr2009
// State Idle { // Trans Run // Guard condition [ctxt.isValid()] // Next State Running // Actions { StopTimer("Idle"); DoWork(); } Run Idle { RejectRequest(); } }
fperrad@OSDC.fr2009
// State Idle { // Transition Run(msg: const Message&) // Guard condition [msg.isValid()] // Next State Running // Actions { StopTimer("Idle"); DoWork(msg); } Run(msg: const Message&) // Next State Actions Idle { RejectRequest(msg); } }
fperrad@OSDC.fr2009
// State Idle Entry { StartTimer("Idle", 1); CheckQueue(); } Exit { StopTimer("Idle"); } { // Transitions }
fperrad@OSDC.fr2009
Introduction Basic concepts Advanced concepts More features A case study : a Telephone Conclusion
fperrad@OSDC.fr2009
Map : state container
only one level (multiple with UML)
Push/Pop
with stack context see UML History
Default state
factorisation of common behavior
No concurrency (ie //)
fperrad@OSDC.fr2009
fperrad@OSDC.fr2009
Introduction Basic concepts Advanced concepts More features A case study : a Telephone Conclusion
fperrad@OSDC.fr2009
fperrad@OSDC.fr2009
fperrad@OSDC.fr2009
Introduction Basic concepts Advanced concepts More Features A case study : a Telephone Conclusion
fperrad@OSDC.fr2009
Go to the WEB Play with the demo (Applet Java)
fperrad@OSDC.fr2009
Introduction Basic concepts Advanced concepts More Features A case study : NSquare Conclusion
fperrad@OSDC.fr2009
fperrad@OSDC.fr2009