Orocos Real-Time Toolkit  2.6.0
Public Member Functions
RTT::scripting::ProgramGraphParser Class Reference

A Parser for Orocos Program Scripts. More...

#include <rtt/scripting/ProgramGraphParser.hpp>

List of all members.

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 ()

Detailed Description

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.


Member Function Documentation

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.

Exceptions:
file_parse_exceptionThe parser found an error.

Definition at line 673 of file ProgramGraphParser.cpp.

References RTT::scripting::CommonParser::skipper.

Referenced by RTT::scripting::Parser::parseProgram().


The documentation for this class was generated from the following files: