Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 12089 of file pugixml.cc.

Constructor & Destructor Documentation

◆ binary_op_t() [1/2]

xpath_parser::binary_op_t::binary_op_t ( )
inline

Definition at line 12095 of file pugixml.cc.

12095 : asttype(ast_unknown), rettype(xpath_type_none), precedence(0)
12096 {
12097 }
@ ast_unknown
Definition pugixml.cc:9555
xpath_value_type rettype
Definition pugixml.cc:12092

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 12099 of file pugixml.cc.

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

Member Function Documentation

◆ parse()

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

Definition at line 12103 of file pugixml.cc.

12104 {
12105 switch (lexer.current())
12106 {
12107 case lex_string:
12108 if (lexer.contents() == PUGIXML_TEXT("or"))
12109 return binary_op_t(ast_op_or, xpath_type_boolean, 1);
12110 else if (lexer.contents() == PUGIXML_TEXT("and"))
12111 return binary_op_t(ast_op_and, xpath_type_boolean, 2);
12112 else if (lexer.contents() == PUGIXML_TEXT("div"))
12113 return binary_op_t(ast_op_divide, xpath_type_number, 6);
12114 else if (lexer.contents() == PUGIXML_TEXT("mod"))
12115 return binary_op_t(ast_op_mod, xpath_type_number, 6);
12116 else
12117 return binary_op_t();
12118
12119 case lex_equal:
12120 return binary_op_t(ast_op_equal, xpath_type_boolean, 3);
12121
12122 case lex_not_equal:
12123 return binary_op_t(ast_op_not_equal, xpath_type_boolean, 3);
12124
12125 case lex_less:
12126 return binary_op_t(ast_op_less, xpath_type_boolean, 4);
12127
12128 case lex_greater:
12129 return binary_op_t(ast_op_greater, xpath_type_boolean, 4);
12130
12131 case lex_less_or_equal:
12132 return binary_op_t(ast_op_less_or_equal, xpath_type_boolean, 4);
12133
12135 return binary_op_t(ast_op_greater_or_equal, xpath_type_boolean, 4);
12136
12137 case lex_plus:
12138 return binary_op_t(ast_op_add, xpath_type_number, 5);
12139
12140 case lex_minus:
12141 return binary_op_t(ast_op_subtract, xpath_type_number, 5);
12142
12143 case lex_multiply:
12144 return binary_op_t(ast_op_multiply, xpath_type_number, 6);
12145
12146 case lex_union:
12147 return binary_op_t(ast_op_union, xpath_type_node_set, 7);
12148
12149 default:
12150 return binary_op_t();
12151 }
12152 }
lexeme_t current() const
Definition pugixml.cc:9535
const xpath_lexer_string & contents() const
Definition pugixml.cc:9545
@ ast_op_and
Definition pugixml.cc:9557
@ ast_op_divide
Definition pugixml.cc:9567
@ ast_op_equal
Definition pugixml.cc:9558
@ ast_op_union
Definition pugixml.cc:9570
@ ast_op_not_equal
Definition pugixml.cc:9559
@ ast_op_greater
Definition pugixml.cc:9561
@ ast_op_subtract
Definition pugixml.cc:9565
@ ast_op_less_or_equal
Definition pugixml.cc:9562
@ ast_op_multiply
Definition pugixml.cc:9566
@ ast_op_add
Definition pugixml.cc:9564
@ ast_op_or
Definition pugixml.cc:9556
@ ast_op_greater_or_equal
Definition pugixml.cc:9563
@ ast_op_mod
Definition pugixml.cc:9568
@ ast_op_less
Definition pugixml.cc:9560
@ lex_multiply
Definition pugixml.cc:9210
@ lex_not_equal
Definition pugixml.cc:9203
@ lex_less
Definition pugixml.cc:9204
@ lex_equal
Definition pugixml.cc:9202
@ lex_greater_or_equal
Definition pugixml.cc:9207
@ lex_union
Definition pugixml.cc:9211
@ lex_minus
Definition pugixml.cc:9209
@ lex_string
Definition pugixml.cc:9221
@ lex_plus
Definition pugixml.cc:9208
@ lex_greater
Definition pugixml.cc:9205
@ lex_less_or_equal
Definition pugixml.cc:9206
#define PUGIXML_TEXT(t)
Definition pugixml.hpp:130

Referenced by xpath_parser::parse_expression_rec().

Member Data Documentation

◆ asttype

ast_type_t xpath_parser::binary_op_t::asttype

Definition at line 12091 of file pugixml.cc.

Referenced by binary_op_t(), binary_op_t(), and xpath_parser::parse_expression_rec().

◆ precedence

int xpath_parser::binary_op_t::precedence

Definition at line 12093 of file pugixml.cc.

Referenced by binary_op_t(), binary_op_t(), and xpath_parser::parse_expression_rec().

◆ rettype

xpath_value_type xpath_parser::binary_op_t::rettype

Definition at line 12092 of file pugixml.cc.

Referenced by binary_op_t(), binary_op_t(), and xpath_parser::parse_expression_rec().


The documentation for this struct was generated from the following file: