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 }
@ ast_unknown
Definition pugixml.cpp:7820
xpath_value_type rettype
Definition pugixml.cpp:9945

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
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 }
lexeme_t current() const
Definition pugixml.cpp:7800
const xpath_lexer_string & contents() const
Definition pugixml.cpp:7810
@ ast_op_and
Definition pugixml.cpp:7822
@ ast_op_divide
Definition pugixml.cpp:7832
@ ast_op_equal
Definition pugixml.cpp:7823
@ ast_op_union
Definition pugixml.cpp:7835
@ ast_op_not_equal
Definition pugixml.cpp:7824
@ ast_op_greater
Definition pugixml.cpp:7826
@ ast_op_subtract
Definition pugixml.cpp:7830
@ ast_op_less_or_equal
Definition pugixml.cpp:7827
@ ast_op_multiply
Definition pugixml.cpp:7831
@ ast_op_add
Definition pugixml.cpp:7829
@ ast_op_or
Definition pugixml.cpp:7821
@ ast_op_greater_or_equal
Definition pugixml.cpp:7828
@ ast_op_mod
Definition pugixml.cpp:7833
@ ast_op_less
Definition pugixml.cpp:7825
@ lex_multiply
Definition pugixml.cpp:7475
@ lex_not_equal
Definition pugixml.cpp:7468
@ lex_less
Definition pugixml.cpp:7469
@ lex_equal
Definition pugixml.cpp:7467
@ lex_greater_or_equal
Definition pugixml.cpp:7472
@ lex_union
Definition pugixml.cpp:7476
@ lex_minus
Definition pugixml.cpp:7474
@ lex_string
Definition pugixml.cpp:7486
@ lex_plus
Definition pugixml.cpp:7473
@ lex_greater
Definition pugixml.cpp:7470
@ lex_less_or_equal
Definition pugixml.cpp:7471

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:

Generated on Sat Feb 3 2024 04:23:15 for QuickFIX by doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2001