MySQL 9.2.0
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
routing_guidelines::Rules_parser Class Referencefinal

Conducting the whole scanning and parsing of routing guidelines rules. More...

#include <rules_parser.h>

Public Member Functions

 Rules_parser (std::function< void(const std::string &)> tracer=nullptr)
 
rpn::Expression parse (const std::string &buf, rpn::Context *context)
 
bool extended_session_info_used () const
 
bool session_rand_used () const
 

Static Public Member Functions

static std::vector< std::string > get_keyword_names ()
 
static std::vector< std::string > get_function_names ()
 

Private Member Functions

 Rules_parser (const Rules_parser &)=delete
 
 Rules_parser (Rules_parser &&)=delete
 
Rules_parseroperator= (const Rules_parser &)=delete
 
Rules_parseroperator= (Rules_parser &&)=delete
 
void emit (rpn::Token::Type type, const YYLTYPE &loc)
 
void emit_null ()
 
void emit_num (double val, rpn::Token::Type type=rpn::Token::Type::NUM)
 
void emit_string (std::string_view str, rpn::Token::Type type=rpn::Token::Type::STR)
 
void emit_log_operation (rpn::Token::Type type, double arg_split, const YYLTYPE &loc)
 
bool emit_in_op (const Exp_info &e, List_info *list, YYLTYPE *llocp, Exp_info *ret)
 
bool emit_like_op (const Exp_info &str, const Exp_info &pattern, YYLTYPE *llocp, Exp_info *ret)
 
bool emit_function (const rpn::Function_definition *function, List_info *arguments, YYLTYPE *llocp, Exp_info *ret)
 
bool emit_resolve (YYLTYPE *llocp, Exp_info *ret, rpn::Token::Type resolve_ver)
 
bool emit_concat (const List_info *arguments, YYLTYPE *llocp, Exp_info *ret)
 
bool emit_regexp (const List_info *arguments, YYLTYPE *llocp, Exp_info *ret)
 
bool emit_reference (std::string_view name, YYLTYPE *llocp, Exp_info *ret)
 
bool emit_network (Exp_info *ret)
 
bool check_role_types (const Exp_info &left, const Exp_info &right, YYLTYPE *llocp)
 
bool type_error (YYLTYPE *llocp, const std::string &msg, rpn::Token::Type expected, rpn::Token::Type got)
 
void trace (const std::string &s)
 
void is_extended_session_info (std::string_view name)
 
void uses_session_rand (std::string_view name)
 
friend int::yyparse (Rules_parser *rp)
 
friend int::yylex (union YYSTYPE *lvalp, YYLTYPE *llocp, routing_guidelines::Rules_parser *rp)
 
friend void::yyerror (YYLTYPE *llocp, routing_guidelines::Rules_parser *rp, const char *msg)
 

Private Attributes

std::vector< rpn::Tokenrpn_
 
std::string error_
 
rpn::Contextcontext_ {nullptr}
 
bool extended_session_info_in_use_ {false}
 
bool session_rand_value_used_ {false}
 
const std::string * buf_ {nullptr}
 
std::string::size_type pos_ {0}
 
std::function< void(const std::string &)> tracer_
 

Detailed Description

Conducting the whole scanning and parsing of routing guidelines rules.

Constructor & Destructor Documentation

◆ Rules_parser() [1/3]

routing_guidelines::Rules_parser::Rules_parser ( std::function< void(const std::string &)>  tracer = nullptr)
inlineexplicit

◆ Rules_parser() [2/3]

routing_guidelines::Rules_parser::Rules_parser ( const Rules_parser )
privatedelete

◆ Rules_parser() [3/3]

routing_guidelines::Rules_parser::Rules_parser ( Rules_parser &&  )
privatedelete

Member Function Documentation

◆ check_role_types()

bool routing_guidelines::Rules_parser::check_role_types ( const Exp_info left,
const Exp_info right,
YYLTYPE *  llocp 
)
private

◆ emit()

void routing_guidelines::Rules_parser::emit ( rpn::Token::Type  type,
const YYLTYPE &  loc 
)
private

◆ emit_concat()

bool routing_guidelines::Rules_parser::emit_concat ( const List_info arguments,
YYLTYPE *  llocp,
Exp_info ret 
)
private

◆ emit_function()

bool routing_guidelines::Rules_parser::emit_function ( const rpn::Function_definition function,
List_info arguments,
YYLTYPE *  llocp,
Exp_info ret 
)
private

◆ emit_in_op()

bool routing_guidelines::Rules_parser::emit_in_op ( const Exp_info e,
List_info list,
YYLTYPE *  llocp,
Exp_info ret 
)
private

◆ emit_like_op()

bool routing_guidelines::Rules_parser::emit_like_op ( const Exp_info str,
const Exp_info pattern,
YYLTYPE *  llocp,
Exp_info ret 
)
private

◆ emit_log_operation()

void routing_guidelines::Rules_parser::emit_log_operation ( rpn::Token::Type  type,
double  arg_split,
const YYLTYPE &  loc 
)
private

◆ emit_network()

bool routing_guidelines::Rules_parser::emit_network ( Exp_info ret)
private

◆ emit_null()

void routing_guidelines::Rules_parser::emit_null ( )
private

◆ emit_num()

void routing_guidelines::Rules_parser::emit_num ( double  val,
rpn::Token::Type  type = rpn::Token::Type::NUM 
)
private

◆ emit_reference()

bool routing_guidelines::Rules_parser::emit_reference ( std::string_view  name,
YYLTYPE *  llocp,
Exp_info ret 
)
private

◆ emit_regexp()

bool routing_guidelines::Rules_parser::emit_regexp ( const List_info arguments,
YYLTYPE *  llocp,
Exp_info ret 
)
private

◆ emit_resolve()

bool routing_guidelines::Rules_parser::emit_resolve ( YYLTYPE *  llocp,
Exp_info ret,
rpn::Token::Type  resolve_ver 
)
private

◆ emit_string()

void routing_guidelines::Rules_parser::emit_string ( std::string_view  str,
rpn::Token::Type  type = rpn::Token::Type::STR 
)
private

◆ extended_session_info_used()

bool routing_guidelines::Rules_parser::extended_session_info_used ( ) const
inline

◆ get_function_names()

std::vector< std::string > routing_guidelines::Rules_parser::get_function_names ( )
static

◆ get_keyword_names()

std::vector< std::string > routing_guidelines::Rules_parser::get_keyword_names ( )
static

◆ int::yylex()

routing_guidelines::Rules_parser::int::yylex ( union YYSTYPE lvalp,
YYLTYPE *  llocp,
routing_guidelines::Rules_parser rp 
)
private

◆ int::yyparse()

◆ is_extended_session_info()

void routing_guidelines::Rules_parser::is_extended_session_info ( std::string_view  name)
private

◆ operator=() [1/2]

Rules_parser & routing_guidelines::Rules_parser::operator= ( const Rules_parser )
privatedelete

◆ operator=() [2/2]

Rules_parser & routing_guidelines::Rules_parser::operator= ( Rules_parser &&  )
privatedelete

◆ parse()

rpn::Expression routing_guidelines::Rules_parser::parse ( const std::string &  buf,
rpn::Context context 
)

◆ session_rand_used()

bool routing_guidelines::Rules_parser::session_rand_used ( ) const
inline

◆ trace()

void routing_guidelines::Rules_parser::trace ( const std::string &  s)
inlineprivate

◆ type_error()

bool routing_guidelines::Rules_parser::type_error ( YYLTYPE *  llocp,
const std::string &  msg,
rpn::Token::Type  expected,
rpn::Token::Type  got 
)
private

◆ uses_session_rand()

void routing_guidelines::Rules_parser::uses_session_rand ( std::string_view  name)
private

◆ void::yyerror()

routing_guidelines::Rules_parser::void::yyerror ( YYLTYPE *  llocp,
routing_guidelines::Rules_parser rp,
const char *  msg 
)
private

Member Data Documentation

◆ buf_

const std::string* routing_guidelines::Rules_parser::buf_ {nullptr}
private

◆ context_

rpn::Context* routing_guidelines::Rules_parser::context_ {nullptr}
private

◆ error_

std::string routing_guidelines::Rules_parser::error_
private

◆ extended_session_info_in_use_

bool routing_guidelines::Rules_parser::extended_session_info_in_use_ {false}
private

◆ pos_

std::string::size_type routing_guidelines::Rules_parser::pos_ {0}
private

◆ rpn_

std::vector<rpn::Token> routing_guidelines::Rules_parser::rpn_
private

◆ session_rand_value_used_

bool routing_guidelines::Rules_parser::session_rand_value_used_ {false}
private

◆ tracer_

std::function<void(const std::string &)> routing_guidelines::Rules_parser::tracer_
private

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