36 #define yylex KHolidayslex
41 #line 30 "holidayparserplan.ypp"
47 #include <sys/types.h>
54 #include <KCalendarSystem>
59 #line 60 "holidayparserplan.cpp"
62 #include "holidayparserplan.hpp"
67 #line 111 "holidayparserplan.ypp"
70 #include "holidayparserdriverplan_p.h"
71 #include "holidayscannerplan_p.h"
77 #define yylex driver.m_scanner->lex
82 #line 83 "holidayparserplan.cpp"
88 # define YY_(msgid) dgettext ("bison-runtime", msgid)
92 # define YY_(msgid) msgid
97 #define YYUSE(e) ((void) (e))
103 # define YYCDEBUG if (yydebug_) (*yycdebug_)
105 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
109 *yycdebug_ << Title << ' '; \
110 yy_symbol_print_ ((Type), (Value), (Location)); \
111 *yycdebug_ << std::endl; \
115 # define YY_REDUCE_PRINT(Rule) \
118 yy_reduce_print_ (Rule); \
121 # define YY_STACK_PRINT() \
129 # define YYCDEBUG if (false) std::cerr
130 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
131 # define YY_REDUCE_PRINT(Rule)
132 # define YY_STACK_PRINT()
136 #define yyerrok (yyerrstatus_ = 0)
137 #define yyclearin (yychar = yyempty_)
139 #define YYACCEPT goto yyacceptlab
140 #define YYABORT goto yyabortlab
141 #define YYERROR goto yyerrorlab
142 #define YYRECOVERING() (!!yyerrstatus_)
146 #line 1 "[Bison:b4_percent_define_default]"
148 namespace KHolidays {
151 #line 152 "holidayparserplan.cpp"
160 HolidayParserPlan::yytnamerr_ (
const char *yystr)
164 std::string yyr =
"";
165 char const *yyp = yystr;
172 goto do_not_strip_quotes;
176 goto do_not_strip_quotes;
185 do_not_strip_quotes: ;
198 yycdebug_ (&std::cerr),
200 driver (driver_yyarg)
204 HolidayParserPlan::~HolidayParserPlan ()
214 HolidayParserPlan::yy_symbol_value_print_ (
int yytype,
215 const semantic_type* yyvaluep,
const location_type* yylocationp)
228 HolidayParserPlan::yy_symbol_print_ (
int yytype,
229 const semantic_type* yyvaluep,
const location_type* yylocationp)
231 *yycdebug_ << (yytype < yyntokens_ ?
"token" :
"nterm")
232 <<
' ' << yytname_[yytype] <<
" ("
233 << *yylocationp <<
": ";
234 yy_symbol_value_print_ (yytype, yyvaluep, yylocationp);
240 HolidayParserPlan::yydestruct_ (
const char* yymsg,
241 int yytype, semantic_type* yyvaluep, location_type* yylocationp)
247 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
254 #line 96 "holidayparserplan.ypp"
255 { free( (yyvaluep->sval) ); };
258 #line 259 "holidayparserplan.cpp"
267 HolidayParserPlan::yypop_ (
unsigned int n)
269 yystate_stack_.pop (n);
270 yysemantic_stack_.pop (n);
271 yylocation_stack_.pop (n);
305 int yychar = yyempty_;
315 int yyerrstatus_ = 0;
331 YYCDEBUG <<
"Starting parse" << std::endl;
337 #line 70 "holidayparserplan.ypp"
345 #line 346 "holidayparserplan.cpp"
351 yystate_stack_ = state_stack_type (0);
352 yysemantic_stack_ = semantic_stack_type (0);
353 yylocation_stack_ = location_stack_type (0);
354 yysemantic_stack_.push (yylval);
355 yylocation_stack_.push (yylloc);
359 yystate_stack_.push (yystate);
360 YYCDEBUG <<
"Entering state " << yystate << std::endl;
363 if (yystate == yyfinal_)
372 yyn = yypact_[yystate];
373 if (yyn == yypact_ninf_)
377 if (yychar == yyempty_)
379 YYCDEBUG <<
"Reading a token: ";
380 yychar = yylex (&yylval, &yylloc);
385 if (yychar <= yyeof_)
387 yychar = yytoken = yyeof_;
388 YYCDEBUG <<
"Now at end of input." << std::endl;
392 yytoken = yytranslate_ (yychar);
393 YY_SYMBOL_PRINT (
"Next token is", yytoken, &yylval, &yylloc);
399 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken)
406 if (yyn == 0 || yyn == yytable_ninf_)
413 YY_SYMBOL_PRINT (
"Shifting", yytoken, &yylval, &yylloc);
418 yysemantic_stack_.push (yylval);
419 yylocation_stack_.push (yylloc);
433 yyn = yydefact_[yystate];
450 yyval = yysemantic_stack_[yylen - 1];
452 yyval = yysemantic_stack_[0];
456 YYLLOC_DEFAULT (yyloc, slice, yylen);
458 YY_REDUCE_PRINT (yyn);
464 #line 132 "holidayparserplan.ypp"
465 { driver.setFileCountryCode(
QString() ); }
471 #line 133 "holidayparserplan.ypp"
472 {
char *s = (yysemantic_stack_[(2) - (2)].sval); driver.setFileCountryCode(
QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(2) - (2)].sval) = NULL; }
478 #line 136 "holidayparserplan.ypp"
479 { driver.setFileLanguageCode(
QString() ); }
485 #line 137 "holidayparserplan.ypp"
486 {
char *s = (yysemantic_stack_[(2) - (2)].sval); driver.setFileLanguageCode(
QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(2) - (2)].sval) = NULL; }
492 #line 140 "holidayparserplan.ypp"
493 { driver.setFileName(
QString() ); }
499 #line 141 "holidayparserplan.ypp"
500 {
char *s = (yysemantic_stack_[(2) - (2)].sval); driver.setFileName(
QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(2) - (2)].sval) = NULL; }
506 #line 144 "holidayparserplan.ypp"
507 { driver.setFileDescription(
QString() ); }
513 #line 145 "holidayparserplan.ypp"
514 {
char *s = (yysemantic_stack_[(2) - (2)].sval); driver.setFileDescription(
QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(2) - (2)].sval) = NULL; }
520 #line 152 "holidayparserplan.ypp"
521 {
char *s = (yysemantic_stack_[(1) - (1)].sval); driver.setEventName(
QString::fromUtf8( s ) ); free( s ); (yysemantic_stack_[(1) - (1)].sval) = NULL; }
527 #line 155 "holidayparserplan.ypp"
528 { driver.setEventCategory( (yysemantic_stack_[(1) - (1)].sval) ); }
534 #line 156 "holidayparserplan.ypp"
535 { driver.setEventCategory( (yysemantic_stack_[(2) - (1)].sval) ); }
541 #line 159 "holidayparserplan.ypp"
542 { driver.setEventCalendarType(
QLatin1String(
"gregorian") ); }
548 #line 160 "holidayparserplan.ypp"
549 { driver.setEventCalendarType(
QString::fromUtf8( (yysemantic_stack_[(1) - (1)].sval) ) ); }
555 #line 163 "holidayparserplan.ypp"
556 { driver.setFromEaster( (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
562 #line 164 "holidayparserplan.ypp"
563 { driver.setFromPascha( (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
569 #line 165 "holidayparserplan.ypp"
570 { driver.setFromDate( (yysemantic_stack_[(4) - (2)].ival), (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (4)].ival) ); }
576 #line 166 "holidayparserplan.ypp"
577 { driver.setFromWeekdayInMonth( 1, (yysemantic_stack_[(3) - (1)].ival), 1, (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
583 #line 167 "holidayparserplan.ypp"
584 { driver.setFromWeekdayInMonth( (yysemantic_stack_[(4) - (1)].ival), (yysemantic_stack_[(4) - (2)].ival), 1, (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (4)].ival) ); }
590 #line 168 "holidayparserplan.ypp"
591 { driver.setFromWeekdayInMonth( (yysemantic_stack_[(6) - (1)].ival), (yysemantic_stack_[(6) - (2)].ival), (yysemantic_stack_[(6) - (4)].ival), (yysemantic_stack_[(6) - (5)].ival), (yysemantic_stack_[(6) - (6)].ival) ); }
597 #line 169 "holidayparserplan.ypp"
598 { driver.setFromRelativeWeekday( (yysemantic_stack_[(5) - (2)].ival), (yysemantic_stack_[(5) - (1)].ival), (yysemantic_stack_[(5) - (4)].ival), (yysemantic_stack_[(5) - (5)].ival) ); }
604 #line 172 "holidayparserplan.ypp"
605 { (yyval.ival) = 0; }
611 #line 173 "holidayparserplan.ypp"
612 { (yyval.ival) = (yysemantic_stack_[(2) - (2)].ival); }
618 #line 174 "holidayparserplan.ypp"
619 { (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); }
625 #line 177 "holidayparserplan.ypp"
626 { (yyval.ival) = 0; }
632 #line 178 "holidayparserplan.ypp"
633 { (yyval.ival) = ( (yysemantic_stack_[(4) - (2)].ival) << 8 ) | (yysemantic_stack_[(4) - (4)].ival); }
639 #line 181 "holidayparserplan.ypp"
640 { (yyval.ival) = 0; }
646 #line 182 "holidayparserplan.ypp"
647 { (yyval.ival) = ( 1 << (yysemantic_stack_[(1) - (1)].ival) ); }
653 #line 183 "holidayparserplan.ypp"
654 { (yyval.ival) = ( 1 << (yysemantic_stack_[(3) - (1)].ival) ) | (yysemantic_stack_[(3) - (3)].ival); }
660 #line 186 "holidayparserplan.ypp"
661 { (yyval.ival) = 1; }
667 #line 187 "holidayparserplan.ypp"
668 { (yyval.ival) = (yysemantic_stack_[(2) - (2)].ival); }
674 #line 190 "holidayparserplan.ypp"
675 { driver.setEventDate( -99999, (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival) ); }
681 #line 191 "holidayparserplan.ypp"
682 { driver.setEventDate( -99999, (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival) ); }
688 #line 192 "holidayparserplan.ypp"
689 { driver.setEventDate( (yysemantic_stack_[(5) - (5)].ival), (yysemantic_stack_[(5) - (3)].ival), (yysemantic_stack_[(5) - (1)].ival) ); }
695 #line 193 "holidayparserplan.ypp"
696 { driver.setEventDate( -99999, (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
702 #line 194 "holidayparserplan.ypp"
703 { driver.setEventDate( (yysemantic_stack_[(5) - (5)].ival), (yysemantic_stack_[(5) - (1)].ival), (yysemantic_stack_[(5) - (3)].ival) ); }
709 #line 195 "holidayparserplan.ypp"
710 { driver.setEventDate( -99999, (yysemantic_stack_[(2) - (1)].ival), (yysemantic_stack_[(2) - (2)].ival) ); }
716 #line 196 "holidayparserplan.ypp"
717 { driver.setEventDate( (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (2)].ival) ); }
723 #line 197 "holidayparserplan.ypp"
724 { driver.setEventDate( -99999, (yysemantic_stack_[(2) - (2)].ival), (yysemantic_stack_[(2) - (1)].ival) ); }
730 #line 198 "holidayparserplan.ypp"
731 { driver.setEventDate( (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (1)].ival) ); }
737 #line 199 "holidayparserplan.ypp"
738 { driver.setEventDate( (yysemantic_stack_[(4) - (4)].ival), (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival) ); }
744 #line 200 "holidayparserplan.ypp"
745 { driver.setEventDate( (yysemantic_stack_[(1) - (1)].ival) ); }
751 #line 203 "holidayparserplan.ypp"
752 {
char *s = (yysemantic_stack_[(1) - (1)].sval); (yyval.ival) = driver.julianDayFromEventName( s ); free( s ); (yysemantic_stack_[(1) - (1)].sval) = NULL; }
758 #line 204 "holidayparserplan.ypp"
759 { (yyval.ival) = driver.julianDayFromEaster(); }
765 #line 205 "holidayparserplan.ypp"
766 { (yyval.ival) = driver.julianDayFromPascha(); }
772 #line 206 "holidayparserplan.ypp"
773 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival) ); }
779 #line 207 "holidayparserplan.ypp"
780 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival) ); }
786 #line 208 "holidayparserplan.ypp"
787 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
793 #line 209 "holidayparserplan.ypp"
794 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(2) - (2)].ival), (yysemantic_stack_[(2) - (1)].ival) ); }
800 #line 210 "holidayparserplan.ypp"
801 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(2) - (1)].ival), (yysemantic_stack_[(2) - (2)].ival) ); }
807 #line 211 "holidayparserplan.ypp"
808 { (yyval.ival) = driver.julianDayFromRelativeWeekday( (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival) ); }
814 #line 212 "holidayparserplan.ypp"
815 { (yyval.ival) = driver.julianDayFromWeekdayInMonth( (yysemantic_stack_[(4) - (1)].ival), (yysemantic_stack_[(4) - (2)].ival), (yysemantic_stack_[(4) - (4)].ival) ); }
821 #line 216 "holidayparserplan.ypp"
822 { (yyval.ival) = driver.adjustedMonthNumber( (yysemantic_stack_[(1) - (1)].ival) ); }
828 #line 219 "holidayparserplan.ypp"
829 { (yyval.ival) = driver.adjustedMonthNumber( (yysemantic_stack_[(1) - (1)].ival) ); }
835 #line 222 "holidayparserplan.ypp"
836 { (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); }
842 #line 223 "holidayparserplan.ypp"
843 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) || (yysemantic_stack_[(3) - (3)].ival); }
849 #line 224 "holidayparserplan.ypp"
850 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) && (yysemantic_stack_[(3) - (3)].ival); }
856 #line 225 "holidayparserplan.ypp"
857 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) == (yysemantic_stack_[(3) - (3)].ival); }
863 #line 226 "holidayparserplan.ypp"
864 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) != (yysemantic_stack_[(3) - (3)].ival); }
870 #line 227 "holidayparserplan.ypp"
871 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) <= (yysemantic_stack_[(3) - (3)].ival); }
877 #line 228 "holidayparserplan.ypp"
878 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) >= (yysemantic_stack_[(3) - (3)].ival); }
884 #line 229 "holidayparserplan.ypp"
885 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) < (yysemantic_stack_[(3) - (3)].ival); }
891 #line 230 "holidayparserplan.ypp"
892 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) > (yysemantic_stack_[(3) - (3)].ival); }
898 #line 231 "holidayparserplan.ypp"
899 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) + (yysemantic_stack_[(3) - (3)].ival); }
905 #line 232 "holidayparserplan.ypp"
906 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) - (yysemantic_stack_[(3) - (3)].ival); }
912 #line 233 "holidayparserplan.ypp"
913 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) * (yysemantic_stack_[(3) - (3)].ival); }
919 #line 234 "holidayparserplan.ypp"
920 { (yyval.ival) = (yysemantic_stack_[(3) - (3)].ival) ? (yysemantic_stack_[(3) - (1)].ival) / (yysemantic_stack_[(3) - (3)].ival) : 0; }
926 #line 235 "holidayparserplan.ypp"
927 { (yyval.ival) = (yysemantic_stack_[(3) - (3)].ival) ? (yysemantic_stack_[(3) - (1)].ival) % (yysemantic_stack_[(3) - (3)].ival) : 0; }
933 #line 236 "holidayparserplan.ypp"
934 { (yyval.ival) = (yysemantic_stack_[(5) - (1)].ival) ? (yysemantic_stack_[(5) - (3)].ival) : (yysemantic_stack_[(5) - (5)].ival); }
940 #line 237 "holidayparserplan.ypp"
941 { (yyval.ival) = !(yysemantic_stack_[(2) - (2)].ival); }
947 #line 238 "holidayparserplan.ypp"
948 { (yyval.ival) = (yysemantic_stack_[(3) - (2)].ival); }
954 #line 241 "holidayparserplan.ypp"
955 { (yyval.ival) = (yysemantic_stack_[(3) - (2)].ival); }
961 #line 242 "holidayparserplan.ypp"
962 { (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); }
968 #line 246 "holidayparserplan.ypp"
969 { (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); }
975 #line 247 "holidayparserplan.ypp"
976 { (yyval.ival) = driver.parseYear(); }
982 #line 248 "holidayparserplan.ypp"
983 { (yyval.ival) = driver.isLeapYear( (yysemantic_stack_[(2) - (2)].ival) ); }
989 #line 990 "holidayparserplan.cpp"
993 YY_SYMBOL_PRINT (
"-> $$ =", yyr1_[yyn], &yyval, &yyloc);
999 yysemantic_stack_.push (yyval);
1000 yylocation_stack_.push (yyloc);
1004 yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0];
1005 if (0 <= yystate && yystate <= yylast_
1006 && yycheck_[yystate] == yystate_stack_[0])
1007 yystate = yytable_[yystate];
1009 yystate = yydefgoto_[yyn - yyntokens_];
1020 error (yylloc, yysyntax_error_ (yystate, yytoken));
1023 yyerror_range[0] = yylloc;
1024 if (yyerrstatus_ == 3)
1029 if (yychar <= yyeof_)
1032 if (yychar == yyeof_)
1037 yydestruct_ (
"Error: discarding", yytoken, &yylval, &yylloc);
1058 yyerror_range[0] = yylocation_stack_[yylen - 1];
1063 yystate = yystate_stack_[0];
1074 yyn = yypact_[yystate];
1075 if (yyn != yypact_ninf_)
1078 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_)
1080 yyn = yytable_[yyn];
1087 if (yystate_stack_.height () == 1)
1090 yyerror_range[0] = yylocation_stack_[0];
1091 yydestruct_ (
"Error: popping",
1093 &yysemantic_stack_[0], &yylocation_stack_[0]);
1095 yystate = yystate_stack_[0];
1099 yyerror_range[1] = yylloc;
1102 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
1103 yysemantic_stack_.push (yylval);
1104 yylocation_stack_.push (yyloc);
1107 YY_SYMBOL_PRINT (
"Shifting", yystos_[yyn],
1108 &yysemantic_stack_[0], &yylocation_stack_[0]);
1124 if (yychar != yyempty_)
1125 yydestruct_ (
"Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
1130 while (yystate_stack_.height () != 1)
1132 yydestruct_ (
"Cleanup: popping",
1133 yystos_[yystate_stack_[0]],
1134 &yysemantic_stack_[0],
1135 &yylocation_stack_[0]);
1144 HolidayParserPlan::yysyntax_error_ (
int yystate,
int tok)
1149 int yyn = yypact_[yystate];
1150 if (yypact_ninf_ < yyn && yyn <= yylast_)
1154 int yyxbegin = yyn < 0 ? -yyn : 0;
1157 int yychecklim = yylast_ - yyn + 1;
1158 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
1160 for (
int x = yyxbegin; x < yyxend; ++x)
1161 if (yycheck_[x + yyn] == x && x != yyterror_)
1172 res =
"syntax error, unexpected ";
1173 res += yytnamerr_ (yytname_[tok]);
1177 for (
int x = yyxbegin; x < yyxend; ++x)
1178 if (yycheck_[x + yyn] == x && x != yyterror_)
1180 res += (!count++) ?
", expecting " :
" or ";
1181 res += yytnamerr_ (yytname_[x]);
1187 res = YY_(
"syntax error");
1194 const signed char HolidayParserPlan::yypact_ninf_ = -70;
1196 HolidayParserPlan::yypact_[] =
1198 -24, -1, 25, -70, 1, -70, -70, 39, 42, 38,
1199 -70, 65, -70, 64, 51, -70, 5, -70, 75, -70,
1200 -70, -70, 114, -70, -70, -70, 129, -70, 6, 30,
1201 30, 84, 134, -70, 30, 58, 6, -2, -70, 134,
1202 134, 77, 63, -70, 77, 77, -70, 134, 85, 160,
1203 -70, 81, 6, 6, 12, 131, 6, 209, 209, 134,
1204 -70, 30, 43, -70, -70, 62, 6, -70, -70, -70,
1205 54, 67, 6, 3, 134, 134, 134, 134, 134, 134,
1206 134, 134, 134, 134, 134, 134, 134, 134, -70, 98,
1207 77, 71, -70, 63, 77, 6, 70, -70, -70, -70,
1208 209, 77, 6, -70, 6, -70, -70, 102, 63, 251,
1209 251, 251, 251, 251, 251, 230, 251, 116, 116, 62,
1210 62, 62, 187, 86, 99, -70, 6, 30, -70, -70,
1211 134, -70, -70, -70, 63, 80, 134, 98, 98, -70,
1212 77, 209, -70, -70, -70, -70, -70, -70
1219 HolidayParserPlan::yydefact_[] =
1221 4, 0, 0, 12, 6, 5, 1, 2, 0, 8,
1222 14, 0, 7, 0, 10, 15, 17, 9, 0, 3,
1223 16, 18, 0, 11, 79, 59, 26, 81, 0, 26,
1224 26, 0, 0, 13, 26, 0, 57, 46, 78, 0,
1225 0, 34, 0, 82, 34, 34, 80, 0, 0, 0,
1226 60, 29, 0, 41, 26, 0, 43, 27, 28, 0,
1227 22, 26, 46, 19, 20, 75, 0, 47, 48, 49,
1228 0, 0, 57, 58, 0, 0, 0, 0, 0, 0,
1229 0, 0, 0, 0, 0, 0, 0, 0, 77, 31,
1230 34, 39, 42, 0, 34, 59, 36, 57, 58, 44,
1231 35, 34, 0, 76, 0, 54, 53, 0, 0, 63,
1232 64, 65, 66, 67, 68, 61, 62, 70, 69, 71,
1233 72, 73, 0, 32, 0, 21, 0, 26, 23, 45,
1234 37, 25, 55, 52, 0, 50, 0, 31, 31, 40,
1235 34, 38, 56, 51, 74, 33, 30, 24
1240 HolidayParserPlan::yypgoto_[] =
1242 -70, -70, -70, -70, -70, -70, -70, -70, -70, -70,
1243 -70, -70, -19, -70, -69, -16, 79, -70, -9, 111,
1249 HolidayParserPlan::yydefgoto_[] =
1251 -1, 2, 3, 4, 9, 14, 19, 7, 11, 16,
1252 22, 33, 41, 90, 124, 60, 34, 70, 35, 97,
1259 const signed char HolidayParserPlan::yytable_ninf_ = -59;
1261 HolidayParserPlan::yytable_[] =
1263 37, 1, 25, 54, 42, 5, 43, 106, 107, 24,
1264 44, 45, 20, 21, 53, 51, 57, 58, 27, 28,
1265 62, 93, 39, 40, 65, 6, 73, 8, 63, 64,
1266 91, 92, -58, 98, 99, 94, 100, 31, 55, 71,
1267 39, 40, 101, 108, 102, 10, 96, 25, 12, 32,
1268 105, 109, 110, 111, 112, 113, 114, 115, 116, 117,
1269 118, 119, 120, 121, 122, 13, 24, 25, 145, 146,
1270 17, 98, 15, 129, 125, 27, 28, -58, 128, 18,
1271 132, 23, 133, 55, 127, 131, 98, 46, 24, 25,
1272 66, 67, 52, 59, 31, 89, 103, 27, 28, 135,
1273 87, 104, 68, 123, 139, 126, 32, 141, 140, 69,
1274 130, 134, 98, 144, 138, 137, 31, 24, 25, 26,
1275 143, 61, 0, 0, 147, 142, 27, 28, 32, 0,
1276 0, 29, 24, 36, 24, 95, 0, 24, 30, 39,
1277 40, 27, 28, 27, 28, 31, 27, 28, 56, 84,
1278 85, 86, 0, 36, 87, 0, 0, 32, 0, 72,
1279 31, 0, 31, 0, 0, 31, 0, 0, 0, 0,
1280 47, 0, 32, 56, 32, 48, 0, 32, 74, 75,
1281 76, 77, 78, 79, 0, 0, 0, 0, 0, 80,
1282 81, 82, 83, 84, 85, 86, 0, 0, 87, 0,
1283 0, 0, 0, 0, 88, 74, 75, 76, 77, 78,
1284 79, 0, 0, 0, 0, 0, 80, 81, 82, 83,
1285 84, 85, 86, 0, 0, 87, 136, 74, 75, 76,
1286 77, 78, 79, 0, 0, 0, 0, 0, 80, 81,
1287 82, 83, 84, 85, 86, 0, 0, 87, 74, 75,
1288 76, 77, 78, 79, 0, 0, 0, 0, 0, 0,
1289 81, 82, 83, 84, 85, 86, 0, 0, 87, 74,
1290 75, 76, 77, 78, 79, 0, 0, 0, 0, 0,
1291 0, 0, 82, 83, 84, 85, 86, 0, 0, 87
1296 HolidayParserPlan::yycheck_[] =
1298 22, 25, 4, 5, 26, 6, 28, 4, 5, 3,
1299 29, 30, 7, 8, 36, 34, 39, 40, 12, 13,
1300 42, 9, 10, 11, 47, 0, 48, 26, 44, 45,
1301 52, 53, 34, 55, 56, 54, 59, 31, 40, 48,
1302 10, 11, 61, 40, 66, 6, 55, 4, 6, 43,
1303 72, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1304 83, 84, 85, 86, 87, 27, 3, 4, 137, 138,
1305 6, 93, 7, 95, 90, 12, 13, 34, 94, 28,
1306 102, 6, 104, 40, 93, 101, 108, 3, 3, 4,
1307 5, 6, 34, 16, 31, 14, 42, 12, 13, 108,
1308 38, 34, 17, 5, 126, 34, 43, 130, 127, 24,
1309 40, 9, 134, 136, 15, 29, 31, 3, 4, 5,
1310 40, 42, -1, -1, 140, 134, 12, 13, 43, -1,
1311 -1, 17, 3, 22, 3, 4, -1, 3, 24, 10,
1312 11, 12, 13, 12, 13, 31, 12, 13, 37, 33,
1313 34, 35, -1, 42, 38, -1, -1, 43, -1, 48,
1314 31, -1, 31, -1, -1, 31, -1, -1, -1, -1,
1315 36, -1, 43, 62, 43, 41, -1, 43, 18, 19,
1316 20, 21, 22, 23, -1, -1, -1, -1, -1, 29,
1317 30, 31, 32, 33, 34, 35, -1, -1, 38, -1,
1318 -1, -1, -1, -1, 44, 18, 19, 20, 21, 22,
1319 23, -1, -1, -1, -1, -1, 29, 30, 31, 32,
1320 33, 34, 35, -1, -1, 38, 39, 18, 19, 20,
1321 21, 22, 23, -1, -1, -1, -1, -1, 29, 30,
1322 31, 32, 33, 34, 35, -1, -1, 38, 18, 19,
1323 20, 21, 22, 23, -1, -1, -1, -1, -1, -1,
1324 30, 31, 32, 33, 34, 35, -1, -1, 38, 18,
1325 19, 20, 21, 22, 23, -1, -1, -1, -1, -1,
1326 -1, -1, 31, 32, 33, 34, 35, -1, -1, 38
1332 HolidayParserPlan::yystos_[] =
1334 0, 25, 46, 47, 48, 6, 0, 52, 26, 49,
1335 6, 53, 6, 27, 50, 7, 54, 6, 28, 51,
1336 7, 8, 55, 6, 3, 4, 5, 12, 13, 17,
1337 24, 31, 43, 56, 61, 63, 64, 66, 67, 10,
1338 11, 57, 66, 66, 57, 57, 3, 36, 41, 65,
1339 66, 57, 34, 66, 5, 40, 64, 65, 65, 16,
1340 60, 61, 66, 60, 60, 65, 5, 6, 17, 24,
1341 62, 63, 64, 66, 18, 19, 20, 21, 22, 23,
1342 29, 30, 31, 32, 33, 34, 35, 38, 44, 14,
1343 58, 66, 66, 9, 57, 4, 63, 64, 66, 66,
1344 65, 57, 66, 42, 34, 66, 4, 5, 40, 65,
1345 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
1346 65, 65, 65, 5, 59, 60, 34, 63, 60, 66,
1347 40, 60, 66, 66, 9, 63, 39, 29, 15, 66,
1348 57, 65, 63, 40, 65, 59, 59, 60
1354 const unsigned short int
1355 HolidayParserPlan::yytoken_number_[] =
1357 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
1358 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
1359 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
1360 285, 45, 43, 42, 47, 37, 33, 286, 63, 58,
1367 HolidayParserPlan::yyr1_[] =
1369 0, 45, 46, 47, 48, 48, 49, 49, 50, 50,
1370 51, 51, 52, 52, 53, 54, 54, 55, 55, 56,
1371 56, 56, 56, 56, 56, 56, 57, 57, 57, 58,
1372 58, 59, 59, 59, 60, 60, 61, 61, 61, 61,
1373 61, 61, 61, 61, 61, 61, 61, 62, 62, 62,
1374 62, 62, 62, 62, 62, 62, 62, 63, 63, 64,
1375 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
1376 65, 65, 65, 65, 65, 65, 65, 66, 66, 67,
1382 HolidayParserPlan::yyr2_[] =
1384 0, 2, 2, 4, 0, 2, 0, 2, 0, 2,
1385 0, 2, 0, 5, 1, 1, 2, 0, 1, 3,
1386 3, 4, 3, 4, 6, 5, 0, 2, 2, 0,
1387 4, 0, 1, 3, 0, 2, 3, 4, 5, 3,
1388 5, 2, 3, 2, 3, 4, 1, 1, 1, 1,
1389 3, 4, 3, 2, 2, 3, 4, 1, 1, 1,
1390 1, 3, 3, 3, 3, 3, 3, 3, 3, 3,
1391 3, 3, 3, 3, 5, 2, 3, 3, 1, 1,
1395 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
1399 const HolidayParserPlan::yytname_[] =
1401 "END",
"error",
"$undefined",
"NUMBER",
"MONTH",
"WDAY",
"STRING",
1402 "CATEGORY",
"CALENDAR",
"INOP",
"PLUS",
"MINUS",
"YEAR",
"LEAPYEAR",
1403 "SHIFT",
"IF",
"LENGTH",
"EASTER",
"EQ",
"NE",
"LE",
"GE",
"LT",
"GT",
1404 "PASCHA",
"COUNTRY",
"LANGUAGE",
"NAME",
"DESCRIPTION",
"OR",
"AND",
1405 "'-'",
"'+'",
"'*'",
"'/'",
"'%'",
"'!'",
"UMINUS",
"'?'",
"':'",
"'.'",
1406 "'['",
"']'",
"'('",
"')'",
"$accept",
"planfile",
"metadata",
1407 "countrycode",
"languagecode",
"name",
"description",
"list",
1408 "eventname",
"categories",
"calendar",
"eventrule",
"offset",
1409 "conditionaloffset",
"wdaycondition",
"length",
"date",
"reldate",
1410 "month",
"monthnumber",
"expr",
"pexpr",
"number", 0
1416 const HolidayParserPlan::rhs_number_type
1417 HolidayParserPlan::yyrhs_[] =
1419 46, 0, -1, 47, 52, -1, 48, 49, 50, 51,
1420 -1, -1, 25, 6, -1, -1, 26, 6, -1, -1,
1421 27, 6, -1, -1, 28, 6, -1, -1, 52, 53,
1422 54, 55, 56, -1, 6, -1, 7, -1, 54, 7,
1423 -1, -1, 8, -1, 17, 57, 60, -1, 24, 57,
1424 60, -1, 61, 57, 58, 60, -1, 5, 57, 60,
1425 -1, 66, 5, 57, 60, -1, 66, 5, 9, 63,
1426 57, 60, -1, 5, 66, 61, 57, 60, -1, -1,
1427 10, 65, -1, 11, 65, -1, -1, 14, 59, 15,
1428 59, -1, -1, 5, -1, 5, 29, 59, -1, -1,
1429 16, 65, -1, 66, 40, 63, -1, 66, 40, 63,
1430 40, -1, 66, 40, 63, 40, 65, -1, 63, 34,
1431 66, -1, 63, 34, 66, 34, 66, -1, 64, 66,
1432 -1, 64, 66, 66, -1, 66, 64, -1, 66, 64,
1433 66, -1, 66, 40, 4, 66, -1, 66, -1, 6,
1434 -1, 17, -1, 24, -1, 66, 40, 63, -1, 66,
1435 40, 63, 40, -1, 63, 34, 66, -1, 66, 4,
1436 -1, 64, 66, -1, 5, 66, 66, -1, 66, 5,
1437 9, 63, -1, 64, -1, 66, -1, 4, -1, 66,
1438 -1, 65, 29, 65, -1, 65, 30, 65, -1, 65,
1439 18, 65, -1, 65, 19, 65, -1, 65, 20, 65,
1440 -1, 65, 21, 65, -1, 65, 22, 65, -1, 65,
1441 23, 65, -1, 65, 32, 65, -1, 65, 31, 65,
1442 -1, 65, 33, 65, -1, 65, 34, 65, -1, 65,
1443 35, 65, -1, 65, 38, 65, 39, 65, -1, 36,
1444 65, -1, 41, 62, 42, -1, 43, 65, 44, -1,
1445 67, -1, 3, -1, 31, 3, -1, 12, -1, 13,
1451 const unsigned short int
1452 HolidayParserPlan::yyprhs_[] =
1454 0, 0, 3, 6, 11, 12, 15, 16, 19, 20,
1455 23, 24, 27, 28, 34, 36, 38, 41, 42, 44,
1456 48, 52, 57, 61, 66, 73, 79, 80, 83, 86,
1457 87, 92, 93, 95, 99, 100, 103, 107, 112, 118,
1458 122, 128, 131, 135, 138, 142, 147, 149, 151, 153,
1459 155, 159, 164, 168, 171, 174, 178, 183, 185, 187,
1460 189, 191, 195, 199, 203, 207, 211, 215, 219, 223,
1461 227, 231, 235, 239, 243, 249, 252, 256, 260, 262,
1467 HolidayParserPlan::yyrline_[] =
1469 0, 126, 126, 129, 132, 133, 136, 137, 140, 141,
1470 144, 145, 148, 149, 152, 155, 156, 159, 160, 163,
1471 164, 165, 166, 167, 168, 169, 172, 173, 174, 177,
1472 178, 181, 182, 183, 186, 187, 190, 191, 192, 193,
1473 194, 195, 196, 197, 198, 199, 200, 203, 204, 205,
1474 206, 207, 208, 209, 210, 211, 212, 215, 216, 219,
1475 222, 223, 224, 225, 226, 227, 228, 229, 230, 231,
1476 232, 233, 234, 235, 236, 237, 238, 241, 242, 245,
1482 HolidayParserPlan::yystack_print_ ()
1484 *yycdebug_ <<
"Stack now";
1485 for (state_stack_type::const_iterator i = yystate_stack_.begin ();
1486 i != yystate_stack_.end (); ++i)
1487 *yycdebug_ <<
' ' << *i;
1488 *yycdebug_ << std::endl;
1493 HolidayParserPlan::yy_reduce_print_ (
int yyrule)
1495 unsigned int yylno = yyrline_[yyrule];
1496 int yynrhs = yyr2_[yyrule];
1498 *yycdebug_ <<
"Reducing stack by rule " << yyrule - 1
1499 <<
" (line " << yylno <<
"):" << std::endl;
1501 for (
int yyi = 0; yyi < yynrhs; yyi++)
1502 YY_SYMBOL_PRINT (
" $" << yyi + 1 <<
" =",
1503 yyrhs_[yyprhs_[yyrule] + yyi],
1504 &(yysemantic_stack_[(yynrhs) - (yyi + 1)]),
1505 &(yylocation_stack_[(yynrhs) - (yyi + 1)]));
1510 HolidayParserPlan::token_number_type
1511 HolidayParserPlan::yytranslate_ (
int t)
1514 const token_number_type
1517 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1520 2, 2, 2, 36, 2, 2, 2, 35, 2, 2,
1521 43, 44, 33, 32, 2, 31, 40, 34, 2, 2,
1522 2, 2, 2, 2, 2, 2, 2, 2, 39, 2,
1523 2, 2, 2, 38, 2, 2, 2, 2, 2, 2,
1524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1526 2, 41, 2, 42, 2, 2, 2, 2, 2, 2,
1527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1528 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1529 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1530 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1531 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1532 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1533 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1534 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1535 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1536 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1537 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1538 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1539 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1540 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1541 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
1542 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
1543 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1544 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1545 25, 26, 27, 28, 29, 30, 37
1547 if ((
unsigned int) t <= yyuser_token_number_max_)
1548 return translate_table[t];
1550 return yyundef_token_;
1553 const int HolidayParserPlan::yyeof_ = 0;
1554 const int HolidayParserPlan::yylast_ = 289;
1555 const int HolidayParserPlan::yynnts_ = 23;
1556 const int HolidayParserPlan::yyempty_ = -2;
1557 const int HolidayParserPlan::yyfinal_ = 6;
1558 const int HolidayParserPlan::yyterror_ = 1;
1559 const int HolidayParserPlan::yyerrcode_ = 256;
1560 const int HolidayParserPlan::yyntokens_ = 45;
1562 const unsigned int HolidayParserPlan::yyuser_token_number_max_ = 286;
1563 const HolidayParserPlan::token_number_type HolidayParserPlan::yyundef_token_ = 2;
1567 #line 1 "[Bison:b4_percent_define_default]"
1572 #line 1573 "holidayparserplan.cpp"
1576 #line 251 "holidayparserplan.ypp"
1583 driver.
error( errorLocation, errorMessage.c_str() );
void set_debug_stream(std::ostream &)
Set the current debugging stream.
Present a slice of the top of a stack.
position end
End of the located region.
void error(const KHolidays::location &errorLocation, const QString &errorMessage)
Bison C++ skeleton error message handling.
int debug_level_type
Type for debugging levels.
void set_debug_level(debug_level_type l)
Set the current debugging level.
QString fromUtf8(const char *str, int size)
debug_level_type debug_level() const
The current debugging level.
virtual int parse()
Parse.
HolidayParserPlan(class HolidayParserDriverPlan &driver_yyarg)
Build a parser object.
std::ostream & debug_stream() const
The current debugging stream.
position begin
Beginning of the located region.
std::string * filename
File name to which this position refers.
HolidayParserDriverPlan implementation class.