Line data Source code
1 : // A Bison parser, made by GNU Bison 3.0.4.
2 :
3 : // Skeleton implementation for Bison LALR(1) parsers in C++
4 :
5 : // Copyright (C) 2002-2015 Free Software Foundation, Inc.
6 :
7 : // This program is free software: you can redistribute it and/or modify
8 : // it under the terms of the GNU General Public License as published by
9 : // the Free Software Foundation, either version 3 of the License, or
10 : // (at your option) any later version.
11 :
12 : // This program is distributed in the hope that it will be useful,
13 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 : // GNU General Public License for more details.
16 :
17 : // You should have received a copy of the GNU General Public License
18 : // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 :
20 : // As a special exception, you may create a larger work that contains
21 : // part or all of the Bison parser skeleton and distribute that work
22 : // under terms of your choice, so long as that work isn't itself a
23 : // parser generator using the skeleton or a modified version thereof
24 : // as a parser skeleton. Alternatively, if you modify or redistribute
25 : // the parser skeleton itself, you may (at your option) remove this
26 : // special exception, which will cause the skeleton and the resulting
27 : // Bison output files to be licensed under the GNU General Public
28 : // License without this special exception.
29 :
30 : // This special exception was added by the Free Software Foundation in
31 : // version 2.2 of Bison.
32 :
33 : // Take the name prefix into account.
34 : #define yylex yambilex
35 :
36 : // First part of user declarations.
37 :
38 : #line 39 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:404
39 :
40 : # ifndef YY_NULLPTR
41 : # if defined __cplusplus && 201103L <= __cplusplus
42 : # define YY_NULLPTR nullptr
43 : # else
44 : # define YY_NULLPTR 0
45 : # endif
46 : # endif
47 :
48 : #include "parser.hpp"
49 :
50 : // User implementation prologue.
51 :
52 : #line 53 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:412
53 : // Unqualified %code blocks.
54 : #line 45 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:413
55 :
56 : # include "driver.hpp"
57 :
58 : #undef yylex
59 : #define yylex lexer.nextToken
60 :
61 : #line 62 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:413
62 :
63 :
64 : #ifndef YY_
65 : # if defined YYENABLE_NLS && YYENABLE_NLS
66 : # if ENABLE_NLS
67 : # include <libintl.h> // FIXME: INFRINGES ON USER NAME SPACE.
68 : # define YY_(msgid) dgettext ("bison-runtime", msgid)
69 : # endif
70 : # endif
71 : # ifndef YY_
72 : # define YY_(msgid) msgid
73 : # endif
74 : #endif
75 :
76 : #define YYRHSLOC(Rhs, K) ((Rhs)[K].location)
77 : /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
78 : If N is 0, then set CURRENT to the empty location which ends
79 : the previous symbol: RHS[0] (always defined). */
80 :
81 : # ifndef YYLLOC_DEFAULT
82 : # define YYLLOC_DEFAULT(Current, Rhs, N) \
83 : do \
84 : if (N) \
85 : { \
86 : (Current).begin = YYRHSLOC (Rhs, 1).begin; \
87 : (Current).end = YYRHSLOC (Rhs, N).end; \
88 : } \
89 : else \
90 : { \
91 : (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \
92 : } \
93 : while (/*CONSTCOND*/ false)
94 : # endif
95 :
96 :
97 : // Suppress unused-variable warnings by "using" E.
98 : #define YYUSE(E) ((void) (E))
99 :
100 : // Enable debugging if requested.
101 : #if YAMBIDEBUG
102 :
103 : // A pseudo ostream that takes yydebug_ into account.
104 : # define YYCDEBUG if (yydebug_) (*yycdebug_)
105 :
106 : # define YY_SYMBOL_PRINT(Title, Symbol) \
107 : do { \
108 : if (yydebug_) \
109 : { \
110 : *yycdebug_ << Title << ' '; \
111 : yy_print_ (*yycdebug_, Symbol); \
112 : *yycdebug_ << std::endl; \
113 : } \
114 : } while (false)
115 :
116 : # define YY_REDUCE_PRINT(Rule) \
117 : do { \
118 : if (yydebug_) \
119 : yy_reduce_print_ (Rule); \
120 : } while (false)
121 :
122 : # define YY_STACK_PRINT() \
123 : do { \
124 : if (yydebug_) \
125 : yystack_print_ (); \
126 : } while (false)
127 :
128 : #else // !YAMBIDEBUG
129 :
130 : # define YYCDEBUG if (false) std::cerr
131 : # define YY_SYMBOL_PRINT(Title, Symbol) YYUSE(Symbol)
132 : # define YY_REDUCE_PRINT(Rule) static_cast<void>(0)
133 : # define YY_STACK_PRINT() static_cast<void>(0)
134 :
135 : #endif // !YAMBIDEBUG
136 :
137 : #define yyerrok (yyerrstatus_ = 0)
138 : #define yyclearin (yyla.clear ())
139 :
140 : #define YYACCEPT goto yyacceptlab
141 : #define YYABORT goto yyabortlab
142 : #define YYERROR goto yyerrorlab
143 : #define YYRECOVERING() (!!yyerrstatus_)
144 :
145 :
146 : namespace yambi {
147 : #line 148 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:479
148 :
149 : /* Return YYSTR after stripping away unnecessary quotes and
150 : backslashes, so that it's suitable for yyerror. The heuristic is
151 : that double-quoting is unnecessary unless the string contains an
152 : apostrophe, a comma, or backslash (other than backslash-backslash).
153 : YYSTR is taken from yytname. */
154 : std::string
155 33 : Parser ::yytnamerr_ (const char *yystr)
156 : {
157 33 : if (*yystr == '"')
158 : {
159 66 : std::string yyr = "";
160 : char const *yyp = yystr;
161 :
162 : for (;;)
163 288 : switch (*++yyp)
164 : {
165 : case '\'':
166 : case ',':
167 : goto do_not_strip_quotes;
168 :
169 : case '\\':
170 0 : if (*++yyp != '\\')
171 : goto do_not_strip_quotes;
172 : // Fall through.
173 : default:
174 255 : yyr += *yyp;
175 : break;
176 :
177 : case '"':
178 66 : return yyr;
179 : }
180 : do_not_strip_quotes: ;
181 : }
182 :
183 0 : return yystr;
184 : }
185 :
186 :
187 : /// Build a parser object.
188 63 : Parser :: Parser (Lexer& lexer_yyarg, Driver& driver_yyarg)
189 : :
190 : #if YAMBIDEBUG
191 : yydebug_ (false),
192 : yycdebug_ (&std::cerr),
193 : #endif
194 : lexer (lexer_yyarg),
195 63 : driver (driver_yyarg)
196 63 : {}
197 :
198 126 : Parser ::~ Parser ()
199 63 : {}
200 :
201 :
202 : /*---------------.
203 : | Symbol types. |
204 : `---------------*/
205 :
206 :
207 :
208 : // by_state.
209 : inline
210 6139 : Parser ::by_state::by_state ()
211 6139 : : state (empty_state)
212 : {}
213 :
214 : inline
215 3482 : Parser ::by_state::by_state (const by_state& other)
216 3482 : : state (other.state)
217 : {}
218 :
219 : inline
220 : void
221 : Parser ::by_state::clear ()
222 : {
223 14117 : state = empty_state;
224 : }
225 :
226 : inline
227 : void
228 : Parser ::by_state::move (by_state& that)
229 : {
230 3482 : state = that.state;
231 3482 : that.clear ();
232 : }
233 :
234 : inline
235 1014 : Parser ::by_state::by_state (state_type s)
236 1014 : : state (s)
237 : {}
238 :
239 : inline
240 : Parser ::symbol_number_type
241 : Parser ::by_state::type_get () const
242 : {
243 24437 : if (state == empty_state)
244 : return empty_symbol;
245 : else
246 13802 : return yystos_[state];
247 : }
248 :
249 : inline
250 12278 : Parser ::stack_symbol_type::stack_symbol_type ()
251 : {}
252 :
253 :
254 : inline
255 1014 : Parser ::stack_symbol_type::stack_symbol_type (state_type s, symbol_type& that)
256 2028 : : super_type (s, that.location)
257 : {
258 2028 : switch (that.type_get ())
259 : {
260 : case 22: // child_comments_empty
261 0 : value.move< bool > (that.value);
262 : break;
263 :
264 : case 3: // "start of document"
265 : case 4: // "end of document"
266 : case 5: // "comment"
267 : case 6: // "plain scalar"
268 : case 7: // "single quoted scalar"
269 : case 8: // "double quoted scalar"
270 : case 9: // "start of map"
271 : case 10: // "end of map"
272 : case 11: // "key"
273 : case 12: // "value"
274 : case 13: // "start of sequence"
275 : case 14: // "end of sequence"
276 : case 15: // "element"
277 : case 26: // scalar
278 888 : value.move< std::string > (that.value);
279 : break;
280 :
281 : default:
282 : break;
283 : }
284 :
285 : // that is emptied.
286 1014 : that.type = empty_symbol;
287 1014 : }
288 :
289 : inline
290 : Parser ::stack_symbol_type&
291 : Parser ::stack_symbol_type::operator= (const stack_symbol_type& that)
292 : {
293 : state = that.state;
294 : switch (that.type_get ())
295 : {
296 : case 22: // child_comments_empty
297 : value.copy< bool > (that.value);
298 : break;
299 :
300 : case 3: // "start of document"
301 : case 4: // "end of document"
302 : case 5: // "comment"
303 : case 6: // "plain scalar"
304 : case 7: // "single quoted scalar"
305 : case 8: // "double quoted scalar"
306 : case 9: // "start of map"
307 : case 10: // "end of map"
308 : case 11: // "key"
309 : case 12: // "value"
310 : case 13: // "start of sequence"
311 : case 14: // "end of sequence"
312 : case 15: // "element"
313 : case 26: // scalar
314 : value.copy< std::string > (that.value);
315 : break;
316 :
317 : default:
318 : break;
319 : }
320 :
321 : location = that.location;
322 : return *this;
323 : }
324 :
325 :
326 : template <typename Base>
327 : inline
328 : void
329 178 : Parser ::yy_destroy_ (const char* yymsg, basic_symbol<Base>& yysym) const
330 : {
331 178 : if (yymsg)
332 356 : YY_SYMBOL_PRINT (yymsg, yysym);
333 178 : }
334 :
335 : #if YAMBIDEBUG
336 : template <typename Base>
337 : void
338 8484 : Parser ::yy_print_ (std::ostream& yyo,
339 : const basic_symbol<Base>& yysym) const
340 : {
341 8484 : std::ostream& yyoutput = yyo;
342 : YYUSE (yyoutput);
343 16968 : symbol_number_type yytype = yysym.type_get ();
344 : // Avoid a (spurious) G++ 4.8 warning about "array subscript is
345 : // below array bounds".
346 8484 : if (yysym.empty ())
347 0 : std::abort ();
348 8484 : yyo << (yytype < yyntokens_ ? "token" : "nterm")
349 8484 : << ' ' << yytname_[yytype] << " ("
350 33936 : << yysym.location << ": ";
351 : YYUSE (yytype);
352 8484 : yyo << ')';
353 8484 : }
354 : #endif
355 :
356 : inline
357 : void
358 1014 : Parser ::yypush_ (const char* m, state_type s, symbol_type& sym)
359 : {
360 2028 : stack_symbol_type t (s, sym);
361 1014 : yypush_ (m, t);
362 1014 : }
363 :
364 : inline
365 : void
366 1077 : Parser ::yypush_ (const char* m, stack_symbol_type& s)
367 : {
368 1077 : if (m)
369 2028 : YY_SYMBOL_PRINT (m, s);
370 3482 : yystack_.push (s);
371 1077 : }
372 :
373 : inline
374 : void
375 : Parser ::yypop_ (unsigned int n)
376 : {
377 2405 : yystack_.pop (n);
378 : }
379 :
380 : #if YAMBIDEBUG
381 : std::ostream&
382 0 : Parser ::debug_stream () const
383 : {
384 0 : return *yycdebug_;
385 : }
386 :
387 : void
388 0 : Parser ::set_debug_stream (std::ostream& o)
389 : {
390 0 : yycdebug_ = &o;
391 0 : }
392 :
393 :
394 : Parser ::debug_level_type
395 0 : Parser ::debug_level () const
396 : {
397 0 : return yydebug_;
398 : }
399 :
400 : void
401 63 : Parser ::set_debug_level (debug_level_type l)
402 : {
403 63 : yydebug_ = l;
404 63 : }
405 : #endif // YAMBIDEBUG
406 :
407 : inline Parser ::state_type
408 : Parser ::yy_lr_goto_state_ (state_type yystate, int yysym)
409 : {
410 2405 : int yyr = yypgoto_[yysym - yyntokens_] + yystate;
411 2405 : if (0 <= yyr && yyr <= yylast_ && yycheck_[yyr] == yystate)
412 699 : return yytable_[yyr];
413 : else
414 1706 : return yydefgoto_[yysym - yyntokens_];
415 : }
416 :
417 : inline bool
418 : Parser ::yy_pact_value_is_default_ (int yyvalue)
419 : {
420 : return yyvalue == yypact_ninf_;
421 : }
422 :
423 : inline bool
424 : Parser ::yy_table_value_is_error_ (int yyvalue)
425 : {
426 : return yyvalue == yytable_ninf_;
427 : }
428 :
429 : int
430 63 : Parser ::parse ()
431 : {
432 : // State.
433 : int yyn;
434 : /// Length of the RHS of the rule being reduced.
435 63 : int yylen = 0;
436 :
437 : // Error handling.
438 63 : int yynerrs_ = 0;
439 63 : int yyerrstatus_ = 0;
440 :
441 : /// The lookahead symbol.
442 126 : symbol_type yyla;
443 :
444 : /// The locations where the error started and ended.
445 693 : stack_symbol_type yyerror_range[3];
446 :
447 : /// The return value of parse ().
448 : int yyresult;
449 :
450 : // FIXME: This shoud be completely indented. It is not yet to
451 : // avoid gratuitous conflicts when merging into the master branch.
452 : try
453 : {
454 126 : YYCDEBUG << "Starting parse" << std::endl;
455 :
456 :
457 : // User initialization code.
458 : #line 34 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:741
459 : {
460 : // Set filename used by location class
461 : yyla.location.begin.filename = yyla.location.end.filename = &driver.filename;
462 : }
463 :
464 : #line 465 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:741
465 :
466 : /* Initialize the stack. The initial state will be set in
467 : yynewstate, since the latter expects the semantical and the
468 : location values to have been already stored, initialize these
469 : stacks with a primary value. */
470 126 : yystack_.clear ();
471 63 : yypush_ (YY_NULLPTR, 0, yyla);
472 :
473 : // A new symbol was pushed on the stack.
474 : yynewstate:
475 10446 : YYCDEBUG << "Entering state " << yystack_[0].state << std::endl;
476 :
477 : // Accept?
478 6964 : if (yystack_[0].state == yyfinal_)
479 : goto yyacceptlab;
480 :
481 : goto yybackup;
482 :
483 : // Backup.
484 : yybackup:
485 :
486 : // Try to take a decision without lookahead.
487 6838 : yyn = yypact_[yystack_[0].state];
488 3419 : if (yy_pact_value_is_default_ (yyn))
489 : goto yydefault;
490 :
491 : // Read a lookahead token.
492 1594 : if (yyla.empty ())
493 : {
494 1003 : YYCDEBUG << "Reading a token: ";
495 : try
496 : {
497 2006 : symbol_type yylookahead (yylex ());
498 1003 : yyla.move (yylookahead);
499 : }
500 0 : catch (const syntax_error& yyexc)
501 : {
502 0 : error (yyexc);
503 : goto yyerrlab1;
504 : }
505 : }
506 4782 : YY_SYMBOL_PRINT ("Next token is", yyla);
507 :
508 : /* If the proper action on seeing token YYLA.TYPE is to reduce or
509 : to detect an error, take that action. */
510 1594 : yyn += yyla.type_get ();
511 1594 : if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yyla.type_get ())
512 : goto yydefault;
513 :
514 : // Reduce or error.
515 1008 : yyn = yytable_[yyn];
516 1008 : if (yyn <= 0)
517 : {
518 57 : if (yy_table_value_is_error_ (yyn))
519 : goto yyerrlab;
520 57 : yyn = -yyn;
521 57 : goto yyreduce;
522 : }
523 :
524 : // Count tokens shifted since error; after three, turn off error status.
525 951 : if (yyerrstatus_)
526 33 : --yyerrstatus_;
527 :
528 : // Shift the lookahead token.
529 951 : yypush_ ("Shifting", yyn, yyla);
530 : goto yynewstate;
531 :
532 : /*-----------------------------------------------------------.
533 : | yydefault -- do the default action for the current state. |
534 : `-----------------------------------------------------------*/
535 : yydefault:
536 4822 : yyn = yydefact_[yystack_[0].state];
537 2411 : if (yyn == 0)
538 : goto yyerrlab;
539 : goto yyreduce;
540 :
541 : /*-----------------------------.
542 : | yyreduce -- Do a reduction. |
543 : `-----------------------------*/
544 : yyreduce:
545 2405 : yylen = yyr2_[yyn];
546 : {
547 4810 : stack_symbol_type yylhs;
548 7215 : yylhs.state = yy_lr_goto_state_(yystack_[yylen].state, yyr1_[yyn]);
549 : /* Variants are always initialized to an empty instance of the
550 : correct type. The default '$$ = $1' action is NOT applied
551 : when using variants. */
552 2405 : switch (yyr1_[yyn])
553 : {
554 : case 22: // child_comments_empty
555 : yylhs.value.build< bool > ();
556 : break;
557 :
558 : case 3: // "start of document"
559 : case 4: // "end of document"
560 : case 5: // "comment"
561 : case 6: // "plain scalar"
562 : case 7: // "single quoted scalar"
563 : case 8: // "double quoted scalar"
564 : case 9: // "start of map"
565 : case 10: // "end of map"
566 : case 11: // "key"
567 : case 12: // "value"
568 : case 13: // "start of sequence"
569 : case 14: // "end of sequence"
570 : case 15: // "element"
571 : case 26: // scalar
572 : yylhs.value.build< std::string > ();
573 : break;
574 :
575 : default:
576 : break;
577 : }
578 :
579 :
580 : // Compute the default @$.
581 : {
582 4810 : slice<stack_symbol_type, stack_type> slice (yystack_, yylen);
583 6624 : YYLLOC_DEFAULT (yylhs.location, slice, yylen);
584 : }
585 :
586 : // Perform the reduction.
587 2405 : YY_REDUCE_PRINT (yyn);
588 : try
589 : {
590 2405 : switch (yyn)
591 : {
592 : case 5:
593 : #line 85 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
594 : { driver.enterEmpty(); }
595 : #line 596 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
596 : break;
597 :
598 : case 10:
599 : #line 93 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
600 : { yylhs.value.as< bool > () = true; }
601 : #line 602 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
602 103 : break;
603 :
604 : case 11:
605 : #line 94 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
606 : { yylhs.value.as< bool > () = false; }
607 : #line 608 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
608 2 : break;
609 :
610 : case 12:
611 : #line 95 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
612 : { yylhs.value.as< bool > () = false; }
613 : #line 614 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
614 3 : break;
615 :
616 : case 17:
617 : #line 103 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
618 : { driver.exitValue(yystack_[0].value.as< std::string > ()); }
619 : #line 620 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
620 : break;
621 :
622 : case 18:
623 : #line 104 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
624 : { yylhs.value.as< std::string > () = yystack_[0].value.as< std::string > (); }
625 : #line 626 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
626 : break;
627 :
628 : case 19:
629 : #line 105 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
630 : { yylhs.value.as< std::string > () = yystack_[0].value.as< std::string > (); }
631 : #line 632 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
632 : break;
633 :
634 : case 20:
635 : #line 106 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
636 : { yylhs.value.as< std::string > () = yystack_[0].value.as< std::string > (); }
637 : #line 638 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
638 : break;
639 :
640 : case 25:
641 : #line 114 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
642 : { driver.exitPair(yystack_[0].value.as< bool > ()); }
643 : #line 644 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
644 : break;
645 :
646 : case 26:
647 : #line 115 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
648 : { driver.exitKey(yystack_[0].value.as< std::string > ()); }
649 : #line 650 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
650 : break;
651 :
652 : case 27:
653 : #line 117 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
654 : { driver.enterSequence(); }
655 : #line 656 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
656 : break;
657 :
658 : case 28:
659 : #line 119 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
660 : { driver.exitSequence(); }
661 : #line 662 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
662 : break;
663 :
664 : case 32:
665 : #line 125 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
666 : { driver.enterElement(); }
667 : #line 668 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
668 : break;
669 :
670 : case 33:
671 : #line 125 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:859
672 : { driver.exitElement(); }
673 : #line 674 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
674 : break;
675 :
676 :
677 : #line 678 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:859
678 : default:
679 : break;
680 : }
681 : }
682 0 : catch (const syntax_error& yyexc)
683 : {
684 0 : error (yyexc);
685 : YYERROR;
686 : }
687 7215 : YY_SYMBOL_PRINT ("-> $$ =", yylhs);
688 2405 : yypop_ (yylen);
689 2405 : yylen = 0;
690 2405 : YY_STACK_PRINT ();
691 :
692 : // Shift the result of the reduction.
693 2405 : yypush_ (YY_NULLPTR, yylhs);
694 : }
695 : goto yynewstate;
696 :
697 : /*--------------------------------------.
698 : | yyerrlab -- here on detecting error. |
699 : `--------------------------------------*/
700 : yyerrlab:
701 : // If not already recovering from an error, report this error.
702 63 : if (!yyerrstatus_)
703 : {
704 11 : ++yynerrs_;
705 33 : error (yyla.location, yysyntax_error_ (yystack_[0].state, yyla));
706 : }
707 :
708 :
709 63 : yyerror_range[1].location = yyla.location;
710 63 : if (yyerrstatus_ == 3)
711 : {
712 : /* If just tried and failed to reuse lookahead token after an
713 : error, discard it. */
714 :
715 : // Return failure if at end of input.
716 52 : if (yyla.type_get () == yyeof_)
717 : YYABORT;
718 52 : else if (!yyla.empty ())
719 : {
720 52 : yy_destroy_ ("Error: discarding", yyla);
721 52 : yyla.clear ();
722 : }
723 : }
724 :
725 : // Else will try to reuse lookahead token after shifting the error token.
726 : goto yyerrlab1;
727 :
728 :
729 : /*---------------------------------------------------.
730 : | yyerrorlab -- error raised explicitly by YYERROR. |
731 : `---------------------------------------------------*/
732 : yyerrorlab:
733 :
734 : /* Pacify compilers like GCC when the user code never invokes
735 : YYERROR and the label yyerrorlab therefore never appears in user
736 : code. */
737 : if (false)
738 : goto yyerrorlab;
739 0 : yyerror_range[1].location = yystack_[yylen - 1].location;
740 : /* Do not reclaim the symbols of the rule whose action triggered
741 : this YYERROR. */
742 0 : yypop_ (yylen);
743 : yylen = 0;
744 : goto yyerrlab1;
745 :
746 : /*-------------------------------------------------------------.
747 : | yyerrlab1 -- common code for both syntax error and YYERROR. |
748 : `-------------------------------------------------------------*/
749 : yyerrlab1:
750 63 : yyerrstatus_ = 3; // Each real token shifted decrements this.
751 : {
752 63 : stack_symbol_type error_token;
753 : for (;;)
754 : {
755 126 : yyn = yypact_[yystack_[0].state];
756 63 : if (!yy_pact_value_is_default_ (yyn))
757 : {
758 63 : yyn += yyterror_;
759 63 : if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
760 : {
761 63 : yyn = yytable_[yyn];
762 63 : if (0 < yyn)
763 : break;
764 : }
765 : }
766 :
767 : // Pop the current state because it cannot handle the error token.
768 0 : if (yystack_.size () == 1)
769 : YYABORT;
770 :
771 0 : yyerror_range[1].location = yystack_[0].location;
772 0 : yy_destroy_ ("Error: popping", yystack_[0]);
773 0 : yypop_ ();
774 0 : YY_STACK_PRINT ();
775 : }
776 :
777 63 : yyerror_range[2].location = yyla.location;
778 63 : YYLLOC_DEFAULT (error_token.location, yyerror_range, 2);
779 :
780 : // Shift the error token.
781 63 : error_token.state = yyn;
782 63 : yypush_ ("Shifting", error_token);
783 : }
784 : goto yynewstate;
785 :
786 : // Accept.
787 : yyacceptlab:
788 : yyresult = 0;
789 : goto yyreturn;
790 :
791 : // Abort.
792 : yyabortlab:
793 : yyresult = 1;
794 : goto yyreturn;
795 :
796 : yyreturn:
797 63 : if (!yyla.empty ())
798 0 : yy_destroy_ ("Cleanup: discarding lookahead", yyla);
799 :
800 : /* Do not reclaim the symbols of the rule whose action triggered
801 : this YYABORT or YYACCEPT. */
802 : yypop_ (yylen);
803 378 : while (1 < yystack_.size ())
804 : {
805 252 : yy_destroy_ ("Cleanup: popping", yystack_[0]);
806 : yypop_ ();
807 : }
808 :
809 63 : return yyresult;
810 : }
811 0 : catch (...)
812 : {
813 0 : YYCDEBUG << "Exception caught: cleaning lookahead and stack"
814 : << std::endl;
815 : // Do not try to display the values of the reclaimed symbols,
816 : // as their printer might throw an exception.
817 0 : if (!yyla.empty ())
818 : yy_destroy_ (YY_NULLPTR, yyla);
819 :
820 0 : while (1 < yystack_.size ())
821 : {
822 : yy_destroy_ (YY_NULLPTR, yystack_[0]);
823 : yypop_ ();
824 : }
825 0 : throw;
826 : }
827 : }
828 :
829 : void
830 0 : Parser ::error (const syntax_error& yyexc)
831 : {
832 0 : error (yyexc.location, yyexc.what());
833 0 : }
834 :
835 : // Generate an error message.
836 : std::string
837 11 : Parser ::yysyntax_error_ (state_type yystate, const symbol_type& yyla) const
838 : {
839 : // Number of reported tokens (one for the "unexpected", one per
840 : // "expected").
841 11 : size_t yycount = 0;
842 : // Its maximum.
843 : enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
844 : // Arguments of yyformat.
845 : char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
846 :
847 : /* There are many possibilities here to consider:
848 : - If this state is a consistent state with a default action, then
849 : the only way this function was invoked is if the default action
850 : is an error action. In that case, don't check for expected
851 : tokens because there are none.
852 : - The only way there can be no lookahead present (in yyla) is
853 : if this state is a consistent state with a default action.
854 : Thus, detecting the absence of a lookahead is sufficient to
855 : determine that there is no unexpected or expected token to
856 : report. In that case, just report a simple "syntax error".
857 : - Don't assume there isn't a lookahead just because this state is
858 : a consistent state with a default action. There might have
859 : been a previous inconsistent state, consistent state with a
860 : non-default action, or user semantic action that manipulated
861 : yyla. (However, yyla is currently not documented for users.)
862 : - Of course, the expected token list depends on states to have
863 : correct lookahead information, and it depends on the parser not
864 : to perform extra reductions after fetching a lookahead from the
865 : scanner and before detecting a syntax error. Thus, state
866 : merging (from LALR or IELR) and default reductions corrupt the
867 : expected token list. However, the list is correct for
868 : canonical LR with one exception: it will still contain any
869 : token that will not be accepted due to an error action in a
870 : later state.
871 : */
872 11 : if (!yyla.empty ())
873 : {
874 11 : int yytoken = yyla.type_get ();
875 11 : yyarg[yycount++] = yytname_[yytoken];
876 11 : int yyn = yypact_[yystate];
877 11 : if (!yy_pact_value_is_default_ (yyn))
878 : {
879 : /* Start YYX at -YYN if negative to avoid negative indexes in
880 : YYCHECK. In other words, skip the first -YYN actions for
881 : this state because they are default actions. */
882 11 : int yyxbegin = yyn < 0 ? -yyn : 0;
883 : // Stay within bounds of both yycheck and yytname.
884 11 : int yychecklim = yylast_ - yyn + 1;
885 11 : int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
886 187 : for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
887 385 : if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
888 198 : && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
889 : {
890 22 : if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
891 : {
892 : yycount = 1;
893 : break;
894 : }
895 : else
896 22 : yyarg[yycount++] = yytname_[yyx];
897 : }
898 : }
899 : }
900 :
901 11 : char const* yyformat = YY_NULLPTR;
902 11 : switch (yycount)
903 : {
904 : #define YYCASE_(N, S) \
905 : case N: \
906 : yyformat = S; \
907 : break
908 0 : YYCASE_(0, YY_("syntax error"));
909 0 : YYCASE_(1, YY_("syntax error, unexpected %s"));
910 0 : YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
911 11 : YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
912 0 : YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
913 0 : YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
914 : #undef YYCASE_
915 : }
916 :
917 11 : std::string yyres;
918 : // Argument number.
919 11 : size_t yyi = 0;
920 495 : for (char const* yyp = yyformat; *yyp; ++yyp)
921 484 : if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
922 : {
923 99 : yyres += yytnamerr_ (yyarg[yyi++]);
924 33 : ++yyp;
925 : }
926 : else
927 451 : yyres += *yyp;
928 11 : return yyres;
929 : }
930 :
931 :
932 : const signed char Parser ::yypact_ninf_ = -33;
933 :
934 : const signed char Parser ::yytable_ninf_ = -33;
935 :
936 : const signed char
937 : Parser ::yypact_[] =
938 : {
939 : 2, 4, 10, -33, 17, -33, -33, 21, 14, -33,
940 : -33, -33, -33, -33, -7, 4, -33, -33, -33, -33,
941 : 18, -33, 16, 7, -33, -33, -33, -33, 20, -33,
942 : -33, -33, -1, -33, 24, 1, -33, -33, -33, 4,
943 : -33, -33, 29, 15, -33
944 : };
945 :
946 : const unsigned char
947 : Parser ::yydefact_[] =
948 : {
949 : 0, 14, 0, 15, 0, 3, 4, 5, 13, 1,
950 : 2, 18, 19, 20, 0, 14, 7, 17, 8, 9,
951 : 0, 16, 0, 0, 22, 6, 32, 26, 0, 24,
952 : 21, 23, 0, 29, 0, 14, 31, 28, 30, 14,
953 : 10, 25, 27, 13, 33
954 : };
955 :
956 : const signed char
957 : Parser ::yypgoto_[] =
958 : {
959 : -33, -33, -33, -33, -32, -33, -33, 0, -2, -33,
960 : 19, -33, -33, 22, -33, -33, -33, -33, 8, -33
961 : };
962 :
963 : const signed char
964 : Parser ::yydefgoto_[] =
965 : {
966 : -1, 2, 4, 5, 6, 15, 41, 42, 8, 16,
967 : 17, 18, 23, 24, 28, 19, 20, 32, 33, 34
968 : };
969 :
970 : const signed char
971 : Parser ::yytable_[] =
972 : {
973 : 36, 7, -12, 40, 22, 1, 3, 44, 29, 3,
974 : 9, -12, -12, 37, -32, 25, -11, 30, 22, 21,
975 : 21, 10, 11, 12, 13, -11, -11, 11, 12, 13,
976 : 14, 26, 35, 43, -27, 11, 12, 13, 14, 39,
977 : 38, 27, 0, 0, 0, 31
978 : };
979 :
980 : const signed char
981 : Parser ::yycheck_[] =
982 : {
983 : 1, 1, 1, 35, 11, 3, 5, 39, 1, 5,
984 : 0, 10, 11, 14, 15, 15, 1, 10, 11, 5,
985 : 5, 4, 6, 7, 8, 10, 11, 6, 7, 8,
986 : 9, 13, 12, 35, 13, 6, 7, 8, 9, 15,
987 : 32, 22, -1, -1, -1, 23
988 : };
989 :
990 : const unsigned char
991 : Parser ::yystos_[] =
992 : {
993 : 0, 3, 17, 5, 18, 19, 20, 23, 24, 0,
994 : 4, 6, 7, 8, 9, 21, 25, 26, 27, 31,
995 : 32, 5, 11, 28, 29, 23, 13, 26, 30, 1,
996 : 10, 29, 33, 34, 35, 12, 1, 14, 34, 15,
997 : 20, 22, 23, 24, 20
998 : };
999 :
1000 : const unsigned char
1001 : Parser ::yyr1_[] =
1002 : {
1003 : 0, 16, 17, 18, 18, 19, 20, 21, 21, 21,
1004 : 22, 22, 22, 23, 23, 24, 24, 25, 26, 26,
1005 : 26, 27, 28, 28, 28, 29, 30, 32, 31, 33,
1006 : 33, 33, 35, 34
1007 : };
1008 :
1009 : const unsigned char
1010 : Parser ::yyr2_[] =
1011 : {
1012 : 0, 2, 3, 1, 1, 1, 3, 1, 1, 1,
1013 : 1, 1, 0, 1, 0, 1, 2, 1, 1, 1,
1014 : 1, 3, 1, 2, 2, 4, 1, 0, 4, 1,
1015 : 2, 2, 0, 3
1016 : };
1017 :
1018 :
1019 :
1020 : // YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1021 : // First, the terminals, then, starting at \a yyntokens_, nonterminals.
1022 : const char*
1023 : const Parser ::yytname_[] =
1024 : {
1025 : "\"end of file\"", "error", "$undefined", "\"start of document\"",
1026 : "\"end of document\"", "\"comment\"", "\"plain scalar\"",
1027 : "\"single quoted scalar\"", "\"double quoted scalar\"",
1028 : "\"start of map\"", "\"end of map\"", "\"key\"", "\"value\"",
1029 : "\"start of sequence\"", "\"end of sequence\"", "\"element\"", "$accept",
1030 : "yaml", "empty_child", "empty", "child", "node", "child_comments_empty",
1031 : "comments_empty", "comments", "value", "scalar", "map", "pairs", "pair",
1032 : "key", "sequence", "$@1", "elements", "element", "$@2", YY_NULLPTR
1033 : };
1034 :
1035 : #if YAMBIDEBUG
1036 : const unsigned char
1037 : Parser ::yyrline_[] =
1038 : {
1039 : 0, 82, 82, 83, 83, 85, 87, 88, 89, 90,
1040 : 93, 94, 95, 98, 98, 99, 100, 103, 104, 105,
1041 : 106, 109, 110, 111, 112, 114, 115, 117, 117, 121,
1042 : 122, 123, 125, 125
1043 : };
1044 :
1045 : // Print the state stack on the debug stream.
1046 : void
1047 2405 : Parser ::yystack_print_ ()
1048 : {
1049 2405 : *yycdebug_ << "Stack now";
1050 22583 : for (stack_type::const_iterator
1051 4810 : i = yystack_.begin (),
1052 2405 : i_end = yystack_.end ();
1053 : i != i_end; ++i)
1054 40356 : *yycdebug_ << ' ' << i->state;
1055 4810 : *yycdebug_ << std::endl;
1056 2405 : }
1057 :
1058 : // Report on the debug stream that the rule \a yyrule is going to be reduced.
1059 : void
1060 2405 : Parser ::yy_reduce_print_ (int yyrule)
1061 : {
1062 2405 : unsigned int yylno = yyrline_[yyrule];
1063 2405 : int yynrhs = yyr2_[yyrule];
1064 : // Print the symbols being reduced, and their result.
1065 4810 : *yycdebug_ << "Reducing stack by rule " << yyrule - 1
1066 14430 : << " (line " << yylno << "):" << std::endl;
1067 : // The symbols being reduced.
1068 5698 : for (int yyi = 0; yyi < yynrhs; yyi++)
1069 16465 : YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
1070 : yystack_[(yynrhs) - (yyi + 1)]);
1071 2405 : }
1072 : #endif // YAMBIDEBUG
1073 :
1074 :
1075 :
1076 : } // yambi
1077 : #line 1078 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.cpp" // lalr1.cc:1167
1078 : #line 127 "/home/jenkins/workspace/libelektra_PR-2949-JSVQFJNQUXFDDEIVMWX2NWLWVTIX5MLFKA62ACPFOA3QLNMROQ7Q/build directory/src/plugins/yambi/parser.ypp" // lalr1.cc:1168
1079 :
1080 :
1081 : /* -- Epilogue -------------------------------------------------------------------------------------------------------------------------- */
1082 :
1083 : /**
1084 : * @brief Bison calls this method in case of an error.
1085 : *
1086 : * @param location This value specifies the location of the erroneous input.
1087 : * @param message This value stores the error message emitted by the Bison parser.
1088 : */
1089 : void yambi::Parser::error (const location_type& location,
1090 : const std::string& message)
1091 : {
1092 : driver.error (location, message, lexer.getText());
1093 : }
|