Orocos Real-Time Toolkit  2.8.3
Public Member Functions | List of all members
RTT::scripting::ProgramGraphParser Class Reference

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)
 
 ~ProgramGraphParser ()
 
std::vector< ProgramInterfacePtrparse (iter_t &begin, iter_t end)
 Tries to parse programs, returns the generated programs on success. More...
 
std::vector< ProgramInterfacePtrparseFunction (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. More...
 
rule_tbodyParser ()
 Parses a multi-line program, which you can retrieve with bodyParserResult(). More...
 
rule_tstatementParser ()
 Parses a single-line statement. More...
 
rule_tprogramParser ()
 Returns a program foo {} parser. More...
 
ProgramInterfacePtr programParserResult ()
 Returns the last program parsed by programParser() More...
 
rule_tfunctionParser ()
 Parses a function foo {} definition. More...
 
ProgramInterfacePtr bodyParserResult ()
 
bool parserUsed () const
 Returns true if the parser was already used (even partially). More...
 

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.

Constructor & Destructor Documentation

RTT::ProgramGraphParser::ProgramGraphParser ( iter_t positer,
TaskContext context,
ExecutionEngine caller,
CommonParser cp 
)

Definition at line 85 of file ProgramGraphParser.cpp.

RTT::ProgramGraphParser::~ProgramGraphParser ( )

Member Function Documentation

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.

Referenced by RTT::scripting::StateGraphParser::getParserResult().

ProgramInterfacePtr RTT::ProgramGraphParser::bodyParserResult ( )
rule_t & RTT::ProgramGraphParser::functionParser ( )

Parses a function foo {} definition.

Definition at line 229 of file ProgramGraphParser.cpp.

Referenced by RTT::scripting::ScriptParser::ScriptParser().

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::StateGraphParser::getParserResult(), and 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 682 of file ProgramGraphParser.cpp.

References RTT::parse_exception::copy(), and RTT::scripting::CommonParser::skipper.

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

std::vector< ProgramInterfacePtr > RTT::ProgramGraphParser::parseFunction ( iter_t begin,
iter_t  end 
)
bool RTT::ProgramGraphParser::parserUsed ( ) const
rule_t & RTT::ProgramGraphParser::programParser ( )

Returns a program foo {} parser.

Definition at line 225 of file ProgramGraphParser.cpp.

Referenced by RTT::scripting::ScriptParser::ScriptParser().

ProgramInterfacePtr RTT::ProgramGraphParser::programParserResult ( )

Returns the last program parsed by programParser()

Definition at line 243 of file ProgramGraphParser.cpp.

Referenced by RTT::scripting::ScriptParser::ScriptParser().

rule_t & RTT::ProgramGraphParser::statementParser ( )

Parses a single-line statement.

Definition at line 238 of file ProgramGraphParser.cpp.

Referenced by RTT::scripting::ScriptParser::ScriptParser().


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