RTT::scripting::StateGraphParser Class Reference

#include <StateGraphParser.hpp>

List of all members.

Public Member Functions

ParsedStateMachinePtr getParserResult ()
ParsedStateMachinePtr getParserResult ()
std::vector
< ParsedStateMachinePtr
parse (iter_t &begin, iter_t end)
std::vector
< ParsedStateMachinePtr
parse (iter_t &begin, iter_t end)
rule_tparser ()
rule_tparser ()
 StateGraphParser (iter_t &positer, TaskContext *tc, ExecutionEngine *caller, CommonParser *cp)
 StateGraphParser (iter_t &positer, TaskContext *tc, ExecutionEngine *caller, CommonParser *cp)
void storeOffset ()
void storeOffset ()
 ~StateGraphParser ()
 ~StateGraphParser ()

Private Types

typedef std::map< std::string,
StateMachineBuilder * > 
machinebuilders_t
typedef std::map< std::string,
StateMachineBuilder * > 
machinebuilders_t
typedef std::map< std::string,
ParsedStateMachinePtr
machinenamemap_t
typedef std::map< std::string,
ParsedStateMachinePtr
machinenamemap_t
typedef std::map< std::string,
base::AttributeBase * > 
machineparams_t
typedef std::map< std::string,
base::AttributeBase * > 
machineparams_t
typedef std::map< std::string,
base::DataSourceBase::shared_ptr
machineparamvalues_t
typedef std::map< std::string,
base::DataSourceBase::shared_ptr
machineparamvalues_t
typedef std::map< std::string,
StateDescription * > 
machinestatesmap_t
typedef std::map< std::string,
StateDescription * > 
machinestatesmap_t
typedef boost::shared_ptr
< ParsedStateMachine
ParsedStateMachinePtr
typedef boost::shared_ptr
< ParsedStateMachine
ParsedStateMachinePtr

Private Member Functions

void clear ()
void clear ()
void doselect (const std::string &name)
void doselect (const std::string &name)
boost::shared_ptr
< ProgramInterface
finishProgram ()
boost::shared_ptr
< ProgramInterface
finishProgram ()
void inpreconditions ()
void inpreconditions ()
void inprogram (const std::string &name)
void inprogram (const std::string &name)
void noselect ()
void noselect ()
void saveText (iter_t begin, iter_t end)
void saveText (iter_t begin, iter_t end)
void seencondition ()
void seencondition ()
void seenelse ()
void seenelse ()
void seenelseprog ()
void seenelseprog ()
void seenendcondition ()
void seenendcondition ()
void seenentry ()
void seenentry ()
void seeneventargs ()
void seeneventargs ()
void seeneventname (iter_t s, iter_t f)
void seeneventname (iter_t s, iter_t f)
void seeneventtrans ()
void seeneventtrans ()
void seenexit ()
void seenexit ()
void seenfinalstate ()
void seenfinalstate ()
void seenhandle ()
void seenhandle ()
void seeninitialstate ()
void seeninitialstate ()
void seeninstmachinename (iter_t begin, iter_t end)
void seeninstmachinename (iter_t begin, iter_t end)
void seenmachineinstantiation ()
void seenmachineinstantiation ()
void seenmachineinstargumentname (iter_t begin, iter_t end)
void seenmachineinstargumentname (iter_t begin, iter_t end)
void seenmachineinstargumentvalue ()
void seenmachineinstargumentvalue ()
void seenmachineparam ()
void seenmachineparam ()
void seenmachinetypename (iter_t begin, iter_t end)
void seenmachinetypename (iter_t begin, iter_t end)
void seenmachinevariable ()
void seenmachinevariable ()
void seenprecondition ()
void seenprecondition ()
void seenpreconditions ()
void seenpreconditions ()
void seenrootmachineinstantiation ()
void seenrootmachineinstantiation ()
void seenrun ()
void seenrun ()
void seenselect (iter_t s, iter_t f)
void seenselect (iter_t s, iter_t f)
void seenstateend ()
void seenstateend ()
void seenstatemachineend ()
void seenstatemachineend ()
void seenstatemachinename (iter_t begin, iter_t end)
void seenstatemachinename (iter_t begin, iter_t end)
void seensubMachineinstantiation ()
void seensubMachineinstantiation ()
void seentransprog ()
void seentransprog ()
void startrootmachineinstantiation ()
void startrootmachineinstantiation ()
void statedef (iter_t s, iter_t f)
void statedef (iter_t s, iter_t f)

Private Attributes

rule_t argslist
ArgumentsParserargsparser
rule_t body
ExecutionEnginecaller
CommonParsercommonparser
ConditionParserconditionparser
TaskContextcontext
std::map< std::string,
ConditionCache * > 
cur_port_events
ConditionInterfacecurcondition
bool curfinalstateflag
bool curinitialstateflag
ParsedStateMachinePtr curinstantiatedmachine
std::string curinstmachinename
machineparamvalues_t curinstmachineparams
StateMachineBuildercurmachinebuilder
std::string curmachineinstargumentname
std::string curmachinename
StateDescriptioncurnonprecstate
boost::shared_ptr
< StateMachineService
curobject
StateDescriptioncurstate
ParsedStateMachinePtr curtemplate
rule_t elsebranch
boost::shared_ptr
< ProgramInterface
elseProgram
StateDescriptionelsestate
rule_t entry
std::vector
< base::DataSourceBase::shared_ptr
evargs
 store line number of select's 'if' statement.
rule_t eventline
std::string evname
rule_t exit
ExpressionParserexpressionparser
std::map< std::string,
ConditionCache * > 
global_port_events
rule_t handle
rule_t ifbranch
bool isroot
int ln_offset
rule_t machinealias
machinebuilders_t machinebuilders
rule_t machineconstant
rule_t machineinstantiation
rule_t machineinstargument
rule_t machineinstarguments
rule_t machinememvar
rule_t machineparam
rule_t machinevariable
our_pos_iter_tmpositer
rule_t newline
std::vector
< base::ActionInterface * > 
paraminitcommands
ServicePtr peer
PeerParserpeerparser
rule_t precondition
rule_t preconditions
rule_t production
ProgramGraphParserprogParser
rule_t program
rule_t programBody
rule_t progselect
int rank
rule_t rootmachineinstantiation
machinenamemap_t rootmachines
rule_t run
our_pos_iter_t saveStartPos
unsigned int selectln
 are we instantiating a rootmachine ?
rule_t selector
rule_t state
rule_t statecontent
rule_t statecontentline
rule_t statemachine
rule_t statemachinecontent
rule_t subMachinedecl
rule_t subMachinevarchange
rule_t transition
rule_t transitions
rule_t transline
boost::shared_ptr
< ProgramInterface
transProgram
ValueChangeParservaluechangeparser
rule_t vardec
std::vector
< base::ActionInterface * > 
varinitcommands
rule_t varline

Detailed Description

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 install/include/rtt/scripting/StateGraphParser.hpp.


Member Typedef Documentation

Definition at line 80 of file rtt/scripting/StateGraphParser.hpp.

Definition at line 76 of file rtt/scripting/StateGraphParser.hpp.

Definition at line 77 of file rtt/scripting/StateGraphParser.hpp.

Definition at line 78 of file rtt/scripting/StateGraphParser.hpp.

Definition at line 79 of file rtt/scripting/StateGraphParser.hpp.

Definition at line 75 of file rtt/scripting/StateGraphParser.hpp.


Constructor & Destructor Documentation

RTT::StateGraphParser::StateGraphParser ( iter_t positer,
TaskContext tc,
ExecutionEngine caller,
CommonParser cp 
)

peerparser->parser() >>

Definition at line 87 of file StateGraphParser.cpp.

RTT::StateGraphParser::~StateGraphParser (  ) 

Definition at line 767 of file StateGraphParser.cpp.

RTT::scripting::StateGraphParser::StateGraphParser ( iter_t positer,
TaskContext tc,
ExecutionEngine caller,
CommonParser cp 
)
RTT::scripting::StateGraphParser::~StateGraphParser (  ) 

Member Function Documentation

void RTT::scripting::StateGraphParser::clear (  )  [private]
void RTT::StateGraphParser::clear (  )  [private]

Definition at line 775 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::doselect ( const std::string &  name  )  [private]
void RTT::StateGraphParser::doselect ( const std::string &  name  )  [private]

Definition at line 498 of file StateGraphParser.cpp.

boost::shared_ptr<ProgramInterface> RTT::scripting::StateGraphParser::finishProgram (  )  [private]
ProgramInterfacePtr RTT::StateGraphParser::finishProgram (  )  [private]

Definition at line 386 of file StateGraphParser.cpp.

ParsedStateMachinePtr RTT::scripting::StateGraphParser::getParserResult (  ) 

Returns the last state machine instantiation of parser() or null if no instantiations were seen.

ParsedStateMachinePtr RTT::StateGraphParser::getParserResult (  ) 

Returns the last state machine instantiation of parser() or null if no instantiations were seen.

Definition at line 307 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::inpreconditions (  )  [private]
void RTT::StateGraphParser::inpreconditions (  )  [private]

Definition at line 872 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::inprogram ( const std::string &  name  )  [private]
void RTT::StateGraphParser::inprogram ( const std::string &  name  )  [private]

Definition at line 374 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::noselect (  )  [private]
void RTT::StateGraphParser::noselect (  )  [private]

Definition at line 483 of file StateGraphParser.cpp.

std::vector<ParsedStateMachinePtr> RTT::scripting::StateGraphParser::parse ( iter_t begin,
iter_t  end 
)
std::vector< ParsedStateMachinePtr > RTT::StateGraphParser::parse ( iter_t begin,
iter_t  end 
)

Definition at line 704 of file StateGraphParser.cpp.

rule_t& RTT::scripting::StateGraphParser::parser (  ) 

Returns the top-level parser for state machines. It parses one state machine definition or one state machine instantiation.

See also:
storeOffset()
rule_t & RTT::StateGraphParser::parser (  ) 

Returns the top-level parser for state machines. It parses one state machine definition or one state machine instantiation.

See also:
storeOffset()

Definition at line 303 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::saveText ( iter_t  begin,
iter_t  end 
) [private]
void RTT::StateGraphParser::saveText ( iter_t  begin,
iter_t  end 
) [private]

Definition at line 862 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seencondition (  )  [private]
void RTT::StateGraphParser::seencondition (  )  [private]

Definition at line 437 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenelse (  )  [private]
void RTT::StateGraphParser::seenelse (  )  [private]

Definition at line 431 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenelseprog (  )  [private]
void RTT::StateGraphParser::seenelseprog (  )  [private]

Definition at line 424 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenendcondition (  )  [private]
void RTT::StateGraphParser::seenendcondition (  )  [private]

Definition at line 604 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenentry (  )  [private]
void RTT::StateGraphParser::seenentry (  )  [private]

Definition at line 391 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seeneventargs (  )  [private]
void RTT::StateGraphParser::seeneventargs (  )  [private]

Definition at line 476 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seeneventname ( iter_t  s,
iter_t  f 
) [private]
void RTT::StateGraphParser::seeneventname ( iter_t  s,
iter_t  f 
) [private]

Definition at line 446 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seeneventtrans (  )  [private]
void RTT::StateGraphParser::seeneventtrans (  )  [private]

Definition at line 611 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenexit (  )  [private]
void RTT::StateGraphParser::seenexit (  )  [private]

Definition at line 398 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenfinalstate (  )  [private]
void RTT::StateGraphParser::seenfinalstate (  )  [private]

Definition at line 322 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenhandle (  )  [private]
void RTT::StateGraphParser::seenhandle (  )  [private]

Definition at line 405 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seeninitialstate (  )  [private]
void RTT::StateGraphParser::seeninitialstate (  )  [private]

Definition at line 317 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seeninstmachinename ( iter_t  begin,
iter_t  end 
) [private]
void RTT::StateGraphParser::seeninstmachinename ( iter_t  begin,
iter_t  end 
) [private]

Definition at line 949 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenmachineinstantiation (  )  [private]
void RTT::StateGraphParser::seenmachineinstantiation (  )  [private]

Definition at line 973 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenmachineinstargumentname ( iter_t  begin,
iter_t  end 
) [private]
void RTT::StateGraphParser::seenmachineinstargumentname ( iter_t  begin,
iter_t  end 
) [private]

Definition at line 955 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenmachineinstargumentvalue (  )  [private]
void RTT::StateGraphParser::seenmachineinstargumentvalue (  )  [private]

Definition at line 961 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenmachineparam (  )  [private]
void RTT::StateGraphParser::seenmachineparam (  )  [private]

Definition at line 1051 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenmachinetypename ( iter_t  begin,
iter_t  end 
) [private]
void RTT::StateGraphParser::seenmachinetypename ( iter_t  begin,
iter_t  end 
) [private]

Definition at line 940 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenmachinevariable (  )  [private]
void RTT::StateGraphParser::seenmachinevariable (  )  [private]

Definition at line 1043 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenprecondition (  )  [private]
void RTT::StateGraphParser::seenprecondition (  )  [private]

Definition at line 617 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenpreconditions (  )  [private]
void RTT::StateGraphParser::seenpreconditions (  )  [private]

Definition at line 880 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenrootmachineinstantiation (  )  [private]
void RTT::StateGraphParser::seenrootmachineinstantiation (  )  [private]

Definition at line 891 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenrun (  )  [private]
void RTT::StateGraphParser::seenrun (  )  [private]

Definition at line 412 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenselect ( iter_t  s,
iter_t  f 
) [private]
void RTT::StateGraphParser::seenselect ( iter_t  s,
iter_t  f 
) [private]

Definition at line 492 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenstateend (  )  [private]
void RTT::StateGraphParser::seenstateend (  )  [private]

Definition at line 350 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenstatemachineend (  )  [private]
void RTT::StateGraphParser::seenstatemachineend (  )  [private]

Definition at line 631 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seenstatemachinename ( iter_t  begin,
iter_t  end 
) [private]
void RTT::StateGraphParser::seenstatemachinename ( iter_t  begin,
iter_t  end 
) [private]

Definition at line 831 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seensubMachineinstantiation (  )  [private]
void RTT::StateGraphParser::seensubMachineinstantiation (  )  [private]

Definition at line 913 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::seentransprog (  )  [private]
void RTT::StateGraphParser::seentransprog (  )  [private]

Definition at line 419 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::startrootmachineinstantiation (  )  [private]
void RTT::StateGraphParser::startrootmachineinstantiation (  )  [private]

Definition at line 887 of file StateGraphParser.cpp.

void RTT::scripting::StateGraphParser::statedef ( iter_t  s,
iter_t  f 
) [private]
void RTT::StateGraphParser::statedef ( iter_t  s,
iter_t  f 
) [private]

Definition at line 327 of file StateGraphParser.cpp.

void RTT::scripting::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().

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 854 of file StateGraphParser.cpp.


Member Data Documentation

store line number of select's 'if' statement.

Definition at line 114 of file install/include/rtt/scripting/StateGraphParser.hpp.

used to sort conditions as they are generated and inserted in the StateMachine.

Definition at line 110 of file install/include/rtt/scripting/StateGraphParser.hpp.

are we instantiating a rootmachine ?

Definition at line 112 of file install/include/rtt/scripting/StateGraphParser.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:50:16 2013