C++ Mathematical Expression Toolkit (ExprTk) release
Loading...
Searching...
No Matches
exprtk::lexer::token_scanner Class Reference

#include <exprtk.hpp>

Inheritance diagram for exprtk::lexer::token_scanner:
[legend]
Collaboration diagram for exprtk::lexer::token_scanner:
[legend]

Public Member Functions

virtual ~token_scanner ()
 token_scanner (const std::size_t &stride)
std::size_t process (generator &g)
virtual bool operator() (const token &)
virtual bool operator() (const token &, const token &)
virtual bool operator() (const token &, const token &, const token &)
virtual bool operator() (const token &, const token &, const token &, const token &)
Public Member Functions inherited from exprtk::lexer::helper_interface
virtual void init ()
virtual void reset ()
virtual bool result ()
virtual ~helper_interface ()

Private Attributes

const std::size_t stride_

Detailed Description

Definition at line 3174 of file exprtk.hpp.

Constructor & Destructor Documentation

◆ ~token_scanner()

virtual exprtk::lexer::token_scanner::~token_scanner ( )
inlinevirtual

Definition at line 3178 of file exprtk.hpp.

3179 {}

References exprtk_override.

◆ token_scanner()

exprtk::lexer::token_scanner::token_scanner ( const std::size_t & stride)
inlineexplicit

Definition at line 3181 of file exprtk.hpp.

3182 : stride_(stride)
3183 {
3184 if (stride > 4)
3185 {
3186 throw std::invalid_argument("token_scanner() - Invalid stride value");
3187 }
3188 }
const std::size_t stride_
Definition exprtk.hpp:3280

References stride_.

Referenced by exprtk::lexer::helper::bracket_checker::bracket_checker(), exprtk::lexer::helper::numeric_checker< T >::numeric_checker(), exprtk::lexer::helper::sequence_validator::sequence_validator(), and exprtk::lexer::helper::sequence_validator_3tokens::sequence_validator_3tokens().

Here is the caller graph for this function:

Member Function Documentation

◆ operator()() [1/4]

virtual bool exprtk::lexer::token_scanner::operator() ( const token & )
inlinevirtual

◆ operator()() [2/4]

virtual bool exprtk::lexer::token_scanner::operator() ( const token & ,
const token &  )
inlinevirtual

◆ operator()() [3/4]

virtual bool exprtk::lexer::token_scanner::operator() ( const token & ,
const token & ,
const token &  )
inlinevirtual

◆ operator()() [4/4]

virtual bool exprtk::lexer::token_scanner::operator() ( const token & ,
const token & ,
const token & ,
const token &  )
inlinevirtual

◆ process()

std::size_t exprtk::lexer::token_scanner::process ( generator & g)
inlinevirtual

Reimplemented from exprtk::lexer::helper_interface.

Definition at line 3190 of file exprtk.hpp.

3191 {
3192 if (g.token_list_.size() >= stride_)
3193 {
3194 for (std::size_t i = 0; i < (g.token_list_.size() - stride_ + 1); ++i)
3195 {
3196 token t;
3197
3198 switch (stride_)
3199 {
3200 case 1 :
3201 {
3202 const token& t0 = g.token_list_[i];
3203
3204 if (!operator()(t0))
3205 {
3206 return 0;
3207 }
3208 }
3209 break;
3210
3211 case 2 :
3212 {
3213 const token& t0 = g.token_list_[i ];
3214 const token& t1 = g.token_list_[i + 1];
3215
3216 if (!operator()(t0, t1))
3217 {
3218 return 0;
3219 }
3220 }
3221 break;
3222
3223 case 3 :
3224 {
3225 const token& t0 = g.token_list_[i ];
3226 const token& t1 = g.token_list_[i + 1];
3227 const token& t2 = g.token_list_[i + 2];
3228
3229 if (!operator()(t0, t1, t2))
3230 {
3231 return 0;
3232 }
3233 }
3234 break;
3235
3236 case 4 :
3237 {
3238 const token& t0 = g.token_list_[i ];
3239 const token& t1 = g.token_list_[i + 1];
3240 const token& t2 = g.token_list_[i + 2];
3241 const token& t3 = g.token_list_[i + 3];
3242
3243 if (!operator()(t0, t1, t2, t3))
3244 {
3245 return 0;
3246 }
3247 }
3248 break;
3249
3250 default: continue;
3251 }
3252 }
3253 }
3254
3255 return 0;
3256 }

References exprtk_override, and stride_.

Referenced by exprtk::lexer::helper::helper_assembly::run_scanners().

Here is the caller graph for this function:

Member Data Documentation

◆ stride_

const std::size_t exprtk::lexer::token_scanner::stride_
private

Definition at line 3280 of file exprtk.hpp.

Referenced by process(), and token_scanner().


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