| 10729 | } |
| 10730 | |
| 10731 | static binary_op_t parse(xpath_lexer& lexer) |
| 10732 | { |
| 10733 | switch (lexer.current()) |
| 10734 | { |
| 10735 | case lex_string: |
| 10736 | if (lexer.contents() == PUGIXML_TEXT("or")) |
| 10737 | return binary_op_t(ast_op_or, xpath_type_boolean, 1); |
| 10738 | else if (lexer.contents() == PUGIXML_TEXT("and")) |
| 10739 | return binary_op_t(ast_op_and, xpath_type_boolean, 2); |
| 10740 | else if (lexer.contents() == PUGIXML_TEXT("div")) |
| 10741 | return binary_op_t(ast_op_divide, xpath_type_number, 6); |
| 10742 | else if (lexer.contents() == PUGIXML_TEXT("mod")) |
| 10743 | return binary_op_t(ast_op_mod, xpath_type_number, 6); |
| 10744 | else |
| 10745 | return binary_op_t(); |
| 10746 | |
| 10747 | case lex_equal: |
| 10748 | return binary_op_t(ast_op_equal, xpath_type_boolean, 3); |
| 10749 | |
| 10750 | case lex_not_equal: |
| 10751 | return binary_op_t(ast_op_not_equal, xpath_type_boolean, 3); |
| 10752 | |
| 10753 | case lex_less: |
| 10754 | return binary_op_t(ast_op_less, xpath_type_boolean, 4); |
| 10755 | |
| 10756 | case lex_greater: |
| 10757 | return binary_op_t(ast_op_greater, xpath_type_boolean, 4); |
| 10758 | |
| 10759 | case lex_less_or_equal: |
| 10760 | return binary_op_t(ast_op_less_or_equal, xpath_type_boolean, 4); |
| 10761 | |
| 10762 | case lex_greater_or_equal: |
| 10763 | return binary_op_t(ast_op_greater_or_equal, xpath_type_boolean, 4); |
| 10764 | |
| 10765 | case lex_plus: |
| 10766 | return binary_op_t(ast_op_add, xpath_type_number, 5); |
| 10767 | |
| 10768 | case lex_minus: |
| 10769 | return binary_op_t(ast_op_subtract, xpath_type_number, 5); |
| 10770 | |
| 10771 | case lex_multiply: |
| 10772 | return binary_op_t(ast_op_multiply, xpath_type_number, 6); |
| 10773 | |
| 10774 | case lex_union: |
| 10775 | return binary_op_t(ast_op_union, xpath_type_node_set, 7); |
| 10776 | |
| 10777 | default: |
| 10778 | return binary_op_t(); |
| 10779 | } |
| 10780 | } |
| 10781 | }; |
| 10782 | |
| 10783 | xpath_ast_node* parse_expression_rec(xpath_ast_node* lhs, int limit) |
nothing calls this directly
no test coverage detected