KHolidays Library
holidayparserplan.cpp
00001 /* A Bison parser, made by GNU Bison 2.3. */ 00002 00003 /* Skeleton implementation for Bison LALR(1) parsers in C++ 00004 00005 Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2, or (at your option) 00010 any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 Boston, MA 02110-1301, USA. */ 00021 00022 /* As a special exception, you may create a larger work that contains 00023 part or all of the Bison parser skeleton and distribute that work 00024 under terms of your choice, so long as that work isn't itself a 00025 parser generator using the skeleton or a modified version thereof 00026 as a parser skeleton. Alternatively, if you modify or redistribute 00027 the parser skeleton itself, you may (at your option) remove this 00028 special exception, which will cause the skeleton and the resulting 00029 Bison output files to be licensed under the GNU General Public 00030 License without this special exception. 00031 00032 This special exception was added by the Free Software Foundation in 00033 version 2.2 of Bison. */ 00034 00035 // Take the name prefix into account. 00036 #define yylex KHolidayslex 00037 00038 #include "holidayparserplan.hpp" 00039 00040 /* User implementation prologue. */ 00041 #line 108 "holidayparserplan.ypp" 00042 00043 00044 #include "holidayparserdriverplan_p.h" 00045 #include "holidayscannerplan_p.h" 00046 00047 /* this "connects" the bison parser in the driver to the flex scanner class 00048 * object. it defines the yylex() function call to pull the next token from the 00049 * current lexer object of the driver context. */ 00050 #undef yylex 00051 #define yylex driver.m_scanner->lex 00052 00053 00054 00055 /* Line 317 of lalr1.cc. */ 00056 #line 57 "holidayparserplan.cpp" 00057 00058 #ifndef YY_ 00059 # if YYENABLE_NLS 00060 # if ENABLE_NLS 00061 # include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */ 00062 # define YY_(msgid) dgettext ("bison-runtime", msgid) 00063 # endif 00064 # endif 00065 # ifndef YY_ 00066 # define YY_(msgid) msgid 00067 # endif 00068 #endif 00069 00070 /* Suppress unused-variable warnings by "using" E. */ 00071 #define YYUSE(e) ((void) (e)) 00072 00073 /* A pseudo ostream that takes yydebug_ into account. */ 00074 # define YYCDEBUG \ 00075 for (bool yydebugcond_ = yydebug_; yydebugcond_; yydebugcond_ = false) \ 00076 (*yycdebug_) 00077 00078 /* Enable debugging if requested. */ 00079 #if YYDEBUG 00080 00081 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ 00082 do { \ 00083 if (yydebug_) \ 00084 { \ 00085 *yycdebug_ << Title << ' '; \ 00086 yy_symbol_print_ ((Type), (Value), (Location)); \ 00087 *yycdebug_ << std::endl; \ 00088 } \ 00089 } while (false) 00090 00091 # define YY_REDUCE_PRINT(Rule) \ 00092 do { \ 00093 if (yydebug_) \ 00094 yy_reduce_print_ (Rule); \ 00095 } while (false) 00096 00097 # define YY_STACK_PRINT() \ 00098 do { \ 00099 if (yydebug_) \ 00100 yystack_print_ (); \ 00101 } while (false) 00102 00103 #else /* !YYDEBUG */ 00104 00105 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) 00106 # define YY_REDUCE_PRINT(Rule) 00107 # define YY_STACK_PRINT() 00108 00109 #endif /* !YYDEBUG */ 00110 00111 #define YYACCEPT goto yyacceptlab 00112 #define YYABORT goto yyabortlab 00113 #define YYERROR goto yyerrorlab 00114 00115 namespace KHolidays 00116 { 00117 #if YYERROR_VERBOSE 00118 00119 /* Return YYSTR after stripping away unnecessary quotes and 00120 backslashes, so that it's suitable for yyerror. The heuristic is 00121 that double-quoting is unnecessary unless the string contains an 00122 apostrophe, a comma, or backslash (other than backslash-backslash). 00123 YYSTR is taken from yytname. */ 00124 std::string 00125 HolidayParserPlan::yytnamerr_ (const char *yystr) 00126 { 00127 if (*yystr == '"') 00128 { 00129 std::string yyr = ""; 00130 char const *yyp = yystr; 00131 00132 for (;;) 00133 switch (*++yyp) 00134 { 00135 case '\'': 00136 case ',': 00137 goto do_not_strip_quotes; 00138 00139 case '\\': 00140 if (*++yyp != '\\') 00141 goto do_not_strip_quotes; 00142 /* Fall through. */ 00143 default: 00144 yyr += *yyp; 00145 break; 00146 00147 case '"': 00148 return yyr; 00149 } 00150 do_not_strip_quotes: ; 00151 } 00152 00153 return yystr; 00154 } 00155 00156 #endif 00157 00159 HolidayParserPlan::HolidayParserPlan (class HolidayParserDriverPlan& driver_yyarg) 00160 : yydebug_ (false), 00161 yycdebug_ (&std::cerr), 00162 driver (driver_yyarg) 00163 { 00164 } 00165 00166 HolidayParserPlan::~HolidayParserPlan () 00167 { 00168 } 00169 00170 #if YYDEBUG 00171 /*--------------------------------. 00172 | Print this symbol on YYOUTPUT. | 00173 `--------------------------------*/ 00174 00175 inline void 00176 HolidayParserPlan::yy_symbol_value_print_ (int yytype, 00177 const semantic_type* yyvaluep, const location_type* yylocationp) 00178 { 00179 YYUSE (yylocationp); 00180 YYUSE (yyvaluep); 00181 switch (yytype) 00182 { 00183 default: 00184 break; 00185 } 00186 } 00187 00188 00189 void 00190 HolidayParserPlan::yy_symbol_print_ (int yytype, 00191 const semantic_type* yyvaluep, const location_type* yylocationp) 00192 { 00193 *yycdebug_ << (yytype < yyntokens_ ? "token" : "nterm") 00194 << ' ' << yytname_[yytype] << " (" 00195 << *yylocationp << ": "; 00196 yy_symbol_value_print_ (yytype, yyvaluep, yylocationp); 00197 *yycdebug_ << ')'; 00198 } 00199 #endif /* ! YYDEBUG */ 00200 00201 void 00202 HolidayParserPlan::yydestruct_ (const char* yymsg, 00203 int yytype, semantic_type* yyvaluep, location_type* yylocationp) 00204 { 00205 YYUSE (yylocationp); 00206 YYUSE (yymsg); 00207 YYUSE (yyvaluep); 00208 00209 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 00210 00211 switch (yytype) 00212 { 00213 00214 default: 00215 break; 00216 } 00217 } 00218 00219 void 00220 HolidayParserPlan::yypop_ (unsigned int n) 00221 { 00222 yystate_stack_.pop (n); 00223 yysemantic_stack_.pop (n); 00224 yylocation_stack_.pop (n); 00225 } 00226 00227 std::ostream& 00228 HolidayParserPlan::debug_stream () const 00229 { 00230 return *yycdebug_; 00231 } 00232 00233 void 00234 HolidayParserPlan::set_debug_stream (std::ostream& o) 00235 { 00236 yycdebug_ = &o; 00237 } 00238 00239 00240 HolidayParserPlan::debug_level_type 00241 HolidayParserPlan::debug_level () const 00242 { 00243 return yydebug_; 00244 } 00245 00246 void 00247 HolidayParserPlan::set_debug_level (debug_level_type l) 00248 { 00249 yydebug_ = l; 00250 } 00251 00252 00253 int 00254 HolidayParserPlan::parse () 00255 { 00257 int yychar = yyempty_; 00258 int yytoken = 0; 00259 00260 /* State. */ 00261 int yyn; 00262 int yylen = 0; 00263 int yystate = 0; 00264 00265 /* Error handling. */ 00266 int yynerrs_ = 0; 00267 int yyerrstatus_ = 0; 00268 00270 semantic_type yylval; 00272 location_type yylloc; 00274 location yyerror_range[2]; 00275 00277 semantic_type yyval; 00279 location_type yyloc; 00280 00281 int yyresult; 00282 00283 YYCDEBUG << "Starting parse" << std::endl; 00284 00285 00286 /* User initialization code. */ 00287 #line 70 "holidayparserplan.ypp" 00288 { 00289 // initialize the initial location object 00290 yylloc.begin.filename = new std::string( driver.filePath().toLocal8Bit().data() ); 00291 yylloc.end.filename = yylloc.begin.filename; 00292 } 00293 /* Line 547 of yacc.c. */ 00294 #line 295 "holidayparserplan.cpp" 00295 /* Initialize the stacks. The initial state will be pushed in 00296 yynewstate, since the latter expects the semantical and the 00297 location values to have been already stored, initialize these 00298 stacks with a primary value. */ 00299 yystate_stack_ = state_stack_type (0); 00300 yysemantic_stack_ = semantic_stack_type (0); 00301 yylocation_stack_ = location_stack_type (0); 00302 yysemantic_stack_.push (yylval); 00303 yylocation_stack_.push (yylloc); 00304 00305 /* New state. */ 00306 yynewstate: 00307 yystate_stack_.push (yystate); 00308 YYCDEBUG << "Entering state " << yystate << std::endl; 00309 goto yybackup; 00310 00311 /* Backup. */ 00312 yybackup: 00313 00314 /* Try to take a decision without look-ahead. */ 00315 yyn = yypact_[yystate]; 00316 if (yyn == yypact_ninf_) 00317 goto yydefault; 00318 00319 /* Read a look-ahead token. */ 00320 if (yychar == yyempty_) 00321 { 00322 YYCDEBUG << "Reading a token: "; 00323 yychar = yylex (&yylval, &yylloc); 00324 } 00325 00326 00327 /* Convert token to internal form. */ 00328 if (yychar <= yyeof_) 00329 { 00330 yychar = yytoken = yyeof_; 00331 YYCDEBUG << "Now at end of input." << std::endl; 00332 } 00333 else 00334 { 00335 yytoken = yytranslate_ (yychar); 00336 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); 00337 } 00338 00339 /* If the proper action on seeing token YYTOKEN is to reduce or to 00340 detect an error, take that action. */ 00341 yyn += yytoken; 00342 if (yyn < 0 || yylast_ < yyn || yycheck_[yyn] != yytoken) 00343 goto yydefault; 00344 00345 /* Reduce or error. */ 00346 yyn = yytable_[yyn]; 00347 if (yyn <= 0) 00348 { 00349 if (yyn == 0 || yyn == yytable_ninf_) 00350 goto yyerrlab; 00351 yyn = -yyn; 00352 goto yyreduce; 00353 } 00354 00355 /* Accept? */ 00356 if (yyn == yyfinal_) 00357 goto yyacceptlab; 00358 00359 /* Shift the look-ahead token. */ 00360 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); 00361 00362 /* Discard the token being shifted unless it is eof. */ 00363 if (yychar != yyeof_) 00364 yychar = yyempty_; 00365 00366 yysemantic_stack_.push (yylval); 00367 yylocation_stack_.push (yylloc); 00368 00369 /* Count tokens shifted since error; after three, turn off error 00370 status. */ 00371 if (yyerrstatus_) 00372 --yyerrstatus_; 00373 00374 yystate = yyn; 00375 goto yynewstate; 00376 00377 /*-----------------------------------------------------------. 00378 | yydefault -- do the default action for the current state. | 00379 `-----------------------------------------------------------*/ 00380 yydefault: 00381 yyn = yydefact_[yystate]; 00382 if (yyn == 0) 00383 goto yyerrlab; 00384 goto yyreduce; 00385 00386 /*-----------------------------. 00387 | yyreduce -- Do a reduction. | 00388 `-----------------------------*/ 00389 yyreduce: 00390 yylen = yyr2_[yyn]; 00391 /* If YYLEN is nonzero, implement the default value of the action: 00392 `$$ = $1'. Otherwise, use the top of the stack. 00393 00394 Otherwise, the following line sets YYVAL to garbage. 00395 This behavior is undocumented and Bison 00396 users should not rely upon it. */ 00397 if (yylen) 00398 yyval = yysemantic_stack_[yylen - 1]; 00399 else 00400 yyval = yysemantic_stack_[0]; 00401 00402 { 00403 slice<location_type, location_stack_type> slice (yylocation_stack_, yylen); 00404 YYLLOC_DEFAULT (yyloc, slice, yylen); 00405 } 00406 YY_REDUCE_PRINT (yyn); 00407 switch (yyn) 00408 { 00409 case 4: 00410 #line 129 "holidayparserplan.ypp" 00411 { driver.setFileCountryCode( QString() ); ;} 00412 break; 00413 00414 case 5: 00415 #line 130 "holidayparserplan.ypp" 00416 { driver.setFileCountryCode( QString::fromUtf8( (yysemantic_stack_[(2) - (2)].sval) ) ); ;} 00417 break; 00418 00419 case 6: 00420 #line 133 "holidayparserplan.ypp" 00421 { driver.setFileLanguageCode( QString() ); ;} 00422 break; 00423 00424 case 7: 00425 #line 134 "holidayparserplan.ypp" 00426 { driver.setFileLanguageCode( QString::fromUtf8( (yysemantic_stack_[(2) - (2)].sval) ) ); ;} 00427 break; 00428 00429 case 8: 00430 #line 137 "holidayparserplan.ypp" 00431 { driver.setFileName( QString() ); ;} 00432 break; 00433 00434 case 9: 00435 #line 138 "holidayparserplan.ypp" 00436 { driver.setFileName( QString::fromUtf8( (yysemantic_stack_[(2) - (2)].sval) ) ); ;} 00437 break; 00438 00439 case 10: 00440 #line 141 "holidayparserplan.ypp" 00441 { driver.setFileDescription( QString() ); ;} 00442 break; 00443 00444 case 11: 00445 #line 142 "holidayparserplan.ypp" 00446 { driver.setFileDescription( QString::fromUtf8( (yysemantic_stack_[(2) - (2)].sval) ) ); ;} 00447 break; 00448 00449 case 16: 00450 #line 153 "holidayparserplan.ypp" 00451 { driver.setEventColorName( 0 ); ;} 00452 break; 00453 00454 case 17: 00455 #line 154 "holidayparserplan.ypp" 00456 { driver.setEventColorName( (yysemantic_stack_[(1) - (1)].ival) ); ;} 00457 break; 00458 00459 case 18: 00460 #line 157 "holidayparserplan.ypp" 00461 { driver.setEventColorDay( 0 ); ;} 00462 break; 00463 00464 case 19: 00465 #line 158 "holidayparserplan.ypp" 00466 { driver.setEventColorDay( (yysemantic_stack_[(1) - (1)].ival) ); ;} 00467 break; 00468 00469 case 20: 00470 #line 161 "holidayparserplan.ypp" 00471 { driver.setEventName( QString::fromUtf8( (yysemantic_stack_[(1) - (1)].sval) ) ); ;} 00472 break; 00473 00474 case 21: 00475 #line 164 "holidayparserplan.ypp" 00476 { driver.setEventCalendarType( "gregorian" ); ;} 00477 break; 00478 00479 case 22: 00480 #line 165 "holidayparserplan.ypp" 00481 { driver.setEventCalendarType( QString::fromUtf8( (yysemantic_stack_[(1) - (1)].sval) ) ); ;} 00482 break; 00483 00484 case 23: 00485 #line 168 "holidayparserplan.ypp" 00486 { driver.setFromEaster( (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival) ); ;} 00487 break; 00488 00489 case 24: 00490 #line 169 "holidayparserplan.ypp" 00491 { driver.setFromPascha( (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival) ); ;} 00492 break; 00493 00494 case 25: 00495 #line 170 "holidayparserplan.ypp" 00496 { driver.setFromDate( (yysemantic_stack_[(4) - (2)].ival), (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (4)].ival) ); ;} 00497 break; 00498 00499 case 26: 00500 #line 171 "holidayparserplan.ypp" 00501 { driver.setFromWeekdayInMonth( 1, (yysemantic_stack_[(3) - (1)].ival), 1, (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (3)].ival) ); ;} 00502 break; 00503 00504 case 27: 00505 #line 172 "holidayparserplan.ypp" 00506 { driver.setFromWeekdayInMonth( (yysemantic_stack_[(4) - (1)].ival), (yysemantic_stack_[(4) - (2)].ival), 1, (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (4)].ival) ); ;} 00507 break; 00508 00509 case 28: 00510 #line 173 "holidayparserplan.ypp" 00511 { 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) ); ;} 00512 break; 00513 00514 case 29: 00515 #line 174 "holidayparserplan.ypp" 00516 { driver.setFromRelativeWeekday( (yysemantic_stack_[(5) - (2)].ival), (yysemantic_stack_[(5) - (1)].ival), (yysemantic_stack_[(5) - (4)].ival), (yysemantic_stack_[(5) - (5)].ival) ); ;} 00517 break; 00518 00519 case 30: 00520 #line 177 "holidayparserplan.ypp" 00521 { (yyval.ival) = 0; ;} 00522 break; 00523 00524 case 31: 00525 #line 178 "holidayparserplan.ypp" 00526 { (yyval.ival) = (yysemantic_stack_[(2) - (2)].ival); ;} 00527 break; 00528 00529 case 32: 00530 #line 179 "holidayparserplan.ypp" 00531 { (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); ;} 00532 break; 00533 00534 case 33: 00535 #line 182 "holidayparserplan.ypp" 00536 { (yyval.ival) = 0; ;} 00537 break; 00538 00539 case 34: 00540 #line 183 "holidayparserplan.ypp" 00541 { (yyval.ival) = ( (yysemantic_stack_[(4) - (2)].ival) << 8 ) | (yysemantic_stack_[(4) - (4)].ival); ;} 00542 break; 00543 00544 case 35: 00545 #line 186 "holidayparserplan.ypp" 00546 { (yyval.ival) = 0; ;} 00547 break; 00548 00549 case 36: 00550 #line 187 "holidayparserplan.ypp" 00551 { (yyval.ival) = ( 1 << (yysemantic_stack_[(1) - (1)].ival) ); ;} 00552 break; 00553 00554 case 37: 00555 #line 188 "holidayparserplan.ypp" 00556 { (yyval.ival) = ( 1 << (yysemantic_stack_[(3) - (1)].ival) ) | (yysemantic_stack_[(3) - (3)].ival); ;} 00557 break; 00558 00559 case 38: 00560 #line 191 "holidayparserplan.ypp" 00561 { (yyval.ival) = 1; ;} 00562 break; 00563 00564 case 39: 00565 #line 192 "holidayparserplan.ypp" 00566 { (yyval.ival) = (yysemantic_stack_[(2) - (2)].ival); ;} 00567 break; 00568 00569 case 40: 00570 #line 195 "holidayparserplan.ypp" 00571 { driver.setEventDate( -99999, (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival) ); ;} 00572 break; 00573 00574 case 41: 00575 #line 196 "holidayparserplan.ypp" 00576 { driver.setEventDate( -99999, (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival) ); ;} 00577 break; 00578 00579 case 42: 00580 #line 197 "holidayparserplan.ypp" 00581 { driver.setEventDate( (yysemantic_stack_[(5) - (5)].ival), (yysemantic_stack_[(5) - (3)].ival), (yysemantic_stack_[(5) - (1)].ival) ); ;} 00582 break; 00583 00584 case 43: 00585 #line 198 "holidayparserplan.ypp" 00586 { driver.setEventDate( -99999, (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival) ); ;} 00587 break; 00588 00589 case 44: 00590 #line 199 "holidayparserplan.ypp" 00591 { driver.setEventDate( (yysemantic_stack_[(5) - (5)].ival), (yysemantic_stack_[(5) - (1)].ival), (yysemantic_stack_[(5) - (3)].ival) ); ;} 00592 break; 00593 00594 case 45: 00595 #line 200 "holidayparserplan.ypp" 00596 { driver.setEventDate( -99999, (yysemantic_stack_[(2) - (1)].ival), (yysemantic_stack_[(2) - (2)].ival) ); ;} 00597 break; 00598 00599 case 46: 00600 #line 201 "holidayparserplan.ypp" 00601 { driver.setEventDate( (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (2)].ival) ); ;} 00602 break; 00603 00604 case 47: 00605 #line 202 "holidayparserplan.ypp" 00606 { driver.setEventDate( -99999, (yysemantic_stack_[(2) - (2)].ival), (yysemantic_stack_[(2) - (1)].ival) ); ;} 00607 break; 00608 00609 case 48: 00610 #line 203 "holidayparserplan.ypp" 00611 { driver.setEventDate( (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (1)].ival) ); ;} 00612 break; 00613 00614 case 49: 00615 #line 204 "holidayparserplan.ypp" 00616 { driver.setEventDate( (yysemantic_stack_[(4) - (4)].ival), (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival) ); ;} 00617 break; 00618 00619 case 50: 00620 #line 205 "holidayparserplan.ypp" 00621 { driver.setEventDate( (yysemantic_stack_[(1) - (1)].ival) ); ;} 00622 break; 00623 00624 case 51: 00625 #line 208 "holidayparserplan.ypp" 00626 { (yyval.ival) = driver.julianDayFromEventName( (yysemantic_stack_[(1) - (1)].sval) ); ;} 00627 break; 00628 00629 case 52: 00630 #line 209 "holidayparserplan.ypp" 00631 { (yyval.ival) = driver.julianDayFromEaster(); ;} 00632 break; 00633 00634 case 53: 00635 #line 210 "holidayparserplan.ypp" 00636 { (yyval.ival) = driver.julianDayFromPascha(); ;} 00637 break; 00638 00639 case 54: 00640 #line 211 "holidayparserplan.ypp" 00641 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(3) - (3)].ival), (yysemantic_stack_[(3) - (1)].ival) ); ;} 00642 break; 00643 00644 case 55: 00645 #line 212 "holidayparserplan.ypp" 00646 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(4) - (3)].ival), (yysemantic_stack_[(4) - (1)].ival) ); ;} 00647 break; 00648 00649 case 56: 00650 #line 213 "holidayparserplan.ypp" 00651 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival) ); ;} 00652 break; 00653 00654 case 57: 00655 #line 214 "holidayparserplan.ypp" 00656 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(2) - (2)].ival), (yysemantic_stack_[(2) - (1)].ival) ); ;} 00657 break; 00658 00659 case 58: 00660 #line 215 "holidayparserplan.ypp" 00661 { (yyval.ival) = driver.julianDayFromMonthDay( (yysemantic_stack_[(2) - (1)].ival), (yysemantic_stack_[(2) - (2)].ival) ); ;} 00662 break; 00663 00664 case 59: 00665 #line 216 "holidayparserplan.ypp" 00666 { (yyval.ival) = driver.julianDayFromRelativeWeekday( (yysemantic_stack_[(3) - (2)].ival), (yysemantic_stack_[(3) - (1)].ival), (yysemantic_stack_[(3) - (3)].ival) ); ;} 00667 break; 00668 00669 case 60: 00670 #line 217 "holidayparserplan.ypp" 00671 { (yyval.ival) = driver.julianDayFromWeekdayInMonth( (yysemantic_stack_[(4) - (1)].ival), (yysemantic_stack_[(4) - (2)].ival), (yysemantic_stack_[(4) - (4)].ival) ); ;} 00672 break; 00673 00674 case 62: 00675 #line 221 "holidayparserplan.ypp" 00676 { (yyval.ival) = driver.adjustedMonthNumber( (yysemantic_stack_[(1) - (1)].ival) ); ;} 00677 break; 00678 00679 case 63: 00680 #line 224 "holidayparserplan.ypp" 00681 { (yyval.ival) = driver.adjustedMonthNumber( (yysemantic_stack_[(1) - (1)].ival) ); ;} 00682 break; 00683 00684 case 64: 00685 #line 227 "holidayparserplan.ypp" 00686 { (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); ;} 00687 break; 00688 00689 case 65: 00690 #line 228 "holidayparserplan.ypp" 00691 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) || (yysemantic_stack_[(3) - (3)].ival); ;} 00692 break; 00693 00694 case 66: 00695 #line 229 "holidayparserplan.ypp" 00696 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) && (yysemantic_stack_[(3) - (3)].ival); ;} 00697 break; 00698 00699 case 67: 00700 #line 230 "holidayparserplan.ypp" 00701 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) == (yysemantic_stack_[(3) - (3)].ival); ;} 00702 break; 00703 00704 case 68: 00705 #line 231 "holidayparserplan.ypp" 00706 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) != (yysemantic_stack_[(3) - (3)].ival); ;} 00707 break; 00708 00709 case 69: 00710 #line 232 "holidayparserplan.ypp" 00711 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) <= (yysemantic_stack_[(3) - (3)].ival); ;} 00712 break; 00713 00714 case 70: 00715 #line 233 "holidayparserplan.ypp" 00716 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) >= (yysemantic_stack_[(3) - (3)].ival); ;} 00717 break; 00718 00719 case 71: 00720 #line 234 "holidayparserplan.ypp" 00721 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) < (yysemantic_stack_[(3) - (3)].ival); ;} 00722 break; 00723 00724 case 72: 00725 #line 235 "holidayparserplan.ypp" 00726 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) > (yysemantic_stack_[(3) - (3)].ival); ;} 00727 break; 00728 00729 case 73: 00730 #line 236 "holidayparserplan.ypp" 00731 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) + (yysemantic_stack_[(3) - (3)].ival); ;} 00732 break; 00733 00734 case 74: 00735 #line 237 "holidayparserplan.ypp" 00736 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) - (yysemantic_stack_[(3) - (3)].ival); ;} 00737 break; 00738 00739 case 75: 00740 #line 238 "holidayparserplan.ypp" 00741 { (yyval.ival) = (yysemantic_stack_[(3) - (1)].ival) * (yysemantic_stack_[(3) - (3)].ival); ;} 00742 break; 00743 00744 case 76: 00745 #line 239 "holidayparserplan.ypp" 00746 { (yyval.ival) = (yysemantic_stack_[(3) - (3)].ival) ? (yysemantic_stack_[(3) - (1)].ival) / (yysemantic_stack_[(3) - (3)].ival) : 0; ;} 00747 break; 00748 00749 case 77: 00750 #line 240 "holidayparserplan.ypp" 00751 { (yyval.ival) = (yysemantic_stack_[(3) - (3)].ival) ? (yysemantic_stack_[(3) - (1)].ival) % (yysemantic_stack_[(3) - (3)].ival) : 0; ;} 00752 break; 00753 00754 case 78: 00755 #line 241 "holidayparserplan.ypp" 00756 { (yyval.ival) = (yysemantic_stack_[(5) - (1)].ival) ? (yysemantic_stack_[(5) - (3)].ival) : (yysemantic_stack_[(5) - (5)].ival); ;} 00757 break; 00758 00759 case 79: 00760 #line 242 "holidayparserplan.ypp" 00761 { (yyval.ival) = !(yysemantic_stack_[(2) - (2)].ival); ;} 00762 break; 00763 00764 case 80: 00765 #line 243 "holidayparserplan.ypp" 00766 { (yyval.ival) = (yysemantic_stack_[(3) - (2)].ival); ;} 00767 break; 00768 00769 case 81: 00770 #line 246 "holidayparserplan.ypp" 00771 { (yyval.ival) = (yysemantic_stack_[(3) - (2)].ival); ;} 00772 break; 00773 00774 case 82: 00775 #line 247 "holidayparserplan.ypp" 00776 { (yyval.ival) = (yysemantic_stack_[(1) - (1)].ival); ;} 00777 break; 00778 00779 case 84: 00780 #line 251 "holidayparserplan.ypp" 00781 { (yyval.ival) = -(yysemantic_stack_[(2) - (2)].ival); ;} 00782 break; 00783 00784 case 85: 00785 #line 252 "holidayparserplan.ypp" 00786 { (yyval.ival) = driver.parseYear(); ;} 00787 break; 00788 00789 case 86: 00790 #line 253 "holidayparserplan.ypp" 00791 { (yyval.ival) = driver.isLeapYear( (yysemantic_stack_[(2) - (2)].ival) ); ;} 00792 break; 00793 00794 00795 /* Line 675 of lalr1.cc. */ 00796 #line 797 "holidayparserplan.cpp" 00797 default: break; 00798 } 00799 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 00800 00801 yypop_ (yylen); 00802 yylen = 0; 00803 YY_STACK_PRINT (); 00804 00805 yysemantic_stack_.push (yyval); 00806 yylocation_stack_.push (yyloc); 00807 00808 /* Shift the result of the reduction. */ 00809 yyn = yyr1_[yyn]; 00810 yystate = yypgoto_[yyn - yyntokens_] + yystate_stack_[0]; 00811 if (0 <= yystate && yystate <= yylast_ 00812 && yycheck_[yystate] == yystate_stack_[0]) 00813 yystate = yytable_[yystate]; 00814 else 00815 yystate = yydefgoto_[yyn - yyntokens_]; 00816 goto yynewstate; 00817 00818 /*------------------------------------. 00819 | yyerrlab -- here on detecting error | 00820 `------------------------------------*/ 00821 yyerrlab: 00822 /* If not already recovering from an error, report this error. */ 00823 if (!yyerrstatus_) 00824 { 00825 ++yynerrs_; 00826 error (yylloc, yysyntax_error_ (yystate, yytoken)); 00827 } 00828 00829 yyerror_range[0] = yylloc; 00830 if (yyerrstatus_ == 3) 00831 { 00832 /* If just tried and failed to reuse look-ahead token after an 00833 error, discard it. */ 00834 00835 if (yychar <= yyeof_) 00836 { 00837 /* Return failure if at end of input. */ 00838 if (yychar == yyeof_) 00839 YYABORT; 00840 } 00841 else 00842 { 00843 yydestruct_ ("Error: discarding", yytoken, &yylval, &yylloc); 00844 yychar = yyempty_; 00845 } 00846 } 00847 00848 /* Else will try to reuse look-ahead token after shifting the error 00849 token. */ 00850 goto yyerrlab1; 00851 00852 00853 /*---------------------------------------------------. 00854 | yyerrorlab -- error raised explicitly by YYERROR. | 00855 `---------------------------------------------------*/ 00856 yyerrorlab: 00857 00858 /* Pacify compilers like GCC when the user code never invokes 00859 YYERROR and the label yyerrorlab therefore never appears in user 00860 code. */ 00861 if (false) 00862 goto yyerrorlab; 00863 00864 yyerror_range[0] = yylocation_stack_[yylen - 1]; 00865 /* Do not reclaim the symbols of the rule which action triggered 00866 this YYERROR. */ 00867 yypop_ (yylen); 00868 yylen = 0; 00869 yystate = yystate_stack_[0]; 00870 goto yyerrlab1; 00871 00872 /*-------------------------------------------------------------. 00873 | yyerrlab1 -- common code for both syntax error and YYERROR. | 00874 `-------------------------------------------------------------*/ 00875 yyerrlab1: 00876 yyerrstatus_ = 3; /* Each real token shifted decrements this. */ 00877 00878 for (;;) 00879 { 00880 yyn = yypact_[yystate]; 00881 if (yyn != yypact_ninf_) 00882 { 00883 yyn += yyterror_; 00884 if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) 00885 { 00886 yyn = yytable_[yyn]; 00887 if (0 < yyn) 00888 break; 00889 } 00890 } 00891 00892 /* Pop the current state because it cannot handle the error token. */ 00893 if (yystate_stack_.height () == 1) 00894 YYABORT; 00895 00896 yyerror_range[0] = yylocation_stack_[0]; 00897 yydestruct_ ("Error: popping", 00898 yystos_[yystate], 00899 &yysemantic_stack_[0], &yylocation_stack_[0]); 00900 yypop_ (); 00901 yystate = yystate_stack_[0]; 00902 YY_STACK_PRINT (); 00903 } 00904 00905 if (yyn == yyfinal_) 00906 goto yyacceptlab; 00907 00908 yyerror_range[1] = yylloc; 00909 // Using YYLLOC is tempting, but would change the location of 00910 // the look-ahead. YYLOC is available though. 00911 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); 00912 yysemantic_stack_.push (yylval); 00913 yylocation_stack_.push (yyloc); 00914 00915 /* Shift the error token. */ 00916 YY_SYMBOL_PRINT ("Shifting", yystos_[yyn], 00917 &yysemantic_stack_[0], &yylocation_stack_[0]); 00918 00919 yystate = yyn; 00920 goto yynewstate; 00921 00922 /* Accept. */ 00923 yyacceptlab: 00924 yyresult = 0; 00925 goto yyreturn; 00926 00927 /* Abort. */ 00928 yyabortlab: 00929 yyresult = 1; 00930 goto yyreturn; 00931 00932 yyreturn: 00933 if (yychar != yyeof_ && yychar != yyempty_) 00934 yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); 00935 00936 /* Do not reclaim the symbols of the rule which action triggered 00937 this YYABORT or YYACCEPT. */ 00938 yypop_ (yylen); 00939 while (yystate_stack_.height () != 1) 00940 { 00941 yydestruct_ ("Cleanup: popping", 00942 yystos_[yystate_stack_[0]], 00943 &yysemantic_stack_[0], 00944 &yylocation_stack_[0]); 00945 yypop_ (); 00946 } 00947 00948 return yyresult; 00949 } 00950 00951 // Generate an error message. 00952 std::string 00953 HolidayParserPlan::yysyntax_error_ (int yystate, int tok) 00954 { 00955 std::string res; 00956 YYUSE (yystate); 00957 #if YYERROR_VERBOSE 00958 int yyn = yypact_[yystate]; 00959 if (yypact_ninf_ < yyn && yyn <= yylast_) 00960 { 00961 /* Start YYX at -YYN if negative to avoid negative indexes in 00962 YYCHECK. */ 00963 int yyxbegin = yyn < 0 ? -yyn : 0; 00964 00965 /* Stay within bounds of both yycheck and yytname. */ 00966 int yychecklim = yylast_ - yyn + 1; 00967 int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; 00968 int count = 0; 00969 for (int x = yyxbegin; x < yyxend; ++x) 00970 if (yycheck_[x + yyn] == x && x != yyterror_) 00971 ++count; 00972 00973 // FIXME: This method of building the message is not compatible 00974 // with internationalization. It should work like yacc.c does it. 00975 // That is, first build a string that looks like this: 00976 // "syntax error, unexpected %s or %s or %s" 00977 // Then, invoke YY_ on this string. 00978 // Finally, use the string as a format to output 00979 // yytname_[tok], etc. 00980 // Until this gets fixed, this message appears in English only. 00981 res = "syntax error, unexpected "; 00982 res += yytnamerr_ (yytname_[tok]); 00983 if (count < 5) 00984 { 00985 count = 0; 00986 for (int x = yyxbegin; x < yyxend; ++x) 00987 if (yycheck_[x + yyn] == x && x != yyterror_) 00988 { 00989 res += (!count++) ? ", expecting " : " or "; 00990 res += yytnamerr_ (yytname_[x]); 00991 } 00992 } 00993 } 00994 else 00995 #endif 00996 res = YY_("syntax error"); 00997 return res; 00998 } 00999 01000 01001 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 01002 STATE-NUM. */ 01003 const short int HolidayParserPlan::yypact_ninf_ = -130; 01004 const short int 01005 HolidayParserPlan::yypact_[] = 01006 { 01007 -22, 10, 24, -130, -1, -130, -130, 6, 29, 12, 01008 -130, 25, -130, 32, 13, -130, 39, -130, 60, -130, 01009 -130, 62, -130, -130, 72, -130, 115, -130, -130, 128, 01010 -130, 131, -9, -9, 66, 34, -130, -9, 47, 131, 01011 117, -130, 34, 34, 74, 61, -130, 74, 74, -130, 01012 34, 83, 157, -130, 77, 131, 131, 11, 122, 131, 01013 206, 206, 34, -130, -9, 126, -130, -130, 50, 131, 01014 -130, -130, -130, 51, 64, 131, 3, 34, 34, 34, 01015 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 01016 34, -130, 90, 74, 65, -130, 61, 74, 131, 63, 01017 -130, -130, -130, 206, 74, 131, -130, 131, -130, -130, 01018 93, 61, 248, 248, 248, 248, 248, 248, 227, 248, 01019 114, 114, 50, 50, 50, 184, 79, 94, -130, 131, 01020 -9, -130, -130, 34, -130, -130, -130, 61, 73, 34, 01021 90, 90, -130, 74, 206, -130, -130, -130, -130, -130, 01022 -130 01023 }; 01024 01025 /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE 01026 doesn't specify something else to do. Zero means the default is an 01027 error. */ 01028 const unsigned char 01029 HolidayParserPlan::yydefact_[] = 01030 { 01031 4, 0, 0, 12, 6, 5, 1, 14, 0, 8, 01032 15, 16, 7, 0, 10, 17, 0, 9, 0, 3, 01033 20, 18, 11, 19, 21, 22, 0, 83, 63, 30, 01034 85, 0, 30, 30, 0, 0, 13, 30, 0, 61, 01035 50, 82, 0, 0, 38, 0, 86, 38, 38, 84, 01036 0, 0, 0, 64, 33, 0, 45, 30, 0, 47, 01037 31, 32, 0, 26, 30, 50, 23, 24, 79, 0, 01038 51, 52, 53, 0, 0, 61, 62, 0, 0, 0, 01039 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 01040 0, 81, 35, 38, 43, 46, 0, 38, 63, 40, 01041 61, 62, 48, 39, 38, 0, 80, 0, 58, 57, 01042 0, 0, 67, 68, 69, 70, 71, 72, 65, 66, 01043 74, 73, 75, 76, 77, 0, 36, 0, 25, 0, 01044 30, 27, 49, 41, 29, 59, 56, 0, 54, 0, 01045 35, 35, 44, 38, 42, 60, 55, 78, 37, 34, 01046 28 01047 }; 01048 01049 /* YYPGOTO[NTERM-NUM]. */ 01050 const short int 01051 HolidayParserPlan::yypgoto_[] = 01052 { 01053 -130, -130, -130, -130, -130, -130, -130, -130, -130, -130, 01054 -130, -130, -130, -130, -23, -130, -129, -20, 68, -130, 01055 -13, 106, -27, -26, -130 01056 }; 01057 01058 /* YYDEFGOTO[NTERM-NUM]. */ 01059 const signed char 01060 HolidayParserPlan::yydefgoto_[] = 01061 { 01062 -1, 2, 3, 4, 9, 14, 19, 7, 11, 16, 01063 24, 21, 26, 36, 44, 93, 127, 63, 37, 73, 01064 38, 100, 52, 53, 41 01065 }; 01066 01067 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 01068 positive, shift that token. If negative, reduce the rule which 01069 number is the opposite. If zero, do what YYDEFACT says. */ 01070 const signed char HolidayParserPlan::yytable_ninf_ = -63; 01071 const short int 01072 HolidayParserPlan::yytable_[] = 01073 { 01074 40, 42, 43, 45, 1, 46, -2, 109, 110, 47, 01075 48, 148, 149, 56, 54, 60, 61, 5, 10, 65, 01076 96, 42, 43, 68, 6, 76, 8, 66, 67, 94, 01077 95, 15, 101, 102, 97, 103, 12, 27, 74, 17, 01078 13, 104, 18, 105, 111, 99, 20, 30, 31, 108, 01079 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 01080 122, 123, 124, 125, 27, 28, 34, 22, 23, 49, 01081 101, 50, 132, 128, 30, 31, 51, 131, 35, 135, 01082 25, 136, 55, 130, 134, 101, 27, 28, 69, 90, 01083 70, 62, 92, 34, 106, 126, 30, 31, 138, 107, 01084 129, 71, 137, 142, 133, 35, 144, 143, 72, 140, 01085 141, 101, 147, 64, 146, 34, 0, 0, 27, 28, 01086 29, 28, 57, 150, 145, 27, 98, 35, 30, 31, 01087 28, 27, 39, 32, 27, 30, 31, 0, 42, 43, 01088 33, 30, 31, 0, 30, 31, 59, 34, 87, 88, 01089 89, 39, -62, 90, 34, 0, 0, 75, 58, 35, 01090 34, -62, 0, 34, 0, 0, 35, 58, 0, 0, 01091 0, 59, 35, 0, 0, 35, 77, 78, 79, 80, 01092 81, 82, 0, 0, 0, 0, 0, 83, 84, 85, 01093 86, 87, 88, 89, 0, 0, 90, 0, 0, 0, 01094 0, 0, 91, 77, 78, 79, 80, 81, 82, 0, 01095 0, 0, 0, 0, 83, 84, 85, 86, 87, 88, 01096 89, 0, 0, 90, 139, 77, 78, 79, 80, 81, 01097 82, 0, 0, 0, 0, 0, 83, 84, 85, 86, 01098 87, 88, 89, 0, 0, 90, 77, 78, 79, 80, 01099 81, 82, 0, 0, 0, 0, 0, 0, 84, 85, 01100 86, 87, 88, 89, 0, 0, 90, 77, 78, 79, 01101 80, 81, 82, 0, 0, 0, 0, 0, 0, 0, 01102 85, 86, 87, 88, 89, 0, 0, 90 01103 }; 01104 01105 /* YYCHECK. */ 01106 const short int 01107 HolidayParserPlan::yycheck_[] = 01108 { 01109 26, 10, 11, 29, 26, 31, 0, 4, 5, 32, 01110 33, 140, 141, 39, 37, 42, 43, 7, 12, 45, 01111 9, 10, 11, 50, 0, 51, 27, 47, 48, 55, 01112 56, 6, 58, 59, 57, 62, 7, 3, 51, 7, 01113 28, 64, 29, 69, 41, 58, 7, 13, 14, 75, 01114 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 01115 87, 88, 89, 90, 3, 4, 32, 7, 6, 3, 01116 96, 37, 98, 93, 13, 14, 42, 97, 44, 105, 01117 8, 107, 35, 96, 104, 111, 3, 4, 5, 39, 01118 7, 17, 15, 32, 43, 5, 13, 14, 111, 35, 01119 35, 18, 9, 129, 41, 44, 133, 130, 25, 30, 01120 16, 137, 139, 45, 41, 32, -1, -1, 3, 4, 01121 5, 4, 5, 143, 137, 3, 4, 44, 13, 14, 01122 4, 3, 26, 18, 3, 13, 14, -1, 10, 11, 01123 25, 13, 14, -1, 13, 14, 40, 32, 34, 35, 01124 36, 45, 35, 39, 32, -1, -1, 51, 41, 44, 01125 32, 35, -1, 32, -1, -1, 44, 41, -1, -1, 01126 -1, 65, 44, -1, -1, 44, 19, 20, 21, 22, 01127 23, 24, -1, -1, -1, -1, -1, 30, 31, 32, 01128 33, 34, 35, 36, -1, -1, 39, -1, -1, -1, 01129 -1, -1, 45, 19, 20, 21, 22, 23, 24, -1, 01130 -1, -1, -1, -1, 30, 31, 32, 33, 34, 35, 01131 36, -1, -1, 39, 40, 19, 20, 21, 22, 23, 01132 24, -1, -1, -1, -1, -1, 30, 31, 32, 33, 01133 34, 35, 36, -1, -1, 39, 19, 20, 21, 22, 01134 23, 24, -1, -1, -1, -1, -1, -1, 31, 32, 01135 33, 34, 35, 36, -1, -1, 39, 19, 20, 21, 01136 22, 23, 24, -1, -1, -1, -1, -1, -1, -1, 01137 32, 33, 34, 35, 36, -1, -1, 39 01138 }; 01139 01140 /* STOS_[STATE-NUM] -- The (internal number of the) accessing 01141 symbol of state STATE-NUM. */ 01142 const unsigned char 01143 HolidayParserPlan::yystos_[] = 01144 { 01145 0, 26, 47, 48, 49, 7, 0, 53, 27, 50, 01146 12, 54, 7, 28, 51, 6, 55, 7, 29, 52, 01147 7, 57, 7, 6, 56, 8, 58, 3, 4, 5, 01148 13, 14, 18, 25, 32, 44, 59, 64, 66, 67, 01149 69, 70, 10, 11, 60, 69, 69, 60, 60, 3, 01150 37, 42, 68, 69, 60, 35, 69, 5, 41, 67, 01151 68, 68, 17, 63, 64, 69, 63, 63, 68, 5, 01152 7, 18, 25, 65, 66, 67, 69, 19, 20, 21, 01153 22, 23, 24, 30, 31, 32, 33, 34, 35, 36, 01154 39, 45, 15, 61, 69, 69, 9, 60, 4, 66, 01155 67, 69, 69, 68, 60, 69, 43, 35, 69, 4, 01156 5, 41, 68, 68, 68, 68, 68, 68, 68, 68, 01157 68, 68, 68, 68, 68, 68, 5, 62, 63, 35, 01158 66, 63, 69, 41, 63, 69, 69, 9, 66, 40, 01159 30, 16, 69, 60, 68, 66, 41, 68, 62, 62, 01160 63 01161 }; 01162 01163 #if YYDEBUG 01164 /* TOKEN_NUMBER_[YYLEX-NUM] -- Internal symbol number corresponding 01165 to YYLEX-NUM. */ 01166 const unsigned short int 01167 HolidayParserPlan::yytoken_number_[] = 01168 { 01169 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 01170 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 01171 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 01172 285, 286, 45, 43, 42, 47, 37, 33, 287, 63, 01173 58, 46, 91, 93, 40, 41 01174 }; 01175 #endif 01176 01177 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ 01178 const unsigned char 01179 HolidayParserPlan::yyr1_[] = 01180 { 01181 0, 46, 47, 48, 49, 49, 50, 50, 51, 51, 01182 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 01183 57, 58, 58, 59, 59, 59, 59, 59, 59, 59, 01184 60, 60, 60, 61, 61, 62, 62, 62, 63, 63, 01185 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 01186 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 01187 65, 66, 66, 67, 68, 68, 68, 68, 68, 68, 01188 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 01189 68, 69, 69, 70, 70, 70, 70 01190 }; 01191 01192 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ 01193 const unsigned char 01194 HolidayParserPlan::yyr2_[] = 01195 { 01196 0, 2, 2, 4, 0, 2, 0, 2, 0, 2, 01197 0, 2, 0, 7, 0, 1, 0, 1, 0, 1, 01198 1, 0, 1, 3, 3, 4, 3, 4, 6, 5, 01199 0, 2, 2, 0, 4, 0, 1, 3, 0, 2, 01200 3, 4, 5, 3, 5, 2, 3, 2, 3, 4, 01201 1, 1, 1, 1, 3, 4, 3, 2, 2, 3, 01202 4, 1, 1, 1, 1, 3, 3, 3, 3, 3, 01203 3, 3, 3, 3, 3, 3, 3, 3, 5, 2, 01204 3, 3, 1, 1, 2, 1, 2 01205 }; 01206 01207 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 01208 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 01209 First, the terminals, then, starting at \a yyntokens_, nonterminals. */ 01210 const char* 01211 const HolidayParserPlan::yytname_[] = 01212 { 01213 "END", "error", "$undefined", "NUMBER", "MONTH", "WDAY", "COLOR", 01214 "STRING", "CALENDAR", "INOP", "PLUS", "MINUS", "SMALL", "YEAR", 01215 "LEAPYEAR", "SHIFT", "IF", "LENGTH", "EASTER", "EQ", "NE", "LE", "GE", 01216 "LT", "GT", "PASCHA", "COUNTRY", "LANGUAGE", "NAME", "DESCRIPTION", "OR", 01217 "AND", "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "UMINUS", "'?'", "':'", 01218 "'.'", "'['", "']'", "'('", "')'", "$accept", "planfile", "metadata", 01219 "countrycode", "languagecode", "name", "description", "list", "small", 01220 "stringcolor", "daycolor", "eventname", "calendar", "eventrule", 01221 "offset", "conditionaloffset", "wdaycondition", "length", "date", 01222 "reldate", "month", "monthnumber", "expr", "pexpr", "number", 0 01223 }; 01224 #endif 01225 01226 #if YYDEBUG 01227 /* YYRHS -- A `-1'-separated list of the rules' RHS. */ 01228 const HolidayParserPlan::rhs_number_type 01229 HolidayParserPlan::yyrhs_[] = 01230 { 01231 47, 0, -1, 48, 53, -1, 49, 50, 51, 52, 01232 -1, -1, 26, 7, -1, -1, 27, 7, -1, -1, 01233 28, 7, -1, -1, 29, 7, -1, -1, 53, 54, 01234 55, 57, 56, 58, 59, -1, -1, 12, -1, -1, 01235 6, -1, -1, 6, -1, 7, -1, -1, 8, -1, 01236 18, 60, 63, -1, 25, 60, 63, -1, 64, 60, 01237 61, 63, -1, 5, 60, 63, -1, 69, 5, 60, 01238 63, -1, 69, 5, 9, 66, 60, 63, -1, 5, 01239 69, 64, 60, 63, -1, -1, 10, 68, -1, 11, 01240 68, -1, -1, 15, 62, 16, 62, -1, -1, 5, 01241 -1, 5, 30, 62, -1, -1, 17, 68, -1, 69, 01242 41, 66, -1, 69, 41, 66, 41, -1, 69, 41, 01243 66, 41, 68, -1, 66, 35, 69, -1, 66, 35, 01244 69, 35, 69, -1, 67, 69, -1, 67, 69, 69, 01245 -1, 69, 67, -1, 69, 67, 69, -1, 69, 41, 01246 4, 69, -1, 69, -1, 7, -1, 18, -1, 25, 01247 -1, 69, 41, 66, -1, 69, 41, 66, 41, -1, 01248 66, 35, 69, -1, 69, 4, -1, 67, 69, -1, 01249 5, 69, 69, -1, 69, 5, 9, 66, -1, 67, 01250 -1, 69, -1, 4, -1, 69, -1, 68, 30, 68, 01251 -1, 68, 31, 68, -1, 68, 19, 68, -1, 68, 01252 20, 68, -1, 68, 21, 68, -1, 68, 22, 68, 01253 -1, 68, 23, 68, -1, 68, 24, 68, -1, 68, 01254 33, 68, -1, 68, 32, 68, -1, 68, 34, 68, 01255 -1, 68, 35, 68, -1, 68, 36, 68, -1, 68, 01256 39, 68, 40, 68, -1, 37, 68, -1, 42, 65, 01257 43, -1, 44, 68, 45, -1, 70, -1, 3, -1, 01258 32, 3, -1, 13, -1, 14, 69, -1 01259 }; 01260 01261 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 01262 YYRHS. */ 01263 const unsigned short int 01264 HolidayParserPlan::yyprhs_[] = 01265 { 01266 0, 0, 3, 6, 11, 12, 15, 16, 19, 20, 01267 23, 24, 27, 28, 36, 37, 39, 40, 42, 43, 01268 45, 47, 48, 50, 54, 58, 63, 67, 72, 79, 01269 85, 86, 89, 92, 93, 98, 99, 101, 105, 106, 01270 109, 113, 118, 124, 128, 134, 137, 141, 144, 148, 01271 153, 155, 157, 159, 161, 165, 170, 174, 177, 180, 01272 184, 189, 191, 193, 195, 197, 201, 205, 209, 213, 01273 217, 221, 225, 229, 233, 237, 241, 245, 249, 255, 01274 258, 262, 266, 268, 270, 273, 275 01275 }; 01276 01277 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ 01278 const unsigned char 01279 HolidayParserPlan::yyrline_[] = 01280 { 01281 0, 123, 123, 126, 129, 130, 133, 134, 137, 138, 01282 141, 142, 145, 146, 149, 150, 153, 154, 157, 158, 01283 161, 164, 165, 168, 169, 170, 171, 172, 173, 174, 01284 177, 178, 179, 182, 183, 186, 187, 188, 191, 192, 01285 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 01286 205, 208, 209, 210, 211, 212, 213, 214, 215, 216, 01287 217, 220, 221, 224, 227, 228, 229, 230, 231, 232, 01288 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 01289 243, 246, 247, 250, 251, 252, 253 01290 }; 01291 01292 // Print the state stack on the debug stream. 01293 void 01294 HolidayParserPlan::yystack_print_ () 01295 { 01296 *yycdebug_ << "Stack now"; 01297 for (state_stack_type::const_iterator i = yystate_stack_.begin (); 01298 i != yystate_stack_.end (); ++i) 01299 *yycdebug_ << ' ' << *i; 01300 *yycdebug_ << std::endl; 01301 } 01302 01303 // Report on the debug stream that the rule \a yyrule is going to be reduced. 01304 void 01305 HolidayParserPlan::yy_reduce_print_ (int yyrule) 01306 { 01307 unsigned int yylno = yyrline_[yyrule]; 01308 int yynrhs = yyr2_[yyrule]; 01309 /* Print the symbols being reduced, and their result. */ 01310 *yycdebug_ << "Reducing stack by rule " << yyrule - 1 01311 << " (line " << yylno << "), "; 01312 /* The symbols being reduced. */ 01313 for (int yyi = 0; yyi < yynrhs; yyi++) 01314 YY_SYMBOL_PRINT (" $" << yyi + 1 << " =", 01315 yyrhs_[yyprhs_[yyrule] + yyi], 01316 &(yysemantic_stack_[(yynrhs) - (yyi + 1)]), 01317 &(yylocation_stack_[(yynrhs) - (yyi + 1)])); 01318 } 01319 #endif // YYDEBUG 01320 01321 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ 01322 HolidayParserPlan::token_number_type 01323 HolidayParserPlan::yytranslate_ (int t) 01324 { 01325 static 01326 const token_number_type 01327 translate_table[] = 01328 { 01329 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01330 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01331 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01332 2, 2, 2, 37, 2, 2, 2, 36, 2, 2, 01333 44, 45, 34, 33, 2, 32, 41, 35, 2, 2, 01334 2, 2, 2, 2, 2, 2, 2, 2, 40, 2, 01335 2, 2, 2, 39, 2, 2, 2, 2, 2, 2, 01336 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01337 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01338 2, 42, 2, 43, 2, 2, 2, 2, 2, 2, 01339 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01340 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01341 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01342 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01343 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01344 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01345 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01346 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01347 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01348 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01349 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01350 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01351 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01352 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01353 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 01354 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 01355 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 01356 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 01357 25, 26, 27, 28, 29, 30, 31, 38 01358 }; 01359 if ((unsigned int) t <= yyuser_token_number_max_) 01360 return translate_table[t]; 01361 else 01362 return yyundef_token_; 01363 } 01364 01365 const int HolidayParserPlan::yyeof_ = 0; 01366 const int HolidayParserPlan::yylast_ = 287; 01367 const int HolidayParserPlan::yynnts_ = 25; 01368 const int HolidayParserPlan::yyempty_ = -2; 01369 const int HolidayParserPlan::yyfinal_ = 6; 01370 const int HolidayParserPlan::yyterror_ = 1; 01371 const int HolidayParserPlan::yyerrcode_ = 256; 01372 const int HolidayParserPlan::yyntokens_ = 46; 01373 01374 const unsigned int HolidayParserPlan::yyuser_token_number_max_ = 287; 01375 const HolidayParserPlan::token_number_type HolidayParserPlan::yyundef_token_ = 2; 01376 01377 } // namespace KHolidays 01378 01379 #line 256 "holidayparserplan.ypp" 01380 01381 01382 /*** Private Yacc callbacks and helper functions ***/ 01383 01384 void KHolidays::HolidayParserPlan::error( const KHolidays::HolidayParserPlan::location_type &errorLocation, const std::string &errorMessage ) 01385 { 01386 driver.error( errorLocation, errorMessage.c_str() ); 01387 } 01388
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:38:39 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:38:39 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.