• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

KHolidays Library

  • sources
  • kde-4.14
  • kdepimlibs
  • kholidays
  • parsers
  • plan2
holidayparserplan.cpp
1 
2 /* A Bison parser, made by GNU Bison 2.4.1. */
3 
4 /* Skeleton implementation for Bison LALR(1) parsers in C++
5 
6  Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
7  Foundation, Inc.
8 
9  This program is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 
22 /* As a special exception, you may create a larger work that contains
23  part or all of the Bison parser skeleton and distribute that work
24  under terms of your choice, so long as that work isn't itself a
25  parser generator using the skeleton or a modified version thereof
26  as a parser skeleton. Alternatively, if you modify or redistribute
27  the parser skeleton itself, you may (at your option) remove this
28  special exception, which will cause the skeleton and the resulting
29  Bison output files to be licensed under the GNU General Public
30  License without this special exception.
31 
32  This special exception was added by the Free Software Foundation in
33  version 2.2 of Bison. */
34 
35 // Take the name prefix into account.
36 #define yylex KHolidayslex
37 
38 /* First part of user declarations. */
39 
40 /* Line 311 of lalr1.cc */
41 #line 30 "holidayparserplan.ypp"
42  /*** C/C++ Declarations ***/
43 
44 #include <stdio.h>
45 #include <stdlib.h>
46 #include <pwd.h>
47 #include <sys/types.h>
48 #include <sys/stat.h>
49 #include <limits.h>
50 #include <string>
51 
52 #include <QString>
53 
54 #include <KCalendarSystem>
55 
56 
57 
58 /* Line 311 of lalr1.cc */
59 #line 60 "holidayparserplan.cpp"
60 
61 
62 #include "holidayparserplan.hpp"
63 
64 /* User implementation prologue. */
65 
66 /* Line 317 of lalr1.cc */
67 #line 111 "holidayparserplan.ypp"
68 
69 
70 #include "holidayparserdriverplan_p.h"
71 #include "holidayscannerplan_p.h"
72 
73 /* this "connects" the bison parser in the driver to the flex scanner class
74  * object. it defines the yylex() function call to pull the next token from the
75  * current lexer object of the driver context. */
76 #undef yylex
77 #define yylex driver.m_scanner->lex
78 
79 
80 
81 /* Line 317 of lalr1.cc */
82 #line 83 "holidayparserplan.cpp"
83 
84 #ifndef YY_
85 # if YYENABLE_NLS
86 # if ENABLE_NLS
87 # include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
88 # define YY_(msgid) dgettext ("bison-runtime", msgid)
89 # endif
90 # endif
91 # ifndef YY_
92 # define YY_(msgid) msgid
93 # endif
94 #endif
95 
96 /* Suppress unused-variable warnings by "using" E. */
97 #define YYUSE(e) ((void) (e))
98 
99 /* Enable debugging if requested. */
100 #if YYDEBUG
101 
102 /* A pseudo ostream that takes yydebug_ into account. */
103 # define YYCDEBUG if (yydebug_) (*yycdebug_)
104 
105 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
106 do { \
107  if (yydebug_) \
108  { \
109  *yycdebug_ << Title << ' '; \
110  yy_symbol_print_ ((Type), (Value), (Location)); \
111  *yycdebug_ << std::endl; \
112  } \
113 } while (false)
114 
115 # define YY_REDUCE_PRINT(Rule) \
116 do { \
117  if (yydebug_) \
118  yy_reduce_print_ (Rule); \
119 } while (false)
120 
121 # define YY_STACK_PRINT() \
122 do { \
123  if (yydebug_) \
124  yystack_print_ (); \
125 } while (false)
126 
127 #else /* !YYDEBUG */
128 
129 # define YYCDEBUG if (false) std::cerr
130 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
131 # define YY_REDUCE_PRINT(Rule)
132 # define YY_STACK_PRINT()
133 
134 #endif /* !YYDEBUG */
135 
136 #define yyerrok (yyerrstatus_ = 0)
137 #define yyclearin (yychar = yyempty_)
138 
139 #define YYACCEPT goto yyacceptlab
140 #define YYABORT goto yyabortlab
141 #define YYERROR goto yyerrorlab
142 #define YYRECOVERING() (!!yyerrstatus_)
143 
144 
145 /* Line 380 of lalr1.cc */
146 #line 1 "[Bison:b4_percent_define_default]"
147 
148 namespace KHolidays {
149 
150 /* Line 380 of lalr1.cc */
151 #line 152 "holidayparserplan.cpp"
152 #if YYERROR_VERBOSE
153 
154  /* Return YYSTR after stripping away unnecessary quotes and
155  backslashes, so that it's suitable for yyerror. The heuristic is
156  that double-quoting is unnecessary unless the string contains an
157  apostrophe, a comma, or backslash (other than backslash-backslash).
158  YYSTR is taken from yytname. */
159  std::string
160  HolidayParserPlan::yytnamerr_ (const char *yystr)
161  {
162  if (*yystr == '"')
163  {
164  std::string yyr = "";
165  char const *yyp = yystr;
166 
167  for (;;)
168  switch (*++yyp)
169  {
170  case '\'':
171  case ',':
172  goto do_not_strip_quotes;
173 
174  case '\\':
175  if (*++yyp != '\\')
176  goto do_not_strip_quotes;
177  /* Fall through. */
178  default:
179  yyr += *yyp;
180  break;
181 
182  case '"':
183  return yyr;
184  }
185  do_not_strip_quotes: ;
186  }
187 
188  return yystr;
189  }
190 
191 #endif
192 
194  HolidayParserPlan::HolidayParserPlan (class HolidayParserDriverPlan& driver_yyarg)
195  :
196 #if YYDEBUG
197  yydebug_ (false),
198  yycdebug_ (&std::cerr),
199 #endif
200  driver (driver_yyarg)
201  {
202  }
203 
204  HolidayParserPlan::~HolidayParserPlan ()
205  {
206  }
207 
208 #if YYDEBUG
209  /*--------------------------------.
210  | Print this symbol on YYOUTPUT. |
211  `--------------------------------*/
212 
213  inline void
214  HolidayParserPlan::yy_symbol_value_print_ (int yytype,
215  const semantic_type* yyvaluep, const location_type* yylocationp)
216  {
217  YYUSE (yylocationp);
218  YYUSE (yyvaluep);
219  switch (yytype)
220  {
221  default:
222  break;
223  }
224  }
225 
226 
227  void
228  HolidayParserPlan::yy_symbol_print_ (int yytype,
229  const semantic_type* yyvaluep, const location_type* yylocationp)
230  {
231  *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm")
232  << ' ' << yytname_[yytype] << " ("
233  << *yylocationp << ": ";
234  yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
235  *yycdebug_ << ')';
236  }
237 #endif
238 
239  void
240  HolidayParserPlan::yydestruct_ (const char* yymsg,
241  int yytype, semantic_type* yyvaluep, location_type* yylocationp)
242  {
243  YYUSE (yylocationp);
244  YYUSE (yymsg);
245  YYUSE (yyvaluep);
246 
247  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
248 
249  switch (yytype)
250  {
251  case 6: /* "STRING" */
252 
253 /* Line 480 of lalr1.cc */
254 #line 96 "holidayparserplan.ypp"
255  { free( (yyvaluep->sval) ); };
256 
257 /* Line 480 of lalr1.cc */
258 #line 259 "holidayparserplan.cpp"
259  break;
260 
261  default:
262  break;
263  }
264  }
265 
266  void
267  HolidayParserPlan::yypop_ (unsigned int n)
268  {
269  yystate_stack_.pop (n);
270  yysemantic_stack_.pop (n);
271  yylocation_stack_.pop (n);
272  }
273 
274 #if YYDEBUG
275  std::ostream&
276  HolidayParserPlan::debug_stream () const
277  {
278  return *yycdebug_;
279  }
280 
281  void
282  HolidayParserPlan::set_debug_stream (std::ostream& o)
283  {
284  yycdebug_ = &o;
285  }
286 
287 
288  HolidayParserPlan::debug_level_type
289  HolidayParserPlan::debug_level () const
290  {
291  return yydebug_;
292  }
293 
294  void
295  HolidayParserPlan::set_debug_level (debug_level_type l)
296  {
297  yydebug_ = l;
298  }
299 #endif
300 
301  int
302  HolidayParserPlan::parse ()
303  {
305  int yychar = yyempty_;
306  int yytoken = 0;
307 
308  /* State. */
309  int yyn;
310  int yylen = 0;
311  int yystate = 0;
312 
313  /* Error handling. */
314  int yynerrs_ = 0;
315  int yyerrstatus_ = 0;
316 
318  semantic_type yylval;
320  location_type yylloc;
322  location_type yyerror_range[2];
323 
325  semantic_type yyval;
327  location_type yyloc;
328 
329  int yyresult;
330 
331  YYCDEBUG << "Starting parse" << std::endl;
332 
333 
334  /* User initialization code. */
335 
336 /* Line 553 of lalr1.cc */
337 #line 70 "holidayparserplan.ypp"
338 {
339  // initialize the initial location object
340  yylloc.begin.filename = driver.fileToParse();
341  yylloc.end.filename = yylloc.begin.filename;
342 }
343 
344 /* Line 553 of lalr1.cc */
345 #line 346 "holidayparserplan.cpp"
346 
347  /* Initialize the stacks. The initial state will be pushed in
348  yynewstate, since the latter expects the semantical and the
349  location values to have been already stored, initialize these
350  stacks with a primary value. */
351  yystate_stack_ = state_stack_type (0);
352  yysemantic_stack_ = semantic_stack_type (0);
353  yylocation_stack_ = location_stack_type (0);
354  yysemantic_stack_.push (yylval);
355  yylocation_stack_.push (yylloc);
356 
357  /* New state. */
358  yynewstate:
359  yystate_stack_.push (yystate);
360  YYCDEBUG << "Entering state " << yystate << std::endl;
361 
362  /* Accept? */
363  if (yystate == yyfinal_)
364  goto yyacceptlab;
365 
366  goto yybackup;
367 
368  /* Backup. */
369  yybackup:
370 
371  /* Try to take a decision without lookahead. */
372  yyn = yypact_[yystate];
373  if (yyn == yypact_ninf_)
374  goto yydefault;
375 
376  /* Read a lookahead token. */
377  if (yychar == yyempty_)
378  {
379  YYCDEBUG << "Reading a token: ";
380  yychar = yylex (&yylval, &yylloc);
381  }
382 
383 
384  /* Convert token to internal form. */
385  if (yychar <= yyeof_)
386  {
387  yychar = yytoken = yyeof_;
388  YYCDEBUG << "Now at end of input." << std::endl;
389  }
390  else
391  {
392  yytoken = yytranslate_ (yychar);
393  YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
394  }
395 
396  /* If the proper action on seeing token YYTOKEN is to reduce or to
397  detect an error, take that action. */
398  yyn += yytoken;
399  if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
400  goto yydefault;
401 
402  /* Reduce or error. */
403  yyn = yytable_[yyn];
404  if (yyn <= 0)
405  {
406  if (yyn == 0 || yyn == yytable_ninf_)
407  goto yyerrlab;
408  yyn = -yyn;
409  goto yyreduce;
410  }
411 
412  /* Shift the lookahead token. */
413  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
414 
415  /* Discard the token being shifted. */
416  yychar = yyempty_;
417 
418  yysemantic_stack_.push (yylval);
419  yylocation_stack_.push (yylloc);
420 
421  /* Count tokens shifted since error; after three, turn off error
422  status. */
423  if (yyerrstatus_)
424  --yyerrstatus_;
425 
426  yystate = yyn;
427  goto yynewstate;
428 
429  /*-----------------------------------------------------------.
430  | yydefault -- do the default action for the current state. |
431  `-----------------------------------------------------------*/
432  yydefault:
433  yyn = yydefact_[yystate];
434  if (yyn == 0)
435  goto yyerrlab;
436  goto yyreduce;
437 
438  /*-----------------------------.
439  | yyreduce -- Do a reduction. |
440  `-----------------------------*/
441  yyreduce:
442  yylen = yyr2_[yyn];
443  /* If YYLEN is nonzero, implement the default value of the action:
444  `$$ = $1'. Otherwise, use the top of the stack.
445 
446  Otherwise, the following line sets YYVAL to garbage.
447  This behavior is undocumented and Bison
448  users should not rely upon it. */
449  if (yylen)
450  yyval = yysemantic_stack_[yylen - 1];
451  else
452  yyval = yysemantic_stack_[0];
453 
454  {
455  slice<location_type, location_stack_type> slice (yylocation_stack_, yylen);
456  YYLLOC_DEFAULT (yyloc, slice, yylen);
457  }
458  YY_REDUCE_PRINT (yyn);
459  switch (yyn)
460  {
461  case 4:
462 
463 /* Line 678 of lalr1.cc */
464 #line 132 "holidayparserplan.ypp"
465  { driver.setFileCountryCode( QString() ); }
466  break;
467 
468  case 5:
469 
470 /* Line 678 of lalr1.cc */
471 #line 133 "holidayparserplan.ypp"
472  { char *s = (yysemantic_stack_[(2) - (2)].sval); driver.setFileCountryCode( QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(2) - (2)].sval) = NULL; }
473  break;
474 
475  case 6:
476 
477 /* Line 678 of lalr1.cc */
478 #line 136 "holidayparserplan.ypp"
479  { driver.setFileLanguageCode( QString() ); }
480  break;
481 
482  case 7:
483 
484 /* Line 678 of lalr1.cc */
485 #line 137 "holidayparserplan.ypp"
486  { char *s = (yysemantic_stack_[(2) - (2)].sval); driver.setFileLanguageCode( QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(2) - (2)].sval) = NULL; }
487  break;
488 
489  case 8:
490 
491 /* Line 678 of lalr1.cc */
492 #line 140 "holidayparserplan.ypp"
493  { driver.setFileName( QString() ); }
494  break;
495 
496  case 9:
497 
498 /* Line 678 of lalr1.cc */
499 #line 141 "holidayparserplan.ypp"
500  { char *s = (yysemantic_stack_[(2) - (2)].sval); driver.setFileName( QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(2) - (2)].sval) = NULL; }
501  break;
502 
503  case 10:
504 
505 /* Line 678 of lalr1.cc */
506 #line 144 "holidayparserplan.ypp"
507  { driver.setFileDescription( QString() ); }
508  break;
509 
510  case 11:
511 
512 /* Line 678 of lalr1.cc */
513 #line 145 "holidayparserplan.ypp"
514  { char *s = (yysemantic_stack_[(2) - (2)].sval); driver.setFileDescription( QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(2) - (2)].sval) = NULL; }
515  break;
516 
517  case 14:
518 
519 /* Line 678 of lalr1.cc */
520 #line 152 "holidayparserplan.ypp"
521  { char *s = (yysemantic_stack_[(1) - (1)].sval); driver.setEventName( QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(1) - (1)].sval) = NULL; }
522  break;
523 
524  case 15:
525 
526 /* Line 678 of lalr1.cc */
527 #line 155 "holidayparserplan.ypp"
528  { driver.setEventCategory( (yysemantic_stack_[(1) - (1)].sval) ); }
529  break;
530 
531  case 16:
532 
533 /* Line 678 of lalr1.cc */
534 #line 156 "holidayparserplan.ypp"
535  { driver.setEventCategory( (yysemantic_stack_[(2) - (1)].sval) ); }
536  break;
537 
538  case 17:
539 
540 /* Line 678 of lalr1.cc */
541 #line 159 "holidayparserplan.ypp"
542  { driver.setEventCalendarType( QLatin1String("gregorian") ); }
543  break;
544 
545  case 18:
546 
547 /* Line 678 of lalr1.cc */
548 #line 160 "holidayparserplan.ypp"
549  { driver.setEventCalendarType( QString::fromUtf8( (yysemantic_stack_[(1) - (1)].sval) ) ); }
550  break;
551 
552  case 19:
553 
554 /* Line 678 of lalr1.cc */
555 #line 163 "holidayparserplan.ypp"
556  { driver.setFromEaster( (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
557  break;
558 
559  case 20:
560 
561 /* Line 678 of lalr1.cc */
562 #line 164 "holidayparserplan.ypp"
563  { driver.setFromPascha( (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
564  break;
565 
566  case 21:
567 
568 /* Line 678 of lalr1.cc */
569 #line 165 "holidayparserplan.ypp"
570  { driver.setFromDate( (yysemantic_stack_[(4) - (2)].ival), (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (4)].ival) ); }
571  break;
572 
573  case 22:
574 
575 /* Line 678 of lalr1.cc */
576 #line 166 "holidayparserplan.ypp"
577  { driver.setFromWeekdayInMonth( 1, (yysemantic_stack_[(3) - (1)].ival), 1, (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
578  break;
579 
580  case 23:
581 
582 /* Line 678 of lalr1.cc */
583 #line 167 "holidayparserplan.ypp"
584  { driver.setFromWeekdayInMonth( (yysemantic_stack_[(4) - (1)].ival), (yysemantic_stack_[(4) - (2)].ival), 1, (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (4)].ival) ); }
585  break;
586 
587  case 24:
588 
589 /* Line 678 of lalr1.cc */
590 #line 168 "holidayparserplan.ypp"
591  { driver.setFromWeekdayInMonth( (yysemantic_stack_[(6) - (1)].ival), (yysemantic_stack_[(6) - (2)].ival), (yysemantic_stack_[(6) - (4)].ival), (yysemantic_stack_[(6) - (5)].ival), (yysemantic_stack_[(6) - (6)].ival) ); }
592  break;
593 
594  case 25:
595 
596 /* Line 678 of lalr1.cc */
597 #line 169 "holidayparserplan.ypp"
598  { driver.setFromRelativeWeekday( (yysemantic_stack_[(5) - (2)].ival), (yysemantic_stack_[(5) - (1)].ival), (yysemantic_stack_[(5) - (4)].ival), (yysemantic_stack_[(5) - (5)].ival) ); }
599  break;
600 
601  case 26:
602 
603 /* Line 678 of lalr1.cc */
604 #line 172 "holidayparserplan.ypp"
605  { (yyval.ival) = 0; }
606  break;
607 
608  case 27:
609 
610 /* Line 678 of lalr1.cc */
611 #line 173 "holidayparserplan.ypp"
612  { (yyval.ival) = (yysemantic_stack_[(2) - (2)].ival); }
613  break;
614 
615  case 28:
616 
617 /* Line 678 of lalr1.cc */
618 #line 174 "holidayparserplan.ypp"
619  { (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); }
620  break;
621 
622  case 29:
623 
624 /* Line 678 of lalr1.cc */
625 #line 177 "holidayparserplan.ypp"
626  { (yyval.ival) = 0; }
627  break;
628 
629  case 30:
630 
631 /* Line 678 of lalr1.cc */
632 #line 178 "holidayparserplan.ypp"
633  { (yyval.ival) = ( (yysemantic_stack_[(4) - (2)].ival) << 8 ) | (yysemantic_stack_[(4) - (4)].ival); }
634  break;
635 
636  case 31:
637 
638 /* Line 678 of lalr1.cc */
639 #line 181 "holidayparserplan.ypp"
640  { (yyval.ival) = 0; }
641  break;
642 
643  case 32:
644 
645 /* Line 678 of lalr1.cc */
646 #line 182 "holidayparserplan.ypp"
647  { (yyval.ival) = ( 1 << (yysemantic_stack_[(1) - (1)].ival) ); }
648  break;
649 
650  case 33:
651 
652 /* Line 678 of lalr1.cc */
653 #line 183 "holidayparserplan.ypp"
654  { (yyval.ival) = ( 1 << (yysemantic_stack_[(3) - (1)].ival) ) | (yysemantic_stack_[(3) - (3)].ival); }
655  break;
656 
657  case 34:
658 
659 /* Line 678 of lalr1.cc */
660 #line 186 "holidayparserplan.ypp"
661  { (yyval.ival) = 1; }
662  break;
663 
664  case 35:
665 
666 /* Line 678 of lalr1.cc */
667 #line 187 "holidayparserplan.ypp"
668  { (yyval.ival) = (yysemantic_stack_[(2) - (2)].ival); }
669  break;
670 
671  case 36:
672 
673 /* Line 678 of lalr1.cc */
674 #line 190 "holidayparserplan.ypp"
675  { driver.setEventDate( -99999, (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival) ); }
676  break;
677 
678  case 37:
679 
680 /* Line 678 of lalr1.cc */
681 #line 191 "holidayparserplan.ypp"
682  { driver.setEventDate( -99999, (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival) ); }
683  break;
684 
685  case 38:
686 
687 /* Line 678 of lalr1.cc */
688 #line 192 "holidayparserplan.ypp"
689  { driver.setEventDate( (yysemantic_stack_[(5) - (5)].ival), (yysemantic_stack_[(5) - (3)].ival), (yysemantic_stack_[(5) - (1)].ival) ); }
690  break;
691 
692  case 39:
693 
694 /* Line 678 of lalr1.cc */
695 #line 193 "holidayparserplan.ypp"
696  { driver.setEventDate( -99999, (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
697  break;
698 
699  case 40:
700 
701 /* Line 678 of lalr1.cc */
702 #line 194 "holidayparserplan.ypp"
703  { driver.setEventDate( (yysemantic_stack_[(5) - (5)].ival), (yysemantic_stack_[(5) - (1)].ival), (yysemantic_stack_[(5) - (3)].ival) ); }
704  break;
705 
706  case 41:
707 
708 /* Line 678 of lalr1.cc */
709 #line 195 "holidayparserplan.ypp"
710  { driver.setEventDate( -99999, (yysemantic_stack_[(2) - (1)].ival), (yysemantic_stack_[(2) - (2)].ival) ); }
711  break;
712 
713  case 42:
714 
715 /* Line 678 of lalr1.cc */
716 #line 196 "holidayparserplan.ypp"
717  { driver.setEventDate( (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (2)].ival) ); }
718  break;
719 
720  case 43:
721 
722 /* Line 678 of lalr1.cc */
723 #line 197 "holidayparserplan.ypp"
724  { driver.setEventDate( -99999, (yysemantic_stack_[(2) - (2)].ival), (yysemantic_stack_[(2) - (1)].ival) ); }
725  break;
726 
727  case 44:
728 
729 /* Line 678 of lalr1.cc */
730 #line 198 "holidayparserplan.ypp"
731  { driver.setEventDate( (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (1)].ival) ); }
732  break;
733 
734  case 45:
735 
736 /* Line 678 of lalr1.cc */
737 #line 199 "holidayparserplan.ypp"
738  { driver.setEventDate( (yysemantic_stack_[(4) - (4)].ival), (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival) ); }
739  break;
740 
741  case 46:
742 
743 /* Line 678 of lalr1.cc */
744 #line 200 "holidayparserplan.ypp"
745  { driver.setEventDate( (yysemantic_stack_[(1) - (1)].ival) ); }
746  break;
747 
748  case 47:
749 
750 /* Line 678 of lalr1.cc */
751 #line 203 "holidayparserplan.ypp"
752  { char *s = (yysemantic_stack_[(1) - (1)].sval); (yyval.ival) = driver.julianDayFromEventName( s ); free( s ); (yysemantic_stack_[(1) - (1)].sval) = NULL; }
753  break;
754 
755  case 48:
756 
757 /* Line 678 of lalr1.cc */
758 #line 204 "holidayparserplan.ypp"
759  { (yyval.ival) = driver.julianDayFromEaster(); }
760  break;
761 
762  case 49:
763 
764 /* Line 678 of lalr1.cc */
765 #line 205 "holidayparserplan.ypp"
766  { (yyval.ival) = driver.julianDayFromPascha(); }
767  break;
768 
769  case 50:
770 
771 /* Line 678 of lalr1.cc */
772 #line 206 "holidayparserplan.ypp"
773  { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival) ); }
774  break;
775 
776  case 51:
777 
778 /* Line 678 of lalr1.cc */
779 #line 207 "holidayparserplan.ypp"
780  { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival) ); }
781  break;
782 
783  case 52:
784 
785 /* Line 678 of lalr1.cc */
786 #line 208 "holidayparserplan.ypp"
787  { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
788  break;
789 
790  case 53:
791 
792 /* Line 678 of lalr1.cc */
793 #line 209 "holidayparserplan.ypp"
794  { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(2) - (2)].ival), (yysemantic_stack_[(2) - (1)].ival) ); }
795  break;
796 
797  case 54:
798 
799 /* Line 678 of lalr1.cc */
800 #line 210 "holidayparserplan.ypp"
801  { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(2) - (1)].ival), (yysemantic_stack_[(2) - (2)].ival) ); }
802  break;
803 
804  case 55:
805 
806 /* Line 678 of lalr1.cc */
807 #line 211 "holidayparserplan.ypp"
808  { (yyval.ival) = driver.julianDayFromRelativeWeekday( (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
809  break;
810 
811  case 56:
812 
813 /* Line 678 of lalr1.cc */
814 #line 212 "holidayparserplan.ypp"
815  { (yyval.ival) = driver.julianDayFromWeekdayInMonth( (yysemantic_stack_[(4) - (1)].ival), (yysemantic_stack_[(4) - (2)].ival), (yysemantic_stack_[(4) - (4)].ival) ); }
816  break;
817 
818  case 58:
819 
820 /* Line 678 of lalr1.cc */
821 #line 216 "holidayparserplan.ypp"
822  { (yyval.ival) = driver.adjustedMonthNumber( (yysemantic_stack_[(1) - (1)].ival) ); }
823  break;
824 
825  case 59:
826 
827 /* Line 678 of lalr1.cc */
828 #line 219 "holidayparserplan.ypp"
829  { (yyval.ival) = driver.adjustedMonthNumber( (yysemantic_stack_[(1) - (1)].ival) ); }
830  break;
831 
832  case 60:
833 
834 /* Line 678 of lalr1.cc */
835 #line 222 "holidayparserplan.ypp"
836  { (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); }
837  break;
838 
839  case 61:
840 
841 /* Line 678 of lalr1.cc */
842 #line 223 "holidayparserplan.ypp"
843  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) || (yysemantic_stack_[(3) - (3)].ival); }
844  break;
845 
846  case 62:
847 
848 /* Line 678 of lalr1.cc */
849 #line 224 "holidayparserplan.ypp"
850  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) && (yysemantic_stack_[(3) - (3)].ival); }
851  break;
852 
853  case 63:
854 
855 /* Line 678 of lalr1.cc */
856 #line 225 "holidayparserplan.ypp"
857  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) == (yysemantic_stack_[(3) - (3)].ival); }
858  break;
859 
860  case 64:
861 
862 /* Line 678 of lalr1.cc */
863 #line 226 "holidayparserplan.ypp"
864  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) != (yysemantic_stack_[(3) - (3)].ival); }
865  break;
866 
867  case 65:
868 
869 /* Line 678 of lalr1.cc */
870 #line 227 "holidayparserplan.ypp"
871  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) <= (yysemantic_stack_[(3) - (3)].ival); }
872  break;
873 
874  case 66:
875 
876 /* Line 678 of lalr1.cc */
877 #line 228 "holidayparserplan.ypp"
878  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) >= (yysemantic_stack_[(3) - (3)].ival); }
879  break;
880 
881  case 67:
882 
883 /* Line 678 of lalr1.cc */
884 #line 229 "holidayparserplan.ypp"
885  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) < (yysemantic_stack_[(3) - (3)].ival); }
886  break;
887 
888  case 68:
889 
890 /* Line 678 of lalr1.cc */
891 #line 230 "holidayparserplan.ypp"
892  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) > (yysemantic_stack_[(3) - (3)].ival); }
893  break;
894 
895  case 69:
896 
897 /* Line 678 of lalr1.cc */
898 #line 231 "holidayparserplan.ypp"
899  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) + (yysemantic_stack_[(3) - (3)].ival); }
900  break;
901 
902  case 70:
903 
904 /* Line 678 of lalr1.cc */
905 #line 232 "holidayparserplan.ypp"
906  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) - (yysemantic_stack_[(3) - (3)].ival); }
907  break;
908 
909  case 71:
910 
911 /* Line 678 of lalr1.cc */
912 #line 233 "holidayparserplan.ypp"
913  { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) * (yysemantic_stack_[(3) - (3)].ival); }
914  break;
915 
916  case 72:
917 
918 /* Line 678 of lalr1.cc */
919 #line 234 "holidayparserplan.ypp"
920  { (yyval.ival) = (yysemantic_stack_[(3) - (3)].ival) ? (yysemantic_stack_[(3) - (1)].ival) / (yysemantic_stack_[(3) - (3)].ival) : 0; }
921  break;
922 
923  case 73:
924 
925 /* Line 678 of lalr1.cc */
926 #line 235 "holidayparserplan.ypp"
927  { (yyval.ival) = (yysemantic_stack_[(3) - (3)].ival) ? (yysemantic_stack_[(3) - (1)].ival) % (yysemantic_stack_[(3) - (3)].ival) : 0; }
928  break;
929 
930  case 74:
931 
932 /* Line 678 of lalr1.cc */
933 #line 236 "holidayparserplan.ypp"
934  { (yyval.ival) = (yysemantic_stack_[(5) - (1)].ival) ? (yysemantic_stack_[(5) - (3)].ival) : (yysemantic_stack_[(5) - (5)].ival); }
935  break;
936 
937  case 75:
938 
939 /* Line 678 of lalr1.cc */
940 #line 237 "holidayparserplan.ypp"
941  { (yyval.ival) = !(yysemantic_stack_[(2) - (2)].ival); }
942  break;
943 
944  case 76:
945 
946 /* Line 678 of lalr1.cc */
947 #line 238 "holidayparserplan.ypp"
948  { (yyval.ival) = (yysemantic_stack_[(3) - (2)].ival); }
949  break;
950 
951  case 77:
952 
953 /* Line 678 of lalr1.cc */
954 #line 241 "holidayparserplan.ypp"
955  { (yyval.ival) = (yysemantic_stack_[(3) - (2)].ival); }
956  break;
957 
958  case 78:
959 
960 /* Line 678 of lalr1.cc */
961 #line 242 "holidayparserplan.ypp"
962  { (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); }
963  break;
964 
965  case 80:
966 
967 /* Line 678 of lalr1.cc */
968 #line 246 "holidayparserplan.ypp"
969  { (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); }
970  break;
971 
972  case 81:
973 
974 /* Line 678 of lalr1.cc */
975 #line 247 "holidayparserplan.ypp"
976  { (yyval.ival) = driver.parseYear(); }
977  break;
978 
979  case 82:
980 
981 /* Line 678 of lalr1.cc */
982 #line 248 "holidayparserplan.ypp"
983  { (yyval.ival) = driver.isLeapYear( (yysemantic_stack_[(2) - (2)].ival) ); }
984  break;
985 
986 
987 
988 /* Line 678 of lalr1.cc */
989 #line 990 "holidayparserplan.cpp"
990  default:
991  break;
992  }
993  YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
994 
995  yypop_ (yylen);
996  yylen = 0;
997  YY_STACK_PRINT ();
998 
999  yysemantic_stack_.push (yyval);
1000  yylocation_stack_.push (yyloc);
1001 
1002  /* Shift the result of the reduction. */
1003  yyn = yyr1_[yyn];
1004  yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
1005  if (0 <= yystate && yystate <= yylast_
1006  && yycheck_[yystate] == yystate_stack_[0])
1007  yystate = yytable_[yystate];
1008  else
1009  yystate = yydefgoto_[yyn - yyntokens_];
1010  goto yynewstate;
1011 
1012  /*------------------------------------.
1013  | yyerrlab -- here on detecting error |
1014  `------------------------------------*/
1015  yyerrlab:
1016  /* If not already recovering from an error, report this error. */
1017  if (!yyerrstatus_)
1018  {
1019  ++yynerrs_;
1020  error (yylloc, yysyntax_error_ (yystate, yytoken));
1021  }
1022 
1023  yyerror_range[0] = yylloc;
1024  if (yyerrstatus_ == 3)
1025  {
1026  /* If just tried and failed to reuse lookahead token after an
1027  error, discard it. */
1028 
1029  if (yychar <= yyeof_)
1030  {
1031  /* Return failure if at end of input. */
1032  if (yychar == yyeof_)
1033  YYABORT;
1034  }
1035  else
1036  {
1037  yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc);
1038  yychar = yyempty_;
1039  }
1040  }
1041 
1042  /* Else will try to reuse lookahead token after shifting the error
1043  token. */
1044  goto yyerrlab1;
1045 
1046 
1047  /*---------------------------------------------------.
1048  | yyerrorlab -- error raised explicitly by YYERROR. |
1049  `---------------------------------------------------*/
1050  yyerrorlab:
1051 
1052  /* Pacify compilers like GCC when the user code never invokes
1053  YYERROR and the label yyerrorlab therefore never appears in user
1054  code. */
1055  if (false)
1056  goto yyerrorlab;
1057 
1058  yyerror_range[0] = yylocation_stack_[yylen - 1];
1059  /* Do not reclaim the symbols of the rule which action triggered
1060  this YYERROR. */
1061  yypop_ (yylen);
1062  yylen = 0;
1063  yystate = yystate_stack_[0];
1064  goto yyerrlab1;
1065 
1066  /*-------------------------------------------------------------.
1067  | yyerrlab1 -- common code for both syntax error and YYERROR. |
1068  `-------------------------------------------------------------*/
1069  yyerrlab1:
1070  yyerrstatus_ = 3; /* Each real token shifted decrements this. */
1071 
1072  for (;;)
1073  {
1074  yyn = yypact_[yystate];
1075  if (yyn != yypact_ninf_)
1076  {
1077  yyn += yyterror_;
1078  if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
1079  {
1080  yyn = yytable_[yyn];
1081  if (0 < yyn)
1082  break;
1083  }
1084  }
1085 
1086  /* Pop the current state because it cannot handle the error token. */
1087  if (yystate_stack_.height () == 1)
1088  YYABORT;
1089 
1090  yyerror_range[0] = yylocation_stack_[0];
1091  yydestruct_ ("Error: popping",
1092  yystos_[yystate],
1093  &yysemantic_stack_[0], &yylocation_stack_[0]);
1094  yypop_ ();
1095  yystate = yystate_stack_[0];
1096  YY_STACK_PRINT ();
1097  }
1098 
1099  yyerror_range[1] = yylloc;
1100  // Using YYLLOC is tempting, but would change the location of
1101  // the lookahead. YYLOC is available though.
1102  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
1103  yysemantic_stack_.push (yylval);
1104  yylocation_stack_.push (yyloc);
1105 
1106  /* Shift the error token. */
1107  YY_SYMBOL_PRINT ("Shifting", yystos_[yyn],
1108  &yysemantic_stack_[0], &yylocation_stack_[0]);
1109 
1110  yystate = yyn;
1111  goto yynewstate;
1112 
1113  /* Accept. */
1114  yyacceptlab:
1115  yyresult = 0;
1116  goto yyreturn;
1117 
1118  /* Abort. */
1119  yyabortlab:
1120  yyresult = 1;
1121  goto yyreturn;
1122 
1123  yyreturn:
1124  if (yychar != yyempty_)
1125  yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
1126 
1127  /* Do not reclaim the symbols of the rule which action triggered
1128  this YYABORT or YYACCEPT. */
1129  yypop_ (yylen);
1130  while (yystate_stack_.height () != 1)
1131  {
1132  yydestruct_ ("Cleanup: popping",
1133  yystos_[yystate_stack_[0]],
1134  &yysemantic_stack_[0],
1135  &yylocation_stack_[0]);
1136  yypop_ ();
1137  }
1138 
1139  return yyresult;
1140  }
1141 
1142  // Generate an error message.
1143  std::string
1144  HolidayParserPlan::yysyntax_error_ (int yystate, int tok)
1145  {
1146  std::string res;
1147  YYUSE (yystate);
1148 #if YYERROR_VERBOSE
1149  int yyn = yypact_[yystate];
1150  if (yypact_ninf_ < yyn && yyn <= yylast_)
1151  {
1152  /* Start YYX at -YYN if negative to avoid negative indexes in
1153  YYCHECK. */
1154  int yyxbegin = yyn < 0 ? -yyn : 0;
1155 
1156  /* Stay within bounds of both yycheck and yytname. */
1157  int yychecklim = yylast_ - yyn + 1;
1158  int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
1159  int count = 0;
1160  for (int x = yyxbegin; x < yyxend; ++x)
1161  if (yycheck_[x + yyn] == x && x != yyterror_)
1162  ++count;
1163 
1164  // FIXME: This method of building the message is not compatible
1165  // with internationalization. It should work like yacc.c does it.
1166  // That is, first build a string that looks like this:
1167  // "syntax error, unexpected %s or %s or %s"
1168  // Then, invoke YY_ on this string.
1169  // Finally, use the string as a format to output
1170  // yytname_[tok], etc.
1171  // Until this gets fixed, this message appears in English only.
1172  res = "syntax error, unexpected ";
1173  res += yytnamerr_ (yytname_[tok]);
1174  if (count < 5)
1175  {
1176  count = 0;
1177  for (int x = yyxbegin; x < yyxend; ++x)
1178  if (yycheck_[x + yyn] == x && x != yyterror_)
1179  {
1180  res += (!count++) ? ", expecting " : " or ";
1181  res += yytnamerr_ (yytname_[x]);
1182  }
1183  }
1184  }
1185  else
1186 #endif
1187  res = YY_("syntax error");
1188  return res;
1189  }
1190 
1191 
1192  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1193  STATE-NUM. */
1194  const signed char HolidayParserPlan::yypact_ninf_ = -70;
1195  const short int
1196  HolidayParserPlan::yypact_[] =
1197  {
1198  -24, -1, 25, -70, 1, -70, -70, 39, 42, 38,
1199  -70, 65, -70, 64, 51, -70, 5, -70, 75, -70,
1200  -70, -70, 114, -70, -70, -70, 129, -70, 6, 30,
1201  30, 84, 134, -70, 30, 58, 6, -2, -70, 134,
1202  134, 77, 63, -70, 77, 77, -70, 134, 85, 160,
1203  -70, 81, 6, 6, 12, 131, 6, 209, 209, 134,
1204  -70, 30, 43, -70, -70, 62, 6, -70, -70, -70,
1205  54, 67, 6, 3, 134, 134, 134, 134, 134, 134,
1206  134, 134, 134, 134, 134, 134, 134, 134, -70, 98,
1207  77, 71, -70, 63, 77, 6, 70, -70, -70, -70,
1208  209, 77, 6, -70, 6, -70, -70, 102, 63, 251,
1209  251, 251, 251, 251, 251, 230, 251, 116, 116, 62,
1210  62, 62, 187, 86, 99, -70, 6, 30, -70, -70,
1211  134, -70, -70, -70, 63, 80, 134, 98, 98, -70,
1212  77, 209, -70, -70, -70, -70, -70, -70
1213  };
1214 
1215  /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
1216  doesn't specify something else to do. Zero means the default is an
1217  error. */
1218  const unsigned char
1219  HolidayParserPlan::yydefact_[] =
1220  {
1221  4, 0, 0, 12, 6, 5, 1, 2, 0, 8,
1222  14, 0, 7, 0, 10, 15, 17, 9, 0, 3,
1223  16, 18, 0, 11, 79, 59, 26, 81, 0, 26,
1224  26, 0, 0, 13, 26, 0, 57, 46, 78, 0,
1225  0, 34, 0, 82, 34, 34, 80, 0, 0, 0,
1226  60, 29, 0, 41, 26, 0, 43, 27, 28, 0,
1227  22, 26, 46, 19, 20, 75, 0, 47, 48, 49,
1228  0, 0, 57, 58, 0, 0, 0, 0, 0, 0,
1229  0, 0, 0, 0, 0, 0, 0, 0, 77, 31,
1230  34, 39, 42, 0, 34, 59, 36, 57, 58, 44,
1231  35, 34, 0, 76, 0, 54, 53, 0, 0, 63,
1232  64, 65, 66, 67, 68, 61, 62, 70, 69, 71,
1233  72, 73, 0, 32, 0, 21, 0, 26, 23, 45,
1234  37, 25, 55, 52, 0, 50, 0, 31, 31, 40,
1235  34, 38, 56, 51, 74, 33, 30, 24
1236  };
1237 
1238  /* YYPGOTO[NTERM-NUM]. */
1239  const signed char
1240  HolidayParserPlan::yypgoto_[] =
1241  {
1242  -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
1243  -70, -70, -19, -70, -69, -16, 79, -70, -9, 111,
1244  -23, -22, -70
1245  };
1246 
1247  /* YYDEFGOTO[NTERM-NUM]. */
1248  const signed char
1249  HolidayParserPlan::yydefgoto_[] =
1250  {
1251  -1, 2, 3, 4, 9, 14, 19, 7, 11, 16,
1252  22, 33, 41, 90, 124, 60, 34, 70, 35, 97,
1253  49, 50, 38
1254  };
1255 
1256  /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1257  positive, shift that token. If negative, reduce the rule which
1258  number is the opposite. If zero, do what YYDEFACT says. */
1259  const signed char HolidayParserPlan::yytable_ninf_ = -59;
1260  const short int
1261  HolidayParserPlan::yytable_[] =
1262  {
1263  37, 1, 25, 54, 42, 5, 43, 106, 107, 24,
1264  44, 45, 20, 21, 53, 51, 57, 58, 27, 28,
1265  62, 93, 39, 40, 65, 6, 73, 8, 63, 64,
1266  91, 92, -58, 98, 99, 94, 100, 31, 55, 71,
1267  39, 40, 101, 108, 102, 10, 96, 25, 12, 32,
1268  105, 109, 110, 111, 112, 113, 114, 115, 116, 117,
1269  118, 119, 120, 121, 122, 13, 24, 25, 145, 146,
1270  17, 98, 15, 129, 125, 27, 28, -58, 128, 18,
1271  132, 23, 133, 55, 127, 131, 98, 46, 24, 25,
1272  66, 67, 52, 59, 31, 89, 103, 27, 28, 135,
1273  87, 104, 68, 123, 139, 126, 32, 141, 140, 69,
1274  130, 134, 98, 144, 138, 137, 31, 24, 25, 26,
1275  143, 61, 0, 0, 147, 142, 27, 28, 32, 0,
1276  0, 29, 24, 36, 24, 95, 0, 24, 30, 39,
1277  40, 27, 28, 27, 28, 31, 27, 28, 56, 84,
1278  85, 86, 0, 36, 87, 0, 0, 32, 0, 72,
1279  31, 0, 31, 0, 0, 31, 0, 0, 0, 0,
1280  47, 0, 32, 56, 32, 48, 0, 32, 74, 75,
1281  76, 77, 78, 79, 0, 0, 0, 0, 0, 80,
1282  81, 82, 83, 84, 85, 86, 0, 0, 87, 0,
1283  0, 0, 0, 0, 88, 74, 75, 76, 77, 78,
1284  79, 0, 0, 0, 0, 0, 80, 81, 82, 83,
1285  84, 85, 86, 0, 0, 87, 136, 74, 75, 76,
1286  77, 78, 79, 0, 0, 0, 0, 0, 80, 81,
1287  82, 83, 84, 85, 86, 0, 0, 87, 74, 75,
1288  76, 77, 78, 79, 0, 0, 0, 0, 0, 0,
1289  81, 82, 83, 84, 85, 86, 0, 0, 87, 74,
1290  75, 76, 77, 78, 79, 0, 0, 0, 0, 0,
1291  0, 0, 82, 83, 84, 85, 86, 0, 0, 87
1292  };
1293 
1294  /* YYCHECK. */
1295  const short int
1296  HolidayParserPlan::yycheck_[] =
1297  {
1298  22, 25, 4, 5, 26, 6, 28, 4, 5, 3,
1299  29, 30, 7, 8, 36, 34, 39, 40, 12, 13,
1300  42, 9, 10, 11, 47, 0, 48, 26, 44, 45,
1301  52, 53, 34, 55, 56, 54, 59, 31, 40, 48,
1302  10, 11, 61, 40, 66, 6, 55, 4, 6, 43,
1303  72, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1304  83, 84, 85, 86, 87, 27, 3, 4, 137, 138,
1305  6, 93, 7, 95, 90, 12, 13, 34, 94, 28,
1306  102, 6, 104, 40, 93, 101, 108, 3, 3, 4,
1307  5, 6, 34, 16, 31, 14, 42, 12, 13, 108,
1308  38, 34, 17, 5, 126, 34, 43, 130, 127, 24,
1309  40, 9, 134, 136, 15, 29, 31, 3, 4, 5,
1310  40, 42, -1, -1, 140, 134, 12, 13, 43, -1,
1311  -1, 17, 3, 22, 3, 4, -1, 3, 24, 10,
1312  11, 12, 13, 12, 13, 31, 12, 13, 37, 33,
1313  34, 35, -1, 42, 38, -1, -1, 43, -1, 48,
1314  31, -1, 31, -1, -1, 31, -1, -1, -1, -1,
1315  36, -1, 43, 62, 43, 41, -1, 43, 18, 19,
1316  20, 21, 22, 23, -1, -1, -1, -1, -1, 29,
1317  30, 31, 32, 33, 34, 35, -1, -1, 38, -1,
1318  -1, -1, -1, -1, 44, 18, 19, 20, 21, 22,
1319  23, -1, -1, -1, -1, -1, 29, 30, 31, 32,
1320  33, 34, 35, -1, -1, 38, 39, 18, 19, 20,
1321  21, 22, 23, -1, -1, -1, -1, -1, 29, 30,
1322  31, 32, 33, 34, 35, -1, -1, 38, 18, 19,
1323  20, 21, 22, 23, -1, -1, -1, -1, -1, -1,
1324  30, 31, 32, 33, 34, 35, -1, -1, 38, 18,
1325  19, 20, 21, 22, 23, -1, -1, -1, -1, -1,
1326  -1, -1, 31, 32, 33, 34, 35, -1, -1, 38
1327  };
1328 
1329  /* STOS_[STATE-NUM] -- The (internal number of the) accessing
1330  symbol of state STATE-NUM. */
1331  const unsigned char
1332  HolidayParserPlan::yystos_[] =
1333  {
1334  0, 25, 46, 47, 48, 6, 0, 52, 26, 49,
1335  6, 53, 6, 27, 50, 7, 54, 6, 28, 51,
1336  7, 8, 55, 6, 3, 4, 5, 12, 13, 17,
1337  24, 31, 43, 56, 61, 63, 64, 66, 67, 10,
1338  11, 57, 66, 66, 57, 57, 3, 36, 41, 65,
1339  66, 57, 34, 66, 5, 40, 64, 65, 65, 16,
1340  60, 61, 66, 60, 60, 65, 5, 6, 17, 24,
1341  62, 63, 64, 66, 18, 19, 20, 21, 22, 23,
1342  29, 30, 31, 32, 33, 34, 35, 38, 44, 14,
1343  58, 66, 66, 9, 57, 4, 63, 64, 66, 66,
1344  65, 57, 66, 42, 34, 66, 4, 5, 40, 65,
1345  65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
1346  65, 65, 65, 5, 59, 60, 34, 63, 60, 66,
1347  40, 60, 66, 66, 9, 63, 39, 29, 15, 66,
1348  57, 65, 63, 40, 65, 59, 59, 60
1349  };
1350 
1351 #if YYDEBUG
1352  /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding
1353  to YYLEX-NUM. */
1354  const unsigned short int
1355  HolidayParserPlan::yytoken_number_[] =
1356  {
1357  0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1358  265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1359  275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1360  285, 45, 43, 42, 47, 37, 33, 286, 63, 58,
1361  46, 91, 93, 40, 41
1362  };
1363 #endif
1364 
1365  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
1366  const unsigned char
1367  HolidayParserPlan::yyr1_[] =
1368  {
1369  0, 45, 46, 47, 48, 48, 49, 49, 50, 50,
1370  51, 51, 52, 52, 53, 54, 54, 55, 55, 56,
1371  56, 56, 56, 56, 56, 56, 57, 57, 57, 58,
1372  58, 59, 59, 59, 60, 60, 61, 61, 61, 61,
1373  61, 61, 61, 61, 61, 61, 61, 62, 62, 62,
1374  62, 62, 62, 62, 62, 62, 62, 63, 63, 64,
1375  65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
1376  65, 65, 65, 65, 65, 65, 65, 66, 66, 67,
1377  67, 67, 67
1378  };
1379 
1380  /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
1381  const unsigned char
1382  HolidayParserPlan::yyr2_[] =
1383  {
1384  0, 2, 2, 4, 0, 2, 0, 2, 0, 2,
1385  0, 2, 0, 5, 1, 1, 2, 0, 1, 3,
1386  3, 4, 3, 4, 6, 5, 0, 2, 2, 0,
1387  4, 0, 1, 3, 0, 2, 3, 4, 5, 3,
1388  5, 2, 3, 2, 3, 4, 1, 1, 1, 1,
1389  3, 4, 3, 2, 2, 3, 4, 1, 1, 1,
1390  1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1391  3, 3, 3, 3, 5, 2, 3, 3, 1, 1,
1392  2, 1, 2
1393  };
1394 
1395 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1396  /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
1397  First, the terminals, then, starting at \a yyntokens_, nonterminals. */
1398  const char*
1399  const HolidayParserPlan::yytname_[] =
1400  {
1401  "END", "error", "$undefined", "NUMBER", "MONTH", "WDAY", "STRING",
1402  "CATEGORY", "CALENDAR", "INOP", "PLUS", "MINUS", "YEAR", "LEAPYEAR",
1403  "SHIFT", "IF", "LENGTH", "EASTER", "EQ", "NE", "LE", "GE", "LT", "GT",
1404  "PASCHA", "COUNTRY", "LANGUAGE", "NAME", "DESCRIPTION", "OR", "AND",
1405  "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "UMINUS", "'?'", "':'", "'.'",
1406  "'['", "']'", "'('", "')'", "$accept", "planfile", "metadata",
1407  "countrycode", "languagecode", "name", "description", "list",
1408  "eventname", "categories", "calendar", "eventrule", "offset",
1409  "conditionaloffset", "wdaycondition", "length", "date", "reldate",
1410  "month", "monthnumber", "expr", "pexpr", "number", 0
1411  };
1412 #endif
1413 
1414 #if YYDEBUG
1415  /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1416  const HolidayParserPlan::rhs_number_type
1417  HolidayParserPlan::yyrhs_[] =
1418  {
1419  46, 0, -1, 47, 52, -1, 48, 49, 50, 51,
1420  -1, -1, 25, 6, -1, -1, 26, 6, -1, -1,
1421  27, 6, -1, -1, 28, 6, -1, -1, 52, 53,
1422  54, 55, 56, -1, 6, -1, 7, -1, 54, 7,
1423  -1, -1, 8, -1, 17, 57, 60, -1, 24, 57,
1424  60, -1, 61, 57, 58, 60, -1, 5, 57, 60,
1425  -1, 66, 5, 57, 60, -1, 66, 5, 9, 63,
1426  57, 60, -1, 5, 66, 61, 57, 60, -1, -1,
1427  10, 65, -1, 11, 65, -1, -1, 14, 59, 15,
1428  59, -1, -1, 5, -1, 5, 29, 59, -1, -1,
1429  16, 65, -1, 66, 40, 63, -1, 66, 40, 63,
1430  40, -1, 66, 40, 63, 40, 65, -1, 63, 34,
1431  66, -1, 63, 34, 66, 34, 66, -1, 64, 66,
1432  -1, 64, 66, 66, -1, 66, 64, -1, 66, 64,
1433  66, -1, 66, 40, 4, 66, -1, 66, -1, 6,
1434  -1, 17, -1, 24, -1, 66, 40, 63, -1, 66,
1435  40, 63, 40, -1, 63, 34, 66, -1, 66, 4,
1436  -1, 64, 66, -1, 5, 66, 66, -1, 66, 5,
1437  9, 63, -1, 64, -1, 66, -1, 4, -1, 66,
1438  -1, 65, 29, 65, -1, 65, 30, 65, -1, 65,
1439  18, 65, -1, 65, 19, 65, -1, 65, 20, 65,
1440  -1, 65, 21, 65, -1, 65, 22, 65, -1, 65,
1441  23, 65, -1, 65, 32, 65, -1, 65, 31, 65,
1442  -1, 65, 33, 65, -1, 65, 34, 65, -1, 65,
1443  35, 65, -1, 65, 38, 65, 39, 65, -1, 36,
1444  65, -1, 41, 62, 42, -1, 43, 65, 44, -1,
1445  67, -1, 3, -1, 31, 3, -1, 12, -1, 13,
1446  66, -1
1447  };
1448 
1449  /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
1450  YYRHS. */
1451  const unsigned short int
1452  HolidayParserPlan::yyprhs_[] =
1453  {
1454  0, 0, 3, 6, 11, 12, 15, 16, 19, 20,
1455  23, 24, 27, 28, 34, 36, 38, 41, 42, 44,
1456  48, 52, 57, 61, 66, 73, 79, 80, 83, 86,
1457  87, 92, 93, 95, 99, 100, 103, 107, 112, 118,
1458  122, 128, 131, 135, 138, 142, 147, 149, 151, 153,
1459  155, 159, 164, 168, 171, 174, 178, 183, 185, 187,
1460  189, 191, 195, 199, 203, 207, 211, 215, 219, 223,
1461  227, 231, 235, 239, 243, 249, 252, 256, 260, 262,
1462  264, 267, 269
1463  };
1464 
1465  /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
1466  const unsigned char
1467  HolidayParserPlan::yyrline_[] =
1468  {
1469  0, 126, 126, 129, 132, 133, 136, 137, 140, 141,
1470  144, 145, 148, 149, 152, 155, 156, 159, 160, 163,
1471  164, 165, 166, 167, 168, 169, 172, 173, 174, 177,
1472  178, 181, 182, 183, 186, 187, 190, 191, 192, 193,
1473  194, 195, 196, 197, 198, 199, 200, 203, 204, 205,
1474  206, 207, 208, 209, 210, 211, 212, 215, 216, 219,
1475  222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
1476  232, 233, 234, 235, 236, 237, 238, 241, 242, 245,
1477  246, 247, 248
1478  };
1479 
1480  // Print the state stack on the debug stream.
1481  void
1482  HolidayParserPlan::yystack_print_ ()
1483  {
1484  *yycdebug_ << "Stack now";
1485  for (state_stack_type::const_iterator i = yystate_stack_.begin ();
1486  i != yystate_stack_.end (); ++i)
1487  *yycdebug_ << ' ' << *i;
1488  *yycdebug_ << std::endl;
1489  }
1490 
1491  // Report on the debug stream that the rule \a yyrule is going to be reduced.
1492  void
1493  HolidayParserPlan::yy_reduce_print_ (int yyrule)
1494  {
1495  unsigned int yylno = yyrline_[yyrule];
1496  int yynrhs = yyr2_[yyrule];
1497  /* Print the symbols being reduced, and their result. */
1498  *yycdebug_ << "Reducing stack by rule " << yyrule - 1
1499  << " (line " << yylno << "):" << std::endl;
1500  /* The symbols being reduced. */
1501  for (int yyi = 0; yyi < yynrhs; yyi++)
1502  YY_SYMBOL_PRINT (" $" << yyi + 1 << " =",
1503  yyrhs_[yyprhs_[yyrule] + yyi],
1504  &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
1505  &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
1506  }
1507 #endif // YYDEBUG
1508 
1509  /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
1510  HolidayParserPlan::token_number_type
1511  HolidayParserPlan::yytranslate_ (int t)
1512  {
1513  static
1514  const token_number_type
1515  translate_table[] =
1516  {
1517  0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1518  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1519  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1520  2, 2, 2, 36, 2, 2, 2, 35, 2, 2,
1521  43, 44, 33, 32, 2, 31, 40, 34, 2, 2,
1522  2, 2, 2, 2, 2, 2, 2, 2, 39, 2,
1523  2, 2, 2, 38, 2, 2, 2, 2, 2, 2,
1524  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1525  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1526  2, 41, 2, 42, 2, 2, 2, 2, 2, 2,
1527  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1528  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1529  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1530  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1531  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1532  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1533  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1534  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1535  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1536  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1537  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1538  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1539  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1540  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1541  2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1542  2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1543  5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1544  15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1545  25, 26, 27, 28, 29, 30, 37
1546  };
1547  if ((unsigned int) t <= yyuser_token_number_max_)
1548  return translate_table[t];
1549  else
1550  return yyundef_token_;
1551  }
1552 
1553  const int HolidayParserPlan::yyeof_ = 0;
1554  const int HolidayParserPlan::yylast_ = 289;
1555  const int HolidayParserPlan::yynnts_ = 23;
1556  const int HolidayParserPlan::yyempty_ = -2;
1557  const int HolidayParserPlan::yyfinal_ = 6;
1558  const int HolidayParserPlan::yyterror_ = 1;
1559  const int HolidayParserPlan::yyerrcode_ = 256;
1560  const int HolidayParserPlan::yyntokens_ = 45;
1561 
1562  const unsigned int HolidayParserPlan::yyuser_token_number_max_ = 286;
1563  const HolidayParserPlan::token_number_type HolidayParserPlan::yyundef_token_ = 2;
1564 
1565 
1566 /* Line 1054 of lalr1.cc */
1567 #line 1 "[Bison:b4_percent_define_default]"
1568 
1569 } // KHolidays
1570 
1571 /* Line 1054 of lalr1.cc */
1572 #line 1573 "holidayparserplan.cpp"
1573 
1574 
1575 /* Line 1056 of lalr1.cc */
1576 #line 251 "holidayparserplan.ypp"
1577 
1578 
1579 /*** Private Yacc callbacks and helper functions ***/
1580 
1581 void KHolidays::HolidayParserPlan::error( const KHolidays::HolidayParserPlan::location_type &errorLocation, const std::string &errorMessage )
1582 {
1583  driver.error( errorLocation, errorMessage.c_str() );
1584 }
1585 
KHolidays::HolidayParserPlan::set_debug_stream
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Definition: holidayparserplan.cpp:282
KHolidays::slice
Present a slice of the top of a stack.
Definition: stack.hh:111
KHolidays::location::end
position end
End of the located region.
Definition: location.hh:101
KHolidays::HolidayParserDriverPlan::error
void error(const KHolidays::location &errorLocation, const QString &errorMessage)
Bison C++ skeleton error message handling.
Definition: holidayparserdriverplan.cpp:80
KHolidays::HolidayParserPlan::debug_level_type
int debug_level_type
Type for debugging levels.
Definition: holidayparserplan.hpp:191
KHolidays::HolidayParserPlan::set_debug_level
void set_debug_level(debug_level_type l)
Set the current debugging level.
Definition: holidayparserplan.cpp:295
KHolidays::HolidayParserPlan::semantic_type
Symbol semantic values.
Definition: holidayparserplan.hpp:119
QString::fromUtf8
QString fromUtf8(const char *str, int size)
KHolidays::HolidayParserPlan::debug_level
debug_level_type debug_level() const
The current debugging level.
Definition: holidayparserplan.cpp:289
QString
KHolidays::HolidayParserPlan::parse
virtual int parse()
Parse.
Definition: holidayparserplan.cpp:302
KHolidays::HolidayParserPlan::HolidayParserPlan
HolidayParserPlan(class HolidayParserDriverPlan &driver_yyarg)
Build a parser object.
Definition: holidayparserplan.cpp:194
QLatin1String
KHolidays::location
Abstract a location.
Definition: location.hh:56
KHolidays::HolidayParserPlan::debug_stream
std::ostream & debug_stream() const
The current debugging stream.
Definition: holidayparserplan.cpp:276
KHolidays::location::begin
position begin
Beginning of the located region.
Definition: location.hh:99
KHolidays::position::filename
std::string * filename
File name to which this position refers.
Definition: position.hh:93
KHolidays::HolidayParserDriverPlan
HolidayParserDriverPlan implementation class.
Definition: holidayparserdriverplan_p.h:53
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:00 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHolidays Library

Skip menu "KHolidays Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal