#include "uscxml/Interpreter.h"
#include "glog/logging.h"
using namespace uscxml;
int main(int argc, char** argv) {
google::LogToStderr();
google::InitGoogleLogging(argv[0]);
const char* scxmlContent =
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" "
" ";
std::string msg;
uscxml::Interpreter scxml = uscxml::Interpreter(uscxml::Interpreter::fromXML(scxmlContent, ""));
std::list issues = scxml.validate();
for (std::list::iterator issueIter = issues.begin(); issueIter != issues.end(); issueIter++) {
std::cout << *issueIter;
}
scxml.addMonitor(new StateTransitionMonitor());
uscxml::InterpreterState state;
// assume initial stable configuration
do {
state = scxml.step();
} while(state > 0);
scxml.receive(Event("move_here"));
scxml.receive(Event("inside_invoke"));
while(state != uscxml::USCXML_FINISHED) {
do {
state = scxml.step(true);
} while(state > 0);
}
std::cout << "************************************" << std::endl;
std::cout << "Successfully finished state machine!" << std::endl;
return EXIT_SUCCESS;
}