Parser Class Reference

#include <rtt/scripting/Parser.hpp>

List of all members.


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:
ProgramLoader. Use the ProgramLoader for a more user friendly loading of scripts into TaskContexts.

Definition at line 76 of file Parser.hpp.


Public Types

typedef std::vector
< ProgramInterfacePtr
ParsedFunctions
 List of parsed functions.
typedef std::vector
< ProgramInterfacePtr
ParsedPrograms
 List of parsed programs.
typedef std::vector
< ParsedStateMachinePtr
ParsedStateMachines
 List of parsed State Machines.

Public Member Functions

ParsedFunctions parseFunction (const std::string &s, TaskContext *, const std::string &filename="stream")
ParsedPrograms parseProgram (const std::string &s, TaskContext *, const std::string &filename="stream")
ParsedStateMachines parseStateMachine (const std::string &s, TaskContext *, const std::string &filename="stream")
ConditionInterfaceparseCondition (const std::string &s, TaskContext *)
std::pair
< CommandInterface *,
ConditionInterface * > 
parseCommand (const std::string &s, TaskContext *t, bool dispatch)
DataSourceBase::shared_ptr parseExpression (const std::string &s, TaskContext *)
DataSourceBase::shared_ptr parseValueChange (const std::string &s, TaskContext *)

Member Function Documentation

Parser::ParsedFunctions 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_exception Throws exceptions of type parse_exception.

Definition at line 53 of file Parser.cpp.

References ProgramGraphParser::parseFunction().

Parser::ParsedPrograms 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_exception Throws exceptions of type parse_exception.

Definition at line 65 of file Parser.cpp.

References ProgramGraphParser::parse().

Parser::ParsedStateMachines 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_exception Throws exceptions of type file_parse_exception.

Definition at line 78 of file Parser.cpp.

References parse_exception::copy(), and StateGraphParser::parse().

ConditionInterface * 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 101 of file Parser.cpp.

References ConditionParser::getParseResult(), ConditionParser::parser(), and ConditionParser::reset().

std::pair< CommandInterface *, ConditionInterface * > parseCommand ( const std::string &  s,
TaskContext t,
bool  dispatch 
)

Parses the command in s.

Exceptions:
parse_exception Throws exceptions of type parse_exception.

Definition at line 188 of file Parser.cpp.

References CommandParser::getCommand(), CommandParser::getImplTermCondition(), CommandParser::parser(), and CommandParser::reset().

Referenced by StatementProcessor::execute().

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

Parses the expression in s.

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

Definition at line 128 of file Parser.cpp.

References ExpressionParser::dropResult(), ExpressionParser::getResult(), ExpressionParser::hasResult(), and ExpressionParser::parser().

Referenced by StatementProcessor::execute().

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

Parses a change of a value in s.

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

Definition at line 157 of file Parser.cpp.

References ValueChangeParser::assignCommand(), ValueChangeParser::reset(), and ValueChangeParser::variableChangeParser().

Referenced by StatementProcessor::execute().


The documentation for this class was generated from the following files:
Generated on Tue Mar 25 17:41:57 2008 for OrocosReal-TimeToolkit by  doxygen 1.5.3