avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] C++ compile-time FSM generator?


From: Bob Paddock
Subject: [avr-libc-dev] C++ compile-time FSM generator?
Date: Sat, 29 May 2004 06:23:17 -0400
User-agent: KMail/1.6.2

> As written the PSTR macro doesn't work when used in C++ modules.

Is enought of the AVR C++ functioning that it could do this?:

  Example: a compile-time FSM generator
... Below we present a simple state machine generator that has been 
implemented using Boost Metaprogramming Library facilities. 

http://www.boost.org/libs/mpl/doc/paper/html/example.html

This is the input "language", the output being C++ State Machine.

typedef mpl::list<
      transition<stopped, play_event,  playing, &player::do_play>
    , transition<playing, stop_event,  stopped, &player::do_stop>
    , transition<playing, pause_event, paused,  &player::do_pause>
    , transition<paused,  play_event,  playing, &player::do_resume>
    , transition<paused,  stop_event,  stopped, &player::do_stop>
    >::type transition_table;



-- 
                    http://www.softwaresafety.net/
       http://www.unusualresearch.com/ http://www.bpaddock.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]