Orocos Real-Time Toolkit
2.8.3
|
This is not a parser in the Boost.spirit sense of the word, it's just a class used to hold the parser and semantic actions. More...
#include <rtt/scripting/StateGraphParser.hpp>
Public Member Functions | |
StateGraphParser (iter_t &positer, TaskContext *tc, ExecutionEngine *caller, CommonParser *cp) | |
~StateGraphParser () | |
std::vector< ParsedStateMachinePtr > | parse (iter_t &begin, iter_t end) |
rule_t & | parser () |
Returns the top-level parser for state machines. More... | |
ParsedStateMachinePtr | getParserResult () |
Returns the last state machine instantiation of parser() or null if no instantiations were seen. More... | |
void | storeOffset () |
Stores the current position in the input stream (iterator received from the constructor) in order to be able to extract the statemachine's text from the input stream. More... | |
This is not a parser in the Boost.spirit sense of the word, it's just a class used to hold the parser and semantic actions.
This class does the actual work. It generates a Finite State Graph, by constructing the State nodes. We just go over the code one single time, and construct the FSM as we go. For every statement, we construct a new GraphNode, and fill it up as we get the information we need.
Definition at line 61 of file StateGraphParser.hpp.
RTT::StateGraphParser::StateGraphParser | ( | iter_t & | positer, |
TaskContext * | tc, | ||
ExecutionEngine * | caller, | ||
CommonParser * | cp | ||
) |
Definition at line 101 of file StateGraphParser.cpp.
References RTT::scripting::ValueChangeParser::aliasDefinitionParser(), RTT::scripting::ValueChangeParser::constantDefinitionParser(), RTT::scripting::CommonParser::eos, RTT::scripting::CommonParser::identifier, keyword_p, RTT::scripting::ValueChangeParser::paramDefinitionParser(), RTT::scripting::ConditionParser::parser(), RTT::scripting::PeerParser::parser(), RTT::scripting::ExpressionParser::parser(), RTT::scripting::CommonParser::skipeol, storeOffset(), and RTT::scripting::ValueChangeParser::variableDefinitionParser().
RTT::StateGraphParser::~StateGraphParser | ( | ) |
Definition at line 786 of file StateGraphParser.cpp.
References RTT::scripting::ParsedStateMachine::getService(), ORO_THROW, RTT::TaskContext::provides(), RTT::scripting::ValueChangeParser::reset(), and RTT::scripting::CommonParser::skipeol.
ParsedStateMachinePtr RTT::StateGraphParser::getParserResult | ( | ) |
Returns the last state machine instantiation of parser() or null if no instantiations were seen.
Definition at line 321 of file StateGraphParser.cpp.
References RTT::scripting::CommandComposite::add(), RTT::scripting::ProgramGraphParser::bodyParser(), RTT::scripting::ProgramGraphParser::bodyParserResult(), RTT::scripting::ConditionInterface::clone(), RTT::base::TaskCore::engine(), RTT::wrong_types_of_args_exception::expected_, RTT::scripting::StateDescription::getEntryProgram(), RTT::scripting::StateDescription::getExitProgram(), RTT::scripting::StateDescription::getHandleProgram(), RTT::scripting::StateDescription::getName(), RTT::scripting::ConditionParser::getParseResult(), RTT::scripting::StateDescription::getRunProgram(), RTT::scripting::ParsedStateMachine::getService(), RTT::scripting::ProgramGraphParser::initBodyParser(), RTT::scripting::StateDescription::isDefined(), RTT::NewData, ORO_THROW, RTT::scripting::ArgumentsParser::parser(), RTT::TaskContext::provides(), RTT::wrong_number_of_args_exception::received, RTT::wrong_types_of_args_exception::received_, RTT::scripting::ConditionParser::reset(), RTT::scripting::PeerParser::reset(), RTT::scripting::ValueChangeParser::reset(), RTT::scripting::ArgumentsParser::result(), RTT::scripting::StateDescription::setDefined(), RTT::scripting::StateDescription::setEntryPoint(), RTT::scripting::StateDescription::setEntryProgram(), RTT::scripting::StateDescription::setExitProgram(), RTT::scripting::StateDescription::setHandleProgram(), RTT::scripting::StateDescription::setRunProgram(), RTT::scripting::ValueChangeParser::store(), RTT::scripting::PeerParser::taskObject(), RTT::internal::values(), RTT::wrong_number_of_args_exception::wanted, and RTT::wrong_types_of_args_exception::whicharg.
Referenced by RTT::scripting::ScriptParser::ScriptParser().
Definition at line 722 of file StateGraphParser.cpp.
References RTT::parse_exception::copy(), RTT::scripting::CommonParser::skipper, storeOffset(), and RTT::internal::values().
Referenced by RTT::scripting::Parser::parseStateMachine().
rule_t & RTT::StateGraphParser::parser | ( | ) |
Returns the top-level parser for state machines.
It parses one state machine definition or one state machine instantiation.
Definition at line 317 of file StateGraphParser.cpp.
Referenced by RTT::scripting::ScriptParser::ScriptParser().
void RTT::StateGraphParser::storeOffset | ( | ) |
Stores the current position in the input stream (iterator received from the constructor) in order to be able to extract the statemachine's text from the input stream.
You need to call this function once before using the parser().
Definition at line 873 of file StateGraphParser.cpp.
References RTT::scripting::CommandComposite::add(), RTT::scripting::ValueChangeParser::assignCommands(), RTT::scripting::StateMachineBuilder::build(), RTT::scripting::ValueChangeParser::clear(), RTT::scripting::ValueChangeParser::definedNames(), RTT::scripting::ValueChangeParser::definedValues(), RTT::scripting::ExpressionParser::dropResult(), RTT::TaskContext::getName(), RTT::scripting::StateMachine::getName(), RTT::scripting::ExpressionParser::getResult(), ORO_THROW, RTT::scripting::StateDescription::postponeState(), RTT::TaskContext::provides(), and RTT::scripting::StateDescription::setDefined().
Referenced by RTT::scripting::ScriptParser::parse(), parse(), RTT::scripting::ScriptParser::ScriptParser(), and StateGraphParser().