1 // clang-format off
2 // A Bison parser, made by GNU Bison 3.4.2.
3
4 // Skeleton implementation for Bison LALR(1) parsers in C++
5
6 // Copyright (C) 2002-2015, 2018-2019 Free Software Foundation, Inc.
7
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
12
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
17
18 // You should have received a copy of the GNU General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21 // As a special exception, you may create a larger work that contains
22 // part or all of the Bison parser skeleton and distribute that work
23 // under terms of your choice, so long as that work isn't itself a
24 // parser generator using the skeleton or a modified version thereof
25 // as a parser skeleton. Alternatively, if you modify or redistribute
26 // the parser skeleton itself, you may (at your option) remove this
27 // special exception, which will cause the skeleton and the resulting
28 // Bison output files to be licensed under the GNU General Public
29 // License without this special exception.
30
31 // This special exception was added by the Free Software Foundation in
32 // version 2.2 of Bison.
33
34 // Undocumented macros, especially those whose name start with YY_,
35 // are private implementation details. Do not rely on them.
36
37
38
39 // First part of user prologue.
40 #line 52 "third_party/blink/renderer/core/xml/xpath_grammar.y"
41
42
43 #include "third_party/blink/renderer/core/xml/xpath_functions.h"
44 #include "third_party/blink/renderer/core/xml/xpath_ns_resolver.h"
45 #include "third_party/blink/renderer/core/xml/xpath_parser.h"
46 #include "third_party/blink/renderer/core/xml/xpath_path.h"
47 #include "third_party/blink/renderer/core/xml/xpath_predicate.h"
48 #include "third_party/blink/renderer/core/xml/xpath_step.h"
49 #include "third_party/blink/renderer/core/xml/xpath_variable_reference.h"
50
51 #define YYENABLE_NLS 0
52 #define YY_EXCEPTIONS 0
53 #define YYDEBUG 0
54
55 using blink::xpath::Step;
56
57 #line 57 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
58
59
60 #include "xpath_grammar_generated.h"
61
62
63 // Unqualified %code blocks.
64 #line 113 "third_party/blink/renderer/core/xml/xpath_grammar.y"
65
66
yylex(xpathyy::YyParser::semantic_type * yylval)67 static int yylex(xpathyy::YyParser::semantic_type* yylval) {
68 return blink::xpath::Parser::Current()->Lex(yylval);
69 }
70
71 namespace xpathyy {
error(const std::string &)72 void YyParser::error(const std::string&) { }
73 }
74
75
76 #line 76 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
77
78
79 #ifndef YY_
80 # if defined YYENABLE_NLS && YYENABLE_NLS
81 # if ENABLE_NLS
82 # include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
83 # define YY_(msgid) dgettext ("bison-runtime", msgid)
84 # endif
85 # endif
86 # ifndef YY_
87 # define YY_(msgid) msgid
88 # endif
89 #endif
90
91 // Whether we are compiled with exception support.
92 #ifndef YY_EXCEPTIONS
93 # if defined __GNUC__ && !defined __EXCEPTIONS
94 # define YY_EXCEPTIONS 0
95 # else
96 # define YY_EXCEPTIONS 1
97 # endif
98 #endif
99
100
101
102 // Enable debugging if requested.
103 #if YYDEBUG
104
105 // A pseudo ostream that takes yydebug_ into account.
106 # define YYCDEBUG if (yydebug_) (*yycdebug_)
107
108 # define YY_SYMBOL_PRINT(Title, Symbol) \
109 do { \
110 if (yydebug_) \
111 { \
112 *yycdebug_ << Title << ' '; \
113 yy_print_ (*yycdebug_, Symbol); \
114 *yycdebug_ << '\n'; \
115 } \
116 } while (false)
117
118 # define YY_REDUCE_PRINT(Rule) \
119 do { \
120 if (yydebug_) \
121 yy_reduce_print_ (Rule); \
122 } while (false)
123
124 # define YY_STACK_PRINT() \
125 do { \
126 if (yydebug_) \
127 yystack_print_ (); \
128 } while (false)
129
130 #else // !YYDEBUG
131
132 # define YYCDEBUG if (false) std::cerr
133 # define YY_SYMBOL_PRINT(Title, Symbol) YYUSE (Symbol)
134 # define YY_REDUCE_PRINT(Rule) static_cast<void> (0)
135 # define YY_STACK_PRINT() static_cast<void> (0)
136
137 #endif // !YYDEBUG
138
139 #define yyerrok (yyerrstatus_ = 0)
140 #define yyclearin (yyla.clear ())
141
142 #define YYACCEPT goto yyacceptlab
143 #define YYABORT goto yyabortlab
144 #define YYERROR goto yyerrorlab
145 #define YYRECOVERING() (!!yyerrstatus_)
146
147 #line 69 "third_party/blink/renderer/core/xml/xpath_grammar.y"
148 namespace xpathyy {
149 #line 149 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
150
151
152 /// Build a parser object.
YyParser(blink::xpath::Parser * parser__yyarg)153 YyParser::YyParser (blink::xpath::Parser* parser__yyarg)
154 :
155 #if YYDEBUG
156 yydebug_ (false),
157 yycdebug_ (&std::cerr),
158 #endif
159 parser_ (parser__yyarg)
160 {}
161
~YyParser()162 YyParser::~YyParser ()
163 {}
164
~syntax_error()165 YyParser::syntax_error::~syntax_error () YY_NOEXCEPT YY_NOTHROW
166 {}
167
168 /*---------------.
169 | Symbol types. |
170 `---------------*/
171
172 // basic_symbol.
173 #if 201103L <= YY_CPLUSPLUS
174 template <typename Base>
basic_symbol(basic_symbol && that)175 YyParser::basic_symbol<Base>::basic_symbol (basic_symbol&& that)
176 : Base (std::move (that))
177 , value ()
178 {
179 switch (this->type_get ())
180 {
181 case 11: // kNodeType
182 case 12: // kPI
183 case 13: // kFunctionName
184 case 14: // kLiteral
185 case 15: // kVariableReference
186 case 16: // kNumber
187 case 19: // kNameTest
188 value.move< String > (std::move (that.value));
189 break;
190
191 case 45: // ArgumentList
192 value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > (std::move (that.value));
193 break;
194
195 case 38: // OptionalPredicateList
196 case 39: // PredicateList
197 value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > (std::move (that.value));
198 break;
199
200 case 31: // Expr
201 case 40: // Predicate
202 case 43: // PrimaryExpr
203 case 44: // FunctionCall
204 case 46: // Argument
205 case 47: // UnionExpr
206 case 48: // PathExpr
207 case 49: // FilterExpr
208 case 50: // OrExpr
209 case 51: // AndExpr
210 case 52: // EqualityExpr
211 case 53: // RelationalExpr
212 case 54: // AdditiveExpr
213 case 55: // MultiplicativeExpr
214 case 56: // UnaryExpr
215 value.move< blink::Persistent<blink::xpath::Expression> > (std::move (that.value));
216 break;
217
218 case 32: // LocationPath
219 case 33: // AbsoluteLocationPath
220 case 34: // RelativeLocationPath
221 value.move< blink::Persistent<blink::xpath::LocationPath> > (std::move (that.value));
222 break;
223
224 case 37: // NodeTest
225 value.move< blink::Persistent<blink::xpath::Step::NodeTest> > (std::move (that.value));
226 break;
227
228 case 35: // Step
229 case 41: // DescendantOrSelf
230 case 42: // AbbreviatedStep
231 value.move< blink::Persistent<blink::xpath::Step> > (std::move (that.value));
232 break;
233
234 case 4: // kEqOp
235 case 5: // kRelOp
236 value.move< blink::xpath::EqTestOp::Opcode > (std::move (that.value));
237 break;
238
239 case 3: // kMulOp
240 value.move< blink::xpath::NumericOp::Opcode > (std::move (that.value));
241 break;
242
243 case 10: // kAxisName
244 case 36: // AxisSpecifier
245 value.move< blink::xpath::Step::Axis > (std::move (that.value));
246 break;
247
248 default:
249 break;
250 }
251
252 }
253 #endif
254
255 template <typename Base>
basic_symbol(const basic_symbol & that)256 YyParser::basic_symbol<Base>::basic_symbol (const basic_symbol& that)
257 : Base (that)
258 , value ()
259 {
260 switch (this->type_get ())
261 {
262 case 11: // kNodeType
263 case 12: // kPI
264 case 13: // kFunctionName
265 case 14: // kLiteral
266 case 15: // kVariableReference
267 case 16: // kNumber
268 case 19: // kNameTest
269 value.copy< String > (YY_MOVE (that.value));
270 break;
271
272 case 45: // ArgumentList
273 value.copy< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > (YY_MOVE (that.value));
274 break;
275
276 case 38: // OptionalPredicateList
277 case 39: // PredicateList
278 value.copy< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > (YY_MOVE (that.value));
279 break;
280
281 case 31: // Expr
282 case 40: // Predicate
283 case 43: // PrimaryExpr
284 case 44: // FunctionCall
285 case 46: // Argument
286 case 47: // UnionExpr
287 case 48: // PathExpr
288 case 49: // FilterExpr
289 case 50: // OrExpr
290 case 51: // AndExpr
291 case 52: // EqualityExpr
292 case 53: // RelationalExpr
293 case 54: // AdditiveExpr
294 case 55: // MultiplicativeExpr
295 case 56: // UnaryExpr
296 value.copy< blink::Persistent<blink::xpath::Expression> > (YY_MOVE (that.value));
297 break;
298
299 case 32: // LocationPath
300 case 33: // AbsoluteLocationPath
301 case 34: // RelativeLocationPath
302 value.copy< blink::Persistent<blink::xpath::LocationPath> > (YY_MOVE (that.value));
303 break;
304
305 case 37: // NodeTest
306 value.copy< blink::Persistent<blink::xpath::Step::NodeTest> > (YY_MOVE (that.value));
307 break;
308
309 case 35: // Step
310 case 41: // DescendantOrSelf
311 case 42: // AbbreviatedStep
312 value.copy< blink::Persistent<blink::xpath::Step> > (YY_MOVE (that.value));
313 break;
314
315 case 4: // kEqOp
316 case 5: // kRelOp
317 value.copy< blink::xpath::EqTestOp::Opcode > (YY_MOVE (that.value));
318 break;
319
320 case 3: // kMulOp
321 value.copy< blink::xpath::NumericOp::Opcode > (YY_MOVE (that.value));
322 break;
323
324 case 10: // kAxisName
325 case 36: // AxisSpecifier
326 value.copy< blink::xpath::Step::Axis > (YY_MOVE (that.value));
327 break;
328
329 default:
330 break;
331 }
332
333 }
334
335
336
337 template <typename Base>
338 bool
empty() const339 YyParser::basic_symbol<Base>::empty () const YY_NOEXCEPT
340 {
341 return Base::type_get () == empty_symbol;
342 }
343
344 template <typename Base>
345 void
move(basic_symbol & s)346 YyParser::basic_symbol<Base>::move (basic_symbol& s)
347 {
348 super_type::move (s);
349 switch (this->type_get ())
350 {
351 case 11: // kNodeType
352 case 12: // kPI
353 case 13: // kFunctionName
354 case 14: // kLiteral
355 case 15: // kVariableReference
356 case 16: // kNumber
357 case 19: // kNameTest
358 value.move< String > (YY_MOVE (s.value));
359 break;
360
361 case 45: // ArgumentList
362 value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > (YY_MOVE (s.value));
363 break;
364
365 case 38: // OptionalPredicateList
366 case 39: // PredicateList
367 value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > (YY_MOVE (s.value));
368 break;
369
370 case 31: // Expr
371 case 40: // Predicate
372 case 43: // PrimaryExpr
373 case 44: // FunctionCall
374 case 46: // Argument
375 case 47: // UnionExpr
376 case 48: // PathExpr
377 case 49: // FilterExpr
378 case 50: // OrExpr
379 case 51: // AndExpr
380 case 52: // EqualityExpr
381 case 53: // RelationalExpr
382 case 54: // AdditiveExpr
383 case 55: // MultiplicativeExpr
384 case 56: // UnaryExpr
385 value.move< blink::Persistent<blink::xpath::Expression> > (YY_MOVE (s.value));
386 break;
387
388 case 32: // LocationPath
389 case 33: // AbsoluteLocationPath
390 case 34: // RelativeLocationPath
391 value.move< blink::Persistent<blink::xpath::LocationPath> > (YY_MOVE (s.value));
392 break;
393
394 case 37: // NodeTest
395 value.move< blink::Persistent<blink::xpath::Step::NodeTest> > (YY_MOVE (s.value));
396 break;
397
398 case 35: // Step
399 case 41: // DescendantOrSelf
400 case 42: // AbbreviatedStep
401 value.move< blink::Persistent<blink::xpath::Step> > (YY_MOVE (s.value));
402 break;
403
404 case 4: // kEqOp
405 case 5: // kRelOp
406 value.move< blink::xpath::EqTestOp::Opcode > (YY_MOVE (s.value));
407 break;
408
409 case 3: // kMulOp
410 value.move< blink::xpath::NumericOp::Opcode > (YY_MOVE (s.value));
411 break;
412
413 case 10: // kAxisName
414 case 36: // AxisSpecifier
415 value.move< blink::xpath::Step::Axis > (YY_MOVE (s.value));
416 break;
417
418 default:
419 break;
420 }
421
422 }
423
424 // by_type.
by_type()425 YyParser::by_type::by_type ()
426 : type (empty_symbol)
427 {}
428
429 #if 201103L <= YY_CPLUSPLUS
by_type(by_type && that)430 YyParser::by_type::by_type (by_type&& that)
431 : type (that.type)
432 {
433 that.clear ();
434 }
435 #endif
436
by_type(const by_type & that)437 YyParser::by_type::by_type (const by_type& that)
438 : type (that.type)
439 {}
440
by_type(token_type t)441 YyParser::by_type::by_type (token_type t)
442 : type (yytranslate_ (t))
443 {}
444
445 void
clear()446 YyParser::by_type::clear ()
447 {
448 type = empty_symbol;
449 }
450
451 void
move(by_type & that)452 YyParser::by_type::move (by_type& that)
453 {
454 type = that.type;
455 that.clear ();
456 }
457
458 int
type_get() const459 YyParser::by_type::type_get () const YY_NOEXCEPT
460 {
461 return type;
462 }
463
464
465 // by_state.
by_state()466 YyParser::by_state::by_state () YY_NOEXCEPT
467 : state (empty_state)
468 {}
469
by_state(const by_state & that)470 YyParser::by_state::by_state (const by_state& that) YY_NOEXCEPT
471 : state (that.state)
472 {}
473
474 void
clear()475 YyParser::by_state::clear () YY_NOEXCEPT
476 {
477 state = empty_state;
478 }
479
480 void
move(by_state & that)481 YyParser::by_state::move (by_state& that)
482 {
483 state = that.state;
484 that.clear ();
485 }
486
by_state(state_type s)487 YyParser::by_state::by_state (state_type s) YY_NOEXCEPT
488 : state (s)
489 {}
490
491 YyParser::symbol_number_type
type_get() const492 YyParser::by_state::type_get () const YY_NOEXCEPT
493 {
494 if (state == empty_state)
495 return empty_symbol;
496 else
497 return yystos_[state];
498 }
499
stack_symbol_type()500 YyParser::stack_symbol_type::stack_symbol_type ()
501 {}
502
stack_symbol_type(YY_RVREF (stack_symbol_type)that)503 YyParser::stack_symbol_type::stack_symbol_type (YY_RVREF (stack_symbol_type) that)
504 : super_type (YY_MOVE (that.state))
505 {
506 switch (that.type_get ())
507 {
508 case 11: // kNodeType
509 case 12: // kPI
510 case 13: // kFunctionName
511 case 14: // kLiteral
512 case 15: // kVariableReference
513 case 16: // kNumber
514 case 19: // kNameTest
515 value.YY_MOVE_OR_COPY< String > (YY_MOVE (that.value));
516 break;
517
518 case 45: // ArgumentList
519 value.YY_MOVE_OR_COPY< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > (YY_MOVE (that.value));
520 break;
521
522 case 38: // OptionalPredicateList
523 case 39: // PredicateList
524 value.YY_MOVE_OR_COPY< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > (YY_MOVE (that.value));
525 break;
526
527 case 31: // Expr
528 case 40: // Predicate
529 case 43: // PrimaryExpr
530 case 44: // FunctionCall
531 case 46: // Argument
532 case 47: // UnionExpr
533 case 48: // PathExpr
534 case 49: // FilterExpr
535 case 50: // OrExpr
536 case 51: // AndExpr
537 case 52: // EqualityExpr
538 case 53: // RelationalExpr
539 case 54: // AdditiveExpr
540 case 55: // MultiplicativeExpr
541 case 56: // UnaryExpr
542 value.YY_MOVE_OR_COPY< blink::Persistent<blink::xpath::Expression> > (YY_MOVE (that.value));
543 break;
544
545 case 32: // LocationPath
546 case 33: // AbsoluteLocationPath
547 case 34: // RelativeLocationPath
548 value.YY_MOVE_OR_COPY< blink::Persistent<blink::xpath::LocationPath> > (YY_MOVE (that.value));
549 break;
550
551 case 37: // NodeTest
552 value.YY_MOVE_OR_COPY< blink::Persistent<blink::xpath::Step::NodeTest> > (YY_MOVE (that.value));
553 break;
554
555 case 35: // Step
556 case 41: // DescendantOrSelf
557 case 42: // AbbreviatedStep
558 value.YY_MOVE_OR_COPY< blink::Persistent<blink::xpath::Step> > (YY_MOVE (that.value));
559 break;
560
561 case 4: // kEqOp
562 case 5: // kRelOp
563 value.YY_MOVE_OR_COPY< blink::xpath::EqTestOp::Opcode > (YY_MOVE (that.value));
564 break;
565
566 case 3: // kMulOp
567 value.YY_MOVE_OR_COPY< blink::xpath::NumericOp::Opcode > (YY_MOVE (that.value));
568 break;
569
570 case 10: // kAxisName
571 case 36: // AxisSpecifier
572 value.YY_MOVE_OR_COPY< blink::xpath::Step::Axis > (YY_MOVE (that.value));
573 break;
574
575 default:
576 break;
577 }
578
579 #if 201103L <= YY_CPLUSPLUS
580 // that is emptied.
581 that.state = empty_state;
582 #endif
583 }
584
stack_symbol_type(state_type s,YY_MOVE_REF (symbol_type)that)585 YyParser::stack_symbol_type::stack_symbol_type (state_type s, YY_MOVE_REF (symbol_type) that)
586 : super_type (s)
587 {
588 switch (that.type_get ())
589 {
590 case 11: // kNodeType
591 case 12: // kPI
592 case 13: // kFunctionName
593 case 14: // kLiteral
594 case 15: // kVariableReference
595 case 16: // kNumber
596 case 19: // kNameTest
597 value.move< String > (YY_MOVE (that.value));
598 break;
599
600 case 45: // ArgumentList
601 value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > (YY_MOVE (that.value));
602 break;
603
604 case 38: // OptionalPredicateList
605 case 39: // PredicateList
606 value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > (YY_MOVE (that.value));
607 break;
608
609 case 31: // Expr
610 case 40: // Predicate
611 case 43: // PrimaryExpr
612 case 44: // FunctionCall
613 case 46: // Argument
614 case 47: // UnionExpr
615 case 48: // PathExpr
616 case 49: // FilterExpr
617 case 50: // OrExpr
618 case 51: // AndExpr
619 case 52: // EqualityExpr
620 case 53: // RelationalExpr
621 case 54: // AdditiveExpr
622 case 55: // MultiplicativeExpr
623 case 56: // UnaryExpr
624 value.move< blink::Persistent<blink::xpath::Expression> > (YY_MOVE (that.value));
625 break;
626
627 case 32: // LocationPath
628 case 33: // AbsoluteLocationPath
629 case 34: // RelativeLocationPath
630 value.move< blink::Persistent<blink::xpath::LocationPath> > (YY_MOVE (that.value));
631 break;
632
633 case 37: // NodeTest
634 value.move< blink::Persistent<blink::xpath::Step::NodeTest> > (YY_MOVE (that.value));
635 break;
636
637 case 35: // Step
638 case 41: // DescendantOrSelf
639 case 42: // AbbreviatedStep
640 value.move< blink::Persistent<blink::xpath::Step> > (YY_MOVE (that.value));
641 break;
642
643 case 4: // kEqOp
644 case 5: // kRelOp
645 value.move< blink::xpath::EqTestOp::Opcode > (YY_MOVE (that.value));
646 break;
647
648 case 3: // kMulOp
649 value.move< blink::xpath::NumericOp::Opcode > (YY_MOVE (that.value));
650 break;
651
652 case 10: // kAxisName
653 case 36: // AxisSpecifier
654 value.move< blink::xpath::Step::Axis > (YY_MOVE (that.value));
655 break;
656
657 default:
658 break;
659 }
660
661 // that is emptied.
662 that.type = empty_symbol;
663 }
664
665 #if YY_CPLUSPLUS < 201103L
666 YyParser::stack_symbol_type&
operator =(stack_symbol_type & that)667 YyParser::stack_symbol_type::operator= (stack_symbol_type& that)
668 {
669 state = that.state;
670 switch (that.type_get ())
671 {
672 case 11: // kNodeType
673 case 12: // kPI
674 case 13: // kFunctionName
675 case 14: // kLiteral
676 case 15: // kVariableReference
677 case 16: // kNumber
678 case 19: // kNameTest
679 value.move< String > (that.value);
680 break;
681
682 case 45: // ArgumentList
683 value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > (that.value);
684 break;
685
686 case 38: // OptionalPredicateList
687 case 39: // PredicateList
688 value.move< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > (that.value);
689 break;
690
691 case 31: // Expr
692 case 40: // Predicate
693 case 43: // PrimaryExpr
694 case 44: // FunctionCall
695 case 46: // Argument
696 case 47: // UnionExpr
697 case 48: // PathExpr
698 case 49: // FilterExpr
699 case 50: // OrExpr
700 case 51: // AndExpr
701 case 52: // EqualityExpr
702 case 53: // RelationalExpr
703 case 54: // AdditiveExpr
704 case 55: // MultiplicativeExpr
705 case 56: // UnaryExpr
706 value.move< blink::Persistent<blink::xpath::Expression> > (that.value);
707 break;
708
709 case 32: // LocationPath
710 case 33: // AbsoluteLocationPath
711 case 34: // RelativeLocationPath
712 value.move< blink::Persistent<blink::xpath::LocationPath> > (that.value);
713 break;
714
715 case 37: // NodeTest
716 value.move< blink::Persistent<blink::xpath::Step::NodeTest> > (that.value);
717 break;
718
719 case 35: // Step
720 case 41: // DescendantOrSelf
721 case 42: // AbbreviatedStep
722 value.move< blink::Persistent<blink::xpath::Step> > (that.value);
723 break;
724
725 case 4: // kEqOp
726 case 5: // kRelOp
727 value.move< blink::xpath::EqTestOp::Opcode > (that.value);
728 break;
729
730 case 3: // kMulOp
731 value.move< blink::xpath::NumericOp::Opcode > (that.value);
732 break;
733
734 case 10: // kAxisName
735 case 36: // AxisSpecifier
736 value.move< blink::xpath::Step::Axis > (that.value);
737 break;
738
739 default:
740 break;
741 }
742
743 // that is emptied.
744 that.state = empty_state;
745 return *this;
746 }
747 #endif
748
749 template <typename Base>
750 void
yy_destroy_(const char * yymsg,basic_symbol<Base> & yysym) const751 YyParser::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
752 {
753 if (yymsg)
754 YY_SYMBOL_PRINT (yymsg, yysym);
755 }
756
757 #if YYDEBUG
758 template <typename Base>
759 void
yy_print_(std::ostream & yyo,const basic_symbol<Base> & yysym) const760 YyParser::yy_print_ (std::ostream& yyo,
761 const basic_symbol<Base>& yysym) const
762 {
763 std::ostream& yyoutput = yyo;
764 YYUSE (yyoutput);
765 symbol_number_type yytype = yysym.type_get ();
766 #if defined __GNUC__ && ! defined __clang__ && ! defined __ICC && __GNUC__ * 100 + __GNUC_MINOR__ <= 408
767 // Avoid a (spurious) G++ 4.8 warning about "array subscript is
768 // below array bounds".
769 if (yysym.empty ())
770 std::abort ();
771 #endif
772 yyo << (yytype < yyntokens_ ? "token" : "nterm")
773 << ' ' << yytname_[yytype] << " (";
774 YYUSE (yytype);
775 yyo << ')';
776 }
777 #endif
778
779 void
yypush_(const char * m,YY_MOVE_REF (stack_symbol_type)sym)780 YyParser::yypush_ (const char* m, YY_MOVE_REF (stack_symbol_type) sym)
781 {
782 if (m)
783 YY_SYMBOL_PRINT (m, sym);
784 yystack_.push (YY_MOVE (sym));
785 }
786
787 void
yypush_(const char * m,state_type s,YY_MOVE_REF (symbol_type)sym)788 YyParser::yypush_ (const char* m, state_type s, YY_MOVE_REF (symbol_type) sym)
789 {
790 #if 201103L <= YY_CPLUSPLUS
791 yypush_ (m, stack_symbol_type (s, std::move (sym)));
792 #else
793 stack_symbol_type ss (s, sym);
794 yypush_ (m, ss);
795 #endif
796 }
797
798 void
yypop_(int n)799 YyParser::yypop_ (int n)
800 {
801 yystack_.pop (n);
802 }
803
804 #if YYDEBUG
805 std::ostream&
debug_stream() const806 YyParser::debug_stream () const
807 {
808 return *yycdebug_;
809 }
810
811 void
set_debug_stream(std::ostream & o)812 YyParser::set_debug_stream (std::ostream& o)
813 {
814 yycdebug_ = &o;
815 }
816
817
818 YyParser::debug_level_type
debug_level() const819 YyParser::debug_level () const
820 {
821 return yydebug_;
822 }
823
824 void
set_debug_level(debug_level_type l)825 YyParser::set_debug_level (debug_level_type l)
826 {
827 yydebug_ = l;
828 }
829 #endif // YYDEBUG
830
831 YyParser::state_type
yy_lr_goto_state_(state_type yystate,int yysym)832 YyParser::yy_lr_goto_state_ (state_type yystate, int yysym)
833 {
834 int yyr = yypgoto_[yysym - yyntokens_] + yystate;
835 if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
836 return yytable_[yyr];
837 else
838 return yydefgoto_[yysym - yyntokens_];
839 }
840
841 bool
yy_pact_value_is_default_(int yyvalue)842 YyParser::yy_pact_value_is_default_ (int yyvalue)
843 {
844 return yyvalue == yypact_ninf_;
845 }
846
847 bool
yy_table_value_is_error_(int yyvalue)848 YyParser::yy_table_value_is_error_ (int yyvalue)
849 {
850 return yyvalue == yytable_ninf_;
851 }
852
853 int
operator ()()854 YyParser::operator() ()
855 {
856 return parse ();
857 }
858
859 int
parse()860 YyParser::parse ()
861 {
862 // State.
863 int yyn;
864 /// Length of the RHS of the rule being reduced.
865 int yylen = 0;
866
867 // Error handling.
868 int yynerrs_ = 0;
869 int yyerrstatus_ = 0;
870
871 /// The lookahead symbol.
872 symbol_type yyla;
873
874 /// The return value of parse ().
875 int yyresult;
876
877 #if YY_EXCEPTIONS
878 try
879 #endif // YY_EXCEPTIONS
880 {
881 YYCDEBUG << "Starting parse\n";
882
883
884 /* Initialize the stack. The initial state will be set in
885 yynewstate, since the latter expects the semantical and the
886 location values to have been already stored, initialize these
887 stacks with a primary value. */
888 yystack_.clear ();
889 yypush_ (YY_NULLPTR, 0, YY_MOVE (yyla));
890
891 /*-----------------------------------------------.
892 | yynewstate -- push a new symbol on the stack. |
893 `-----------------------------------------------*/
894 yynewstate:
895 YYCDEBUG << "Entering state " << yystack_[0].state << '\n';
896
897 // Accept?
898 if (yystack_[0].state == yyfinal_)
899 YYACCEPT;
900
901 goto yybackup;
902
903
904 /*-----------.
905 | yybackup. |
906 `-----------*/
907 yybackup:
908 // Try to take a decision without lookahead.
909 yyn = yypact_[yystack_[0].state];
910 if (yy_pact_value_is_default_ (yyn))
911 goto yydefault;
912
913 // Read a lookahead token.
914 if (yyla.empty ())
915 {
916 YYCDEBUG << "Reading a token: ";
917 #if YY_EXCEPTIONS
918 try
919 #endif // YY_EXCEPTIONS
920 {
921 yyla.type = yytranslate_ (yylex (&yyla.value));
922 }
923 #if YY_EXCEPTIONS
924 catch (const syntax_error& yyexc)
925 {
926 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
927 error (yyexc);
928 goto yyerrlab1;
929 }
930 #endif // YY_EXCEPTIONS
931 }
932 YY_SYMBOL_PRINT ("Next token is", yyla);
933
934 /* If the proper action on seeing token YYLA.TYPE is to reduce or
935 to detect an error, take that action. */
936 yyn += yyla.type_get ();
937 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ())
938 goto yydefault;
939
940 // Reduce or error.
941 yyn = yytable_[yyn];
942 if (yyn <= 0)
943 {
944 if (yy_table_value_is_error_ (yyn))
945 goto yyerrlab;
946 yyn = -yyn;
947 goto yyreduce;
948 }
949
950 // Count tokens shifted since error; after three, turn off error status.
951 if (yyerrstatus_)
952 --yyerrstatus_;
953
954 // Shift the lookahead token.
955 yypush_ ("Shifting", yyn, YY_MOVE (yyla));
956 goto yynewstate;
957
958
959 /*-----------------------------------------------------------.
960 | yydefault -- do the default action for the current state. |
961 `-----------------------------------------------------------*/
962 yydefault:
963 yyn = yydefact_[yystack_[0].state];
964 if (yyn == 0)
965 goto yyerrlab;
966 goto yyreduce;
967
968
969 /*-----------------------------.
970 | yyreduce -- do a reduction. |
971 `-----------------------------*/
972 yyreduce:
973 yylen = yyr2_[yyn];
974 {
975 stack_symbol_type yylhs;
976 yylhs.state = yy_lr_goto_state_ (yystack_[yylen].state, yyr1_[yyn]);
977 /* Variants are always initialized to an empty instance of the
978 correct type. The default '$$ = $1' action is NOT applied
979 when using variants. */
980 switch (yyr1_[yyn])
981 {
982 case 11: // kNodeType
983 case 12: // kPI
984 case 13: // kFunctionName
985 case 14: // kLiteral
986 case 15: // kVariableReference
987 case 16: // kNumber
988 case 19: // kNameTest
989 yylhs.value.emplace< String > ();
990 break;
991
992 case 45: // ArgumentList
993 yylhs.value.emplace< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > ();
994 break;
995
996 case 38: // OptionalPredicateList
997 case 39: // PredicateList
998 yylhs.value.emplace< blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ();
999 break;
1000
1001 case 31: // Expr
1002 case 40: // Predicate
1003 case 43: // PrimaryExpr
1004 case 44: // FunctionCall
1005 case 46: // Argument
1006 case 47: // UnionExpr
1007 case 48: // PathExpr
1008 case 49: // FilterExpr
1009 case 50: // OrExpr
1010 case 51: // AndExpr
1011 case 52: // EqualityExpr
1012 case 53: // RelationalExpr
1013 case 54: // AdditiveExpr
1014 case 55: // MultiplicativeExpr
1015 case 56: // UnaryExpr
1016 yylhs.value.emplace< blink::Persistent<blink::xpath::Expression> > ();
1017 break;
1018
1019 case 32: // LocationPath
1020 case 33: // AbsoluteLocationPath
1021 case 34: // RelativeLocationPath
1022 yylhs.value.emplace< blink::Persistent<blink::xpath::LocationPath> > ();
1023 break;
1024
1025 case 37: // NodeTest
1026 yylhs.value.emplace< blink::Persistent<blink::xpath::Step::NodeTest> > ();
1027 break;
1028
1029 case 35: // Step
1030 case 41: // DescendantOrSelf
1031 case 42: // AbbreviatedStep
1032 yylhs.value.emplace< blink::Persistent<blink::xpath::Step> > ();
1033 break;
1034
1035 case 4: // kEqOp
1036 case 5: // kRelOp
1037 yylhs.value.emplace< blink::xpath::EqTestOp::Opcode > ();
1038 break;
1039
1040 case 3: // kMulOp
1041 yylhs.value.emplace< blink::xpath::NumericOp::Opcode > ();
1042 break;
1043
1044 case 10: // kAxisName
1045 case 36: // AxisSpecifier
1046 yylhs.value.emplace< blink::xpath::Step::Axis > ();
1047 break;
1048
1049 default:
1050 break;
1051 }
1052
1053
1054
1055 // Perform the reduction.
1056 YY_REDUCE_PRINT (yyn);
1057 #if YY_EXCEPTIONS
1058 try
1059 #endif // YY_EXCEPTIONS
1060 {
1061 switch (yyn)
1062 {
1063 case 2:
1064 #line 129 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1065 {
1066 parser_->top_expr_ = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ();
1067 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ();
1068 }
1069 #line 1069 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1070 break;
1071
1072 case 3:
1073 #line 137 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1074 {
1075 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ();
1076 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > ()->SetAbsolute(false);
1077 }
1078 #line 1078 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1079 break;
1080
1081 case 4:
1082 #line 143 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1083 {
1084 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ();
1085 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > ()->SetAbsolute(true);
1086 }
1087 #line 1087 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1088 break;
1089
1090 case 5:
1091 #line 151 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1092 {
1093 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > () = blink::MakeGarbageCollected<blink::xpath::LocationPath>();
1094 }
1095 #line 1095 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1096 break;
1097
1098 case 6:
1099 #line 156 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1100 {
1101 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ();
1102 }
1103 #line 1103 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1104 break;
1105
1106 case 7:
1107 #line 161 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1108 {
1109 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ();
1110 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > ()->InsertFirstStep(yystack_[1].value.as < blink::Persistent<blink::xpath::Step> > ());
1111 }
1112 #line 1112 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1113 break;
1114
1115 case 8:
1116 #line 169 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1117 {
1118 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > () = blink::MakeGarbageCollected<blink::xpath::LocationPath>();
1119 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > ()->AppendStep(yystack_[0].value.as < blink::Persistent<blink::xpath::Step> > ());
1120 }
1121 #line 1121 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1122 break;
1123
1124 case 9:
1125 #line 175 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1126 {
1127 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > () = yystack_[2].value.as < blink::Persistent<blink::xpath::LocationPath> > ();
1128 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > ()->AppendStep(yystack_[0].value.as < blink::Persistent<blink::xpath::Step> > ());
1129 }
1130 #line 1130 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1131 break;
1132
1133 case 10:
1134 #line 181 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1135 {
1136 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > () = yystack_[2].value.as < blink::Persistent<blink::xpath::LocationPath> > ();
1137 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > ()->AppendStep(yystack_[1].value.as < blink::Persistent<blink::xpath::Step> > ());
1138 yylhs.value.as < blink::Persistent<blink::xpath::LocationPath> > ()->AppendStep(yystack_[0].value.as < blink::Persistent<blink::xpath::Step> > ());
1139 }
1140 #line 1140 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1141 break;
1142
1143 case 11:
1144 #line 190 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1145 {
1146 if (yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ())
1147 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(Step::kChildAxis, *yystack_[1].value.as < blink::Persistent<blink::xpath::Step::NodeTest> > (), *yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ());
1148 else
1149 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(Step::kChildAxis, *yystack_[1].value.as < blink::Persistent<blink::xpath::Step::NodeTest> > ());
1150 }
1151 #line 1151 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1152 break;
1153
1154 case 12:
1155 #line 198 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1156 {
1157 AtomicString local_name;
1158 AtomicString namespace_uri;
1159 if (!parser_->ExpandQName(yystack_[1].value.as < String > (), local_name, namespace_uri)) {
1160 parser_->got_namespace_error_ = true;
1161 YYABORT;
1162 }
1163
1164 if (yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ())
1165 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(Step::kChildAxis, Step::NodeTest(Step::NodeTest::kNameTest, local_name, namespace_uri), *yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ());
1166 else
1167 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(Step::kChildAxis, Step::NodeTest(Step::NodeTest::kNameTest, local_name, namespace_uri));
1168 }
1169 #line 1169 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1170 break;
1171
1172 case 13:
1173 #line 213 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1174 {
1175 if (yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ())
1176 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(yystack_[2].value.as < blink::xpath::Step::Axis > (), *yystack_[1].value.as < blink::Persistent<blink::xpath::Step::NodeTest> > (), *yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ());
1177 else
1178 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(yystack_[2].value.as < blink::xpath::Step::Axis > (), *yystack_[1].value.as < blink::Persistent<blink::xpath::Step::NodeTest> > ());
1179 }
1180 #line 1180 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1181 break;
1182
1183 case 14:
1184 #line 221 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1185 {
1186 AtomicString local_name;
1187 AtomicString namespace_uri;
1188 if (!parser_->ExpandQName(yystack_[1].value.as < String > (), local_name, namespace_uri)) {
1189 parser_->got_namespace_error_ = true;
1190 YYABORT;
1191 }
1192
1193 if (yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ())
1194 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(yystack_[2].value.as < blink::xpath::Step::Axis > (), Step::NodeTest(Step::NodeTest::kNameTest, local_name, namespace_uri), *yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ());
1195 else
1196 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(yystack_[2].value.as < blink::xpath::Step::Axis > (), Step::NodeTest(Step::NodeTest::kNameTest, local_name, namespace_uri));
1197 }
1198 #line 1198 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1199 break;
1200
1201 case 15:
1202 #line 235 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1203 { yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Step> > (); }
1204 #line 1204 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1205 break;
1206
1207 case 16:
1208 #line 239 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1209 { yylhs.value.as < blink::xpath::Step::Axis > () = yystack_[0].value.as < blink::xpath::Step::Axis > (); }
1210 #line 1210 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1211 break;
1212
1213 case 17:
1214 #line 242 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1215 {
1216 yylhs.value.as < blink::xpath::Step::Axis > () = Step::kAttributeAxis;
1217 }
1218 #line 1218 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1219 break;
1220
1221 case 18:
1222 #line 249 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1223 {
1224 if (yystack_[2].value.as < String > () == "node")
1225 yylhs.value.as < blink::Persistent<blink::xpath::Step::NodeTest> > () = blink::MakeGarbageCollected<Step::NodeTest>(Step::NodeTest::kAnyNodeTest);
1226 else if (yystack_[2].value.as < String > () == "text")
1227 yylhs.value.as < blink::Persistent<blink::xpath::Step::NodeTest> > () = blink::MakeGarbageCollected<Step::NodeTest>(Step::NodeTest::kTextNodeTest);
1228 else if (yystack_[2].value.as < String > () == "comment")
1229 yylhs.value.as < blink::Persistent<blink::xpath::Step::NodeTest> > () = blink::MakeGarbageCollected<Step::NodeTest>(Step::NodeTest::kCommentNodeTest);
1230 }
1231 #line 1231 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1232 break;
1233
1234 case 19:
1235 #line 259 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1236 {
1237 yylhs.value.as < blink::Persistent<blink::xpath::Step::NodeTest> > () = blink::MakeGarbageCollected<Step::NodeTest>(Step::NodeTest::kProcessingInstructionNodeTest);
1238 }
1239 #line 1239 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1240 break;
1241
1242 case 20:
1243 #line 264 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1244 {
1245 yylhs.value.as < blink::Persistent<blink::xpath::Step::NodeTest> > () = blink::MakeGarbageCollected<Step::NodeTest>(Step::NodeTest::kProcessingInstructionNodeTest, yystack_[1].value.as < String > ().StripWhiteSpace());
1246 }
1247 #line 1247 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1248 break;
1249
1250 case 21:
1251 #line 271 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1252 {
1253 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > () = 0;
1254 }
1255 #line 1255 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1256 break;
1257
1258 case 22:
1259 #line 276 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1260 {
1261 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > () = yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ();
1262 }
1263 #line 1263 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1264 break;
1265
1266 case 23:
1267 #line 283 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1268 {
1269 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > () = blink::MakeGarbageCollected<blink::HeapVector<blink::Member<blink::xpath::Predicate>>>();
1270 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ()->push_back(blink::MakeGarbageCollected<blink::xpath::Predicate>(yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ()));
1271 }
1272 #line 1272 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1273 break;
1274
1275 case 24:
1276 #line 289 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1277 {
1278 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > () = yystack_[1].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ();
1279 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ()->push_back(blink::MakeGarbageCollected<blink::xpath::Predicate>(yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ()));
1280 }
1281 #line 1281 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1282 break;
1283
1284 case 25:
1285 #line 297 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1286 {
1287 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[1].value.as < blink::Persistent<blink::xpath::Expression> > ();
1288 }
1289 #line 1289 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1290 break;
1291
1292 case 26:
1293 #line 304 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1294 {
1295 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(Step::kDescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::kAnyNodeTest));
1296 }
1297 #line 1297 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1298 break;
1299
1300 case 27:
1301 #line 311 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1302 {
1303 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(Step::kSelfAxis, Step::NodeTest(Step::NodeTest::kAnyNodeTest));
1304 }
1305 #line 1305 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1306 break;
1307
1308 case 28:
1309 #line 316 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1310 {
1311 yylhs.value.as < blink::Persistent<blink::xpath::Step> > () = blink::MakeGarbageCollected<Step>(Step::kParentAxis, Step::NodeTest(Step::NodeTest::kAnyNodeTest));
1312 }
1313 #line 1313 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1314 break;
1315
1316 case 29:
1317 #line 323 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1318 {
1319 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::VariableReference>(yystack_[0].value.as < String > ());
1320 }
1321 #line 1321 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1322 break;
1323
1324 case 30:
1325 #line 328 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1326 {
1327 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[1].value.as < blink::Persistent<blink::xpath::Expression> > ();
1328 }
1329 #line 1329 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1330 break;
1331
1332 case 31:
1333 #line 333 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1334 {
1335 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::StringExpression>(yystack_[0].value.as < String > ());
1336 }
1337 #line 1337 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1338 break;
1339
1340 case 32:
1341 #line 338 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1342 {
1343 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::Number>(yystack_[0].value.as < String > ().ToDouble());
1344 }
1345 #line 1345 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1346 break;
1347
1348 case 33:
1349 #line 342 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1350 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1351 #line 1351 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1352 break;
1353
1354 case 34:
1355 #line 347 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1356 {
1357 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::xpath::CreateFunction(yystack_[2].value.as < String > ());
1358 if (!yylhs.value.as < blink::Persistent<blink::xpath::Expression> > ())
1359 YYABORT;
1360 }
1361 #line 1361 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1362 break;
1363
1364 case 35:
1365 #line 354 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1366 {
1367 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::xpath::CreateFunction(yystack_[3].value.as < String > (), *yystack_[1].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > ());
1368 if (!yylhs.value.as < blink::Persistent<blink::xpath::Expression> > ())
1369 YYABORT;
1370 }
1371 #line 1371 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1372 break;
1373
1374 case 36:
1375 #line 363 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1376 {
1377 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > () = blink::MakeGarbageCollected<blink::HeapVector<blink::Member<blink::xpath::Expression>>>();
1378 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > ()->push_back(yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1379 }
1380 #line 1380 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1381 break;
1382
1383 case 37:
1384 #line 369 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1385 {
1386 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > () = yystack_[2].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > ();
1387 yylhs.value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Expression>>> > ()->push_back(yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1388 }
1389 #line 1389 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1390 break;
1391
1392 case 38:
1393 #line 376 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1394 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1395 #line 1395 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1396 break;
1397
1398 case 39:
1399 #line 380 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1400 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1401 #line 1401 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1402 break;
1403
1404 case 40:
1405 #line 383 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1406 {
1407 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::Union>();
1408 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > ()->AddSubExpression(yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > ());
1409 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > ()->AddSubExpression(yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1410 }
1411 #line 1411 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1412 break;
1413
1414 case 41:
1415 #line 392 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1416 {
1417 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ();
1418 }
1419 #line 1419 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1420 break;
1421
1422 case 42:
1423 #line 396 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1424 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1425 #line 1425 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1426 break;
1427
1428 case 43:
1429 #line 399 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1430 {
1431 yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ()->SetAbsolute(true);
1432 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::Path>(yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > (), yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ());
1433 }
1434 #line 1434 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1435 break;
1436
1437 case 44:
1438 #line 405 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1439 {
1440 yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ()->InsertFirstStep(yystack_[1].value.as < blink::Persistent<blink::xpath::Step> > ());
1441 yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ()->SetAbsolute(true);
1442 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::Path>(yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > (), yystack_[0].value.as < blink::Persistent<blink::xpath::LocationPath> > ());
1443 }
1444 #line 1444 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1445 break;
1446
1447 case 45:
1448 #line 413 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1449 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1450 #line 1450 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1451 break;
1452
1453 case 46:
1454 #line 416 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1455 {
1456 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::Filter>(yystack_[1].value.as < blink::Persistent<blink::xpath::Expression> > (), *yystack_[0].value.as < blink::Persistent<blink::HeapVector<blink::Member<blink::xpath::Predicate>>> > ());
1457 }
1458 #line 1458 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1459 break;
1460
1461 case 47:
1462 #line 422 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1463 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1464 #line 1464 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1465 break;
1466
1467 case 48:
1468 #line 425 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1469 {
1470 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::LogicalOp>(blink::xpath::LogicalOp::kOP_Or, yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > (), yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1471 }
1472 #line 1472 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1473 break;
1474
1475 case 49:
1476 #line 431 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1477 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1478 #line 1478 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1479 break;
1480
1481 case 50:
1482 #line 434 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1483 {
1484 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::LogicalOp>(blink::xpath::LogicalOp::kOP_And, yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > (), yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1485 }
1486 #line 1486 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1487 break;
1488
1489 case 51:
1490 #line 440 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1491 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1492 #line 1492 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1493 break;
1494
1495 case 52:
1496 #line 443 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1497 {
1498 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::EqTestOp>(yystack_[1].value.as < blink::xpath::EqTestOp::Opcode > (), yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > (), yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1499 }
1500 #line 1500 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1501 break;
1502
1503 case 53:
1504 #line 449 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1505 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1506 #line 1506 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1507 break;
1508
1509 case 54:
1510 #line 452 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1511 {
1512 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::EqTestOp>(yystack_[1].value.as < blink::xpath::EqTestOp::Opcode > (), yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > (), yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1513 }
1514 #line 1514 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1515 break;
1516
1517 case 55:
1518 #line 458 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1519 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1520 #line 1520 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1521 break;
1522
1523 case 56:
1524 #line 461 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1525 {
1526 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::NumericOp>(blink::xpath::NumericOp::kOP_Add, yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > (), yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1527 }
1528 #line 1528 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1529 break;
1530
1531 case 57:
1532 #line 466 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1533 {
1534 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::NumericOp>(blink::xpath::NumericOp::kOP_Sub, yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > (), yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1535 }
1536 #line 1536 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1537 break;
1538
1539 case 58:
1540 #line 472 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1541 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1542 #line 1542 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1543 break;
1544
1545 case 59:
1546 #line 475 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1547 {
1548 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::NumericOp>(yystack_[1].value.as < blink::xpath::NumericOp::Opcode > (), yystack_[2].value.as < blink::Persistent<blink::xpath::Expression> > (), yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1549 }
1550 #line 1550 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1551 break;
1552
1553 case 60:
1554 #line 481 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1555 { yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > (); }
1556 #line 1556 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1557 break;
1558
1559 case 61:
1560 #line 484 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1561 {
1562 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > () = blink::MakeGarbageCollected<blink::xpath::Negative>();
1563 yylhs.value.as < blink::Persistent<blink::xpath::Expression> > ()->AddSubExpression(yystack_[0].value.as < blink::Persistent<blink::xpath::Expression> > ());
1564 }
1565 #line 1565 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1566 break;
1567
1568
1569 #line 1569 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1570
1571 default:
1572 break;
1573 }
1574 }
1575 #if YY_EXCEPTIONS
1576 catch (const syntax_error& yyexc)
1577 {
1578 YYCDEBUG << "Caught exception: " << yyexc.what() << '\n';
1579 error (yyexc);
1580 YYERROR;
1581 }
1582 #endif // YY_EXCEPTIONS
1583 YY_SYMBOL_PRINT ("-> $$ =", yylhs);
1584 yypop_ (yylen);
1585 yylen = 0;
1586 YY_STACK_PRINT ();
1587
1588 // Shift the result of the reduction.
1589 yypush_ (YY_NULLPTR, YY_MOVE (yylhs));
1590 }
1591 goto yynewstate;
1592
1593
1594 /*--------------------------------------.
1595 | yyerrlab -- here on detecting error. |
1596 `--------------------------------------*/
1597 yyerrlab:
1598 // If not already recovering from an error, report this error.
1599 if (!yyerrstatus_)
1600 {
1601 ++yynerrs_;
1602 error (yysyntax_error_ (yystack_[0].state, yyla));
1603 }
1604
1605
1606 if (yyerrstatus_ == 3)
1607 {
1608 /* If just tried and failed to reuse lookahead token after an
1609 error, discard it. */
1610
1611 // Return failure if at end of input.
1612 if (yyla.type_get () == yyeof_)
1613 YYABORT;
1614 else if (!yyla.empty ())
1615 {
1616 yy_destroy_ ("Error: discarding", yyla);
1617 yyla.clear ();
1618 }
1619 }
1620
1621 // Else will try to reuse lookahead token after shifting the error token.
1622 goto yyerrlab1;
1623
1624
1625 /*---------------------------------------------------.
1626 | yyerrorlab -- error raised explicitly by YYERROR. |
1627 `---------------------------------------------------*/
1628 yyerrorlab:
1629 /* Pacify compilers when the user code never invokes YYERROR and
1630 the label yyerrorlab therefore never appears in user code. */
1631 if (false)
1632 YYERROR;
1633
1634 /* Do not reclaim the symbols of the rule whose action triggered
1635 this YYERROR. */
1636 yypop_ (yylen);
1637 yylen = 0;
1638 goto yyerrlab1;
1639
1640
1641 /*-------------------------------------------------------------.
1642 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1643 `-------------------------------------------------------------*/
1644 yyerrlab1:
1645 yyerrstatus_ = 3; // Each real token shifted decrements this.
1646 {
1647 stack_symbol_type error_token;
1648 for (;;)
1649 {
1650 yyn = yypact_[yystack_[0].state];
1651 if (!yy_pact_value_is_default_ (yyn))
1652 {
1653 yyn += yyterror_;
1654 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
1655 {
1656 yyn = yytable_[yyn];
1657 if (0 < yyn)
1658 break;
1659 }
1660 }
1661
1662 // Pop the current state because it cannot handle the error token.
1663 if (yystack_.size () == 1)
1664 YYABORT;
1665
1666 yy_destroy_ ("Error: popping", yystack_[0]);
1667 yypop_ ();
1668 YY_STACK_PRINT ();
1669 }
1670
1671
1672 // Shift the error token.
1673 error_token.state = yyn;
1674 yypush_ ("Shifting", YY_MOVE (error_token));
1675 }
1676 goto yynewstate;
1677
1678
1679 /*-------------------------------------.
1680 | yyacceptlab -- YYACCEPT comes here. |
1681 `-------------------------------------*/
1682 yyacceptlab:
1683 yyresult = 0;
1684 goto yyreturn;
1685
1686
1687 /*-----------------------------------.
1688 | yyabortlab -- YYABORT comes here. |
1689 `-----------------------------------*/
1690 yyabortlab:
1691 yyresult = 1;
1692 goto yyreturn;
1693
1694
1695 /*-----------------------------------------------------.
1696 | yyreturn -- parsing is finished, return the result. |
1697 `-----------------------------------------------------*/
1698 yyreturn:
1699 if (!yyla.empty ())
1700 yy_destroy_ ("Cleanup: discarding lookahead", yyla);
1701
1702 /* Do not reclaim the symbols of the rule whose action triggered
1703 this YYABORT or YYACCEPT. */
1704 yypop_ (yylen);
1705 while (1 < yystack_.size ())
1706 {
1707 yy_destroy_ ("Cleanup: popping", yystack_[0]);
1708 yypop_ ();
1709 }
1710
1711 return yyresult;
1712 }
1713 #if YY_EXCEPTIONS
1714 catch (...)
1715 {
1716 YYCDEBUG << "Exception caught: cleaning lookahead and stack\n";
1717 // Do not try to display the values of the reclaimed symbols,
1718 // as their printers might throw an exception.
1719 if (!yyla.empty ())
1720 yy_destroy_ (YY_NULLPTR, yyla);
1721
1722 while (1 < yystack_.size ())
1723 {
1724 yy_destroy_ (YY_NULLPTR, yystack_[0]);
1725 yypop_ ();
1726 }
1727 throw;
1728 }
1729 #endif // YY_EXCEPTIONS
1730 }
1731
1732 void
error(const syntax_error & yyexc)1733 YyParser::error (const syntax_error& yyexc)
1734 {
1735 error (yyexc.what ());
1736 }
1737
1738 // Generate an error message.
1739 std::string
yysyntax_error_(state_type,const symbol_type &) const1740 YyParser::yysyntax_error_ (state_type, const symbol_type&) const
1741 {
1742 return YY_("syntax error");
1743 }
1744
1745
1746 const signed char YyParser::yypact_ninf_ = -44;
1747
1748 const signed char YyParser::yytable_ninf_ = -1;
1749
1750 const signed char
1751 YyParser::yypact_[] =
1752 {
1753 77, 77, -44, -9, -4, 18, -44, -44, -44, -44,
1754 -44, 19, -2, -44, 77, -44, 36, -44, -44, 13,
1755 -44, 11, 19, -2, -44, 19, -44, 21, -44, 17,
1756 34, 38, 44, 46, 20, 49, -44, -44, 25, -3,
1757 59, 77, -44, 19, -44, 13, 29, -44, -2, -2,
1758 19, 19, -44, 13, 19, 95, -2, -2, 77, 77,
1759 77, 77, 77, 77, 77, -44, 30, -44, -44, -44,
1760 0, -44, 31, -44, -44, -44, -44, -44, -44, -44,
1761 13, 13, 38, 44, 46, 20, 49, 49, -44, -44,
1762 -44, 77, -44, -44
1763 };
1764
1765 const unsigned char
1766 YyParser::yydefact_[] =
1767 {
1768 0, 0, 16, 0, 0, 0, 31, 29, 32, 28,
1769 26, 21, 5, 17, 0, 27, 0, 41, 4, 3,
1770 8, 0, 21, 0, 15, 45, 33, 60, 39, 42,
1771 2, 47, 49, 51, 53, 55, 58, 61, 0, 0,
1772 0, 0, 12, 22, 23, 6, 0, 1, 0, 0,
1773 21, 21, 11, 7, 46, 0, 0, 0, 0, 0,
1774 0, 0, 0, 0, 0, 18, 0, 19, 34, 38,
1775 0, 36, 0, 24, 30, 9, 10, 14, 13, 40,
1776 43, 44, 48, 50, 52, 54, 56, 57, 59, 20,
1777 35, 0, 25, 37
1778 };
1779
1780 const signed char
1781 YyParser::yypgoto_[] =
1782 {
1783 -44, 2, -44, -44, -11, -43, -44, 35, -18, 33,
1784 -36, -16, -44, -44, -44, -44, -32, -44, 5, -44,
1785 -44, 3, 8, -5, 1, -23, -1
1786 };
1787
1788 const signed char
1789 YyParser::yydefgoto_[] =
1790 {
1791 -1, 69, 17, 18, 19, 20, 21, 22, 42, 43,
1792 44, 23, 24, 25, 26, 70, 71, 27, 28, 29,
1793 30, 31, 32, 33, 34, 35, 36
1794 };
1795
1796 const unsigned char
1797 YyParser::yytable_[] =
1798 {
1799 37, 45, 16, 49, 52, 75, 76, 73, 2, 3,
1800 4, 66, 53, 57, 38, 9, 46, 11, 73, 39,
1801 13, 67, 3, 4, 90, 15, 62, 63, 91, 49,
1802 50, 10, 77, 78, 48, 10, 47, 49, 56, 86,
1803 87, 40, 58, 72, 41, 80, 81, 59, 60, 65,
1804 55, 61, 64, 74, 89, 84, 51, 92, 54, 93,
1805 79, 82, 85, 88, 49, 49, 1, 83, 0, 2,
1806 3, 4, 5, 6, 7, 8, 9, 10, 11, 0,
1807 12, 13, 14, 68, 1, 0, 15, 2, 3, 4,
1808 5, 6, 7, 8, 9, 10, 11, 0, 12, 13,
1809 14, 0, 0, 0, 15, 2, 3, 4, 5, 6,
1810 7, 8, 9, 10, 11, 0, 12, 13, 14, 0,
1811 0, 0, 15
1812 };
1813
1814 const signed char
1815 YyParser::yycheck_[] =
1816 {
1817 1, 12, 0, 19, 22, 48, 49, 43, 10, 11,
1818 12, 14, 23, 29, 23, 17, 14, 19, 54, 23,
1819 22, 24, 11, 12, 24, 27, 6, 7, 28, 45,
1820 19, 18, 50, 51, 21, 18, 0, 53, 21, 62,
1821 63, 23, 8, 41, 25, 56, 57, 9, 4, 24,
1822 29, 5, 3, 24, 24, 60, 21, 26, 25, 91,
1823 55, 58, 61, 64, 80, 81, 7, 59, -1, 10,
1824 11, 12, 13, 14, 15, 16, 17, 18, 19, -1,
1825 21, 22, 23, 24, 7, -1, 27, 10, 11, 12,
1826 13, 14, 15, 16, 17, 18, 19, -1, 21, 22,
1827 23, -1, -1, -1, 27, 10, 11, 12, 13, 14,
1828 15, 16, 17, 18, 19, -1, 21, 22, 23, -1,
1829 -1, -1, 27
1830 };
1831
1832 const unsigned char
1833 YyParser::yystos_[] =
1834 {
1835 0, 7, 10, 11, 12, 13, 14, 15, 16, 17,
1836 18, 19, 21, 22, 23, 27, 31, 32, 33, 34,
1837 35, 36, 37, 41, 42, 43, 44, 47, 48, 49,
1838 50, 51, 52, 53, 54, 55, 56, 56, 23, 23,
1839 23, 25, 38, 39, 40, 34, 31, 0, 21, 41,
1840 19, 37, 38, 34, 39, 29, 21, 41, 8, 9,
1841 4, 5, 6, 7, 3, 24, 14, 24, 24, 31,
1842 45, 46, 31, 40, 24, 35, 35, 38, 38, 48,
1843 34, 34, 51, 52, 53, 54, 55, 55, 56, 24,
1844 24, 28, 26, 46
1845 };
1846
1847 const unsigned char
1848 YyParser::yyr1_[] =
1849 {
1850 0, 30, 31, 32, 32, 33, 33, 33, 34, 34,
1851 34, 35, 35, 35, 35, 35, 36, 36, 37, 37,
1852 37, 38, 38, 39, 39, 40, 41, 42, 42, 43,
1853 43, 43, 43, 43, 44, 44, 45, 45, 46, 47,
1854 47, 48, 48, 48, 48, 49, 49, 50, 50, 51,
1855 51, 52, 52, 53, 53, 54, 54, 54, 55, 55,
1856 56, 56
1857 };
1858
1859 const unsigned char
1860 YyParser::yyr2_[] =
1861 {
1862 0, 2, 1, 1, 1, 1, 2, 2, 1, 3,
1863 3, 2, 2, 3, 3, 1, 1, 1, 3, 3,
1864 4, 0, 1, 1, 2, 3, 1, 1, 1, 1,
1865 3, 1, 1, 1, 3, 4, 1, 3, 1, 1,
1866 3, 1, 1, 3, 3, 1, 2, 1, 3, 1,
1867 3, 1, 3, 1, 3, 1, 3, 3, 1, 3,
1868 1, 2
1869 };
1870
1871
1872 #if YYDEBUG
1873 // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1874 // First, the terminals, then, starting at \a yyntokens_, nonterminals.
1875 const char*
1876 const YyParser::yytname_[] =
1877 {
1878 "$end", "error", "$undefined", "kMulOp", "kEqOp", "kRelOp", "kPlus",
1879 "kMinus", "kOr", "kAnd", "kAxisName", "kNodeType", "kPI",
1880 "kFunctionName", "kLiteral", "kVariableReference", "kNumber", "kDotDot",
1881 "kSlashSlash", "kNameTest", "kXPathError", "'/'", "'@'", "'('", "')'",
1882 "'['", "']'", "'.'", "','", "'|'", "$accept", "Expr", "LocationPath",
1883 "AbsoluteLocationPath", "RelativeLocationPath", "Step", "AxisSpecifier",
1884 "NodeTest", "OptionalPredicateList", "PredicateList", "Predicate",
1885 "DescendantOrSelf", "AbbreviatedStep", "PrimaryExpr", "FunctionCall",
1886 "ArgumentList", "Argument", "UnionExpr", "PathExpr", "FilterExpr",
1887 "OrExpr", "AndExpr", "EqualityExpr", "RelationalExpr", "AdditiveExpr",
1888 "MultiplicativeExpr", "UnaryExpr", YY_NULLPTR
1889 };
1890
1891
1892 const unsigned short
1893 YyParser::yyrline_[] =
1894 {
1895 0, 128, 128, 136, 142, 150, 155, 160, 168, 174,
1896 180, 189, 197, 212, 220, 235, 239, 241, 248, 258,
1897 263, 271, 275, 282, 288, 296, 303, 310, 315, 322,
1898 327, 332, 337, 342, 346, 353, 362, 368, 376, 380,
1899 382, 391, 396, 398, 404, 413, 415, 422, 424, 431,
1900 433, 440, 442, 449, 451, 458, 460, 465, 472, 474,
1901 481, 483
1902 };
1903
1904 // Print the state stack on the debug stream.
1905 void
yystack_print_()1906 YyParser::yystack_print_ ()
1907 {
1908 *yycdebug_ << "Stack now";
1909 for (stack_type::const_iterator
1910 i = yystack_.begin (),
1911 i_end = yystack_.end ();
1912 i != i_end; ++i)
1913 *yycdebug_ << ' ' << i->state;
1914 *yycdebug_ << '\n';
1915 }
1916
1917 // Report on the debug stream that the rule \a yyrule is going to be reduced.
1918 void
yy_reduce_print_(int yyrule)1919 YyParser::yy_reduce_print_ (int yyrule)
1920 {
1921 unsigned yylno = yyrline_[yyrule];
1922 int yynrhs = yyr2_[yyrule];
1923 // Print the symbols being reduced, and their result.
1924 *yycdebug_ << "Reducing stack by rule " << yyrule - 1
1925 << " (line " << yylno << "):\n";
1926 // The symbols being reduced.
1927 for (int yyi = 0; yyi < yynrhs; yyi++)
1928 YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
1929 yystack_[(yynrhs) - (yyi + 1)]);
1930 }
1931 #endif // YYDEBUG
1932
1933 YyParser::token_number_type
yytranslate_(int t)1934 YyParser::yytranslate_ (int t)
1935 {
1936 // YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to
1937 // TOKEN-NUM as returned by yylex.
1938 static
1939 const token_number_type
1940 translate_table[] =
1941 {
1942 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1943 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1944 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1945 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1946 23, 24, 2, 2, 28, 2, 27, 21, 2, 2,
1947 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1948 2, 2, 2, 2, 22, 2, 2, 2, 2, 2,
1949 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1950 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1951 2, 25, 2, 26, 2, 2, 2, 2, 2, 2,
1952 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1953 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1954 2, 2, 2, 2, 29, 2, 2, 2, 2, 2,
1955 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1956 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1957 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1958 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1959 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1960 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1961 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1962 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1963 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1964 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1965 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1966 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1967 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1968 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1969 15, 16, 17, 18, 19, 20
1970 };
1971 const unsigned user_token_number_max_ = 275;
1972 const token_number_type undef_token_ = 2;
1973
1974 if (static_cast<int> (t) <= yyeof_)
1975 return yyeof_;
1976 else if (static_cast<unsigned> (t) <= user_token_number_max_)
1977 return translate_table[t];
1978 else
1979 return undef_token_;
1980 }
1981
1982 #line 69 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1983 } // xpathyy
1984 #line 1984 "third_party/blink/renderer/core/xml/xpath_grammar_generated.cc"
1985
1986 #line 490 "third_party/blink/renderer/core/xml/xpath_grammar.y"
1987
1988