Warning, file /frameworks/kholidays/src/parsers/plan2/holidayparserplan.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 0002 /* A Bison parser, made by GNU Bison 2.4.1. */ 0003 0004 /* Skeleton implementation for Bison LALR(1) parsers in C++ 0005 0006 SPDX-FileCopyrightText: 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 0007 0008 SPDX-License-Identifier: GPL-3.0-or-later WITH Bison-exception-2.2 0009 */ 0010 0011 // Take the name prefix into account. 0012 #define yylex KHolidayslex 0013 0014 /* First part of user declarations. */ 0015 0016 /* Line 311 of lalr1.cc */ 0017 #line 30 "holidayparserplan.ypp" 0018 /*** C/C++ Declarations ***/ 0019 0020 #include <limits.h> 0021 #include <stdio.h> 0022 #include <stdlib.h> 0023 #include <string> 0024 #include <sys/stat.h> 0025 #include <sys/types.h> 0026 0027 #include <QString> 0028 0029 // clang-format off 0030 0031 /* Line 311 of lalr1.cc */ 0032 #line 60 "holidayparserplan.cpp" 0033 0034 #include "holidayparserplan.hpp" 0035 0036 /* User implementation prologue. */ 0037 0038 /* Line 317 of lalr1.cc */ 0039 #line 111 "holidayparserplan.ypp" 0040 0041 #include "holidayparserdriverplan_p.h" 0042 #include "holidayscannerplan_p.h" 0043 0044 /* this "connects" the bison parser in the driver to the flex scanner class 0045 * object. it defines the yylex() function call to pull the next token from the 0046 * current lexer object of the driver context. */ 0047 #undef yylex 0048 #define yylex driver.m_scanner->lex 0049 0050 /* Line 317 of lalr1.cc */ 0051 #line 83 "holidayparserplan.cpp" 0052 0053 #ifndef YY_ 0054 # if defined(YYENABLE_NLS) && YYENABLE_NLS 0055 # if ENABLE_NLS 0056 # include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */ 0057 # define YY_(msgid) dgettext ("bison-runtime", msgid) 0058 # endif 0059 # endif 0060 # ifndef YY_ 0061 # define YY_(msgid) msgid 0062 # endif 0063 #endif 0064 0065 /* Suppress unused-variable warnings by "using" E. */ 0066 #define YYUSE(e) ((void) (e)) 0067 0068 /* Enable debugging if requested. */ 0069 #if YYDEBUG 0070 0071 /* A pseudo ostream that takes yydebug_ into account. */ 0072 # define YYCDEBUG if (yydebug_) (*yycdebug_) 0073 0074 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 0075 do { \ 0076 if (yydebug_) \ 0077 { \ 0078 *yycdebug_ << Title << ' '; \ 0079 yy_symbol_print_ ((Type), (Value), (Location)); \ 0080 *yycdebug_ << std::endl; \ 0081 } \ 0082 } while (false) 0083 0084 # define YY_REDUCE_PRINT(Rule) \ 0085 do { \ 0086 if (yydebug_) \ 0087 yy_reduce_print_ (Rule); \ 0088 } while (false) 0089 0090 # define YY_STACK_PRINT() \ 0091 do { \ 0092 if (yydebug_) \ 0093 yystack_print_ (); \ 0094 } while (false) 0095 0096 #else /* !YYDEBUG */ 0097 0098 # define YYCDEBUG if (false) std::cerr 0099 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 0100 # define YY_REDUCE_PRINT(Rule) 0101 # define YY_STACK_PRINT() 0102 0103 #endif /* !YYDEBUG */ 0104 0105 #define yyerrok (yyerrstatus_ = 0) 0106 #define yyclearin (yychar = yyempty_) 0107 0108 #define YYACCEPT goto yyacceptlab 0109 #define YYABORT goto yyabortlab 0110 #define YYERROR goto yyerrorlab 0111 #define YYRECOVERING() (!!yyerrstatus_) 0112 0113 /* Line 380 of lalr1.cc */ 0114 #line 1 "[Bison:b4_percent_define_default]" 0115 0116 namespace KHolidays 0117 { 0118 0119 /* Line 380 of lalr1.cc */ 0120 #line 152 "holidayparserplan.cpp" 0121 #if YYERROR_VERBOSE 0122 0123 /* Return YYSTR after stripping away unnecessary quotes and 0124 backslashes, so that it's suitable for yyerror. The heuristic is 0125 that double-quoting is unnecessary unless the string contains an 0126 apostrophe, a comma, or backslash (other than backslash-backslash). 0127 YYSTR is taken from yytname. */ 0128 std::string 0129 HolidayParserPlan::yytnamerr_(const char *yystr) 0130 { 0131 if (*yystr == '"') { 0132 std::string yyr = ""; 0133 char const *yyp = yystr; 0134 0135 for (;;) 0136 switch (*++yyp) { 0137 case '\'': 0138 case ',': 0139 goto do_not_strip_quotes; 0140 0141 case '\\': 0142 if (*++yyp != '\\') { 0143 goto do_not_strip_quotes; 0144 } 0145 /* Fall through. */ 0146 default: 0147 yyr += *yyp; 0148 break; 0149 0150 case '"': 0151 return yyr; 0152 } 0153 do_not_strip_quotes:; 0154 } 0155 0156 return yystr; 0157 } 0158 0159 #endif 0160 0161 /// Build a parser object. 0162 HolidayParserPlan::HolidayParserPlan(class HolidayParserDriverPlan &driver_yyarg) 0163 : 0164 #if YYDEBUG 0165 yydebug_(false), 0166 yycdebug_(&std::cerr), 0167 #endif 0168 driver(driver_yyarg) 0169 { 0170 } 0171 0172 HolidayParserPlan::~HolidayParserPlan() 0173 { 0174 } 0175 0176 #if YYDEBUG 0177 /*--------------------------------. 0178 | Print this symbol on YYOUTPUT. | 0179 `--------------------------------*/ 0180 0181 inline void 0182 HolidayParserPlan::yy_symbol_value_print_(int yytype, 0183 const semantic_type *yyvaluep, const location_type *yylocationp) 0184 { 0185 YYUSE(yylocationp); 0186 YYUSE(yyvaluep); 0187 switch (yytype) { 0188 default: 0189 break; 0190 } 0191 } 0192 0193 void 0194 HolidayParserPlan::yy_symbol_print_(int yytype, 0195 const semantic_type *yyvaluep, const location_type *yylocationp) 0196 { 0197 *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") 0198 << ' ' << yytname_[yytype] << " (" 0199 << *yylocationp << ": "; 0200 yy_symbol_value_print_(yytype, yyvaluep, yylocationp); 0201 *yycdebug_ << ')'; 0202 } 0203 #endif 0204 0205 void 0206 HolidayParserPlan::yydestruct_(const char *yymsg, 0207 int yytype, semantic_type *yyvaluep, location_type *yylocationp) 0208 { 0209 YYUSE(yylocationp); 0210 YYUSE(yymsg); 0211 YYUSE(yyvaluep); 0212 0213 YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp); 0214 0215 switch (yytype) { 0216 case 6: /* "STRING" */ 0217 0218 /* Line 480 of lalr1.cc */ 0219 #line 96 "holidayparserplan.ypp" 0220 { 0221 free((yyvaluep->sval)); 0222 }; 0223 0224 /* Line 480 of lalr1.cc */ 0225 #line 259 "holidayparserplan.cpp" 0226 break; 0227 0228 default: 0229 break; 0230 } 0231 } 0232 0233 void 0234 HolidayParserPlan::yypop_(unsigned int n) 0235 { 0236 yystate_stack_.pop(n); 0237 yysemantic_stack_.pop(n); 0238 yylocation_stack_.pop(n); 0239 } 0240 0241 #if YYDEBUG 0242 std::ostream & 0243 HolidayParserPlan::debug_stream() const 0244 { 0245 return *yycdebug_; 0246 } 0247 0248 void 0249 HolidayParserPlan::set_debug_stream(std::ostream &o) 0250 { 0251 yycdebug_ = &o; 0252 } 0253 0254 HolidayParserPlan::debug_level_type 0255 HolidayParserPlan::debug_level() const 0256 { 0257 return yydebug_; 0258 } 0259 0260 void 0261 HolidayParserPlan::set_debug_level(debug_level_type l) 0262 { 0263 yydebug_ = l; 0264 } 0265 #endif 0266 0267 int 0268 HolidayParserPlan::parse() 0269 { 0270 /// Lookahead and lookahead in internal form. 0271 int yychar = yyempty_; 0272 int yytoken = 0; 0273 0274 /* State. */ 0275 int yyn; 0276 int yylen = 0; 0277 int yystate = 0; 0278 0279 /* Error handling. */ 0280 int yynerrs_ = 0; 0281 int yyerrstatus_ = 0; 0282 0283 /// Semantic value of the lookahead. 0284 semantic_type yylval; 0285 /// Location of the lookahead. 0286 location_type yylloc; 0287 /// The locations where the error started and ended. 0288 location_type yyerror_range[2]; 0289 0290 /// $$. 0291 semantic_type yyval; 0292 /// @$. 0293 location_type yyloc; 0294 0295 int yyresult; 0296 0297 YYCDEBUG << "Starting parse" << std::endl; 0298 0299 /* User initialization code. */ 0300 0301 /* Line 553 of lalr1.cc */ 0302 #line 70 "holidayparserplan.ypp" 0303 { 0304 // initialize the initial location object 0305 yylloc.begin.filename = driver.fileToParse(); 0306 yylloc.end.filename = yylloc.begin.filename; 0307 } 0308 0309 /* Line 553 of lalr1.cc */ 0310 #line 346 "holidayparserplan.cpp" 0311 0312 /* Initialize the stacks. The initial state will be pushed in 0313 yynewstate, since the latter expects the semantical and the 0314 location values to have been already stored, initialize these 0315 stacks with a primary value. */ 0316 yystate_stack_ = state_stack_type(0); 0317 yysemantic_stack_ = semantic_stack_type(0); 0318 yylocation_stack_ = location_stack_type(0); 0319 yysemantic_stack_.push(yylval); 0320 yylocation_stack_.push(yylloc); 0321 0322 /* New state. */ 0323 yynewstate: 0324 yystate_stack_.push(yystate); 0325 YYCDEBUG << "Entering state " << yystate << std::endl; 0326 0327 /* Accept? */ 0328 if (yystate == yyfinal_) { 0329 goto yyacceptlab; 0330 } 0331 0332 goto yybackup; 0333 0334 /* Backup. */ 0335 yybackup: 0336 0337 /* Try to take a decision without lookahead. */ 0338 yyn = yypact_[yystate]; 0339 if (yyn == yypact_ninf_) { 0340 goto yydefault; 0341 } 0342 0343 /* Read a lookahead token. */ 0344 if (yychar == yyempty_) { 0345 YYCDEBUG << "Reading a token: "; 0346 yychar = yylex(&yylval, &yylloc); 0347 } 0348 0349 /* Convert token to internal form. */ 0350 if (yychar <= yyeof_) { 0351 yychar = yytoken = yyeof_; 0352 YYCDEBUG << "Now at end of input." << std::endl; 0353 } else { 0354 yytoken = yytranslate_(yychar); 0355 YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc); 0356 } 0357 0358 /* If the proper action on seeing token YYTOKEN is to reduce or to 0359 detect an error, take that action. */ 0360 yyn += yytoken; 0361 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) { 0362 goto yydefault; 0363 } 0364 0365 /* Reduce or error. */ 0366 yyn = yytable_[yyn]; 0367 if (yyn <= 0) { 0368 if (yyn == 0 || yyn == yytable_ninf_) { 0369 goto yyerrlab; 0370 } 0371 yyn = -yyn; 0372 goto yyreduce; 0373 } 0374 0375 /* Shift the lookahead token. */ 0376 YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc); 0377 0378 /* Discard the token being shifted. */ 0379 yychar = yyempty_; 0380 0381 yysemantic_stack_.push(yylval); 0382 yylocation_stack_.push(yylloc); 0383 0384 /* Count tokens shifted since error; after three, turn off error 0385 status. */ 0386 if (yyerrstatus_) { 0387 --yyerrstatus_; 0388 } 0389 0390 yystate = yyn; 0391 goto yynewstate; 0392 0393 /*-----------------------------------------------------------. 0394 | yydefault -- do the default action for the current state. | 0395 `-----------------------------------------------------------*/ 0396 yydefault: 0397 yyn = yydefact_[yystate]; 0398 if (yyn == 0) { 0399 goto yyerrlab; 0400 } 0401 goto yyreduce; 0402 0403 /*-----------------------------. 0404 | yyreduce -- Do a reduction. | 0405 `-----------------------------*/ 0406 yyreduce: 0407 yylen = yyr2_[yyn]; 0408 /* If YYLEN is nonzero, implement the default value of the action: 0409 `$$ = $1'. Otherwise, use the top of the stack. 0410 0411 Otherwise, the following line sets YYVAL to garbage. 0412 This behavior is undocumented and Bison 0413 users should not rely upon it. */ 0414 if (yylen) { 0415 yyval = yysemantic_stack_[yylen - 1]; 0416 } else { 0417 yyval = yysemantic_stack_[0]; 0418 } 0419 0420 { 0421 slice<location_type, location_stack_type> slice(yylocation_stack_, yylen); 0422 YYLLOC_DEFAULT(yyloc, slice, yylen); 0423 } 0424 YY_REDUCE_PRINT(yyn); 0425 switch (yyn) { 0426 case 4: 0427 0428 /* Line 678 of lalr1.cc */ 0429 #line 132 "holidayparserplan.ypp" 0430 { 0431 driver.setFileCountryCode(QString()); 0432 } 0433 break; 0434 0435 case 5: 0436 0437 /* Line 678 of lalr1.cc */ 0438 #line 133 "holidayparserplan.ypp" 0439 { 0440 char *s = (yysemantic_stack_[(2) - (2)].sval); 0441 driver.setFileCountryCode(QString::fromUtf8(s)); 0442 free(s); 0443 (yysemantic_stack_[(2) - (2)].sval) = nullptr; 0444 } 0445 break; 0446 0447 case 6: 0448 0449 /* Line 678 of lalr1.cc */ 0450 #line 136 "holidayparserplan.ypp" 0451 { 0452 driver.setFileLanguageCode(QString()); 0453 } 0454 break; 0455 0456 case 7: 0457 0458 /* Line 678 of lalr1.cc */ 0459 #line 137 "holidayparserplan.ypp" 0460 { 0461 char *s = (yysemantic_stack_[(2) - (2)].sval); 0462 driver.setFileLanguageCode(QString::fromUtf8(s)); 0463 free(s); 0464 (yysemantic_stack_[(2) - (2)].sval) = nullptr; 0465 } 0466 break; 0467 0468 case 8: 0469 0470 /* Line 678 of lalr1.cc */ 0471 #line 140 "holidayparserplan.ypp" 0472 { 0473 driver.setFileName(QString()); 0474 } 0475 break; 0476 0477 case 9: 0478 0479 /* Line 678 of lalr1.cc */ 0480 #line 141 "holidayparserplan.ypp" 0481 { 0482 char *s = (yysemantic_stack_[(2) - (2)].sval); 0483 driver.setFileName(QString::fromUtf8(s)); 0484 free(s); 0485 (yysemantic_stack_[(2) - (2)].sval) = nullptr; 0486 } 0487 break; 0488 0489 case 10: 0490 0491 /* Line 678 of lalr1.cc */ 0492 #line 144 "holidayparserplan.ypp" 0493 { 0494 driver.setFileDescription(QString()); 0495 } 0496 break; 0497 0498 case 11: 0499 0500 /* Line 678 of lalr1.cc */ 0501 #line 145 "holidayparserplan.ypp" 0502 { 0503 char *s = (yysemantic_stack_[(2) - (2)].sval); 0504 driver.setFileDescription(QString::fromUtf8(s)); 0505 free(s); 0506 (yysemantic_stack_[(2) - (2)].sval) = nullptr; 0507 } 0508 break; 0509 0510 case 14: 0511 0512 /* Line 678 of lalr1.cc */ 0513 #line 152 "holidayparserplan.ypp" 0514 { 0515 char *s = (yysemantic_stack_[(1) - (1)].sval); 0516 driver.setEventName(QString::fromUtf8(s)); 0517 free(s); 0518 (yysemantic_stack_[(1) - (1)].sval) = nullptr; 0519 } 0520 break; 0521 0522 case 15: 0523 0524 /* Line 678 of lalr1.cc */ 0525 #line 155 "holidayparserplan.ypp" 0526 { 0527 driver.setEventCategory((yysemantic_stack_[(1) - (1)].sval)); 0528 } 0529 break; 0530 0531 case 16: 0532 0533 /* Line 678 of lalr1.cc */ 0534 #line 156 "holidayparserplan.ypp" 0535 { 0536 driver.setEventCategory((yysemantic_stack_[(2) - (2)].sval)); 0537 } 0538 break; 0539 0540 case 17: 0541 0542 /* Line 678 of lalr1.cc */ 0543 #line 159 "holidayparserplan.ypp" 0544 { 0545 driver.setEventCalendarType(QStringLiteral("gregorian")); 0546 } 0547 break; 0548 0549 case 18: 0550 0551 /* Line 678 of lalr1.cc */ 0552 #line 160 "holidayparserplan.ypp" 0553 { 0554 driver.setEventCalendarType(QString::fromUtf8((yysemantic_stack_[(1) - (1)].sval))); 0555 } 0556 break; 0557 0558 case 19: 0559 0560 /* Line 678 of lalr1.cc */ 0561 #line 163 "holidayparserplan.ypp" 0562 { 0563 driver.setFromEaster((yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival)); 0564 } 0565 break; 0566 0567 case 20: 0568 0569 /* Line 678 of lalr1.cc */ 0570 #line 164 "holidayparserplan.ypp" 0571 { 0572 driver.setFromPascha((yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival)); 0573 } 0574 break; 0575 0576 case 21: 0577 0578 /* Line 678 of lalr1.cc */ 0579 #line 165 "holidayparserplan.ypp" 0580 { 0581 driver.setFromDate((yysemantic_stack_[(4) - (2)].ival), (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (4)].ival)); 0582 } 0583 break; 0584 0585 case 22: 0586 0587 /* Line 678 of lalr1.cc */ 0588 #line 166 "holidayparserplan.ypp" 0589 { 0590 driver.setFromWeekdayInMonth(1, (yysemantic_stack_[(3) - (1)].ival), 1, (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival)); 0591 } 0592 break; 0593 0594 case 23: 0595 0596 /* Line 678 of lalr1.cc */ 0597 #line 167 "holidayparserplan.ypp" 0598 { 0599 driver.setFromWeekdayInMonth((yysemantic_stack_[(4) - (1)].ival), (yysemantic_stack_[(4) - (2)].ival), 1, (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (4)].ival)); 0600 } 0601 break; 0602 0603 case 24: 0604 0605 /* Line 678 of lalr1.cc */ 0606 #line 168 "holidayparserplan.ypp" 0607 { 0608 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)); 0609 } 0610 break; 0611 0612 case 25: 0613 0614 /* Line 678 of lalr1.cc */ 0615 #line 169 "holidayparserplan.ypp" 0616 { 0617 driver.setFromRelativeWeekday((yysemantic_stack_[(5) - (2)].ival), (yysemantic_stack_[(5) - (1)].ival), (yysemantic_stack_[(5) - (4)].ival), (yysemantic_stack_[(5) - (5)].ival)); 0618 } 0619 break; 0620 0621 case 26: 0622 0623 /* Line 678 of lalr1.cc */ 0624 #line 172 "holidayparserplan.ypp" 0625 { 0626 (yyval.ival) = 0; 0627 } 0628 break; 0629 0630 case 27: 0631 0632 /* Line 678 of lalr1.cc */ 0633 #line 173 "holidayparserplan.ypp" 0634 { 0635 (yyval.ival) = (yysemantic_stack_[(2) - (2)].ival); 0636 } 0637 break; 0638 0639 case 28: 0640 0641 /* Line 678 of lalr1.cc */ 0642 #line 174 "holidayparserplan.ypp" 0643 { 0644 (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); 0645 } 0646 break; 0647 0648 case 29: 0649 0650 /* Line 678 of lalr1.cc */ 0651 #line 177 "holidayparserplan.ypp" 0652 { 0653 (yyval.ival) = 0; 0654 } 0655 break; 0656 0657 case 30: 0658 0659 /* Line 678 of lalr1.cc */ 0660 #line 178 "holidayparserplan.ypp" 0661 { 0662 (yyval.ival) = ((yysemantic_stack_[(4) - (2)].ival) << 8) | (yysemantic_stack_[(4) - (4)].ival); 0663 } 0664 break; 0665 0666 case 31: 0667 0668 /* Line 678 of lalr1.cc */ 0669 #line 181 "holidayparserplan.ypp" 0670 { 0671 (yyval.ival) = 0; 0672 } 0673 break; 0674 0675 case 32: 0676 0677 /* Line 678 of lalr1.cc */ 0678 #line 182 "holidayparserplan.ypp" 0679 { 0680 (yyval.ival) = (1 << (yysemantic_stack_[(1) - (1)].ival)); 0681 } 0682 break; 0683 0684 case 33: 0685 0686 /* Line 678 of lalr1.cc */ 0687 #line 183 "holidayparserplan.ypp" 0688 { 0689 (yyval.ival) = (1 << (yysemantic_stack_[(3) - (1)].ival)) | (yysemantic_stack_[(3) - (3)].ival); 0690 } 0691 break; 0692 0693 case 34: 0694 0695 /* Line 678 of lalr1.cc */ 0696 #line 186 "holidayparserplan.ypp" 0697 { 0698 (yyval.ival) = 1; 0699 } 0700 break; 0701 0702 case 35: 0703 0704 /* Line 678 of lalr1.cc */ 0705 #line 187 "holidayparserplan.ypp" 0706 { 0707 (yyval.ival) = (yysemantic_stack_[(2) - (2)].ival); 0708 } 0709 break; 0710 0711 case 36: 0712 0713 /* Line 678 of lalr1.cc */ 0714 #line 190 "holidayparserplan.ypp" 0715 { 0716 driver.setEventDate(-99999, (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival)); 0717 } 0718 break; 0719 0720 case 37: 0721 0722 /* Line 678 of lalr1.cc */ 0723 #line 191 "holidayparserplan.ypp" 0724 { 0725 driver.setEventDate(-99999, (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival)); 0726 } 0727 break; 0728 0729 case 38: 0730 0731 /* Line 678 of lalr1.cc */ 0732 #line 192 "holidayparserplan.ypp" 0733 { 0734 driver.setEventDate((yysemantic_stack_[(5) - (5)].ival), (yysemantic_stack_[(5) - (3)].ival), (yysemantic_stack_[(5) - (1)].ival)); 0735 } 0736 break; 0737 0738 case 39: 0739 0740 /* Line 678 of lalr1.cc */ 0741 #line 193 "holidayparserplan.ypp" 0742 { 0743 driver.setEventDate(-99999, (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival)); 0744 } 0745 break; 0746 0747 case 40: 0748 0749 /* Line 678 of lalr1.cc */ 0750 #line 194 "holidayparserplan.ypp" 0751 { 0752 driver.setEventDate((yysemantic_stack_[(5) - (5)].ival), (yysemantic_stack_[(5) - (1)].ival), (yysemantic_stack_[(5) - (3)].ival)); 0753 } 0754 break; 0755 0756 case 41: 0757 0758 /* Line 678 of lalr1.cc */ 0759 #line 195 "holidayparserplan.ypp" 0760 { 0761 driver.setEventDate(-99999, (yysemantic_stack_[(2) - (1)].ival), (yysemantic_stack_[(2) - (2)].ival)); 0762 } 0763 break; 0764 0765 case 42: 0766 0767 /* Line 678 of lalr1.cc */ 0768 #line 196 "holidayparserplan.ypp" 0769 { 0770 driver.setEventDate((yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (2)].ival)); 0771 } 0772 break; 0773 0774 case 43: 0775 0776 /* Line 678 of lalr1.cc */ 0777 #line 197 "holidayparserplan.ypp" 0778 { 0779 driver.setEventDate(-99999, (yysemantic_stack_[(2) - (2)].ival), (yysemantic_stack_[(2) - (1)].ival)); 0780 } 0781 break; 0782 0783 case 44: 0784 0785 /* Line 678 of lalr1.cc */ 0786 #line 198 "holidayparserplan.ypp" 0787 { 0788 driver.setEventDate((yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (1)].ival)); 0789 } 0790 break; 0791 0792 case 45: 0793 0794 /* Line 678 of lalr1.cc */ 0795 #line 199 "holidayparserplan.ypp" 0796 { 0797 driver.setEventDate((yysemantic_stack_[(4) - (4)].ival), (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival)); 0798 } 0799 break; 0800 0801 case 46: 0802 0803 /* Line 678 of lalr1.cc */ 0804 #line 200 "holidayparserplan.ypp" 0805 { 0806 driver.setEventDate((yysemantic_stack_[(1) - (1)].ival)); 0807 } 0808 break; 0809 0810 case 47: 0811 0812 /* Line 678 of lalr1.cc */ 0813 #line 203 "holidayparserplan.ypp" 0814 { 0815 char *s = (yysemantic_stack_[(1) - (1)].sval); 0816 (yyval.ival) = driver.julianDayFromEventName(s); 0817 free(s); 0818 (yysemantic_stack_[(1) - (1)].sval) = nullptr; 0819 } 0820 break; 0821 0822 case 48: 0823 0824 /* Line 678 of lalr1.cc */ 0825 #line 204 "holidayparserplan.ypp" 0826 { 0827 (yyval.ival) = driver.julianDayFromEaster(); 0828 } 0829 break; 0830 0831 case 49: 0832 0833 /* Line 678 of lalr1.cc */ 0834 #line 205 "holidayparserplan.ypp" 0835 { 0836 (yyval.ival) = driver.julianDayFromPascha(); 0837 } 0838 break; 0839 0840 case 50: 0841 0842 /* Line 678 of lalr1.cc */ 0843 #line 206 "holidayparserplan.ypp" 0844 { 0845 (yyval.ival) = driver.julianDayFromMonthDay((yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival)); 0846 } 0847 break; 0848 0849 case 51: 0850 0851 /* Line 678 of lalr1.cc */ 0852 #line 207 "holidayparserplan.ypp" 0853 { 0854 (yyval.ival) = driver.julianDayFromMonthDay((yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival)); 0855 } 0856 break; 0857 0858 case 52: 0859 0860 /* Line 678 of lalr1.cc */ 0861 #line 208 "holidayparserplan.ypp" 0862 { 0863 (yyval.ival) = driver.julianDayFromMonthDay((yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival)); 0864 } 0865 break; 0866 0867 case 53: 0868 0869 /* Line 678 of lalr1.cc */ 0870 #line 209 "holidayparserplan.ypp" 0871 { 0872 (yyval.ival) = driver.julianDayFromMonthDay((yysemantic_stack_[(2) - (2)].ival), (yysemantic_stack_[(2) - (1)].ival)); 0873 } 0874 break; 0875 0876 case 54: 0877 0878 /* Line 678 of lalr1.cc */ 0879 #line 210 "holidayparserplan.ypp" 0880 { 0881 (yyval.ival) = driver.julianDayFromMonthDay((yysemantic_stack_[(2) - (1)].ival), (yysemantic_stack_[(2) - (2)].ival)); 0882 } 0883 break; 0884 0885 case 55: 0886 0887 /* Line 678 of lalr1.cc */ 0888 #line 211 "holidayparserplan.ypp" 0889 { 0890 (yyval.ival) = driver.julianDayFromRelativeWeekday((yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival)); 0891 } 0892 break; 0893 0894 case 56: 0895 0896 /* Line 678 of lalr1.cc */ 0897 #line 212 "holidayparserplan.ypp" 0898 { 0899 (yyval.ival) = driver.julianDayFromWeekdayInMonth((yysemantic_stack_[(4) - (1)].ival), (yysemantic_stack_[(4) - (2)].ival), (yysemantic_stack_[(4) - (4)].ival)); 0900 } 0901 break; 0902 0903 case 58: 0904 0905 /* Line 678 of lalr1.cc */ 0906 #line 216 "holidayparserplan.ypp" 0907 { 0908 (yyval.ival) = driver.adjustedMonthNumber((yysemantic_stack_[(1) - (1)].ival)); 0909 } 0910 break; 0911 0912 case 59: 0913 0914 /* Line 678 of lalr1.cc */ 0915 #line 219 "holidayparserplan.ypp" 0916 { 0917 (yyval.ival) = driver.adjustedMonthNumber((yysemantic_stack_[(1) - (1)].ival)); 0918 } 0919 break; 0920 0921 case 60: 0922 0923 /* Line 678 of lalr1.cc */ 0924 #line 222 "holidayparserplan.ypp" 0925 { 0926 (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); 0927 } 0928 break; 0929 0930 case 61: 0931 0932 /* Line 678 of lalr1.cc */ 0933 #line 223 "holidayparserplan.ypp" 0934 { 0935 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) || (yysemantic_stack_[(3) - (3)].ival); 0936 } 0937 break; 0938 0939 case 62: 0940 0941 /* Line 678 of lalr1.cc */ 0942 #line 224 "holidayparserplan.ypp" 0943 { 0944 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) && (yysemantic_stack_[(3) - (3)].ival); 0945 } 0946 break; 0947 0948 case 63: 0949 0950 /* Line 678 of lalr1.cc */ 0951 #line 225 "holidayparserplan.ypp" 0952 { 0953 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) == (yysemantic_stack_[(3) - (3)].ival); 0954 } 0955 break; 0956 0957 case 64: 0958 0959 /* Line 678 of lalr1.cc */ 0960 #line 226 "holidayparserplan.ypp" 0961 { 0962 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) != (yysemantic_stack_[(3) - (3)].ival); 0963 } 0964 break; 0965 0966 case 65: 0967 0968 /* Line 678 of lalr1.cc */ 0969 #line 227 "holidayparserplan.ypp" 0970 { 0971 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) <= (yysemantic_stack_[(3) - (3)].ival); 0972 } 0973 break; 0974 0975 case 66: 0976 0977 /* Line 678 of lalr1.cc */ 0978 #line 228 "holidayparserplan.ypp" 0979 { 0980 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) >= (yysemantic_stack_[(3) - (3)].ival); 0981 } 0982 break; 0983 0984 case 67: 0985 0986 /* Line 678 of lalr1.cc */ 0987 #line 229 "holidayparserplan.ypp" 0988 { 0989 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) < (yysemantic_stack_[(3) - (3)].ival); 0990 } 0991 break; 0992 0993 case 68: 0994 0995 /* Line 678 of lalr1.cc */ 0996 #line 230 "holidayparserplan.ypp" 0997 { 0998 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) > (yysemantic_stack_[(3) - (3)].ival); 0999 } 1000 break; 1001 1002 case 69: 1003 1004 /* Line 678 of lalr1.cc */ 1005 #line 231 "holidayparserplan.ypp" 1006 { 1007 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) + (yysemantic_stack_[(3) - (3)].ival); 1008 } 1009 break; 1010 1011 case 70: 1012 1013 /* Line 678 of lalr1.cc */ 1014 #line 232 "holidayparserplan.ypp" 1015 { 1016 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) - (yysemantic_stack_[(3) - (3)].ival); 1017 } 1018 break; 1019 1020 case 71: 1021 1022 /* Line 678 of lalr1.cc */ 1023 #line 233 "holidayparserplan.ypp" 1024 { 1025 (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) * (yysemantic_stack_[(3) - (3)].ival); 1026 } 1027 break; 1028 1029 case 72: 1030 1031 /* Line 678 of lalr1.cc */ 1032 #line 234 "holidayparserplan.ypp" 1033 { 1034 (yyval.ival) = (yysemantic_stack_[(3) - (3)].ival) ? (yysemantic_stack_[(3) - (1)].ival) / (yysemantic_stack_[(3) - (3)].ival) : 0; 1035 } 1036 break; 1037 1038 case 73: 1039 1040 /* Line 678 of lalr1.cc */ 1041 #line 235 "holidayparserplan.ypp" 1042 { 1043 (yyval.ival) = (yysemantic_stack_[(3) - (3)].ival) ? (yysemantic_stack_[(3) - (1)].ival) % (yysemantic_stack_[(3) - (3)].ival) : 0; 1044 } 1045 break; 1046 1047 case 74: 1048 1049 /* Line 678 of lalr1.cc */ 1050 #line 236 "holidayparserplan.ypp" 1051 { 1052 (yyval.ival) = (yysemantic_stack_[(5) - (1)].ival) ? (yysemantic_stack_[(5) - (3)].ival) : (yysemantic_stack_[(5) - (5)].ival); 1053 } 1054 break; 1055 1056 case 75: 1057 1058 /* Line 678 of lalr1.cc */ 1059 #line 237 "holidayparserplan.ypp" 1060 { 1061 (yyval.ival) = !(yysemantic_stack_[(2) - (2)].ival); 1062 } 1063 break; 1064 1065 case 76: 1066 1067 /* Line 678 of lalr1.cc */ 1068 #line 238 "holidayparserplan.ypp" 1069 { 1070 (yyval.ival) = (yysemantic_stack_[(3) - (2)].ival); 1071 } 1072 break; 1073 1074 case 77: 1075 1076 /* Line 678 of lalr1.cc */ 1077 #line 241 "holidayparserplan.ypp" 1078 { 1079 (yyval.ival) = (yysemantic_stack_[(3) - (2)].ival); 1080 } 1081 break; 1082 1083 case 78: 1084 1085 /* Line 678 of lalr1.cc */ 1086 #line 242 "holidayparserplan.ypp" 1087 { 1088 (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); 1089 } 1090 break; 1091 1092 case 80: 1093 1094 /* Line 678 of lalr1.cc */ 1095 #line 246 "holidayparserplan.ypp" 1096 { 1097 (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); 1098 } 1099 break; 1100 1101 case 81: 1102 1103 /* Line 678 of lalr1.cc */ 1104 #line 247 "holidayparserplan.ypp" 1105 { 1106 (yyval.ival) = driver.parseYear(); 1107 } 1108 break; 1109 1110 case 82: 1111 1112 /* Line 678 of lalr1.cc */ 1113 #line 248 "holidayparserplan.ypp" 1114 { 1115 (yyval.ival) = driver.isLeapYear((yysemantic_stack_[(2) - (2)].ival)); 1116 } 1117 break; 1118 1119 /* Line 678 of lalr1.cc */ 1120 #line 990 "holidayparserplan.cpp" 1121 default: 1122 break; 1123 } 1124 YY_SYMBOL_PRINT("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 1125 1126 yypop_(yylen); 1127 yylen = 0; 1128 YY_STACK_PRINT(); 1129 1130 yysemantic_stack_.push(yyval); 1131 yylocation_stack_.push(yyloc); 1132 1133 /* Shift the result of the reduction. */ 1134 yyn = yyr1_[yyn]; 1135 yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; 1136 if (0 <= yystate && yystate <= yylast_ 1137 && yycheck_[yystate] == yystate_stack_[0]) { 1138 yystate = yytable_[yystate]; 1139 } else { 1140 yystate = yydefgoto_[yyn - yyntokens_]; 1141 } 1142 goto yynewstate; 1143 1144 /*------------------------------------. 1145 | yyerrlab -- here on detecting error | 1146 `------------------------------------*/ 1147 yyerrlab: 1148 /* If not already recovering from an error, report this error. */ 1149 if (!yyerrstatus_) { 1150 ++yynerrs_; 1151 error(yylloc, yysyntax_error_(yylloc.begin.filename, yystate, yytoken)); 1152 } 1153 1154 yyerror_range[0] = yylloc; 1155 if (yyerrstatus_ == 3) { 1156 /* If just tried and failed to reuse lookahead token after an 1157 error, discard it. */ 1158 1159 if (yychar <= yyeof_) { 1160 /* Return failure if at end of input. */ 1161 if (yychar == yyeof_) { 1162 YYABORT; 1163 } 1164 } else { 1165 yydestruct_("Error: discarding", yytoken, &yylval, &yylloc); 1166 yychar = yyempty_; 1167 } 1168 } 1169 1170 /* Else will try to reuse lookahead token after shifting the error 1171 token. */ 1172 goto yyerrlab1; 1173 1174 /*---------------------------------------------------. 1175 | yyerrorlab -- error raised explicitly by YYERROR. | 1176 `---------------------------------------------------*/ 1177 yyerrorlab: 1178 1179 /* Pacify compilers like GCC when the user code never invokes 1180 YYERROR and the label yyerrorlab therefore never appears in user 1181 code. */ 1182 if (false) { 1183 goto yyerrorlab; 1184 } 1185 1186 yyerror_range[0] = yylocation_stack_[yylen - 1]; 1187 /* Do not reclaim the symbols of the rule which action triggered 1188 this YYERROR. */ 1189 yypop_(yylen); 1190 yylen = 0; 1191 yystate = yystate_stack_[0]; 1192 goto yyerrlab1; 1193 1194 /*-------------------------------------------------------------. 1195 | yyerrlab1 -- common code for both syntax error and YYERROR. | 1196 `-------------------------------------------------------------*/ 1197 yyerrlab1: 1198 yyerrstatus_ = 3; /* Each real token shifted decrements this. */ 1199 1200 for (;;) { 1201 yyn = yypact_[yystate]; 1202 if (yyn != yypact_ninf_) { 1203 yyn += yyterror_; 1204 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) { 1205 yyn = yytable_[yyn]; 1206 if (0 < yyn) { 1207 break; 1208 } 1209 } 1210 } 1211 1212 /* Pop the current state because it cannot handle the error token. */ 1213 if (yystate_stack_.height() == 1) { 1214 YYABORT; 1215 } 1216 1217 yyerror_range[0] = yylocation_stack_[0]; 1218 yydestruct_("Error: popping", 1219 yystos_[yystate], 1220 &yysemantic_stack_[0], &yylocation_stack_[0]); 1221 yypop_(); 1222 yystate = yystate_stack_[0]; 1223 YY_STACK_PRINT(); 1224 } 1225 1226 yyerror_range[1] = yylloc; 1227 // Using YYLLOC is tempting, but would change the location of 1228 // the lookahead. YYLOC is available though. 1229 YYLLOC_DEFAULT(yyloc, (yyerror_range - 1), 2); 1230 yysemantic_stack_.push(yylval); 1231 yylocation_stack_.push(yyloc); 1232 1233 /* Shift the error token. */ 1234 YY_SYMBOL_PRINT("Shifting", yystos_[yyn], 1235 &yysemantic_stack_[0], &yylocation_stack_[0]); 1236 1237 yystate = yyn; 1238 goto yynewstate; 1239 1240 /* Accept. */ 1241 yyacceptlab: 1242 yyresult = 0; 1243 goto yyreturn; 1244 1245 /* Abort. */ 1246 yyabortlab: 1247 yyresult = 1; 1248 goto yyreturn; 1249 1250 yyreturn: 1251 if (yychar != yyempty_) { 1252 yydestruct_("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); 1253 } 1254 1255 /* Do not reclaim the symbols of the rule which action triggered 1256 this YYABORT or YYACCEPT. */ 1257 yypop_(yylen); 1258 while (yystate_stack_.height() != 1) { 1259 yydestruct_("Cleanup: popping", 1260 yystos_[yystate_stack_[0]], 1261 &yysemantic_stack_[0], 1262 &yylocation_stack_[0]); 1263 yypop_(); 1264 } 1265 1266 return yyresult; 1267 } 1268 1269 // Generate an error message. 1270 std::string 1271 HolidayParserPlan::yysyntax_error_(std::string *filename, int yystate, int tok) 1272 { 1273 std::string res; 1274 YYUSE(yystate); 1275 #if YYERROR_VERBOSE 1276 int yyn = yypact_[yystate]; 1277 if (yypact_ninf_ < yyn && yyn <= yylast_) { 1278 /* Start YYX at -YYN if negative to avoid negative indexes in 1279 YYCHECK. */ 1280 int yyxbegin = yyn < 0 ? -yyn : 0; 1281 1282 /* Stay within bounds of both yycheck and yytname. */ 1283 int yychecklim = yylast_ - yyn + 1; 1284 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 1285 int count = 0; 1286 for (int x = yyxbegin; x < yyxend; ++x) 1287 if (yycheck_[x + yyn] == x && x != yyterror_) { 1288 ++count; 1289 } 1290 1291 // FIXME: This method of building the message is not compatible 1292 // with internationalization. It should work like yacc.c does it. 1293 // That is, first build a string that looks like this: 1294 // "syntax error, unexpected %s or %s or %s" 1295 // Then, invoke YY_ on this string. 1296 // Finally, use the string as a format to output 1297 // yytname_[tok], etc. 1298 // Until this gets fixed, this message appears in English only. 1299 res = "syntax error, unexpected "; 1300 res += yytnamerr_(yytname_[tok]); 1301 if (count < 5) { 1302 count = 0; 1303 for (int x = yyxbegin; x < yyxend; ++x) 1304 if (yycheck_[x + yyn] == x && x != yyterror_) { 1305 res += (!count++) ? ", expecting " : " or "; 1306 res += yytnamerr_(yytname_[x]); 1307 res += ". Filepath : " + *filename; 1308 } 1309 } 1310 } else 1311 #endif 1312 res = YY_("syntax error"); 1313 return res; 1314 } 1315 1316 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 1317 STATE-NUM. */ 1318 const signed char HolidayParserPlan::yypact_ninf_ = -70; 1319 const short int 1320 HolidayParserPlan::yypact_[] = { 1321 -24, -1, 25, -70, 1, -70, -70, 39, 42, 38, 1322 -70, 65, -70, 64, 51, -70, 5, -70, 75, -70, 1323 -70, -70, 114, -70, -70, -70, 129, -70, 6, 30, 1324 30, 84, 134, -70, 30, 58, 6, -2, -70, 134, 1325 134, 77, 63, -70, 77, 77, -70, 134, 85, 160, 1326 -70, 81, 6, 6, 12, 131, 6, 209, 209, 134, 1327 -70, 30, 43, -70, -70, 62, 6, -70, -70, -70, 1328 54, 67, 6, 3, 134, 134, 134, 134, 134, 134, 1329 134, 134, 134, 134, 134, 134, 134, 134, -70, 98, 1330 77, 71, -70, 63, 77, 6, 70, -70, -70, -70, 1331 209, 77, 6, -70, 6, -70, -70, 102, 63, 251, 1332 251, 251, 251, 251, 251, 230, 251, 116, 116, 62, 1333 62, 62, 187, 86, 99, -70, 6, 30, -70, -70, 1334 134, -70, -70, -70, 63, 80, 134, 98, 98, -70, 1335 77, 209, -70, -70, -70, -70, -70, -70 1336 }; 1337 1338 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE 1339 doesn't specify something else to do. Zero means the default is an 1340 error. */ 1341 const unsigned char 1342 HolidayParserPlan::yydefact_[] = { 1343 4, 0, 0, 12, 6, 5, 1, 2, 0, 8, 1344 14, 0, 7, 0, 10, 15, 17, 9, 0, 3, 1345 16, 18, 0, 11, 79, 59, 26, 81, 0, 26, 1346 26, 0, 0, 13, 26, 0, 57, 46, 78, 0, 1347 0, 34, 0, 82, 34, 34, 80, 0, 0, 0, 1348 60, 29, 0, 41, 26, 0, 43, 27, 28, 0, 1349 22, 26, 46, 19, 20, 75, 0, 47, 48, 49, 1350 0, 0, 57, 58, 0, 0, 0, 0, 0, 0, 1351 0, 0, 0, 0, 0, 0, 0, 0, 77, 31, 1352 34, 39, 42, 0, 34, 59, 36, 57, 58, 44, 1353 35, 34, 0, 76, 0, 54, 53, 0, 0, 63, 1354 64, 65, 66, 67, 68, 61, 62, 70, 69, 71, 1355 72, 73, 0, 32, 0, 21, 0, 26, 23, 45, 1356 37, 25, 55, 52, 0, 50, 0, 31, 31, 40, 1357 34, 38, 56, 51, 74, 33, 30, 24 1358 }; 1359 1360 /* YYPGOTO[NTERM-NUM]. */ 1361 const signed char 1362 HolidayParserPlan::yypgoto_[] = { 1363 -70, -70, -70, -70, -70, -70, -70, -70, -70, -70, 1364 -70, -70, -19, -70, -69, -16, 79, -70, -9, 111, 1365 -23, -22, -70 1366 }; 1367 1368 /* YYDEFGOTO[NTERM-NUM]. */ 1369 const signed char 1370 HolidayParserPlan::yydefgoto_[] = { 1371 -1, 2, 3, 4, 9, 14, 19, 7, 11, 16, 1372 22, 33, 41, 90, 124, 60, 34, 70, 35, 97, 1373 49, 50, 38 1374 }; 1375 1376 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 1377 positive, shift that token. If negative, reduce the rule which 1378 number is the opposite. If zero, do what YYDEFACT says. */ 1379 const signed char HolidayParserPlan::yytable_ninf_ = -59; 1380 const short int 1381 HolidayParserPlan::yytable_[] = { 1382 37, 1, 25, 54, 42, 5, 43, 106, 107, 24, 1383 44, 45, 20, 21, 53, 51, 57, 58, 27, 28, 1384 62, 93, 39, 40, 65, 6, 73, 8, 63, 64, 1385 91, 92, -58, 98, 99, 94, 100, 31, 55, 71, 1386 39, 40, 101, 108, 102, 10, 96, 25, 12, 32, 1387 105, 109, 110, 111, 112, 113, 114, 115, 116, 117, 1388 118, 119, 120, 121, 122, 13, 24, 25, 145, 146, 1389 17, 98, 15, 129, 125, 27, 28, -58, 128, 18, 1390 132, 23, 133, 55, 127, 131, 98, 46, 24, 25, 1391 66, 67, 52, 59, 31, 89, 103, 27, 28, 135, 1392 87, 104, 68, 123, 139, 126, 32, 141, 140, 69, 1393 130, 134, 98, 144, 138, 137, 31, 24, 25, 26, 1394 143, 61, 0, 0, 147, 142, 27, 28, 32, 0, 1395 0, 29, 24, 36, 24, 95, 0, 24, 30, 39, 1396 40, 27, 28, 27, 28, 31, 27, 28, 56, 84, 1397 85, 86, 0, 36, 87, 0, 0, 32, 0, 72, 1398 31, 0, 31, 0, 0, 31, 0, 0, 0, 0, 1399 47, 0, 32, 56, 32, 48, 0, 32, 74, 75, 1400 76, 77, 78, 79, 0, 0, 0, 0, 0, 80, 1401 81, 82, 83, 84, 85, 86, 0, 0, 87, 0, 1402 0, 0, 0, 0, 88, 74, 75, 76, 77, 78, 1403 79, 0, 0, 0, 0, 0, 80, 81, 82, 83, 1404 84, 85, 86, 0, 0, 87, 136, 74, 75, 76, 1405 77, 78, 79, 0, 0, 0, 0, 0, 80, 81, 1406 82, 83, 84, 85, 86, 0, 0, 87, 74, 75, 1407 76, 77, 78, 79, 0, 0, 0, 0, 0, 0, 1408 81, 82, 83, 84, 85, 86, 0, 0, 87, 74, 1409 75, 76, 77, 78, 79, 0, 0, 0, 0, 0, 1410 0, 0, 82, 83, 84, 85, 86, 0, 0, 87 1411 }; 1412 1413 /* YYCHECK. */ 1414 const short int 1415 HolidayParserPlan::yycheck_[] = { 1416 22, 25, 4, 5, 26, 6, 28, 4, 5, 3, 1417 29, 30, 7, 8, 36, 34, 39, 40, 12, 13, 1418 42, 9, 10, 11, 47, 0, 48, 26, 44, 45, 1419 52, 53, 34, 55, 56, 54, 59, 31, 40, 48, 1420 10, 11, 61, 40, 66, 6, 55, 4, 6, 43, 1421 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 1422 83, 84, 85, 86, 87, 27, 3, 4, 137, 138, 1423 6, 93, 7, 95, 90, 12, 13, 34, 94, 28, 1424 102, 6, 104, 40, 93, 101, 108, 3, 3, 4, 1425 5, 6, 34, 16, 31, 14, 42, 12, 13, 108, 1426 38, 34, 17, 5, 126, 34, 43, 130, 127, 24, 1427 40, 9, 134, 136, 15, 29, 31, 3, 4, 5, 1428 40, 42, -1, -1, 140, 134, 12, 13, 43, -1, 1429 -1, 17, 3, 22, 3, 4, -1, 3, 24, 10, 1430 11, 12, 13, 12, 13, 31, 12, 13, 37, 33, 1431 34, 35, -1, 42, 38, -1, -1, 43, -1, 48, 1432 31, -1, 31, -1, -1, 31, -1, -1, -1, -1, 1433 36, -1, 43, 62, 43, 41, -1, 43, 18, 19, 1434 20, 21, 22, 23, -1, -1, -1, -1, -1, 29, 1435 30, 31, 32, 33, 34, 35, -1, -1, 38, -1, 1436 -1, -1, -1, -1, 44, 18, 19, 20, 21, 22, 1437 23, -1, -1, -1, -1, -1, 29, 30, 31, 32, 1438 33, 34, 35, -1, -1, 38, 39, 18, 19, 20, 1439 21, 22, 23, -1, -1, -1, -1, -1, 29, 30, 1440 31, 32, 33, 34, 35, -1, -1, 38, 18, 19, 1441 20, 21, 22, 23, -1, -1, -1, -1, -1, -1, 1442 30, 31, 32, 33, 34, 35, -1, -1, 38, 18, 1443 19, 20, 21, 22, 23, -1, -1, -1, -1, -1, 1444 -1, -1, 31, 32, 33, 34, 35, -1, -1, 38 1445 }; 1446 1447 /* STOS_[STATE-NUM] -- The (internal number of the) accessing 1448 symbol of state STATE-NUM. */ 1449 const unsigned char 1450 HolidayParserPlan::yystos_[] = { 1451 0, 25, 46, 47, 48, 6, 0, 52, 26, 49, 1452 6, 53, 6, 27, 50, 7, 54, 6, 28, 51, 1453 7, 8, 55, 6, 3, 4, 5, 12, 13, 17, 1454 24, 31, 43, 56, 61, 63, 64, 66, 67, 10, 1455 11, 57, 66, 66, 57, 57, 3, 36, 41, 65, 1456 66, 57, 34, 66, 5, 40, 64, 65, 65, 16, 1457 60, 61, 66, 60, 60, 65, 5, 6, 17, 24, 1458 62, 63, 64, 66, 18, 19, 20, 21, 22, 23, 1459 29, 30, 31, 32, 33, 34, 35, 38, 44, 14, 1460 58, 66, 66, 9, 57, 4, 63, 64, 66, 66, 1461 65, 57, 66, 42, 34, 66, 4, 5, 40, 65, 1462 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1463 65, 65, 65, 5, 59, 60, 34, 63, 60, 66, 1464 40, 60, 66, 66, 9, 63, 39, 29, 15, 66, 1465 57, 65, 63, 40, 65, 59, 59, 60 1466 }; 1467 1468 #if YYDEBUG 1469 /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding 1470 to YYLEX-NUM. */ 1471 const unsigned short int 1472 HolidayParserPlan::yytoken_number_[] = { 1473 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 1474 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 1475 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 1476 285, 45, 43, 42, 47, 37, 33, 286, 63, 58, 1477 46, 91, 93, 40, 41 1478 }; 1479 #endif 1480 1481 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 1482 const unsigned char 1483 HolidayParserPlan::yyr1_[] = { 1484 0, 45, 46, 47, 48, 48, 49, 49, 50, 50, 1485 51, 51, 52, 52, 53, 54, 54, 55, 55, 56, 1486 56, 56, 56, 56, 56, 56, 57, 57, 57, 58, 1487 58, 59, 59, 59, 60, 60, 61, 61, 61, 61, 1488 61, 61, 61, 61, 61, 61, 61, 62, 62, 62, 1489 62, 62, 62, 62, 62, 62, 62, 63, 63, 64, 1490 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 1491 65, 65, 65, 65, 65, 65, 65, 66, 66, 67, 1492 67, 67, 67 1493 }; 1494 1495 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 1496 const unsigned char 1497 HolidayParserPlan::yyr2_[] = { 1498 0, 2, 2, 4, 0, 2, 0, 2, 0, 2, 1499 0, 2, 0, 5, 1, 1, 2, 0, 1, 3, 1500 3, 4, 3, 4, 6, 5, 0, 2, 2, 0, 1501 4, 0, 1, 3, 0, 2, 3, 4, 5, 3, 1502 5, 2, 3, 2, 3, 4, 1, 1, 1, 1, 1503 3, 4, 3, 2, 2, 3, 4, 1, 1, 1, 1504 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1505 3, 3, 3, 3, 5, 2, 3, 3, 1, 1, 1506 2, 1, 2 1507 }; 1508 1509 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 1510 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 1511 First, the terminals, then, starting at \a yyntokens_, nonterminals. */ 1512 const char * 1513 const HolidayParserPlan::yytname_[] = { 1514 "END", "error", "$undefined", "NUMBER", "MONTH", "WDAY", "STRING", 1515 "CATEGORY", "CALENDAR", "INOP", "PLUS", "MINUS", "YEAR", "LEAPYEAR", 1516 "SHIFT", "IF", "LENGTH", "EASTER", "EQ", "NE", "LE", "GE", "LT", "GT", 1517 "PASCHA", "COUNTRY", "LANGUAGE", "NAME", "DESCRIPTION", "OR", "AND", 1518 "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "UMINUS", "'?'", "':'", "'.'", 1519 "'['", "']'", "'('", "')'", "$accept", "planfile", "metadata", 1520 "countrycode", "languagecode", "name", "description", "list", 1521 "eventname", "categories", "calendar", "eventrule", "offset", 1522 "conditionaloffset", "wdaycondition", "length", "date", "reldate", 1523 "month", "monthnumber", "expr", "pexpr", "number", nullptr 1524 }; 1525 #endif 1526 1527 #if YYDEBUG 1528 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 1529 const HolidayParserPlan::rhs_number_type 1530 HolidayParserPlan::yyrhs_[] = { 1531 46, 0, -1, 47, 52, -1, 48, 49, 50, 51, 1532 -1, -1, 25, 6, -1, -1, 26, 6, -1, -1, 1533 27, 6, -1, -1, 28, 6, -1, -1, 52, 53, 1534 54, 55, 56, -1, 6, -1, 7, -1, 54, 7, 1535 -1, -1, 8, -1, 17, 57, 60, -1, 24, 57, 1536 60, -1, 61, 57, 58, 60, -1, 5, 57, 60, 1537 -1, 66, 5, 57, 60, -1, 66, 5, 9, 63, 1538 57, 60, -1, 5, 66, 61, 57, 60, -1, -1, 1539 10, 65, -1, 11, 65, -1, -1, 14, 59, 15, 1540 59, -1, -1, 5, -1, 5, 29, 59, -1, -1, 1541 16, 65, -1, 66, 40, 63, -1, 66, 40, 63, 1542 40, -1, 66, 40, 63, 40, 65, -1, 63, 34, 1543 66, -1, 63, 34, 66, 34, 66, -1, 64, 66, 1544 -1, 64, 66, 66, -1, 66, 64, -1, 66, 64, 1545 66, -1, 66, 40, 4, 66, -1, 66, -1, 6, 1546 -1, 17, -1, 24, -1, 66, 40, 63, -1, 66, 1547 40, 63, 40, -1, 63, 34, 66, -1, 66, 4, 1548 -1, 64, 66, -1, 5, 66, 66, -1, 66, 5, 1549 9, 63, -1, 64, -1, 66, -1, 4, -1, 66, 1550 -1, 65, 29, 65, -1, 65, 30, 65, -1, 65, 1551 18, 65, -1, 65, 19, 65, -1, 65, 20, 65, 1552 -1, 65, 21, 65, -1, 65, 22, 65, -1, 65, 1553 23, 65, -1, 65, 32, 65, -1, 65, 31, 65, 1554 -1, 65, 33, 65, -1, 65, 34, 65, -1, 65, 1555 35, 65, -1, 65, 38, 65, 39, 65, -1, 36, 1556 65, -1, 41, 62, 42, -1, 43, 65, 44, -1, 1557 67, -1, 3, -1, 31, 3, -1, 12, -1, 13, 1558 66, -1 1559 }; 1560 1561 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 1562 YYRHS. */ 1563 const unsigned short int 1564 HolidayParserPlan::yyprhs_[] = { 1565 0, 0, 3, 6, 11, 12, 15, 16, 19, 20, 1566 23, 24, 27, 28, 34, 36, 38, 41, 42, 44, 1567 48, 52, 57, 61, 66, 73, 79, 80, 83, 86, 1568 87, 92, 93, 95, 99, 100, 103, 107, 112, 118, 1569 122, 128, 131, 135, 138, 142, 147, 149, 151, 153, 1570 155, 159, 164, 168, 171, 174, 178, 183, 185, 187, 1571 189, 191, 195, 199, 203, 207, 211, 215, 219, 223, 1572 227, 231, 235, 239, 243, 249, 252, 256, 260, 262, 1573 264, 267, 269 1574 }; 1575 1576 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 1577 const unsigned char 1578 HolidayParserPlan::yyrline_[] = { 1579 0, 126, 126, 129, 132, 133, 136, 137, 140, 141, 1580 144, 145, 148, 149, 152, 155, 156, 159, 160, 163, 1581 164, 165, 166, 167, 168, 169, 172, 173, 174, 177, 1582 178, 181, 182, 183, 186, 187, 190, 191, 192, 193, 1583 194, 195, 196, 197, 198, 199, 200, 203, 204, 205, 1584 206, 207, 208, 209, 210, 211, 212, 215, 216, 219, 1585 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 1586 232, 233, 234, 235, 236, 237, 238, 241, 242, 245, 1587 246, 247, 248 1588 }; 1589 1590 // Print the state stack on the debug stream. 1591 void 1592 HolidayParserPlan::yystack_print_() 1593 { 1594 *yycdebug_ << "Stack now"; 1595 for (state_stack_type::const_iterator i = yystate_stack_.begin(); 1596 i != yystate_stack_.end(); ++i) { 1597 *yycdebug_ << ' ' << *i; 1598 } 1599 *yycdebug_ << std::endl; 1600 } 1601 1602 // Report on the debug stream that the rule \a yyrule is going to be reduced. 1603 void 1604 HolidayParserPlan::yy_reduce_print_(int yyrule) 1605 { 1606 unsigned int yylno = yyrline_[yyrule]; 1607 int yynrhs = yyr2_[yyrule]; 1608 /* Print the symbols being reduced, and their result. */ 1609 *yycdebug_ << "Reducing stack by rule " << yyrule - 1 1610 << " (line " << yylno << "):" << std::endl; 1611 /* The symbols being reduced. */ 1612 for (int yyi = 0; yyi < yynrhs; yyi++) 1613 YY_SYMBOL_PRINT(" $" << yyi + 1 << " =", 1614 yyrhs_[yyprhs_[yyrule] + yyi], 1615 &(yysemantic_stack_[(yynrhs) - (yyi + 1)]), 1616 &(yylocation_stack_[(yynrhs) - (yyi + 1)])); 1617 } 1618 #endif // YYDEBUG 1619 1620 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 1621 HolidayParserPlan::token_number_type 1622 HolidayParserPlan::yytranslate_(int t) 1623 { 1624 static 1625 const token_number_type 1626 translate_table[] = { 1627 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1630 2, 2, 2, 36, 2, 2, 2, 35, 2, 2, 1631 43, 44, 33, 32, 2, 31, 40, 34, 2, 2, 1632 2, 2, 2, 2, 2, 2, 2, 2, 39, 2, 1633 2, 2, 2, 38, 2, 2, 2, 2, 2, 2, 1634 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1635 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1636 2, 41, 2, 42, 2, 2, 2, 2, 2, 2, 1637 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1638 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1639 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1640 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1641 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1642 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1643 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1644 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1645 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1652 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 1653 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 1654 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 1655 25, 26, 27, 28, 29, 30, 37 1656 }; 1657 if ((unsigned int) t <= yyuser_token_number_max_) { 1658 return translate_table[t]; 1659 } else { 1660 return yyundef_token_; 1661 } 1662 } 1663 1664 const int HolidayParserPlan::yyeof_ = 0; 1665 const int HolidayParserPlan::yylast_ = 289; 1666 const int HolidayParserPlan::yynnts_ = 23; 1667 const int HolidayParserPlan::yyempty_ = -2; 1668 const int HolidayParserPlan::yyfinal_ = 6; 1669 const int HolidayParserPlan::yyterror_ = 1; 1670 const int HolidayParserPlan::yyerrcode_ = 256; 1671 const int HolidayParserPlan::yyntokens_ = 45; 1672 1673 const unsigned int HolidayParserPlan::yyuser_token_number_max_ = 286; 1674 const HolidayParserPlan::token_number_type HolidayParserPlan::yyundef_token_ = 2; 1675 1676 /* Line 1054 of lalr1.cc */ 1677 #line 1 "[Bison:b4_percent_define_default]" 1678 1679 } // KHolidays 1680 1681 /* Line 1054 of lalr1.cc */ 1682 #line 1573 "holidayparserplan.cpp" 1683 1684 /* Line 1056 of lalr1.cc */ 1685 #line 251 "holidayparserplan.ypp" 1686 1687 /*** Private Yacc callbacks and helper functions ***/ 1688 1689 void KHolidays::HolidayParserPlan::error(const KHolidays::HolidayParserPlan::location_type &errorLocation, const std::string &errorMessage) 1690 { 1691 driver.error(errorLocation, errorMessage.c_str()); 1692 } 1693