Public Member Functions | Static Public Member Functions | Public Attributes
xpath_parser::binary_op_t Struct Reference

List of all members.

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

Definition at line 9948 of file pugixml.cpp.

Referenced by parse().

                                     : asttype(ast_unknown), rettype(xpath_type_none), precedence(0)
                        {
                        }
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

static binary_op_t xpath_parser::binary_op_t::parse ( xpath_lexer lexer) [inline, static]

Definition at line 9956 of file pugixml.cpp.

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().

                        {
                                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();
                                }
                        }

Member Data Documentation

Definition at line 9944 of file pugixml.cpp.

Referenced by xpath_parser::parse_expression_rec().

Definition at line 9946 of file pugixml.cpp.

Referenced by xpath_parser::parse_expression_rec().

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 Mon Sep 15 2014 01:23:56 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001