📄 getdate.c
字号:
case 24:#line 393 "getdate.y" { pc->time_zone = (yyvsp[(1) - (3)].intval) + time_zone_hhmm ((yyvsp[(2) - (3)].textintval), (yyvsp[(3) - (3)].intval)); } break; case 25:#line 395 "getdate.y" { pc->time_zone = (yyvsp[(1) - (1)].intval) + 60; } break; case 26:#line 397 "getdate.y" { pc->time_zone = (yyvsp[(1) - (2)].intval) + 60; } break; case 27:#line 402 "getdate.y" { pc->day_ordinal = 1; pc->day_number = (yyvsp[(1) - (1)].intval); } break; case 28:#line 407 "getdate.y" { pc->day_ordinal = 1; pc->day_number = (yyvsp[(1) - (2)].intval); } break; case 29:#line 412 "getdate.y" { pc->day_ordinal = (yyvsp[(1) - (2)].intval); pc->day_number = (yyvsp[(2) - (2)].intval); } break; case 30:#line 417 "getdate.y" { pc->day_ordinal = (yyvsp[(1) - (2)].textintval).value; pc->day_number = (yyvsp[(2) - (2)].intval); } break; case 31:#line 425 "getdate.y" { pc->month = (yyvsp[(1) - (3)].textintval).value; pc->day = (yyvsp[(3) - (3)].textintval).value; } break; case 32:#line 430 "getdate.y" { /* Interpret as YYYY/MM/DD if the first value has 4 or more digits, otherwise as MM/DD/YY. The goal in recognizing YYYY/MM/DD is solely to support legacy machine-generated dates like those in an RCS log listing. If you want portability, use the ISO 8601 format. */ if (4 <= (yyvsp[(1) - (5)].textintval).digits) { pc->year = (yyvsp[(1) - (5)].textintval); pc->month = (yyvsp[(3) - (5)].textintval).value; pc->day = (yyvsp[(5) - (5)].textintval).value; } else { pc->month = (yyvsp[(1) - (5)].textintval).value; pc->day = (yyvsp[(3) - (5)].textintval).value; pc->year = (yyvsp[(5) - (5)].textintval); } } break; case 33:#line 450 "getdate.y" { /* ISO 8601 format. YYYY-MM-DD. */ pc->year = (yyvsp[(1) - (3)].textintval); pc->month = -(yyvsp[(2) - (3)].textintval).value; pc->day = -(yyvsp[(3) - (3)].textintval).value; } break; case 34:#line 457 "getdate.y" { /* e.g. 17-JUN-1992. */ pc->day = (yyvsp[(1) - (3)].textintval).value; pc->month = (yyvsp[(2) - (3)].intval); pc->year.value = -(yyvsp[(3) - (3)].textintval).value; pc->year.digits = (yyvsp[(3) - (3)].textintval).digits; } break; case 35:#line 465 "getdate.y" { /* e.g. JUN-17-1992. */ pc->month = (yyvsp[(1) - (3)].intval); pc->day = -(yyvsp[(2) - (3)].textintval).value; pc->year.value = -(yyvsp[(3) - (3)].textintval).value; pc->year.digits = (yyvsp[(3) - (3)].textintval).digits; } break; case 36:#line 473 "getdate.y" { pc->month = (yyvsp[(1) - (2)].intval); pc->day = (yyvsp[(2) - (2)].textintval).value; } break; case 37:#line 478 "getdate.y" { pc->month = (yyvsp[(1) - (4)].intval); pc->day = (yyvsp[(2) - (4)].textintval).value; pc->year = (yyvsp[(4) - (4)].textintval); } break; case 38:#line 484 "getdate.y" { pc->day = (yyvsp[(1) - (2)].textintval).value; pc->month = (yyvsp[(2) - (2)].intval); } break; case 39:#line 489 "getdate.y" { pc->day = (yyvsp[(1) - (3)].textintval).value; pc->month = (yyvsp[(2) - (3)].intval); pc->year = (yyvsp[(3) - (3)].textintval); } break; case 40:#line 498 "getdate.y" { pc->rel.ns -= (yyvsp[(1) - (2)].rel).ns; pc->rel.seconds -= (yyvsp[(1) - (2)].rel).seconds; pc->rel.minutes -= (yyvsp[(1) - (2)].rel).minutes; pc->rel.hour -= (yyvsp[(1) - (2)].rel).hour; pc->rel.day -= (yyvsp[(1) - (2)].rel).day; pc->rel.month -= (yyvsp[(1) - (2)].rel).month; pc->rel.year -= (yyvsp[(1) - (2)].rel).year; } break; case 41:#line 508 "getdate.y" { pc->rel.ns += (yyvsp[(1) - (1)].rel).ns; pc->rel.seconds += (yyvsp[(1) - (1)].rel).seconds; pc->rel.minutes += (yyvsp[(1) - (1)].rel).minutes; pc->rel.hour += (yyvsp[(1) - (1)].rel).hour; pc->rel.day += (yyvsp[(1) - (1)].rel).day; pc->rel.month += (yyvsp[(1) - (1)].rel).month; pc->rel.year += (yyvsp[(1) - (1)].rel).year; } break; case 42:#line 521 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].intval); } break; case 43:#line 523 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].textintval).value; } break; case 44:#line 525 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = 1; } break; case 45:#line 527 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].intval); } break; case 46:#line 529 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].textintval).value; } break; case 47:#line 531 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = 1; } break; case 48:#line 533 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].intval) * (yyvsp[(2) - (2)].intval); } break; case 49:#line 535 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); } break; case 50:#line 537 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (1)].intval); } break; case 51:#line 539 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].intval); } break; case 52:#line 541 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].textintval).value; } break; case 53:#line 543 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = 1; } break; case 54:#line 545 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].intval); } break; case 55:#line 547 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].textintval).value; } break; case 56:#line 549 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = 1; } break; case 57:#line 551 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].intval); } break; case 58:#line 553 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].textintval).value; } break; case 59:#line 555 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].timespec).tv_sec; (yyval.rel).ns = (yyvsp[(1) - (2)].timespec).tv_nsec; } break; case 60:#line 557 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].timespec).tv_sec; (yyval.rel).ns = (yyvsp[(1) - (2)].timespec).tv_nsec; } break; case 61:#line 559 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = 1; } break; case 63:#line 565 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).year = (yyvsp[(1) - (2)].textintval).value; } break; case 64:#line 567 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).month = (yyvsp[(1) - (2)].textintval).value; } break; case 65:#line 569 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).day = (yyvsp[(1) - (2)].textintval).value * (yyvsp[(2) - (2)].intval); } break; case 66:#line 571 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).hour = (yyvsp[(1) - (2)].textintval).value; } break; case 67:#line 573 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).minutes = (yyvsp[(1) - (2)].textintval).value; } break; case 68:#line 575 "getdate.y" { (yyval.rel) = RELATIVE_TIME_0; (yyval.rel).seconds = (yyvsp[(1) - (2)].textintval).value; } break; case 72:#line 583 "getdate.y" { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; } break; case 74:#line 589 "getdate.y" { (yyval.timespec).tv_sec = (yyvsp[(1) - (1)].textintval).value; (yyval.timespec).tv_nsec = 0; } break; case 75:#line 594 "getdate.y" { digits_to_date_time (pc, (yyvsp[(1) - (1)].textintval)); } break; case 76:#line 599 "getdate.y" { /* Hybrid all-digit and relative offset, so that we accept e.g., "YYYYMMDD +N days" as well as "YYYYMMDD N days". */ digits_to_date_time (pc, (yyvsp[(1) - (2)].textintval)); pc->rel.ns += (yyvsp[(2) - (2)].rel).ns; pc->rel.seconds += (yyvsp[(2) - (2)].rel).seconds; pc->rel.minutes += (yyvsp[(2) - (2)].rel).minutes; pc->rel.hour += (yyvsp[(2) - (2)].rel).hour; pc->rel.day += (yyvsp[(2) - (2)].rel).day; pc->rel.month += (yyvsp[(2) - (2)].rel).month; pc->rel.year += (yyvsp[(2) - (2)].rel).year; pc->rels_seen = true; } break; case 77:#line 616 "getdate.y" { (yyval.intval) = -1; } break; case 78:#line 618 "getdate.y" { (yyval.intval) = (yyvsp[(2) - (2)].textintval).value; } break; case 79:#line 623 "getdate.y" { (yyval.intval) = MER24; } break; case 80:#line 625 "getdate.y" { (yyval.intval) = (yyvsp[(1) - (1)].intval); } break;/* Line 1267 of yacc.c. */#line 2185 "getdate.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate;/*------------------------------------.| yyerrlab -- here on detecting error |`------------------------------------*/yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs;#if ! YYERROR_VERBOSE yyerror (pc, YY_("syntax error"));#else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (pc, yymsg); } else { yyerror (pc, YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } }#endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval, pc); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1;/*---------------------------------------------------.| y
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -