g4tools  5.4.0
Public Member Functions | List of all members
tools::valop_visitor Class Referenceabstract
Inheritance diagram for tools::valop_visitor:
Inheritance graph
[legend]

Public Member Functions

virtual ~valop_visitor ()
 
virtual bool binary (unsigned int, const valop &, const valop &)=0
 
virtual bool unary (unsigned int, const valop &)=0
 
virtual bool variable (unsigned int, const value &)=0
 
virtual bool option (const valop &)=0
 
virtual bool func_1 (const valop &, const valop &)=0
 
virtual bool func_2 (const valop &, const valop &, const valop &)=0
 
virtual bool func_3 (const valop &, const valop &, const valop &, const valop &)=0
 
virtual bool func_4 (const valop &, const valop &, const valop &, const valop &, const valop &)=0
 
virtual bool func_5 (const valop &, const valop &, const valop &, const valop &, const valop &, const valop &)=0
 
virtual bool func_6 (const valop &, const valop &, const valop &, const valop &, const valop &, const valop &, const valop &)=0
 
bool visit (const valop &a_valop)
 

Detailed Description

Definition at line 400 of file valop.

Constructor & Destructor Documentation

◆ ~valop_visitor()

virtual tools::valop_visitor::~valop_visitor ( )
inlinevirtual

Definition at line 402 of file valop.

402 {}

Member Function Documentation

◆ binary()

virtual bool tools::valop_visitor::binary ( unsigned int  ,
const valop ,
const valop  
)
pure virtual

◆ func_1()

virtual bool tools::valop_visitor::func_1 ( const valop ,
const valop  
)
pure virtual

◆ func_2()

virtual bool tools::valop_visitor::func_2 ( const valop ,
const valop ,
const valop  
)
pure virtual

◆ func_3()

virtual bool tools::valop_visitor::func_3 ( const valop ,
const valop ,
const valop ,
const valop  
)
pure virtual

◆ func_4()

virtual bool tools::valop_visitor::func_4 ( const valop ,
const valop ,
const valop ,
const valop ,
const valop  
)
pure virtual

◆ func_5()

virtual bool tools::valop_visitor::func_5 ( const valop ,
const valop ,
const valop ,
const valop ,
const valop ,
const valop  
)
pure virtual

◆ func_6()

virtual bool tools::valop_visitor::func_6 ( const valop ,
const valop ,
const valop ,
const valop ,
const valop ,
const valop ,
const valop  
)
pure virtual

◆ option()

virtual bool tools::valop_visitor::option ( const valop )
pure virtual

◆ unary()

virtual bool tools::valop_visitor::unary ( unsigned int  ,
const valop  
)
pure virtual

◆ variable()

virtual bool tools::valop_visitor::variable ( unsigned int  ,
const value  
)
pure virtual

◆ visit()

bool tools::valop_visitor::visit ( const valop a_valop)
inline

Definition at line 419 of file valop.

419  {
420  switch(a_valop.m_type) {
421  case valop::CMP_GT:
422  case valop::CMP_GE:
423  case valop::CMP_LT:
424  case valop::CMP_LE:
425  case valop::CMP_EQ:
426  case valop::CMP_NE:
427  case valop::CMP_AND:
428  case valop::CMP_OR:
429 
430  case valop::ADD:
431  case valop::MUL:
432  case valop::SUB:
433  case valop::DIV:
434 
435  case valop::ASIDE:
436  case valop::NVMUL:
437  case valop::EQUAL:
438  case valop::SUPS:
439  case valop::SUBS:
440  if(!a_valop.m_A || !a_valop.m_B) break;
441  return binary(a_valop.m_type,*a_valop.m_A,*a_valop.m_B);
442 
443  case valop::BOOL_TRUE:
444  case valop::BOOL_FALSE:
446  case valop::REAL:
447  case valop::STRING:
448  case valop::SYMBOL:
449  return variable(a_valop.m_type,a_valop.m_variable);
450  case valop::NAME:
451  return option(a_valop);
452  case valop::MINUS:
453  case valop::NOT:
454  case valop::ASSIGN:
455  if(!a_valop.m_A) break;
456  return unary(a_valop.m_type,*a_valop.m_A);
457  case valop::FUNC:{
458  if(!a_valop.m_A) break;
459  if(!a_valop.m_function) {
460  //a_error = std::string("valop::execute : null function");
461  return false;
462  }
463  size_t argn = a_valop.m_function->number_of_arguments();
464  if(argn==1) {
465  return func_1(a_valop,*a_valop.m_A);
466  } else if(argn==2) {
467  if(!a_valop.m_B) break;
468  return func_2(a_valop,*a_valop.m_A,*a_valop.m_B);
469  } else if(argn==3) {
470  if(!a_valop.m_B || !a_valop.m_C) break;
471  return func_3(a_valop,*a_valop.m_A,*a_valop.m_B,*a_valop.m_C);
472  } else if(argn==4) {
473  if(!a_valop.m_B || !a_valop.m_C || !a_valop.m_D) break;
474  return func_4(a_valop,*a_valop.m_A,*a_valop.m_B,*a_valop.m_C,*a_valop.m_D);
475  } else if(argn==5) {
476  if(!a_valop.m_B || !a_valop.m_C || !a_valop.m_D || !a_valop.m_E) break;
477  return func_5(a_valop,*a_valop.m_A,*a_valop.m_B,*a_valop.m_C,*a_valop.m_D,*a_valop.m_E);
478  } else if(argn==6) {
479  if(!a_valop.m_B || !a_valop.m_C || !a_valop.m_D || !a_valop.m_E || !a_valop.m_F) break;
480  return func_6(a_valop,*a_valop.m_A,*a_valop.m_B,*a_valop.m_C,*a_valop.m_D,*a_valop.m_E,*a_valop.m_F);
481  } else {
482  return false;
483  }}
484  default:
485  break;
486  }
487  return false;
488  }

The documentation for this class was generated from the following file:
tools::valop::SYMBOL
@ SYMBOL
Definition: valop:44
tools::valop::CMP_GE
@ CMP_GE
Definition: valop:19
tools::valop::SUPS
@ SUPS
Definition: valop:48
tools::valop::NVMUL
@ NVMUL
Definition: valop:46
tools::valop::ADD
@ ADD
Definition: valop:27
tools::valop::BOOL_TRUE
@ BOOL_TRUE
Definition: valop:40
tools::valop::CMP_EQ
@ CMP_EQ
Definition: valop:22
tools::valop_visitor::func_4
virtual bool func_4(const valop &, const valop &, const valop &, const valop &, const valop &)=0
tools::valop::BOOL_FALSE
@ BOOL_FALSE
Definition: valop:41
tools::valop::CMP_GT
@ CMP_GT
Definition: valop:18
tools::valop::DIV
@ DIV
Definition: valop:30
tools::valop_visitor::func_5
virtual bool func_5(const valop &, const valop &, const valop &, const valop &, const valop &, const valop &)=0
tools::valop_visitor::variable
virtual bool variable(unsigned int, const value &)=0
tools::valop::NAME
@ NAME
Definition: valop:36
tools::valop::NOT
@ NOT
Definition: valop:42
tools::valop::MUL
@ MUL
Definition: valop:28
tools::valop_visitor::option
virtual bool option(const valop &)=0
tools::valop::SUB
@ SUB
Definition: valop:29
tools::valop_visitor::unary
virtual bool unary(unsigned int, const valop &)=0
tools::valop::CMP_OR
@ CMP_OR
Definition: valop:25
tools::valop_visitor::func_2
virtual bool func_2(const valop &, const valop &, const valop &)=0
tools::valop::CMP_LT
@ CMP_LT
Definition: valop:20
tools::valop::MINUS
@ MINUS
Definition: valop:33
tools::valop::STRING
@ STRING
Definition: valop:37
tools::valop::ASSIGN
@ ASSIGN
Definition: valop:32
tools::valop::CMP_NE
@ CMP_NE
Definition: valop:23
tools::valop_visitor::binary
virtual bool binary(unsigned int, const valop &, const valop &)=0
tools::valop::UNSIGNED_INTEGER
@ UNSIGNED_INTEGER
Definition: valop:34
tools::valop::REAL
@ REAL
Definition: valop:35
tools::valop_visitor::func_3
virtual bool func_3(const valop &, const valop &, const valop &, const valop &)=0
tools::valop::ASIDE
@ ASIDE
Definition: valop:45
tools::valop::CMP_LE
@ CMP_LE
Definition: valop:21
tools::valop_visitor::func_1
virtual bool func_1(const valop &, const valop &)=0
tools::valop::SUBS
@ SUBS
Definition: valop:49
tools::valop::EQUAL
@ EQUAL
Definition: valop:47
tools::valop::FUNC
@ FUNC
Definition: valop:39
tools::valop::CMP_AND
@ CMP_AND
Definition: valop:24
tools::valop_visitor::func_6
virtual bool func_6(const valop &, const valop &, const valop &, const valop &, const valop &, const valop &, const valop &)=0