#include <PredicatesScript.h>
Public Member Functions | |
void | addInternalFunction (string functionName) |
string | getName () |
string | getParameter (string name) |
PythonScript | getPythonScript () |
string | getSourceScript () |
string | getTranslatedScript () |
PredicatesScript (string script, set< string > &internalFunctions) | |
Private Member Functions | |
bool | addParameter (const boost::match_results< std::string::const_iterator > ¶mMatch) |
void | processInternalFunctions (string &script) |
void | processParameters (string &script) |
void | processPredicates (string &script) |
void | processTopics (string &script) |
Private Attributes | |
set< string > | _internalFunctions |
string | _name |
map< string, string > | _parameters |
string | _sourceScript |
string | _translatedScript |
Definition at line 22 of file PredicatesScript.h.
PredicatesScript::PredicatesScript | ( | string | script, |
set< string > & | internalFunctions | ||
) |
Parses provided predicates script to python code
script | The script |
internalFunctions | Internal known function which will be replaced with appropriate wrapper |
Definition at line 10 of file PredicatesScript.cpp.
void PredicatesScript::addInternalFunction | ( | string | functionName | ) | [inline] |
Adds a name of internal function
functionName |
Definition at line 69 of file PredicatesScript.h.
bool PredicatesScript::addParameter | ( | const boost::match_results< std::string::const_iterator > & | paramMatch | ) | [private] |
Callback method for regex param search
paramMatch |
Definition at line 29 of file PredicatesScript.cpp.
string PredicatesScript::getName | ( | ) | [inline] |
string PredicatesScript::getParameter | ( | string | name | ) | [inline] |
Returns parameter value by name
name | Parameter name |
Definition at line 61 of file PredicatesScript.h.
PythonScript PredicatesScript::getPythonScript | ( | ) | [inline] |
string PredicatesScript::getSourceScript | ( | ) | [inline] |
Returns the source script without changes
Definition at line 36 of file PredicatesScript.h.
string PredicatesScript::getTranslatedScript | ( | ) | [inline] |
void PredicatesScript::processInternalFunctions | ( | string & | script | ) | [private] |
Replaces call to known function with python wrapper (robil_lib.invoke('function_name', param1, param2, ...)
script |
Definition at line 79 of file PredicatesScript.cpp.
void PredicatesScript::processParameters | ( | string & | script | ) | [private] |
Extracts all parameters from script (#! param_name param_value)
script |
Definition at line 44 of file PredicatesScript.cpp.
void PredicatesScript::processPredicates | ( | string & | script | ) | [private] |
Replaces all predicates with validate.is_true(predicate)
script |
Definition at line 58 of file PredicatesScript.cpp.
void PredicatesScript::processTopics | ( | string & | script | ) | [private] |
Replaces all ros topics {topic_name} with python method topic('topic_name')
script |
Definition at line 52 of file PredicatesScript.cpp.
set<string> PredicatesScript::_internalFunctions [private] |
Definition at line 109 of file PredicatesScript.h.
string PredicatesScript::_name [private] |
Definition at line 107 of file PredicatesScript.h.
map<string, string> PredicatesScript::_parameters [private] |
Definition at line 108 of file PredicatesScript.h.
string PredicatesScript::_sourceScript [private] |
Definition at line 105 of file PredicatesScript.h.
string PredicatesScript::_translatedScript [private] |
Definition at line 106 of file PredicatesScript.h.