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

#include <ExpressionParser.hpp>

Public Member Functions

void dropResult ()
 
 ExpressionParser (TaskContext *pc, ExecutionEngine *caller, CommonParser &common_parser)
 
ConditionInterfacegetCmdResult ()
 
boost::shared_ptr< base::AttributeBasegetHandle ()
 
base::DataSourceBase::shared_ptr getResult ()
 
bool hasResult ()
 
rule_tparser ()
 
 ~ExpressionParser ()
 

Private Member Functions

void inverttime ()
 
void seen_assign ()
 
void seen_binary (const std::string &op)
 
void seen_dotmember (iter_t begin, iter_t end)
 
void seen_index ()
 
void seen_unary (const std::string &op)
 
void seenconstructor ()
 
void seendatacall ()
 
void seentimeexpr ()
 
void seentimespec (int n)
 
void seentimeunit (iter_t begin, iter_t end)
 
void seenvalue ()
 

Private Attributes

bool _invert_time
 
rule_t andexp
 
rule_t assignexp
 
rule_t atomicexpression
 
rule_t call_expression
 
rule_t close_brace
 
rule_t comma
 
CommonParsercommonparser
 
ConstructorParser constrparser
 
rule_t constructor_expression
 
TaskContextcontext
 
DataCallParser datacallparser
 
rule_t div_or_mul
 
rule_t dotexp
 
rule_t equalexp
 
rule_t expression
 
rule_t greatereqexp
 
rule_t greaterexp
 
rule_t groupexp
 
rule_t ifthenelseexp
 
rule_t indexexp
 
ConditionInterfacemcmdcnd
 
boost::shared_ptr< SendHandleAliasmhandle
 
std::string mobjectname
 
rule_t modexp
 
std::string mpropname
 
rule_t notequalexp
 
types::OperatorRepository::shared_ptr opreg
 
rule_t orexp
 
std::stack< base::DataSourceBase::shared_ptrparsestack
 
rule_t plus_or_min
 
rule_t smallereqexp
 
rule_t smallerexp
 
rule_t time_expression
 
rule_t time_spec
 
nsecs tsecs
 
rule_t unaryminusexp
 
rule_t unarynotexp
 
rule_t unaryplusexp
 
rule_t value_expression
 
ValueParser valueparser
 

Detailed Description

How we parse: this parser works like a stack-based RPN calculator. An atomic expression pushes one internal::DataSource up the stack, a binary expression pops two DataSources, and pushes a new one, a unary pops one, and pushes one etc. This allows for the reentrancy we need..

Definition at line 146 of file ExpressionParser.hpp.

Constructor & Destructor Documentation

RTT::ExpressionParser::ExpressionParser ( TaskContext pc,
ExecutionEngine caller,
CommonParser common_parser 
)

Definition at line 373 of file ExpressionParser.cpp.

RTT::ExpressionParser::~ExpressionParser ( )

Definition at line 612 of file ExpressionParser.cpp.

Member Function Documentation

void RTT::ExpressionParser::dropResult ( )

Definition at line 757 of file ExpressionParser.cpp.

ConditionInterface * RTT::ExpressionParser::getCmdResult ( )

Definition at line 631 of file ExpressionParser.cpp.

boost::shared_ptr< AttributeBase > RTT::ExpressionParser::getHandle ( )

In case the parsed result returns a SendHandle, ask the parser to also create a handle for it.

Returns
null pointer if no handle could be made.

Definition at line 637 of file ExpressionParser.cpp.

DataSourceBase::shared_ptr RTT::ExpressionParser::getResult ( )

Definition at line 625 of file ExpressionParser.cpp.

bool RTT::scripting::ExpressionParser::hasResult ( )
inline

Definition at line 227 of file ExpressionParser.hpp.

void RTT::ExpressionParser::inverttime ( )
private

Definition at line 539 of file ExpressionParser.cpp.

rule_t & RTT::ExpressionParser::parser ( )

Definition at line 620 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seen_assign ( )
private

Definition at line 687 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seen_binary ( const std::string &  op)
private

Definition at line 670 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seen_dotmember ( iter_t  begin,
iter_t  end 
)
private

Definition at line 657 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seen_index ( )
private

Definition at line 741 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seen_unary ( const std::string &  op)
private

Definition at line 643 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seenconstructor ( )
private

Definition at line 606 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seendatacall ( )
private

Definition at line 598 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seentimeexpr ( )
private

Definition at line 544 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seentimespec ( int  n)
private

Definition at line 587 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seentimeunit ( iter_t  begin,
iter_t  end 
)
private

Definition at line 558 of file ExpressionParser.cpp.

void RTT::ExpressionParser::seenvalue ( )
private

Definition at line 592 of file ExpressionParser.cpp.

Member Data Documentation

bool RTT::scripting::ExpressionParser::_invert_time
private

Definition at line 201 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::andexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::assignexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::atomicexpression
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::call_expression
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::close_brace
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::comma
private

Definition at line 148 of file ExpressionParser.hpp.

CommonParser& RTT::scripting::ExpressionParser::commonparser
private

The governing common parser.

Definition at line 199 of file ExpressionParser.hpp.

ConstructorParser RTT::scripting::ExpressionParser::constrparser
private

Definition at line 195 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::constructor_expression
private

Definition at line 148 of file ExpressionParser.hpp.

TaskContext* RTT::scripting::ExpressionParser::context
private

Definition at line 204 of file ExpressionParser.hpp.

DataCallParser RTT::scripting::ExpressionParser::datacallparser
private

Definition at line 194 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::div_or_mul
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::dotexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::equalexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::expression
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::greatereqexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::greaterexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::groupexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::ifthenelseexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::indexexp
private

Definition at line 148 of file ExpressionParser.hpp.

ConditionInterface* RTT::scripting::ExpressionParser::mcmdcnd
private

Definition at line 168 of file ExpressionParser.hpp.

boost::shared_ptr<SendHandleAlias> RTT::scripting::ExpressionParser::mhandle
private

Contains the last SendHandle encountered, Will also be dropped by dropResult().

Definition at line 166 of file ExpressionParser.hpp.

std::string RTT::scripting::ExpressionParser::mobjectname
private

Definition at line 172 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::modexp
private

Definition at line 148 of file ExpressionParser.hpp.

std::string RTT::scripting::ExpressionParser::mpropname
private

Definition at line 176 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::notequalexp
private

Definition at line 148 of file ExpressionParser.hpp.

types::OperatorRepository::shared_ptr RTT::scripting::ExpressionParser::opreg
private

Definition at line 202 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::orexp
private

Definition at line 148 of file ExpressionParser.hpp.

std::stack<base::DataSourceBase::shared_ptr> RTT::scripting::ExpressionParser::parsestack
private

The parse stack.. see the comment for this class ( scroll up ;) ) for info on the general idea. We keep a reference to the DataSources in here, while they're in here..

Definition at line 161 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::plus_or_min
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::smallereqexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::smallerexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::time_expression
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::time_spec
private

Definition at line 148 of file ExpressionParser.hpp.

nsecs RTT::scripting::ExpressionParser::tsecs
private

Definition at line 179 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::unaryminusexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::unarynotexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::unaryplusexp
private

Definition at line 148 of file ExpressionParser.hpp.

rule_t RTT::scripting::ExpressionParser::value_expression
private

Definition at line 148 of file ExpressionParser.hpp.

ValueParser RTT::scripting::ExpressionParser::valueparser
private

Definition at line 200 of file ExpressionParser.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:47