Public Types | Public Member Functions | Private Attributes | List of all members
RTT::scripting::Parser Class Reference

This class is the public interface to the Orocos Program Parser Framework. It parsers Orocos program scripts, Orocos State Contexts and allows to parse a text Command, Condition or Expression to the respective objects. More...

#include <Parser.hpp>

Public Types

typedef std::vector< ProgramInterfacePtrParsedFunctions
 
typedef std::vector< ProgramInterfacePtrParsedPrograms
 
typedef std::vector< ParsedStateMachinePtrParsedStateMachines
 

Public Member Functions

ConditionInterfaceparseCondition (const std::string &s, TaskContext *)
 Parses the string as a condition, and returns a new ConditionInterface. Will throw parse_exception on failure. Use ext to get the data from the components. More...
 
base::DataSourceBase::shared_ptr parseExpression (const std::string &s, TaskContext *)
 Parses the expression in s. More...
 
ParsedFunctions parseFunction (const std::string &s, TaskContext *, const std::string &filename="stream")
 Reads out the string, parses it, and returns a new FunctionGraph. More...
 
ParsedPrograms parseProgram (const std::string &s, TaskContext *, const std::string &filename="stream")
 Reads out the string, parses it, and returns a new ProgramGraph. More...
 
 Parser (ExecutionEngine *caller=0)
 
ParsedStateMachines parseStateMachine (const std::string &s, TaskContext *, const std::string &filename="stream")
 Reads out the string, parses it, and returns a new ParsedStateMachine. More...
 
base::DataSourceBase::shared_ptr parseValueChange (const std::string &s, TaskContext *)
 Parses a change of a value in s. More...
 
base::DataSourceBase::shared_ptr parseValueStatement (const std::string &s, TaskContext *)
 Parses a whole value manipulation/creation statement. Requires the set/var/const etc prefixes. More...
 
void runScript (std::string const &code, TaskContext *mowner, ScriptingService *service, std::string const &filename)
 

Private Attributes

ExecutionEnginemcaller
 

Detailed Description

This class is the public interface to the Orocos Program Parser Framework. It parsers Orocos program scripts, Orocos State Contexts and allows to parse a text Command, Condition or Expression to the respective objects.

See also
ScriptingAccess for a more user friendly loading of scripts into TaskContexts.

Definition at line 65 of file Parser.hpp.

Member Typedef Documentation

List of parsed functions.

Definition at line 89 of file Parser.hpp.

List of parsed programs.

Definition at line 101 of file Parser.hpp.

List of parsed State Machines.

Definition at line 113 of file Parser.hpp.

Constructor & Destructor Documentation

RTT::Parser::Parser ( ExecutionEngine caller = 0)

Create a parser and allow to explicitly specify which TaskContext's ExecutionEngine is calling it. This allows to generate the correct asynchonous method invocation code in case caller and parser are not identical.

Definition at line 64 of file Parser.cpp.

Member Function Documentation

ConditionInterface * RTT::Parser::parseCondition ( const std::string &  s,
TaskContext tc 
)

Parses the string as a condition, and returns a new ConditionInterface. Will throw parse_exception on failure. Use ext to get the data from the components.

Exceptions
parse_exception

Definition at line 141 of file Parser.cpp.

DataSourceBase::shared_ptr RTT::Parser::parseExpression ( const std::string &  s,
TaskContext tc 
)

Parses the expression in s.

Returns
A base::DataSourceBase which contains the expression.
Exceptions
parse_exceptionThrows exceptions of type parse_exception.

Definition at line 170 of file Parser.cpp.

Parser::ParsedFunctions RTT::Parser::parseFunction ( const std::string &  s,
TaskContext c,
const std::string &  filename = "stream" 
)

Reads out the string, parses it, and returns a new FunctionGraph.

Exceptions
parse_exceptionThrows exceptions of type parse_exception.

Definition at line 91 of file Parser.cpp.

Parser::ParsedPrograms RTT::Parser::parseProgram ( const std::string &  s,
TaskContext c,
const std::string &  filename = "stream" 
)

Reads out the string, parses it, and returns a new ProgramGraph.

Exceptions
parse_exceptionThrows exceptions of type parse_exception.

Definition at line 103 of file Parser.cpp.

Parser::ParsedStateMachines RTT::Parser::parseStateMachine ( const std::string &  s,
TaskContext c,
const std::string &  filename = "stream" 
)

Reads out the string, parses it, and returns a new ParsedStateMachine.

Exceptions
file_parse_exceptionThrows exceptions of type file_parse_exception.

Definition at line 117 of file Parser.cpp.

DataSourceBase::shared_ptr RTT::Parser::parseValueChange ( const std::string &  s,
TaskContext tc 
)

Parses a change of a value in s.

Returns
A base::DataSourceBase which contains the command to change the value.
Exceptions
parse_exceptionThrows exceptions of type parse_exception.

Definition at line 201 of file Parser.cpp.

DataSourceBase::shared_ptr RTT::Parser::parseValueStatement ( const std::string &  s,
TaskContext tc 
)

Parses a whole value manipulation/creation statement. Requires the set/var/const etc prefixes.

Returns
A base::DataSourceBase which contains the command to change the value.
Exceptions
parse_exceptionThrows exceptions of type parse_exception.

Definition at line 207 of file Parser.cpp.

void RTT::Parser::runScript ( std::string const &  code,
TaskContext mowner,
ScriptingService service,
std::string const &  filename 
)

Runs all statements in code.

Parameters
codeA list of scripting statements and definitions
mownerThe task in which the code must be interpreted
filenameAn informational description of the source of code.
Exceptions
parse_exceptionand its derivatives.

Definition at line 72 of file Parser.cpp.

Member Data Documentation

ExecutionEngine* RTT::scripting::Parser::mcaller
private

Definition at line 67 of file Parser.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:46