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

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