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

KHolidays Library

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

Skip menu "kdepimlibs-4.10.5 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
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