MarlinMT  0.1.0
marlinmt::Tokenizer Class Reference

Helper class for LogicalExpressions that splits the expression into subexpressions - needs to be apllied iteratively. More...

#include <LogicalExpressions.h>

Public Member Functions

 Tokenizer (std::vector< Expression > &tokens)
 
void operator() (const char &c)
 Save the current character and change state if necessary. More...
 
 ~Tokenizer ()
 
std::vector< Expression > & result ()
 

Private Types

enum  state { newtoken, parenthesis, operation }
 

Private Attributes

std::vector< Expression > & _tokens
 
char _last
 
bool needToken
 
int openPar
 
int closedPar
 
state _state
 

Detailed Description

Helper class for LogicalExpressions that splits the expression into subexpressions - needs to be apllied iteratively.

Definition at line 39 of file LogicalExpressions.h.

Member Enumeration Documentation

◆ state

Enumerator
newtoken 
parenthesis 
operation 

Definition at line 41 of file LogicalExpressions.h.

Constructor & Destructor Documentation

◆ Tokenizer()

marlinmt::Tokenizer::Tokenizer ( std::vector< Expression > &  tokens)
inline

Definition at line 56 of file LogicalExpressions.h.

◆ ~Tokenizer()

marlinmt::Tokenizer::~Tokenizer ( )
inline

Definition at line 130 of file LogicalExpressions.h.

Member Function Documentation

◆ operator()()

void marlinmt::Tokenizer::operator() ( const char &  c)
inline

Save the current character and change state if necessary.

Definition at line 63 of file LogicalExpressions.h.

References marlinmt::Expression::AND, marlinmt::Expression::Expression(), and marlinmt::Expression::OR.

◆ result()

std::vector<Expression>& marlinmt::Tokenizer::result ( )
inline

Definition at line 133 of file LogicalExpressions.h.

Member Data Documentation

◆ _last

char marlinmt::Tokenizer::_last
private

Definition at line 48 of file LogicalExpressions.h.

◆ _state

state marlinmt::Tokenizer::_state
private

Definition at line 52 of file LogicalExpressions.h.

◆ _tokens

std::vector< Expression >& marlinmt::Tokenizer::_tokens
private

Definition at line 47 of file LogicalExpressions.h.

◆ closedPar

int marlinmt::Tokenizer::closedPar
private

Definition at line 51 of file LogicalExpressions.h.

◆ needToken

bool marlinmt::Tokenizer::needToken
private

Definition at line 49 of file LogicalExpressions.h.

◆ openPar

int marlinmt::Tokenizer::openPar
private

Definition at line 50 of file LogicalExpressions.h.


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