LocationPath ::= RelativeLocationPath | AbsoluteLocationPath AbsoluteLocationPath ::= '/' RelativeLocationPath? | '//' RelativeLocationPath
| 9302 | // LocationPath ::= RelativeLocationPath | AbsoluteLocationPath |
| 9303 | // AbsoluteLocationPath ::= '/' RelativeLocationPath? | '//' RelativeLocationPath |
| 9304 | xpath_ast_node* parse_location_path() |
| 9305 | { |
| 9306 | if (_lexer.current() == lex_slash) |
| 9307 | { |
| 9308 | _lexer.next(); |
| 9309 | |
| 9310 | xpath_ast_node* n = new (alloc_node()) xpath_ast_node(ast_step_root, xpath_type_node_set); |
| 9311 | |
| 9312 | // relative location path can start from axis_attribute, dot, double_dot, multiply and string lexemes; any other lexeme means standalone root path |
| 9313 | lexeme_t l = _lexer.current(); |
| 9314 | |
| 9315 | if (l == lex_string || l == lex_axis_attribute || l == lex_dot || l == lex_double_dot || l == lex_multiply) |
| 9316 | return parse_relative_location_path(n); |
| 9317 | else |
| 9318 | return n; |
| 9319 | } |
| 9320 | else if (_lexer.current() == lex_double_slash) |
| 9321 | { |
| 9322 | _lexer.next(); |
| 9323 | |
| 9324 | xpath_ast_node* n = new (alloc_node()) xpath_ast_node(ast_step_root, xpath_type_node_set); |
| 9325 | n = new (alloc_node()) xpath_ast_node(ast_step, n, axis_descendant_or_self, nodetest_type_node, 0); |
| 9326 | |
| 9327 | return parse_relative_location_path(n); |
| 9328 | } |
| 9329 | |
| 9330 | // else clause moved outside of if because of bogus warning 'control may reach end of non-void function being inlined' in gcc 4.0.1 |
| 9331 | return parse_relative_location_path(0); |
| 9332 | } |
| 9333 | |
| 9334 | // PathExpr ::= LocationPath |
| 9335 | // | FilterExpr |