36 #include "../Logger.hpp" 47 #include "../TaskContext.hpp" 48 #include "../internal/GlobalService.hpp" 51 #include <boost/bind.hpp> 52 #include <boost/lambda/lambda.hpp> 56 #pragma optimize( "", off) 62 using namespace boost;
63 using namespace detail;
68 boost::spirit::classic::assertion<std::string> expect_opencurly(
"Open curly brace '{' expected.");
69 boost::spirit::classic::assertion<std::string> expect_closecurly(
"Closing curly brace '}' expected in statement block (or could not find out what this line means).");
70 boost::spirit::classic::assertion<std::string> expect_closefunction(
"Closing curly brace '}' expected at end of program or function (or could not find out what this line means).");
71 boost::spirit::classic::assertion<std::string> expect_open(
"Open brace '(' expected.");
72 boost::spirit::classic::assertion<std::string> expect_close(
"Closing brace ')' expected.");
73 boost::spirit::classic::assertion<std::string> expect_comma(
"Expected a comma separator.");
74 boost::spirit::classic::assertion<std::string> expect_ident(
"Expected a valid identifier.");
75 boost::spirit::classic::assertion<std::string> expect_semicolon(
"Semicolon ';' expected after statement.");
76 boost::spirit::classic::assertion<std::string> expect_condition(
"Expected a boolean expression ( a condition ).");
77 boost::spirit::classic::assertion<std::string> expect_expression(
"Expected an expression.");
78 boost::spirit::classic::assertion<std::string> expect_command(
"Expected a command after 'do'.");
79 boost::spirit::classic::assertion<std::string> expect_nl(
"Expected a newline after statement.");
80 boost::spirit::classic::assertion<std::string> expect_eof(
"Invalid input in file.");
81 boost::spirit::classic::assertion<std::string> expect_term(
"No valid termination claues found in do ... until { } block.");
86 : rootc( t ),context(), fcontext(0), mpositer( positer ),
88 implcond(0), mcondition(0), try_cond(0),
90 conditionparser( rootc, caller, cp ),
91 valuechangeparser( rootc, cp, t->provides(), caller ),
92 expressionparser( rootc, caller, cp ),
94 peerparser(rootc, commonparser),
97 exportf(false),globalf(false),
112 void ProgramGraphParser::setup() {
113 BOOST_SPIRIT_DEBUG_RULE( newline );
114 BOOST_SPIRIT_DEBUG_RULE( openbrace );
115 BOOST_SPIRIT_DEBUG_RULE( closebrace );
116 BOOST_SPIRIT_DEBUG_RULE( opencurly );
117 BOOST_SPIRIT_DEBUG_RULE( closecurly );
118 BOOST_SPIRIT_DEBUG_RULE( semicolon );
119 BOOST_SPIRIT_DEBUG_RULE( condition );
120 BOOST_SPIRIT_DEBUG_RULE( terminationclause );
121 BOOST_SPIRIT_DEBUG_RULE( jumpdestination );
122 BOOST_SPIRIT_DEBUG_RULE( terminationpart );
123 BOOST_SPIRIT_DEBUG_RULE( dostatement );
124 BOOST_SPIRIT_DEBUG_RULE( trystatement );
125 BOOST_SPIRIT_DEBUG_RULE( catchpart );
126 BOOST_SPIRIT_DEBUG_RULE( statement );
127 BOOST_SPIRIT_DEBUG_RULE( line );
128 BOOST_SPIRIT_DEBUG_RULE( content );
129 BOOST_SPIRIT_DEBUG_RULE( program );
130 BOOST_SPIRIT_DEBUG_RULE( production );
131 BOOST_SPIRIT_DEBUG_RULE( valuechange );
132 BOOST_SPIRIT_DEBUG_RULE(
function );
133 BOOST_SPIRIT_DEBUG_RULE( functions );
134 BOOST_SPIRIT_DEBUG_RULE( arguments );
135 BOOST_SPIRIT_DEBUG_RULE( returnstatement );
136 BOOST_SPIRIT_DEBUG_RULE( funcstatement );
137 BOOST_SPIRIT_DEBUG_RULE( continuepart );
138 BOOST_SPIRIT_DEBUG_RULE( callpart );
139 BOOST_SPIRIT_DEBUG_RULE( returnpart );
140 BOOST_SPIRIT_DEBUG_RULE( ifstatement );
141 BOOST_SPIRIT_DEBUG_RULE( whilestatement );
142 BOOST_SPIRIT_DEBUG_RULE( forstatement );
143 BOOST_SPIRIT_DEBUG_RULE( breakstatement );
144 BOOST_SPIRIT_DEBUG_RULE( ifblock );
145 BOOST_SPIRIT_DEBUG_RULE( funcargs );
148 openbrace = expect_open( ch_p(
'(') );
149 closebrace = expect_close( ch_p(
')') );
150 opencurly = expect_opencurly( ch_p(
'{') );
151 closecurly = expect_closecurly( ch_p(
'}') );
152 semicolon = expect_semicolon( ch_p(
';') );
153 condition = expect_condition( conditionparser.
parser()[ boost::bind(&ProgramGraphParser::seencondition,
this) ] );
160 production = *( program | function )[boost::bind(&ProgramGraphParser::programtext,
this, _1, _2)] >> expect_eof(end_p) ;
165 !(
keyword_p(
"export" )[boost::bind(&ProgramGraphParser::exportdef,
this)] |
keyword_p(
"global" )[boost::bind(&ProgramGraphParser::globaldef,
this)] |
keyword_p(
"local") )[boost::bind(&ProgramGraphParser::seenvalidinput,
this)]
166 >> (
keyword_p(
"function" )[boost::bind(&ProgramGraphParser::seenvalidinput,
this)] | commonparser.
notassertingidentifier[boost::bind( &ProgramGraphParser::seenreturntype,
this, _1, _2)] )
167 >> expect_ident( commonparser.
identifier[boost::bind(&ProgramGraphParser::seenvalidinput,
this)][ boost::bind( &ProgramGraphParser::functiondef,
this, _1, _2 ) ] )
171 >> expect_closefunction( ch_p(
'}') )[ boost::bind( &ProgramGraphParser::seenfunctionend,
this ) ]
175 funcargs = ch_p(
'(') >> ( !str_p(
"void") >> ch_p(
')') | ((
176 valuechangeparser.
bareDefinitionParser()[boost::bind(&ProgramGraphParser::seenfunctionarg,
this)]
177 >> *(ch_p(
',')>> valuechangeparser.
bareDefinitionParser()[boost::bind(&ProgramGraphParser::seenfunctionarg,
this)]) )
182 keyword_p(
"program" )[boost::bind(&ProgramGraphParser::seenvalidinput,
this)]
183 >> expect_ident( commonparser.
identifier[ boost::bind( &ProgramGraphParser::programdef,
this, _1, _2 ) ] )
186 >> expect_closefunction( ch_p(
'}') )[ boost::bind( &ProgramGraphParser::seenprogramend,
this ) ];
196 line = statement[boost::bind(&ProgramGraphParser::noskip_eol,
this )] >> commonparser.
eos[boost::bind(&ProgramGraphParser::skip_eol,
this )];
198 statement = valuechange | trystatement | funcstatement | returnstatement | ifstatement | whilestatement | forstatement | breakstatement | dostatement;
200 valuechange = valuechangeparser.
parser()[ boost::bind( &ProgramGraphParser::seenvaluechange,
this ) ];
205 (
keyword_p(
"yield") |
keyword_p(
"nothing"))[boost::bind(&ProgramGraphParser::seenyield,
this)]
206 | expressionparser.
parser()[ boost::bind(&ProgramGraphParser::seenstatement,
this) ]
212 >> expect_command ( expressionparser.
parser()[ boost::bind( &ProgramGraphParser::seentrystatement,
this ) ] )
219 assert(program_builder != 0 );
220 program_builder->startFunction(name);
221 this->setStack( stck );
222 this->clearParseState();
245 if (program_list.empty())
247 program_text =
"Bug: Program Text to be set by Parser.";
249 program_list.front()->setText( program_text );
250 result=program_list.front();
251 this->cleanup(
false);
252 program_list.clear();
259 valuechangeparser.
store( context );
260 valuechangeparser.
reset();
263 program_builder->returnFunction(
new ConditionTrue, mpositer.get_position().line - ln_offset );
264 program_builder->proceedToNext( mpositer.get_position().line - ln_offset);
265 return program_builder->endFunction( mpositer.get_position().line - ln_offset );
282 valuechangeparser.
load(context);
285 void ProgramGraphParser::clearParseState() {
291 void ProgramGraphParser::startofprogram()
295 void ProgramGraphParser::programdef(
iter_t begin,
iter_t end )
299 std::string def(begin, end);
301 if ( rootc->
provides()->hasService( def ) )
307 pi->setProgramService(ptsk);
308 pi->setUnloadOnStop(
false );
310 rootc->
provides()->addService( ptsk );
313 void ProgramGraphParser::programtext(
iter_t begin,
iter_t end )
319 void ProgramGraphParser::exportdef()
324 void ProgramGraphParser::globaldef()
329 void ProgramGraphParser::seenreturntype(
iter_t begin,
iter_t end )
331 rettype = std::string(begin, end);
333 void ProgramGraphParser::functiondef(
iter_t begin,
iter_t end )
337 std::string funcdef(begin, end);
350 if ( mfuncs.count( funcdef ) )
354 if ( !rettype.empty() && rettype !=
"void") {
357 throw_(
iter_t(),
"Return type '" + rettype +
"' for function '"+ funcdef +
"' is an unknown type." );
361 mfuncs[funcdef] = program_builder->startFunction( funcdef );
362 program_builder->getFunction()->setResult( retarg );
372 void ProgramGraphParser::seenfunctionarg()
378 valuechangeparser.
clear();
381 void ProgramGraphParser::seenfunctionend()
384 program_builder->returnFunction(
new ConditionTrue, mpositer.get_position().line - ln_offset );
385 program_builder->proceedToNext( mpositer.get_position().line - ln_offset );
386 boost::shared_ptr<ProgramInterface> mfunc = program_builder->endFunction( mpositer.get_position().line - ln_offset );
390 std::map<const DataSourceBase*, DataSourceBase*> dummy;
392 if (rootc->
provides()->hasMember( mfunc->getName() ) )
393 log(
Warning) <<
"Redefining function '"<< rootc->
getName() <<
"." << mfunc->getName() <<
"': only new programs will use this new function." <<endlog();
394 rootc->
provides()->add(mfunc->getName(), cfi );
399 std::map<const DataSourceBase*, DataSourceBase*> dummy;
402 log(
Warning) <<
"Redefining function '"<<
GlobalService::Instance()->getName() <<
"."<< mfunc->getName() <<
"': only new programs will use this new function." <<endlog();
406 std::map<const DataSourceBase*, DataSourceBase*> dummy;
408 if (rootc->
provides(
"scripting")->hasMember( mfunc->getName() ) )
409 log(
Warning) <<
"Redefining function '"<< rootc->
getName() <<
".scripting."<< mfunc->getName() <<
"': only new programs will use this new function." <<endlog();
410 rootc->
provides(
"scripting")->add(mfunc->getName(), cfi );
420 exportf =
false; globalf =
false;
422 valuechangeparser.
reset();
425 void ProgramGraphParser::seenvalidinput() {
429 void ProgramGraphParser::seencondition()
432 assert( mcondition );
442 void ProgramGraphParser::seenreturnstatement()
445 program_builder->returnFunction(
new ConditionTrue, mpositer.get_position().line - ln_offset );
446 program_builder->proceedToNext( mpositer.get_position().line - ln_offset );
449 void ProgramGraphParser::seenreturnvalue()
451 AttributeBase* ar =program_builder->getFunction()->getResult();
460 program_builder->setCommand( assigncomm );
461 program_builder->proceedToNext(
new ConditionTrue(), mpositer.get_position().line - ln_offset );
469 void ProgramGraphParser::seenbreakstatement()
471 if ( program_builder->inLoop() ) {
472 program_builder->breakLoop();
473 program_builder->proceedToNext( mpositer.get_position().line - ln_offset );
478 void ProgramGraphParser::seenfuncidentifier(
iter_t begin,
iter_t end )
481 std::string fname(begin, end);
482 if ( mfuncs.count(fname) == 0 )
484 if ( fname == program_builder->getFunction()->getName() )
487 mcallfunc = mfuncs[ fname ];
492 arguments = argsparser->
parser();
496 void ProgramGraphParser::seencallfuncargs()
498 callfnargs = argsparser->
result();
501 void ProgramGraphParser::seencallfuncstatement()
503 log(
Warning) <<
" 'call' has been deprecated. Please remove this keyword." << endlog();
511 program_builder->setFunction( mcallfunc, callfnargs );
534 program_builder->proceedToNext(mpositer.get_position().line - ln_offset);
537 void ProgramGraphParser::skip_eol() {
541 void ProgramGraphParser::noskip_eol() {
545 void ProgramGraphParser::startcatchpart() {
549 program_builder->startIfStatement( try_cond, mpositer.get_position().line - ln_offset );
553 void ProgramGraphParser::seencatchpart() {
555 this->endifstatement();
558 void ProgramGraphParser::seenifstatement() {
562 std::pair<ActionInterface*, ConditionInterface*> comcon;
564 program_builder->setCommand( comcon.first );
565 program_builder->startIfStatement( comcon.second, mpositer.get_position().line - ln_offset );
572 void ProgramGraphParser::endifblock() {
573 program_builder->endIfBlock(mpositer.get_position().line - ln_offset);
577 void ProgramGraphParser::endifstatement() {
578 program_builder->endElseBlock(mpositer.get_position().line - ln_offset);
581 void ProgramGraphParser::seenwhilestatement() {
585 std::pair<ActionInterface*, ConditionInterface*> comcon;
587 program_builder->setCommand( comcon.first );
588 program_builder->startWhileStatement( comcon.second, mpositer.get_position().line - ln_offset );
594 void ProgramGraphParser::endwhilestatement() {
595 program_builder->endWhileBlock(mpositer.get_position().line - ln_offset);
599 void ProgramGraphParser::seenforinit()
604 std::vector<ActionInterface*> acv = valuechangeparser.
assignCommands();
606 valuechangeparser.
clear();
607 if ( acv.size() == 1) {
610 else if (acv.size() > 1) {
613 for_init_command = ac;
616 void ProgramGraphParser::seenforinit_expr()
623 void ProgramGraphParser::seenforincr()
630 void ProgramGraphParser::seenemptyforincr()
632 for_incr_command.push( 0 );
635 void ProgramGraphParser::seenforstatement() {
636 assert( mcondition );
639 if ( for_init_command )
641 program_builder->setCommand( for_init_command );
642 program_builder->proceedToNext(
new ConditionTrue, mpositer.get_position().line - ln_offset );
644 for_init_command = 0;
647 std::pair<ActionInterface*, ConditionInterface*> comcon;
649 program_builder->setCommand( comcon.first );
650 program_builder->startWhileStatement( comcon.second, mpositer.get_position().line - ln_offset );
655 void ProgramGraphParser::endforstatement() {
658 for_incr_command.pop();
662 program_builder->setCommand( incr );
665 program_builder->proceedToNext(
new ConditionTrue, mpositer.get_position().line - ln_offset );
667 program_builder->endWhileBlock(mpositer.get_position().line - ln_offset);
670 void ProgramGraphParser::seenprogramend()
673 program_builder->returnFunction(
new ConditionTrue, mpositer.get_position().line - ln_offset );
674 program_builder->proceedToNext( mpositer.get_position().line - ln_offset );
675 program_list.push_back(program_builder->endFunction( mpositer.get_position().line - ln_offset ) );
678 valuechangeparser.
store( context );
679 valuechangeparser.
reset();
685 iter_t begin_copy = begin;
686 skip_parser_t skip_parser = comment_p(
"#" ) | comment_p(
"//" ) | comment_p(
"/*",
"*/" ) | (space_p - eol_p) | commonparser.
skipper;
689 scanner_t scanner( begin, end, policies );
690 program_list.clear();
696 if ( ! production.parse( scanner ) )
701 mpositer.get_position().file, mpositer.get_position().line,
702 mpositer.get_position().column );
704 program_text = std::string( begin_copy, begin );
706 for (std::vector<FunctionGraphPtr>::iterator it= program_list.begin();it!=program_list.end();++it)
707 (*it)->setText( program_text );
708 this->cleanup(
false);
709 std::vector<ProgramInterfacePtr> result;
710 for (std::vector<FunctionGraphPtr>::iterator it= program_list.begin();it!=program_list.end();++it)
711 result.push_back( *it );
712 program_list.clear();
715 catch(
const parser_error<std::string, iter_t>& e )
718 program_list.clear();
721 mpositer.get_position().file, mpositer.get_position().line,
722 mpositer.get_position().column );
729 program_list.clear();
731 e.
copy(), mpositer.get_position().file,
732 mpositer.get_position().line, mpositer.get_position().column );
739 iter_t begin_copy = begin;
742 iter_pol_t iter_policy( ( comment_p(
"#" ) | comment_p(
"//" ) | comment_p(
"/*",
"*/" ) | (space_p - eol_p) | commonparser.
skipper ) );
744 scanner_t scanner( begin, end, policies );
746 std::vector< ProgramInterfacePtr > function_list;
749 if ( ! functions.parse( scanner ) )
754 mpositer.get_position().file, mpositer.get_position().line,
755 mpositer.get_position().column );
757 program_text = std::string( begin_copy, begin );
759 for (funcmap::iterator it= mfuncs.begin();it!=mfuncs.end();++it) {
760 it->second->setText( program_text );
761 function_list.push_back( it->second );
764 this->cleanup(
false);
765 return function_list;
768 catch(
const parser_error<std::string, iter_t>& e )
773 mpositer.get_position().file, mpositer.get_position().line,
774 mpositer.get_position().column );
782 e.
copy(), mpositer.get_position().file,
783 mpositer.get_position().line, mpositer.get_position().column );
787 void ProgramGraphParser::cleanup(
bool unload_service)
789 if (unload_service && rootc && context)
790 rootc->
provides()->removeService( context->getName() );
801 delete for_init_command;
802 for_init_command = 0;
803 while (!for_incr_command.empty() ) {
804 delete for_incr_command.top();
805 for_incr_command.pop();
810 exportf =
false; globalf =
false;
820 while ( ! mfuncs.empty() ) {
821 mfuncs.erase( mfuncs.begin() );
825 valuechangeparser.
reset();
826 conditionparser.
reset();
830 void ProgramGraphParser::seentrystatement()
841 program_builder->setCommand(command);
849 program_builder->setCommand( trycommand );
850 try_cond = tryresult;
852 if ( program_builder->buildEdges() == 0 )
853 program_builder->proceedToNext(
new ConditionTrue(), mpositer.get_position().line - ln_offset );
855 program_builder->proceedToNext( mpositer.get_position().line - ln_offset );
858 void ProgramGraphParser::seenstatement()
868 if ( program_builder->buildEdges() == 0 )
869 program_builder->proceedToNext(
new ConditionTrue(), mpositer.get_position().line - ln_offset );
871 program_builder->proceedToNext( mpositer.get_position().line - ln_offset );
874 void ProgramGraphParser::seenyield()
877 program_builder->setCommand(
new CommandNOP );
878 program_builder->proceedToNext(
new ConditionOnce(
false), mpositer.get_position().line - ln_offset );
881 void ProgramGraphParser::seenvaluechange()
886 std::vector<ActionInterface*> acv = valuechangeparser.
assignCommands();
888 valuechangeparser.
clear();
889 if ( acv.size() == 1) {
892 else if (acv.size() > 1) {
896 program_builder->setCommand( ac );
899 program_builder->proceedToNext(
new ConditionTrue, mpositer.get_position().line - ln_offset );
903 void ProgramGraphParser::seencallfunclabel(
iter_t begin,
iter_t end )
907 seenfuncidentifier( begin, end );
909 assert( mcondition );
911 program_builder->appendFunction( mcondition, mcallfunc, callfnargs);
916 void ProgramGraphParser::seencontinue( )
920 assert ( mcondition );
923 program_builder->addConditionEdge( mcondition, program_builder->nextNode() );
std::pair< base::ActionInterface *, ConditionInterface * > getParseResultAsCommand()
Retrieve the result as a command, condition pair.
#define keyword_p(word)
Returns a rule which parses a keyword followed by a non-identifier character, newline or semicolon...
std::vector< base::DataSourceBase::shared_ptr > result()
Get the parsed internal::DataSource's.
rule_t & parser()
Returns the full parser, as it is used most.
This class builds a program consisting of data contained in a program graph tree, based on the Boost ...
A Command which evaluates a internal::DataSource<bool> and returns the result of get().
rule_t eos
End Of Statement Parser.
boost::shared_ptr< FunctionGraph > FunctionGraphPtr
ConditionInterface * getParseResult()
Call this to get the parsed condition.
base::AttributeBase * buildAttribute(std::string name, base::DataSourceBase::shared_ptr source=0) const
Build an Attribute of this type.
Service::shared_ptr provides()
Returns this Service.
void load(Service::shared_ptr source)
Loads all defined names from a service.
virtual AttributeBase * clone() const =0
Returns a clone of this AttributeBase.
rule_t & bareDefinitionParser()
The parser that parses a bare variable definition.
void reset()
After reset, peer() == current context and object() == "this".
ProgramInterfacePtr bodyParserResult()
bool skipeol
Saves eol skipping state.
A conditional that evaluates true.
void reset()
Completely clear all data and erase all parsed definitions from the taskcontext given in the construc...
parse_exception class that is used for various semantic errors for which it was not worth defining a ...
virtual DataSourceBase::shared_ptr getDataSource() const =0
Return a internal::DataSource which contains the same contents.
boost::shared_ptr< ProgramInterface > ProgramInterfacePtr
virtual parse_exception * copy() const =0
void initBodyParser(const std::string &name, Service::shared_ptr stck, int offset)
Initialize the bodyParser to parse and store each statement it sees.
This is a parser that you construct to parse a set of arguments.
This is an exception class that keeps a parse_exception pointer along with the location in the file a...
This class contains some very common parser definitions.
parse_exception class that is used for various syntactic errors for which it was not worth defining a...
An execution engine serialises (executes one after the other) the execution of all commands...
A command which tries another command and stores the result in a internal::DataSource<bool>.
A conditional that evaluates the first time true and afterwards always false (or vice versa)...
boost::shared_ptr< Service > shared_ptr
ProgramInterfacePtr programParserResult()
Returns the last program parsed by programParser()
bool parserUsed() const
Returns true if the parser was already used (even partially).
rule_t & programParser()
Returns a program foo {} parser.
void store(Service::shared_ptr other)
Store allDefinedNames() in a service.
scanner< iter_t, scanner_pol_t > scanner_t
rule_t & functionParser()
Parses a function foo {} definition.
ProgramGraphParser(iter_t &positer, TaskContext *context, ExecutionEngine *caller, CommonParser &cp)
An attribute is a minimalistic, named placeholder for data.
skip_parser_iteration_policy< skip_parser_t > iter_pol_t
This class represents a program as an Service in the Orocos TaskContext system.
functor_parser< eol_skip_functor > skipper
End Of Statement Parser.
static std::ostream & endl(std::ostream &__os)
Based on the software pattern 'command', this interface allows execution of action objects...
base::DataSourceBase::shared_ptr getResult()
This is the uppermost exception class in the parser system.
A class for representing a user type, and which can build instances of that type. ...
internal::AssignableDataSource< bool >::shared_ptr result()
rule_t & statementParser()
Parses a single-line statement.
rule_t & bodyParser()
Parses a multi-line program, which you can retrieve with bodyParserResult().
A Command which evaluates a base::DataSourceBase and always returns true.
boost_spirit::alternative< boost_spirit::alternative< boost_spirit::alternative< boost_spirit::alternative< boost_spirit::confix_parser< boost_spirit::impl::string_as_parser::type, boost_spirit::kleene_star< boost_spirit::anychar_parser >, boost_spirit::alternative< boost_spirit::eol_parser, boost_spirit::end_parser >, boost_spirit::unary_parser_category, boost_spirit::non_nested, boost_spirit::is_lexeme >, boost_spirit::confix_parser< boost_spirit::impl::string_as_parser::type, boost_spirit::kleene_star< boost_spirit::anychar_parser >, boost_spirit::alternative< boost_spirit::eol_parser, boost_spirit::end_parser >, boost_spirit::unary_parser_category, boost_spirit::non_nested, boost_spirit::is_lexeme > >, boost_spirit::confix_parser< boost_spirit::impl::string_as_parser::type, boost_spirit::kleene_star< boost_spirit::anychar_parser >, boost_spirit::impl::string_as_parser::type, boost_spirit::unary_parser_category, boost_spirit::non_nested, boost_spirit::is_lexeme > >, boost_spirit::difference< boost_spirit::space_parser, boost_spirit::eol_parser > >, boost_spirit::functor_parser< eol_skip_functor > > skip_parser_t
std::vector< ProgramInterfacePtr > parse(iter_t &begin, iter_t end)
Tries to parse programs, returns the generated programs on success.
A Factory which delivers operations which execute a FunctionGraph in an engine.
void clear()
Clear assignCommands(), definedValues() and definedNames().
std::vector< ProgramInterfacePtr > parseFunction(iter_t &begin, iter_t end)
static shared_ptr Instance()
static Logger & log()
As Instance(), but more userfriendly.
base::AttributeBase * lastDefinedValue()
The TaskContext is the C++ representation of an Orocos component.
Exception thrown when a factory is requested to create an object, but a wrong argument type was given...
std::vector< base::ActionInterface * > assignCommands()
Returns the (accept/reject) status of another command.
Exception thrown when a factory is requested to create an object but the wrong number of arguments wa...
boost::intrusive_ptr< DataSourceBase > shared_ptr
Use this type to store a pointer to a DataSourceBase.
rule_t notassertingidentifier
identifier with <template> marks in it
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
boost::shared_ptr< ProgramService > ProgramServicePtr
scanner_policies< iter_pol_t > scanner_pol_t
Based on the software pattern 'composite', this class RTT_SCRIPTING_API allows composing command obje...
A conditional that evaluates false.
const ExecutionEngine * engine() const
Get a const pointer to the ExecutionEngine of this Task.
static RTT_API Service::shared_ptr Instance()
virtual const std::string & getName() const
Returns the name of this TaskContext.