38 #ifndef EXECUTION_STATE_PARSER_HPP 39 #define EXECUTION_STATE_PARSER_HPP 45 #include <boost/function.hpp> 46 #include <boost/shared_ptr.hpp> 47 #include "../internal/DataSource.hpp" 48 namespace RTT {
namespace scripting
68 boost::shared_ptr<StateMachineService> curobject ;
75 typedef boost::shared_ptr<ParsedStateMachine> ParsedStateMachinePtr;
76 typedef std::map<std::string, ParsedStateMachinePtr> machinenamemap_t;
77 typedef std::map<std::string, base::AttributeBase*> machineparams_t;
78 typedef std::map<std::string, base::DataSourceBase::shared_ptr> machineparamvalues_t;
79 typedef std::map<std::string, StateDescription*> machinestatesmap_t;
80 typedef std::map<std::string, StateMachineBuilder*> machinebuilders_t;
82 machinenamemap_t rootmachines;
83 machinebuilders_t machinebuilders;
84 ParsedStateMachinePtr curtemplate;
85 std::vector<base::ActionInterface*> paraminitcommands;
86 std::vector<base::ActionInterface*> varinitcommands;
87 ParsedStateMachinePtr curinstantiatedmachine;
89 std::string curinstmachinename;
90 machineparamvalues_t curinstmachineparams;
91 std::string curmachineinstargumentname;
92 std::string curmachinename;
93 bool curinitialstateflag;
94 bool curfinalstateflag;
98 boost::shared_ptr<ProgramInterface> transProgram;
100 boost::shared_ptr<ProgramInterface> elseProgram;
103 std::string curscvcmachinename;
104 std::string curscvcparamname;
112 unsigned int selectln;
114 std::vector<base::DataSourceBase::shared_ptr> evargs;
116 std::map<std::string,ConditionCache*> cur_port_events;
117 std::map<std::string,ConditionCache*> global_port_events;
122 rule_t rootmachineinstantiation;
124 rule_t machineinstantiation;
125 rule_t statemachinecontent;
149 rule_t machineinstarguments;
150 rule_t machineinstargument;
156 rule_t subMachinevarchange;
167 void seeninitialstate();
168 void seenfinalstate();
172 void inprogram(
const std::string& name );
177 boost::shared_ptr<ProgramInterface> finishProgram();
179 void seencondition();
180 void seenendcondition();
181 void seentransprog();
186 void doselect(
const std::string& name);
187 void seenprecondition();
189 void seeneventtrans();
190 void seeneventargs();
194 void startrootmachineinstantiation();
195 void seenrootmachineinstantiation();
196 void seenstatemachineend();
197 void seensubMachineinstantiation();
199 void inpreconditions();
200 void seenpreconditions();
204 void seenmachineinstantiation();
205 void seenmachineinstargumentname(
iter_t begin,
iter_t end );
206 void seenmachineinstargumentvalue();
208 void seenmachinevariable();
209 void seenmachineparam();
212 void seenscvcsubMachinename(
iter_t begin,
iter_t end );
This is not a parser in the Boost.spirit sense of the word, it's just a class used to hold the parser...
This interface represents the concept of a condition which can be evaluated and return true or false...
This class represents a state with all actions stored in an external program.
StateGraphParser(iter_t &positer, TaskContext *tc, ExecutionEngine *caller, CommonParser *cp)
A Parser for Orocos Program Scripts.
This is a parser that you construct to parse a set of arguments.
This class contains some very common parser definitions.
void storeOffset()
Stores the current position in the input stream (iterator received from the constructor) in order to ...
An execution engine serialises (executes one after the other) the execution of all commands...
How we parse: this parser works like a stack-based RPN calculator.
position_iterator< our_iterator_t > our_pos_iter_t
ParsedStateMachinePtr getParserResult()
Returns the last state machine instantiation of parser() or null if no instantiations were seen...
boost::shared_ptr< Service > ServicePtr
Get the peer and object from an invocation path like a.b.c.d() .
This class is responsible for parsing constant definitions, variable definitions, variable change ins...
The TaskContext is the C++ representation of an Orocos component.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
rule_t & parser()
Returns the top-level parser for state machines.
This is a class containing a parse function for conditions.
std::vector< ParsedStateMachinePtr > parse(iter_t &begin, iter_t end)