The State Machine Compiler

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    The State Machine Compiler - Presentation Transcript

    1. SMC The State Machine Compiler (40 ’) François Perrad francois.perrad@gadz.org fperrad@OSDC.fr2009
    2. The State Machine Compiler  Introduction  Basic concepts  Advanced concepts  More features  A case study : a Telephone  Conclusion fperrad@OSDC.fr2009
    3. FSM are everywhere  FSM : Finite State Machine  Not a new technology  Strong theorical base  Reactive systems / Transformational systems  Event driven  Applications :  Telephones, automobiles, communication networks, avionic systems, man-machine interface fperrad@OSDC.fr2009
    4. FSM graphical view  Moore  Mealy  Grafcet  UML = Harel statechart fperrad@OSDC.fr2009
    5. A SourceForge project  Some facts :  registered in 2000  ~500 downloads / month  ~100 bugs (closed)  written in Java  mature codebase  well documented  3 developers  Licence MPL  See : http://www.ohloh.net/projects/7339?p=SMC fperrad@OSDC.fr2009
    6. The State Machine Compiler  Introduction  Basic concepts  Advanced concepts  More features  A case study : a Telephone  Conclusion fperrad@OSDC.fr2009
    7. A Compiler  A input source .sm (yacc-like syntax)  A output source (readable) in your language  Currently 14 target languages :  C, C++, C#, Groovy, Java, Lua, Objective-C, Perl, PHP, Python, Ruby, Scala, Tcl and VB.net  An Object Oriented design :  your class has a member which is the FSM generated class  A small RunTime Library  Parser & Lexer of SMC are written with SMC  The root of SMC is ATN (Augmented Transition Network)  Robert C. Martin (uncle bob) is the author of the initial SMC implementation fperrad@OSDC.fr2009
    8. A Simple Transition // State  Idle { // Trans  Next State Actions  Run  Running  {}  }  fperrad@OSDC.fr2009
    9. A Reflexive Transition // State  Idle {  // Trans  Next State  Actions  Timeout  Idle  {}  }  fperrad@OSDC.fr2009
    10. A Internal Event // State Idle {  // Trans  Next State  Actions  Timeout  nil  {}  }  fperrad@OSDC.fr2009
    11. A Transition with Actions // State  Idle  {  // Trans  Run  // Next State  Running  // Actions  {      StopTimer("Idle");      DoWork();  }  }  fperrad@OSDC.fr2009
    12. Transition Guards // State  Idle  {      // Trans      Run  // Guard condition  [ctxt.isValid()]  // Next State  Running  // Actions  {      StopTimer("Idle");      DoWork();  }      Run  Idle  { RejectRequest(); }  }  fperrad@OSDC.fr2009
    13. Transition Arguments // 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
    14. Entry and Exit Actions // State  Idle  Entry { StartTimer("Idle", 1); CheckQueue(); }  Exit { StopTimer("Idle"); }  {  // Transitions  }  fperrad@OSDC.fr2009
    15. the State Machine Compiler  Introduction  Basic concepts  Advanced concepts  More features  A case study : a Telephone  Conclusion fperrad@OSDC.fr2009
    16. Advanced Features  Map : state container  only one level (multiple with UML)  Push/Pop  with stack context  see UML History  Default state  factorisation of common behavior in a map  No concurrency (ie //) fperrad@OSDC.fr2009
    17. The Design Pattern fperrad@OSDC.fr2009
    18. the State Machine Compiler  Introduction  Basic concepts  Advanced concepts  More features  A case study : a Telephone  Conclusion fperrad@OSDC.fr2009
    19. More features  Event management is yours  Graphviz output generation  HTML table generation  Dynamic trace  Namespace support  Reflection/Introspection (for MMI) fperrad@OSDC.fr2009
    20. Graphviz output fperrad@OSDC.fr2009
    21. the State Machine Compiler  Introduction  Basic concepts  Advanced concepts  More Features  A case study : a Telephone  Conclusion fperrad@OSDC.fr2009
    22. A Telephone  Go to the WEB  Play with the demo (Applet Java) @ http://smc.sourceforge.net/SmcDemo.htm fperrad@OSDC.fr2009
    23. the State Machine Compiler  Introduction  Basic concepts  Advanced concepts  More Features  A case study : a Telephone  Conclusion fperrad@OSDC.fr2009
    24. all contributions welcomed  Eclipse plugin  Debian packaging  Pluggable language support  New target language  Regression test  … fperrad@OSDC.fr2009
    25. Bibliography / Webography - SMC : http://smc.sourceforge.net/ - Robert C. Martin, "Agile Software Development" - http://en.wikipedia.org/wiki/Finite_state_machine - http://en.wikipedia.org/wiki/Statechart - D. Harel, "Statecharts: A Visual Formalism for Complex Systems" - http://www.uml.org/ - http://fr.wikipedia.org/wiki/Grafcet - NF C03-190 - Diagramme fonctionnel "GRAFCET" - http://en.wikipedia.org/wiki/Augmented_transition_network fperrad@OSDC.fr2009

    + François PerradFrançois Perrad, 1 month ago

    custom

    252 views, 0 favs, 0 embeds more stats

    SMC takes a state machine stored in a .sm file and more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 252
      • 252 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 2
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories