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 < ProgramInterfacePtr > | ParsedFunctions |
typedef std::vector < ProgramInterfacePtr > | ParsedFunctions |
typedef std::vector < ProgramInterfacePtr > | ParsedPrograms |
typedef std::vector < ProgramInterfacePtr > | ParsedPrograms |
typedef std::vector < ParsedStateMachinePtr > | ParsedStateMachines |
typedef std::vector < ParsedStateMachinePtr > | ParsedStateMachines |
Public Member Functions | |
ConditionInterface * | parseCondition (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. | |
ConditionInterface * | parseCondition (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. | |
base::DataSourceBase::shared_ptr | parseExpression (const std::string &s, TaskContext *) |
Parses the expression in s. | |
base::DataSourceBase::shared_ptr | parseExpression (const std::string &s, TaskContext *) |
Parses the expression in s. | |
ParsedFunctions | parseFunction (const std::string &s, TaskContext *, const std::string &filename="stream") |
Reads out the string, parses it, and returns a new FunctionGraph. | |
ParsedFunctions | parseFunction (const std::string &s, TaskContext *, const std::string &filename="stream") |
Reads out the string, parses it, and returns a new FunctionGraph. | |
ParsedPrograms | parseProgram (const std::string &s, TaskContext *, const std::string &filename="stream") |
Reads out the string, parses it, and returns a new ProgramGraph. | |
ParsedPrograms | parseProgram (const std::string &s, TaskContext *, const std::string &filename="stream") |
Reads out the string, parses it, and returns a new ProgramGraph. | |
Parser (TaskContext *caller=0) | |
Parser (TaskContext *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. | |
ParsedStateMachines | parseStateMachine (const std::string &s, TaskContext *, const std::string &filename="stream") |
Reads out the string, parses it, and returns a new ParsedStateMachine. | |
base::DataSourceBase::shared_ptr | parseValueChange (const std::string &s, TaskContext *) |
Parses a change of a value in s. | |
base::DataSourceBase::shared_ptr | parseValueChange (const std::string &s, TaskContext *) |
Parses a change of a value in s. | |
base::DataSourceBase::shared_ptr | parseValueStatement (const std::string &s, TaskContext *) |
Parses a whole value manipulation/creation statement. Requires the set/var/const etc prefixes. | |
base::DataSourceBase::shared_ptr | parseValueStatement (const std::string &s, TaskContext *) |
Parses a whole value manipulation/creation statement. Requires the set/var/const etc prefixes. | |
void | runScript (std::string const &code, TaskContext *mowner, ScriptingService *service, std::string const &filename) |
void | runScript (std::string const &code, TaskContext *mowner, ScriptingService *service, std::string const &filename) |
Private Attributes | |
ExecutionEngine * | mcaller |
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.
Definition at line 61 of file install/include/rtt/scripting/Parser.hpp.
typedef std::vector< ProgramInterfacePtr > RTT::scripting::Parser::ParsedFunctions |
List of parsed functions.
Definition at line 89 of file rtt/scripting/Parser.hpp.
typedef std::vector< ProgramInterfacePtr > RTT::scripting::Parser::ParsedFunctions |
List of parsed functions.
Definition at line 74 of file install/include/rtt/scripting/Parser.hpp.
typedef std::vector< ProgramInterfacePtr > RTT::scripting::Parser::ParsedPrograms |
List of parsed programs.
Definition at line 101 of file rtt/scripting/Parser.hpp.
typedef std::vector< ProgramInterfacePtr > RTT::scripting::Parser::ParsedPrograms |
List of parsed programs.
Definition at line 86 of file install/include/rtt/scripting/Parser.hpp.
typedef std::vector< ParsedStateMachinePtr > RTT::scripting::Parser::ParsedStateMachines |
List of parsed State Machines.
Definition at line 113 of file rtt/scripting/Parser.hpp.
typedef std::vector< ParsedStateMachinePtr > RTT::scripting::Parser::ParsedStateMachines |
List of parsed State Machines.
Definition at line 98 of file install/include/rtt/scripting/Parser.hpp.
RTT::Parser::Parser | ( | TaskContext * | caller = 0 |
) |
Create a parser and allow to explicitly specify which TaskContext is calling it. This allows to generate the correct asynchonous method invocation code in case caller and parser are not identical.
Definition at line 54 of file Parser.cpp.
RTT::scripting::Parser::Parser | ( | TaskContext * | caller = 0 |
) |
Create a parser and allow to explicitly specify which TaskContext is calling it. This allows to generate the correct asynchonous method invocation code in case caller and parser are not identical.
ConditionInterface* RTT::scripting::Parser::parseCondition | ( | 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.
parse_exception |
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.
parse_exception |
Definition at line 134 of file Parser.cpp.
base::DataSourceBase::shared_ptr RTT::scripting::Parser::parseExpression | ( | const std::string & | s, | |
TaskContext * | ||||
) |
Parses the expression in s.
parse_exception | Throws exceptions of type parse_exception. |
DataSourceBase::shared_ptr RTT::Parser::parseExpression | ( | const std::string & | s, | |
TaskContext * | tc | |||
) |
Parses the expression in s.
parse_exception | Throws exceptions of type parse_exception. |
Definition at line 163 of file Parser.cpp.
ParsedFunctions RTT::scripting::Parser::parseFunction | ( | const std::string & | s, | |
TaskContext * | , | |||
const std::string & | filename = "stream" | |||
) |
Reads out the string, parses it, and returns a new FunctionGraph.
parse_exception | Throws exceptions of type parse_exception. |
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.
parse_exception | Throws exceptions of type parse_exception. |
Definition at line 84 of file Parser.cpp.
ParsedPrograms RTT::scripting::Parser::parseProgram | ( | const std::string & | s, | |
TaskContext * | , | |||
const std::string & | filename = "stream" | |||
) |
Reads out the string, parses it, and returns a new ProgramGraph.
parse_exception | Throws exceptions of type parse_exception. |
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.
parse_exception | Throws exceptions of type parse_exception. |
Definition at line 96 of file Parser.cpp.
ParsedStateMachines RTT::scripting::Parser::parseStateMachine | ( | const std::string & | s, | |
TaskContext * | , | |||
const std::string & | filename = "stream" | |||
) |
Reads out the string, parses it, and returns a new ParsedStateMachine.
file_parse_exception | Throws exceptions of type file_parse_exception. |
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.
file_parse_exception | Throws exceptions of type file_parse_exception. |
Definition at line 110 of file Parser.cpp.
base::DataSourceBase::shared_ptr RTT::scripting::Parser::parseValueChange | ( | const std::string & | s, | |
TaskContext * | ||||
) |
Parses a change of a value in s.
parse_exception | Throws exceptions of type parse_exception. |
DataSourceBase::shared_ptr RTT::Parser::parseValueChange | ( | const std::string & | s, | |
TaskContext * | tc | |||
) |
Parses a change of a value in s.
parse_exception | Throws exceptions of type parse_exception. |
Definition at line 194 of file Parser.cpp.
base::DataSourceBase::shared_ptr RTT::scripting::Parser::parseValueStatement | ( | const std::string & | s, | |
TaskContext * | ||||
) |
Parses a whole value manipulation/creation statement. Requires the set/var/const etc prefixes.
parse_exception | Throws exceptions of type parse_exception. |
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.
parse_exception | Throws exceptions of type parse_exception. |
Definition at line 200 of file Parser.cpp.
void RTT::scripting::Parser::runScript | ( | std::string const & | code, | |
TaskContext * | mowner, | |||
ScriptingService * | service, | |||
std::string const & | filename | |||
) |
Runs all statements in code.
code | A list of scripting statements and definitions | |
mowner | The task in which the code must be interpreted | |
filename | An informational description of the source of code. |
parse_exception | and its derivatives. |
void RTT::Parser::runScript | ( | std::string const & | code, | |
TaskContext * | mowner, | |||
ScriptingService * | service, | |||
std::string const & | filename | |||
) |
Runs all statements in code.
code | A list of scripting statements and definitions | |
mowner | The task in which the code must be interpreted | |
filename | An informational description of the source of code. |
parse_exception | and its derivatives. |
Definition at line 65 of file Parser.cpp.
ExecutionEngine * RTT::scripting::Parser::mcaller [private] |
Definition at line 52 of file install/include/rtt/scripting/Parser.hpp.