Orocos Real-Time Toolkit
2.5.0
|
A Parser for Orocos Program Scripts. More...
#include <rtt/scripting/ProgramGraphParser.hpp>
Public Member Functions | |
ProgramGraphParser (iter_t &positer, TaskContext *context, ExecutionEngine *caller, CommonParser &cp) | |
std::vector< ProgramInterfacePtr > | parse (iter_t &begin, iter_t end) |
Tries to parse programs, returns the generated programs on success. | |
std::vector< ProgramInterfacePtr > | parseFunction (iter_t &begin, iter_t end) |
void | initBodyParser (const std::string &name, Service::shared_ptr stck, int offset) |
Initialize the bodyParser to parse and store each statement it sees. | |
rule_t & | bodyParser () |
Parses a multi-line program, which you can retrieve with bodyParserResult(). | |
rule_t & | statementParser () |
Parses a single-line statement. | |
rule_t & | programParser () |
Returns a program foo {} parser. | |
ProgramInterfacePtr | programParserResult () |
Returns the last program parsed by programParser() | |
rule_t & | functionParser () |
Parses a function foo {} definition. | |
ProgramInterfacePtr | bodyParserResult () |
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.
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.
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.
Referenced by RTT::scripting::ScriptParser::ScriptParser().
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.
References RTT::scripting::CommonParser::skipper.
Referenced by RTT::scripting::Parser::parseProgram().