Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
xpath_parser::binary_op_t Struct Reference

Public Member Functions

 binary_op_t ()
 
 binary_op_t (ast_type_t asttype_, xpath_value_type rettype_, int precedence_)
 

Static Public Member Functions

static binary_op_t parse (xpath_lexer &lexer)
 

Public Attributes

ast_type_t asttype
 
xpath_value_type rettype
 
int precedence
 

Detailed Description

Definition at line 9942 of file pugixml.cpp.

Constructor & Destructor Documentation

◆ binary_op_t() [1/2]

xpath_parser::binary_op_t::binary_op_t ( )
inline

Definition at line 9948 of file pugixml.cpp.

9948  : asttype(ast_unknown), rettype(xpath_type_none), precedence(0)
9949  {
9950  }

Referenced by parse().

◆ binary_op_t() [2/2]

xpath_parser::binary_op_t::binary_op_t ( ast_type_t  asttype_,
xpath_value_type  rettype_,
int  precedence_ 
)
inline

Definition at line 9952 of file pugixml.cpp.

9952  : asttype(asttype_), rettype(rettype_), precedence(precedence_)
9953  {
9954  }

Member Function Documentation

◆ parse()

static binary_op_t xpath_parser::binary_op_t::parse ( xpath_lexer lexer)
inlinestatic

Definition at line 9956 of file pugixml.cpp.

9957  {
9958  switch (lexer.current())
9959  {
9960  case lex_string:
9961  if (lexer.contents() == PUGIXML_TEXT("or"))
9962  return binary_op_t(ast_op_or, xpath_type_boolean, 1);
9963  else if (lexer.contents() == PUGIXML_TEXT("and"))
9964  return binary_op_t(ast_op_and, xpath_type_boolean, 2);
9965  else if (lexer.contents() == PUGIXML_TEXT("div"))
9966  return binary_op_t(ast_op_divide, xpath_type_number, 6);
9967  else if (lexer.contents() == PUGIXML_TEXT("mod"))
9968  return binary_op_t(ast_op_mod, xpath_type_number, 6);
9969  else
9970  return binary_op_t();
9971 
9972  case lex_equal:
9973  return binary_op_t(ast_op_equal, xpath_type_boolean, 3);
9974 
9975  case lex_not_equal:
9976  return binary_op_t(ast_op_not_equal, xpath_type_boolean, 3);
9977 
9978  case lex_less:
9979  return binary_op_t(ast_op_less, xpath_type_boolean, 4);
9980 
9981  case lex_greater:
9982  return binary_op_t(ast_op_greater, xpath_type_boolean, 4);
9983 
9984  case lex_less_or_equal:
9985  return binary_op_t(ast_op_less_or_equal, xpath_type_boolean, 4);
9986 
9987  case lex_greater_or_equal:
9988  return binary_op_t(ast_op_greater_or_equal, xpath_type_boolean, 4);
9989 
9990  case lex_plus:
9991  return binary_op_t(ast_op_add, xpath_type_number, 5);
9992 
9993  case lex_minus:
9994  return binary_op_t(ast_op_subtract, xpath_type_number, 5);
9995 
9996  case lex_multiply:
9997  return binary_op_t(ast_op_multiply, xpath_type_number, 6);
9998 
9999  case lex_union:
10000  return binary_op_t(ast_op_union, xpath_type_node_set, 7);
10001 
10002  default:
10003  return binary_op_t();
10004  }
10005  }

References ast_op_add, ast_op_and, ast_op_divide, ast_op_equal, ast_op_greater, ast_op_greater_or_equal, ast_op_less, ast_op_less_or_equal, ast_op_mod, ast_op_multiply, ast_op_not_equal, ast_op_or, ast_op_subtract, ast_op_union, binary_op_t(), xpath_lexer::contents(), xpath_lexer::current(), lex_equal, lex_greater, lex_greater_or_equal, lex_less, lex_less_or_equal, lex_minus, lex_multiply, lex_not_equal, lex_plus, lex_string, and lex_union.

Referenced by xpath_parser::parse_expression_rec().

Member Data Documentation

◆ asttype

ast_type_t xpath_parser::binary_op_t::asttype

Definition at line 9944 of file pugixml.cpp.

Referenced by xpath_parser::parse_expression_rec().

◆ precedence

int xpath_parser::binary_op_t::precedence

Definition at line 9946 of file pugixml.cpp.

Referenced by xpath_parser::parse_expression_rec().

◆ rettype

xpath_value_type xpath_parser::binary_op_t::rettype

Definition at line 9945 of file pugixml.cpp.

Referenced by xpath_parser::parse_expression_rec().


The documentation for this struct was generated from the following file:
xpath_parser::binary_op_t::precedence
int precedence
Definition: pugixml.cpp:9946
lex_less
@ lex_less
Definition: pugixml.cpp:7469
ast_op_add
@ ast_op_add
Definition: pugixml.cpp:7829
ast_op_divide
@ ast_op_divide
Definition: pugixml.cpp:7832
ast_op_equal
@ ast_op_equal
Definition: pugixml.cpp:7823
xpath_lexer::contents
const xpath_lexer_string & contents() const
Definition: pugixml.cpp:7810
ast_op_less
@ ast_op_less
Definition: pugixml.cpp:7825
ast_op_union
@ ast_op_union
Definition: pugixml.cpp:7835
ast_op_not_equal
@ ast_op_not_equal
Definition: pugixml.cpp:7824
lex_union
@ lex_union
Definition: pugixml.cpp:7476
lex_plus
@ lex_plus
Definition: pugixml.cpp:7473
lex_equal
@ lex_equal
Definition: pugixml.cpp:7467
lex_not_equal
@ lex_not_equal
Definition: pugixml.cpp:7468
ast_op_greater
@ ast_op_greater
Definition: pugixml.cpp:7826
ast_op_greater_or_equal
@ ast_op_greater_or_equal
Definition: pugixml.cpp:7828
ast_op_multiply
@ ast_op_multiply
Definition: pugixml.cpp:7831
xpath_parser::binary_op_t::rettype
xpath_value_type rettype
Definition: pugixml.cpp:9945
ast_op_less_or_equal
@ ast_op_less_or_equal
Definition: pugixml.cpp:7827
lex_greater_or_equal
@ lex_greater_or_equal
Definition: pugixml.cpp:7472
xpath_parser::binary_op_t::binary_op_t
binary_op_t()
Definition: pugixml.cpp:9948
xpath_lexer::current
lexeme_t current() const
Definition: pugixml.cpp:7800
lex_multiply
@ lex_multiply
Definition: pugixml.cpp:7475
lex_string
@ lex_string
Definition: pugixml.cpp:7486
lex_minus
@ lex_minus
Definition: pugixml.cpp:7474
xpath_parser::binary_op_t::asttype
ast_type_t asttype
Definition: pugixml.cpp:9944
lex_greater
@ lex_greater
Definition: pugixml.cpp:7470
ast_op_and
@ ast_op_and
Definition: pugixml.cpp:7822
lex_less_or_equal
@ lex_less_or_equal
Definition: pugixml.cpp:7471
ast_unknown
@ ast_unknown
Definition: pugixml.cpp:7820
ast_op_subtract
@ ast_op_subtract
Definition: pugixml.cpp:7830
ast_op_mod
@ ast_op_mod
Definition: pugixml.cpp:7833
ast_op_or
@ ast_op_or
Definition: pugixml.cpp:7821

Generated on Wed Apr 29 2020 19:41:30 for QuickFIX by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2001