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.

: asttype(ast_unknown), rettype(xpath_type_none), precedence(0)
{
}
ast_unknown
@ ast_unknown
Definition pugixml.cpp:7820
xpath_parser::binary_op_t::rettype
xpath_value_type rettype
Definition pugixml.cpp:9945
xpath_parser::binary_op_t::asttype
ast_type_t asttype
Definition pugixml.cpp:9944
xpath_parser::binary_op_t::precedence
int precedence
Definition pugixml.cpp:9946

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.

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

## Member Function Documentation

## parse()

static binary_op_t xpath_parser::binary_op_t::parse | ( | xpath_lexer & | lexer | ) |

inline static

Definition at line 9956 of file pugixml.cpp.

{
switch (lexer.current())
{
case lex_string:
if (lexer.contents() == PUGIXML_TEXT("or"))
return binary_op_t(ast_op_or, xpath_type_boolean, 1);
else if (lexer.contents() == PUGIXML_TEXT("and"))
return binary_op_t(ast_op_and, xpath_type_boolean, 2);
else if (lexer.contents() == PUGIXML_TEXT("div"))
return binary_op_t(ast_op_divide, xpath_type_number, 6);
else if (lexer.contents() == PUGIXML_TEXT("mod"))
return binary_op_t(ast_op_mod, xpath_type_number, 6);
else
return binary_op_t();
case lex_equal:
return binary_op_t(ast_op_equal, xpath_type_boolean, 3);
case lex_not_equal:
return binary_op_t(ast_op_not_equal, xpath_type_boolean, 3);
case lex_less:
return binary_op_t(ast_op_less, xpath_type_boolean, 4);
case lex_greater:
return binary_op_t(ast_op_greater, xpath_type_boolean, 4);
case lex_less_or_equal:
return binary_op_t(ast_op_less_or_equal, xpath_type_boolean, 4);
case lex_greater_or_equal:
return binary_op_t(ast_op_greater_or_equal, xpath_type_boolean, 4);
case lex_plus:
return binary_op_t(ast_op_add, xpath_type_number, 5);
case lex_minus:
return binary_op_t(ast_op_subtract, xpath_type_number, 5);
case lex_multiply:
return binary_op_t(ast_op_multiply, xpath_type_number, 6);
case lex_union:
return binary_op_t(ast_op_union, xpath_type_node_set, 7);
default:
return binary_op_t();
}
}
xpath_lexer::current
lexeme_t current() const
Definition pugixml.cpp:7800
xpath_lexer::contents
const xpath_lexer_string & contents() const
Definition pugixml.cpp:7810
ast_op_and
@ ast_op_and
Definition pugixml.cpp:7822
ast_op_divide
@ ast_op_divide
Definition pugixml.cpp:7832
ast_op_equal
@ ast_op_equal
Definition pugixml.cpp:7823
ast_op_union
@ ast_op_union
Definition pugixml.cpp:7835
ast_op_not_equal
@ ast_op_not_equal
Definition pugixml.cpp:7824
ast_op_greater
@ ast_op_greater
Definition pugixml.cpp:7826
ast_op_subtract
@ ast_op_subtract
Definition pugixml.cpp:7830
ast_op_less_or_equal
@ ast_op_less_or_equal
Definition pugixml.cpp:7827
ast_op_multiply
@ ast_op_multiply
Definition pugixml.cpp:7831
ast_op_add
@ ast_op_add
Definition pugixml.cpp:7829
ast_op_or
@ ast_op_or
Definition pugixml.cpp:7821
ast_op_greater_or_equal
@ ast_op_greater_or_equal
Definition pugixml.cpp:7828
ast_op_mod
@ ast_op_mod
Definition pugixml.cpp:7833
ast_op_less
@ ast_op_less
Definition pugixml.cpp:7825
lex_multiply
@ lex_multiply
Definition pugixml.cpp:7475
lex_not_equal
@ lex_not_equal
Definition pugixml.cpp:7468
lex_less
@ lex_less
Definition pugixml.cpp:7469
lex_equal
@ lex_equal
Definition pugixml.cpp:7467
lex_greater_or_equal
@ lex_greater_or_equal
Definition pugixml.cpp:7472
lex_union
@ lex_union
Definition pugixml.cpp:7476
lex_minus
@ lex_minus
Definition pugixml.cpp:7474
lex_string
@ lex_string
Definition pugixml.cpp:7486
lex_plus
@ lex_plus
Definition pugixml.cpp:7473
lex_greater
@ lex_greater
Definition pugixml.cpp:7470
lex_less_or_equal
@ lex_less_or_equal
Definition pugixml.cpp:7471
xpath_parser::binary_op_t::binary_op_t
binary_op_t()
Definition pugixml.cpp:9948

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:

- pugixml.cpp