A Parser for Orocos Program Scripts. More...
#include <ProgramGraphParser.hpp>
A Parser for Orocos Program Scripts.
This class does the actual work. It generates a Program, by constructing the ProgramNode's. We just go over the code one single time, and construct the Program as we go. For every statement, we construct a new ProgramNode, and fill it up as we get the information we need.
Definition at line 72 of file ProgramGraphParser.hpp.
Definition at line 74 of file ProgramGraphParser.hpp.
typedef FunctionGraphBuilder::ConditionEdge RTT::scripting::ProgramGraphParser::ConditionEdge [private] |
Definition at line 75 of file ProgramGraphParser.hpp.
typedef std::map<std::string, FunctionGraphPtr> RTT::scripting::ProgramGraphParser::funcmap [private] |
Definition at line 108 of file ProgramGraphParser.hpp.
typedef FunctionGraphBuilder::Graph RTT::scripting::ProgramGraphParser::Graph [private] |
Definition at line 76 of file ProgramGraphParser.hpp.
RTT::ProgramGraphParser::ProgramGraphParser | ( | iter_t & | positer, |
TaskContext * | context, | ||
ExecutionEngine * | caller, | ||
CommonParser & | cp | ||
) |
Definition at line 85 of file ProgramGraphParser.cpp.
Definition at line 105 of file ProgramGraphParser.cpp.
rule_t & RTT::ProgramGraphParser::bodyParser | ( | ) |
Parses a multi-line program, which you can retrieve with bodyParserResult(). You need to initialize it with initBodyParser
Definition at line 233 of file ProgramGraphParser.cpp.
Definition at line 256 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::cleanup | ( | bool | remove_service | ) | [private] |
Definition at line 779 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::clearParseState | ( | ) | [private] |
Clears helper variables of parser.
Definition at line 281 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::endforstatement | ( | ) | [private] |
Definition at line 646 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::endifblock | ( | ) | [private] |
Definition at line 563 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::endifstatement | ( | ) | [private] |
Definition at line 568 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::endwhilestatement | ( | ) | [private] |
Definition at line 585 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::exportdef | ( | ) | [private] |
Definition at line 314 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::functiondef | ( | iter_t | begin, |
iter_t | end | ||
) | [private] |
Definition at line 328 of file ProgramGraphParser.cpp.
rule_t & RTT::ProgramGraphParser::functionParser | ( | ) |
Parses a function foo {} definition.
Definition at line 229 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::globaldef | ( | ) | [private] |
Definition at line 319 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::initBodyParser | ( | const std::string & | name, |
Service::shared_ptr | stck, | ||
int | offset | ||
) |
Initialize the bodyParser to parse and store each statement it sees. The result is retrieved with bodyParserResult().
Definition at line 217 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::noskip_eol | ( | ) | [private] |
Definition at line 532 of file ProgramGraphParser.cpp.
std::vector< ProgramInterfacePtr > RTT::ProgramGraphParser::parse | ( | iter_t & | begin, |
iter_t | end | ||
) |
Tries to parse programs, returns the generated programs on success.
file_parse_exception | The parser found an error. |
Definition at line 673 of file ProgramGraphParser.cpp.
std::vector< ProgramInterfacePtr > RTT::ProgramGraphParser::parseFunction | ( | iter_t & | begin, |
iter_t | end | ||
) |
Definition at line 728 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::programdef | ( | iter_t | begin, |
iter_t | end | ||
) | [private] |
Definition at line 290 of file ProgramGraphParser.cpp.
rule_t & RTT::ProgramGraphParser::programParser | ( | ) |
Returns a program foo {} parser.
Definition at line 225 of file ProgramGraphParser.cpp.
Returns the last program parsed by programParser()
Definition at line 243 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::programtext | ( | iter_t | begin, |
iter_t | end | ||
) | [private] |
Definition at line 308 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenbreakstatement | ( | ) | [private] |
Definition at line 460 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seencallfuncargs | ( | ) | [private] |
Definition at line 487 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seencallfunclabel | ( | iter_t | begin, |
iter_t | end | ||
) | [private] |
Definition at line 895 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seencallfuncstatement | ( | ) | [private] |
Definition at line 492 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seencatchpart | ( | ) | [private] |
Definition at line 544 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seencondition | ( | ) | [private] |
Definition at line 420 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seencontinue | ( | ) | [private] |
Definition at line 908 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenemptyforincr | ( | ) | [private] |
Definition at line 621 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenforincr | ( | ) | [private] |
Definition at line 614 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenforinit | ( | ) | [private] |
Definition at line 590 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenforinit_expr | ( | ) | [private] |
Definition at line 607 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenforstatement | ( | ) | [private] |
Definition at line 626 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenfuncidentifier | ( | iter_t | begin, |
iter_t | end | ||
) | [private] |
Definition at line 469 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenfunctionarg | ( | ) | [private] |
Definition at line 367 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenfunctionend | ( | ) | [private] |
Definition at line 376 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenifstatement | ( | ) | [private] |
Definition at line 549 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenprogramend | ( | ) | [private] |
Definition at line 661 of file ProgramGraphParser.cpp.
void RTT::scripting::ProgramGraphParser::seenreturnlabel | ( | ) | [private] |
void RTT::ProgramGraphParser::seenreturnstatement | ( | ) | [private] |
Definition at line 433 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenreturntype | ( | iter_t | begin, |
iter_t | end | ||
) | [private] |
Definition at line 324 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenreturnvalue | ( | ) | [private] |
Definition at line 440 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenstatement | ( | ) | [private] |
Definition at line 850 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seentrystatement | ( | ) | [private] |
Definition at line 822 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenvaluechange | ( | ) | [private] |
Definition at line 873 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenwhilestatement | ( | ) | [private] |
Definition at line 572 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::seenyield | ( | ) | [private] |
Definition at line 866 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::setStack | ( | Service::shared_ptr | st | ) | [private] |
Definition at line 276 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::setup | ( | ) | [private] |
Definition at line 112 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::setup2 | ( | ) | [private] |
Definition at line 63 of file ProgramGraphParser2.cpp.
void RTT::ProgramGraphParser::skip_eol | ( | ) | [private] |
Definition at line 528 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::startcatchpart | ( | ) | [private] |
Definition at line 536 of file ProgramGraphParser.cpp.
void RTT::ProgramGraphParser::startofprogram | ( | ) | [private] |
Definition at line 286 of file ProgramGraphParser.cpp.
rule_t & RTT::ProgramGraphParser::statementParser | ( | ) |
Parses a single-line statement.
Definition at line 238 of file ProgramGraphParser.cpp.
rule_t RTT::scripting::ProgramGraphParser::andpart [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
Definition at line 195 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::arguments [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::breakstatement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
std::vector<base::DataSourceBase::shared_ptr> RTT::scripting::ProgramGraphParser::callfnargs [private] |
Definition at line 118 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::callpart [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::catchpart [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::closebrace [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::closecurly [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
Definition at line 191 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::condition [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
Definition at line 192 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::content [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
The current subcontext of root where we are working in.
Definition at line 87 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::continuepart [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::dostatement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::emitstatement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
bool RTT::scripting::ProgramGraphParser::exportf [private] |
Definition at line 204 of file ProgramGraphParser.hpp.
Definition at line 194 of file ProgramGraphParser.hpp.
The current function context where we are working in.
Definition at line 92 of file ProgramGraphParser.hpp.
std::stack<base::ActionInterface*> RTT::scripting::ProgramGraphParser::for_incr_command [private] |
Definition at line 202 of file ProgramGraphParser.hpp.
Definition at line 201 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::forstatement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::funcargs [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::funcstatement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::function [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::functionarg [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::functions [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
bool RTT::scripting::ProgramGraphParser::globalf [private] |
Definition at line 204 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::ifblock [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::ifstatement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
Definition at line 116 of file ProgramGraphParser.hpp.
std::vector<ConditionInterface*> RTT::scripting::ProgramGraphParser::implcond_v [private] |
Definition at line 117 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::jumpdestination [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::line [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
int RTT::scripting::ProgramGraphParser::ln_offset [private] |
Definition at line 205 of file ProgramGraphParser.hpp.
Definition at line 105 of file ProgramGraphParser.hpp.
Definition at line 121 of file ProgramGraphParser.hpp.
Definition at line 102 of file ProgramGraphParser.hpp.
Definition at line 109 of file ProgramGraphParser.hpp.
our_pos_iter_t& RTT::scripting::ProgramGraphParser::mpositer [private] |
Definition at line 99 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::newline [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::openbrace [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::opencurly [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
peer context for events.
Definition at line 97 of file ProgramGraphParser.hpp.
Definition at line 196 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::production [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::program [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
boost::shared_ptr<FunctionGraphBuilder> RTT::scripting::ProgramGraphParser::program_builder [private] |
Definition at line 198 of file ProgramGraphParser.hpp.
std::vector< FunctionGraphPtr > RTT::scripting::ProgramGraphParser::program_list [private] |
Definition at line 199 of file ProgramGraphParser.hpp.
std::string RTT::scripting::ProgramGraphParser::program_text [private] |
Definition at line 203 of file ProgramGraphParser.hpp.
std::string RTT::scripting::ProgramGraphParser::rettype [private] |
Definition at line 112 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::returnpart [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::returnstatement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
The context given to us by the user to root the parsed programs into.
Definition at line 82 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::semicolon [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::statement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::terminationclause [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::terminationpart [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
Definition at line 123 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::trystatement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::valuechange [private] |
Definition at line 184 of file ProgramGraphParser.hpp.
Definition at line 193 of file ProgramGraphParser.hpp.
rule_t RTT::scripting::ProgramGraphParser::whilestatement [private] |
Definition at line 184 of file ProgramGraphParser.hpp.