modules/getdate.c

ソースコードを見る。

データ構造

struct  textint
struct  table
struct  parser_control
union  YYSTYPE
union  yyalloc

型定義

typedef signed char yysigned_char
typedef short yysigned_char

列挙型

enum  yytokentype {
  tAGO = 258, tDST = 259, tDAY = 260,
  tDAY_UNIT = 261, tDAYZONE = 262, tHOUR_UNIT = 263,
  tLOCAL_ZONE = 264, tMERIDIAN = 265, tMINUTE_UNIT = 266,
  tMONTH = 267, tMONTH_UNIT = 268, tSEC_UNIT = 269,
  tYEAR_UNIT = 270, tZONE = 271, tSNUMBER = 272,
  tUNUMBER = 273
}
enum  { MERam, MERpm, MER24 }

関数

static int yyerror ()
static int yylex ()
static void yy_stack_print (short *bottom, short *top) static void yy_stack_print(bottom
static YYSIZE_T yystrlen (const char *yystr) yystrlen(yystr) const char *yystr
int yyparse ()
int yyparse (void *YYPARSE_PARAM) int yyparse(YYPARSE_PARAM) void *YYPARSE_PARAM
tm * gmtime ()
tm * localtime ()
time_t mktime ()
static int to_hour (int hours, int meridian)
static int to_year (textint textyear)
static table const * lookup_zone (parser_control const *pc, char const *name)
static int tm_diff (struct tm const *a, struct tm const *b)
static table const * lookup_word (parser_control const *pc, char *word)
static int yylex (YYSTYPE *lvalp, parser_control *pc)
static int yyerror (char *s ATTRIBUTE_UNUSED)
time_t get_date (const char *p, const time_t *now)
int main (int ac, char **av)

変数

static const unsigned char yytranslate []
static const unsigned char yyprhs []
static const yysigned_char yyrhs []
static const unsigned short yyrline []
static const char *const yytname []
static const unsigned short yytoknum []
static const unsigned char yyr1 []
static const unsigned char yyr2 []
static const unsigned char yydefact []
static const yysigned_char yydefgoto []
static const yysigned_char yypact []
static const yysigned_char yypgoto []
static const unsigned char yytable []
static const unsigned char yycheck []
static const unsigned char yystos []
static void top short * bottom
short * top
const char * yysrc
int yytype
YYSTYPEyyvaluep
YYSTYPEyyvaluep
static table const meridian_table []
static table const dst_table []
static table const month_and_day_table []
static table const time_units_table []
static table const relative_time_table []
static table const time_zone_table []
static table const military_table []


型定義

typedef signed char yysigned_char

getdate.c384 行で定義されています。

typedef short yysigned_char

getdate.c386 行で定義されています。


列挙型

enum yytokentype

列挙型の値:
tAGO 
tDST 
tDAY 
tDAY_UNIT 
tDAYZONE 
tHOUR_UNIT 
tLOCAL_ZONE 
tMERIDIAN 
tMINUTE_UNIT 
tMONTH 
tMONTH_UNIT 
tSEC_UNIT 
tYEAR_UNIT 
tZONE 
tSNUMBER 
tUNUMBER 

getdate.c55 行で定義されています。

00055                     {
00056      tAGO = 258,
00057      tDST = 259,
00058      tDAY = 260,
00059      tDAY_UNIT = 261,
00060      tDAYZONE = 262,
00061      tHOUR_UNIT = 263,
00062      tLOCAL_ZONE = 264,
00063      tMERIDIAN = 265,
00064      tMINUTE_UNIT = 266,
00065      tMONTH = 267,
00066      tMONTH_UNIT = 268,
00067      tSEC_UNIT = 269,
00068      tYEAR_UNIT = 270,
00069      tZONE = 271,
00070      tSNUMBER = 272,
00071      tUNUMBER = 273
00072    };

anonymous enum

列挙型の値:
MERam 
MERpm 
MER24 

getdate.c201 行で定義されています。

00201 { MERam, MERpm, MER24 };


関数

static int yyerror (  )  [static]

参照元 yyparse().

static int yylex (  )  [static]

static void yy_stack_print ( short *  bottom,
short *  top 
) [static]

static YYSIZE_T yystrlen ( const char *  yystr  )  const [static]

参照元 yyparse().

int yyparse (  ) 

getdate.c965 行で定義されています。

参照先 textint::digitsYYSTYPE::intvalMER24YYSTYPE::textintvaltextint::valueyycheckyydefactyydefgotoyyerror()yypactyypgotoyyr1yyr2yystosyystrlen()yytableyytnameyyalloc::yyvs.

00972 {
00973   /* The lookahead symbol.  */
00974 int yychar;
00975 
00976 /* The semantic value of the lookahead symbol.  */
00977 YYSTYPE yylval;
00978 
00979 /* Number of syntax errors so far.  */
00980 int yynerrs;
00981 
00982   register int yystate;
00983   register int yyn;
00984   int yyresult;
00985   /* Number of tokens to shift before error messages enabled.  */
00986   int yyerrstatus;
00987   /* Lookahead token as an internal (translated) token number.  */
00988   int yytoken = 0;
00989 
00990   /* Three stacks and their tools:
00991      `yyss': related to states,
00992      `yyvs': related to semantic values,
00993      `yyls': related to locations.
00994 
00995      Refer to the stacks thru separate pointers, to allow yyoverflow
00996      to reallocate them elsewhere.  */
00997 
00998   /* The state stack.  */
00999   short yyssa[YYINITDEPTH];
01000   short *yyss = yyssa;
01001   register short *yyssp;
01002 
01003   /* The semantic value stack.  */
01004   YYSTYPE yyvsa[YYINITDEPTH];
01005   YYSTYPE *yyvs = yyvsa;
01006   register YYSTYPE *yyvsp;
01007 
01008 
01009 
01010 #define YYPOPSTACK   (yyvsp--, yyssp--)
01011 
01012   YYSIZE_T yystacksize = YYINITDEPTH;
01013 
01014   /* The variables used to return semantic value and location from the
01015      action routines.  */
01016   YYSTYPE yyval;
01017 
01018 
01019   /* When reducing, the number of symbols on the RHS of the reduced
01020      rule.  */
01021   int yylen;
01022 
01023   YYDPRINTF ((stderr, "Starting parse\n"));
01024 
01025   yystate = 0;
01026   yyerrstatus = 0;
01027   yynerrs = 0;
01028   yychar = YYEMPTY;             /* Cause a token to be read.  */
01029 
01030   /* Initialize stack pointers.
01031      Waste one element of value and location stack
01032      so that they stay on the same level as the state stack.
01033      The wasted elements are never initialized.  */
01034 
01035   yyssp = yyss;
01036   yyvsp = yyvs;
01037 
01038   goto yysetstate;
01039 
01040 /*------------------------------------------------------------.
01041 | yynewstate -- Push a new state, which is found in yystate.  |
01042 `------------------------------------------------------------*/
01043  yynewstate:
01044   /* In all cases, when you get here, the value and location stacks
01045      have just been pushed. so pushing a state here evens the stacks.
01046      */
01047   yyssp++;
01048 
01049  yysetstate:
01050   *yyssp = yystate;
01051 
01052   if (yyss + yystacksize - 1 <= yyssp)
01053     {
01054       /* Get the current used size of the three stacks, in elements.  */
01055       YYSIZE_T yysize = yyssp - yyss + 1;
01056 
01057 #ifdef yyoverflow
01058       {
01059         /* Give user a chance to reallocate the stack. Use copies of
01060            these so that the &'s don't force the real ones into
01061            memory.  */
01062         YYSTYPE *yyvs1 = yyvs;
01063         short *yyss1 = yyss;
01064 
01065 
01066         /* Each stack pointer address is followed by the size of the
01067            data in use in that stack, in bytes.  This used to be a
01068            conditional around just the two extra args, but that might
01069            be undefined if yyoverflow is a macro.  */
01070         yyoverflow ("parser stack overflow",
01071                     &yyss1, yysize * sizeof (*yyssp),
01072                     &yyvs1, yysize * sizeof (*yyvsp),
01073 
01074                     &yystacksize);
01075 
01076         yyss = yyss1;
01077         yyvs = yyvs1;
01078       }
01079 #else /* no yyoverflow */
01080 # ifndef YYSTACK_RELOCATE
01081       goto yyoverflowlab;
01082 # else
01083       /* Extend the stack our own way.  */
01084       if (YYMAXDEPTH <= yystacksize)
01085         goto yyoverflowlab;
01086       yystacksize *= 2;
01087       if (YYMAXDEPTH < yystacksize)
01088         yystacksize = YYMAXDEPTH;
01089 
01090       {
01091         short *yyss1 = yyss;
01092         union yyalloc *yyptr =
01093           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
01094         if (! yyptr)
01095           goto yyoverflowlab;
01096         YYSTACK_RELOCATE (yyss);
01097         YYSTACK_RELOCATE (yyvs);
01098 
01099 #  undef YYSTACK_RELOCATE
01100         if (yyss1 != yyssa)
01101           YYSTACK_FREE (yyss1);
01102       }
01103 # endif
01104 #endif /* no yyoverflow */
01105 
01106       yyssp = yyss + yysize - 1;
01107       yyvsp = yyvs + yysize - 1;
01108 
01109 
01110       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
01111                   (unsigned long int) yystacksize));
01112 
01113       if (yyss + yystacksize - 1 <= yyssp)
01114         YYABORT;
01115     }
01116 
01117   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
01118 
01119   goto yybackup;
01120 
01121 /*-----------.
01122 | yybackup.  |
01123 `-----------*/
01124 yybackup:
01125 
01126 /* Do appropriate processing given the current state.  */
01127 /* Read a lookahead token if we need one and don't already have one.  */
01128 /* yyresume: */
01129 
01130   /* First try to decide what to do without reference to lookahead token.  */
01131 
01132   yyn = yypact[yystate];
01133   if (yyn == YYPACT_NINF)
01134     goto yydefault;
01135 
01136   /* Not known => get a lookahead token if don't already have one.  */
01137 
01138   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
01139   if (yychar == YYEMPTY)
01140     {
01141       YYDPRINTF ((stderr, "Reading a token: "));
01142       yychar = YYLEX;
01143     }
01144 
01145   if (yychar <= YYEOF)
01146     {
01147       yychar = yytoken = YYEOF;
01148       YYDPRINTF ((stderr, "Now at end of input.\n"));
01149     }
01150   else
01151     {
01152       yytoken = YYTRANSLATE (yychar);
01153       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
01154     }
01155 
01156   /* If the proper action on seeing token YYTOKEN is to reduce or to
01157      detect an error, take that action.  */
01158   yyn += yytoken;
01159   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
01160     goto yydefault;
01161   yyn = yytable[yyn];
01162   if (yyn <= 0)
01163     {
01164       if (yyn == 0 || yyn == YYTABLE_NINF)
01165         goto yyerrlab;
01166       yyn = -yyn;
01167       goto yyreduce;
01168     }
01169 
01170   if (yyn == YYFINAL)
01171     YYACCEPT;
01172 
01173   /* Shift the lookahead token.  */
01174   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
01175 
01176   /* Discard the token being shifted unless it is eof.  */
01177   if (yychar != YYEOF)
01178     yychar = YYEMPTY;
01179 
01180   *++yyvsp = yylval;
01181 
01182 
01183   /* Count tokens shifted since error; after three, turn off error
01184      status.  */
01185   if (yyerrstatus)
01186     yyerrstatus--;
01187 
01188   yystate = yyn;
01189   goto yynewstate;
01190 
01191 
01192 /*-----------------------------------------------------------.
01193 | yydefault -- do the default action for the current state.  |
01194 `-----------------------------------------------------------*/
01195 yydefault:
01196   yyn = yydefact[yystate];
01197   if (yyn == 0)
01198     goto yyerrlab;
01199   goto yyreduce;
01200 
01201 
01202 /*-----------------------------.
01203 | yyreduce -- Do a reduction.  |
01204 `-----------------------------*/
01205 yyreduce:
01206   /* yyn is the number of a rule to reduce with.  */
01207   yylen = yyr2[yyn];
01208 
01209   /* If YYLEN is nonzero, implement the default value of the action:
01210      `$$ = $1'.
01211 
01212      Otherwise, the following line sets YYVAL to garbage.
01213      This behavior is undocumented and Bison
01214      users should not rely upon it.  Assigning to YYVAL
01215      unconditionally makes the parser a bit smaller, and it avoids a
01216      GCC warning that YYVAL may be used uninitialized.  */
01217   yyval = yyvsp[1-yylen];
01218 
01219 
01220   YY_REDUCE_PRINT (yyn);
01221   switch (yyn)
01222     {
01223         case 4:
01224 #line 195 "getdate.y"
01225     { PC.times_seen++; }
01226     break;
01227 
01228   case 5:
01229 #line 197 "getdate.y"
01230     { PC.local_zones_seen++; }
01231     break;
01232 
01233   case 6:
01234 #line 199 "getdate.y"
01235     { PC.zones_seen++; }
01236     break;
01237 
01238   case 7:
01239 #line 201 "getdate.y"
01240     { PC.dates_seen++; }
01241     break;
01242 
01243   case 8:
01244 #line 203 "getdate.y"
01245     { PC.days_seen++; }
01246     break;
01247 
01248   case 9:
01249 #line 205 "getdate.y"
01250     { PC.rels_seen++; }
01251     break;
01252 
01253   case 11:
01254 #line 211 "getdate.y"
01255     {
01256         PC.hour = yyvsp[-1].textintval.value;
01257         PC.minutes = 0;
01258         PC.seconds = 0;
01259         PC.meridian = yyvsp[0].intval;
01260       }
01261     break;
01262 
01263   case 12:
01264 #line 218 "getdate.y"
01265     {
01266         PC.hour = yyvsp[-3].textintval.value;
01267         PC.minutes = yyvsp[-1].textintval.value;
01268         PC.seconds = 0;
01269         PC.meridian = yyvsp[0].intval;
01270       }
01271     break;
01272 
01273   case 13:
01274 #line 225 "getdate.y"
01275     {
01276         PC.hour = yyvsp[-3].textintval.value;
01277         PC.minutes = yyvsp[-1].textintval.value;
01278         PC.meridian = MER24;
01279         PC.zones_seen++;
01280         PC.time_zone = yyvsp[0].textintval.value % 100 + (yyvsp[0].textintval.value / 100) * 60;
01281       }
01282     break;
01283 
01284   case 14:
01285 #line 233 "getdate.y"
01286     {
01287         PC.hour = yyvsp[-5].textintval.value;
01288         PC.minutes = yyvsp[-3].textintval.value;
01289         PC.seconds = yyvsp[-1].textintval.value;
01290         PC.meridian = yyvsp[0].intval;
01291       }
01292     break;
01293 
01294   case 15:
01295 #line 240 "getdate.y"
01296     {
01297         PC.hour = yyvsp[-5].textintval.value;
01298         PC.minutes = yyvsp[-3].textintval.value;
01299         PC.seconds = yyvsp[-1].textintval.value;
01300         PC.meridian = MER24;
01301         PC.zones_seen++;
01302         PC.time_zone = yyvsp[0].textintval.value % 100 + (yyvsp[0].textintval.value / 100) * 60;
01303       }
01304     break;
01305 
01306   case 16:
01307 #line 252 "getdate.y"
01308     { PC.local_isdst = yyvsp[0].intval; }
01309     break;
01310 
01311   case 17:
01312 #line 254 "getdate.y"
01313     { PC.local_isdst = yyvsp[-1].intval < 0 ? 1 : yyvsp[-1].intval + 1; }
01314     break;
01315 
01316   case 18:
01317 #line 259 "getdate.y"
01318     { PC.time_zone = yyvsp[0].intval; }
01319     break;
01320 
01321   case 19:
01322 #line 261 "getdate.y"
01323     { PC.time_zone = yyvsp[0].intval + 60; }
01324     break;
01325 
01326   case 20:
01327 #line 263 "getdate.y"
01328     { PC.time_zone = yyvsp[-1].intval + 60; }
01329     break;
01330 
01331   case 21:
01332 #line 268 "getdate.y"
01333     {
01334         PC.day_ordinal = 1;
01335         PC.day_number = yyvsp[0].intval;
01336       }
01337     break;
01338 
01339   case 22:
01340 #line 273 "getdate.y"
01341     {
01342         PC.day_ordinal = 1;
01343         PC.day_number = yyvsp[-1].intval;
01344       }
01345     break;
01346 
01347   case 23:
01348 #line 278 "getdate.y"
01349     {
01350         PC.day_ordinal = yyvsp[-1].textintval.value;
01351         PC.day_number = yyvsp[0].intval;
01352       }
01353     break;
01354 
01355   case 24:
01356 #line 286 "getdate.y"
01357     {
01358         PC.month = yyvsp[-2].textintval.value;
01359         PC.day = yyvsp[0].textintval.value;
01360       }
01361     break;
01362 
01363   case 25:
01364 #line 291 "getdate.y"
01365     {
01366         /* Interpret as YYYY/MM/DD if the first value has 4 or more digits,
01367            otherwise as MM/DD/YY.
01368            The goal in recognizing YYYY/MM/DD is solely to support legacy
01369            machine-generated dates like those in an RCS log listing.  If
01370            you want portability, use the ISO 8601 format.  */
01371         if (4 <= yyvsp[-4].textintval.digits)
01372           {
01373             PC.year = yyvsp[-4].textintval;
01374             PC.month = yyvsp[-2].textintval.value;
01375             PC.day = yyvsp[0].textintval.value;
01376           }
01377         else
01378           {
01379             PC.month = yyvsp[-4].textintval.value;
01380             PC.day = yyvsp[-2].textintval.value;
01381             PC.year = yyvsp[0].textintval;
01382           }
01383       }
01384     break;
01385 
01386   case 26:
01387 #line 311 "getdate.y"
01388     {
01389         /* ISO 8601 format.  YYYY-MM-DD.  */
01390         PC.year = yyvsp[-2].textintval;
01391         PC.month = -yyvsp[-1].textintval.value;
01392         PC.day = -yyvsp[0].textintval.value;
01393       }
01394     break;
01395 
01396   case 27:
01397 #line 318 "getdate.y"
01398     {
01399         /* e.g. 17-JUN-1992.  */
01400         PC.day = yyvsp[-2].textintval.value;
01401         PC.month = yyvsp[-1].intval;
01402         PC.year.value = -yyvsp[0].textintval.value;
01403         PC.year.digits = yyvsp[0].textintval.digits;
01404       }
01405     break;
01406 
01407   case 28:
01408 #line 326 "getdate.y"
01409     {
01410         PC.month = yyvsp[-1].intval;
01411         PC.day = yyvsp[0].textintval.value;
01412       }
01413     break;
01414 
01415   case 29:
01416 #line 331 "getdate.y"
01417     {
01418         PC.month = yyvsp[-3].intval;
01419         PC.day = yyvsp[-2].textintval.value;
01420         PC.year = yyvsp[0].textintval;
01421       }
01422     break;
01423 
01424   case 30:
01425 #line 337 "getdate.y"
01426     {
01427         PC.day = yyvsp[-1].textintval.value;
01428         PC.month = yyvsp[0].intval;
01429       }
01430     break;
01431 
01432   case 31:
01433 #line 342 "getdate.y"
01434     {
01435         PC.day = yyvsp[-2].textintval.value;
01436         PC.month = yyvsp[-1].intval;
01437         PC.year = yyvsp[0].textintval;
01438       }
01439     break;
01440 
01441   case 32:
01442 #line 351 "getdate.y"
01443     {
01444         PC.rel_seconds = -PC.rel_seconds;
01445         PC.rel_minutes = -PC.rel_minutes;
01446         PC.rel_hour = -PC.rel_hour;
01447         PC.rel_day = -PC.rel_day;
01448         PC.rel_month = -PC.rel_month;
01449         PC.rel_year = -PC.rel_year;
01450       }
01451     break;
01452 
01453   case 34:
01454 #line 364 "getdate.y"
01455     { PC.rel_year += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01456     break;
01457 
01458   case 35:
01459 #line 366 "getdate.y"
01460     { PC.rel_year += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01461     break;
01462 
01463   case 36:
01464 #line 368 "getdate.y"
01465     { PC.rel_year += yyvsp[0].intval; }
01466     break;
01467 
01468   case 37:
01469 #line 370 "getdate.y"
01470     { PC.rel_month += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01471     break;
01472 
01473   case 38:
01474 #line 372 "getdate.y"
01475     { PC.rel_month += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01476     break;
01477 
01478   case 39:
01479 #line 374 "getdate.y"
01480     { PC.rel_month += yyvsp[0].intval; }
01481     break;
01482 
01483   case 40:
01484 #line 376 "getdate.y"
01485     { PC.rel_day += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01486     break;
01487 
01488   case 41:
01489 #line 378 "getdate.y"
01490     { PC.rel_day += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01491     break;
01492 
01493   case 42:
01494 #line 380 "getdate.y"
01495     { PC.rel_day += yyvsp[0].intval; }
01496     break;
01497 
01498   case 43:
01499 #line 382 "getdate.y"
01500     { PC.rel_hour += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01501     break;
01502 
01503   case 44:
01504 #line 384 "getdate.y"
01505     { PC.rel_hour += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01506     break;
01507 
01508   case 45:
01509 #line 386 "getdate.y"
01510     { PC.rel_hour += yyvsp[0].intval; }
01511     break;
01512 
01513   case 46:
01514 #line 388 "getdate.y"
01515     { PC.rel_minutes += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01516     break;
01517 
01518   case 47:
01519 #line 390 "getdate.y"
01520     { PC.rel_minutes += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01521     break;
01522 
01523   case 48:
01524 #line 392 "getdate.y"
01525     { PC.rel_minutes += yyvsp[0].intval; }
01526     break;
01527 
01528   case 49:
01529 #line 394 "getdate.y"
01530     { PC.rel_seconds += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01531     break;
01532 
01533   case 50:
01534 #line 396 "getdate.y"
01535     { PC.rel_seconds += yyvsp[-1].textintval.value * yyvsp[0].intval; }
01536     break;
01537 
01538   case 51:
01539 #line 398 "getdate.y"
01540     { PC.rel_seconds += yyvsp[0].intval; }
01541     break;
01542 
01543   case 52:
01544 #line 403 "getdate.y"
01545     {
01546         if (PC.dates_seen
01547             && ! PC.rels_seen && (PC.times_seen || 2 < yyvsp[0].textintval.digits))
01548           PC.year = yyvsp[0].textintval;
01549         else
01550           {
01551             if (4 < yyvsp[0].textintval.digits)
01552               {
01553                 PC.dates_seen++;
01554                 PC.day = yyvsp[0].textintval.value % 100;
01555                 PC.month = (yyvsp[0].textintval.value / 100) % 100;
01556                 PC.year.value = yyvsp[0].textintval.value / 10000;
01557                 PC.year.digits = yyvsp[0].textintval.digits - 4;
01558               }
01559             else
01560               {
01561                 PC.times_seen++;
01562                 if (yyvsp[0].textintval.digits <= 2)
01563                   {
01564                     PC.hour = yyvsp[0].textintval.value;
01565                     PC.minutes = 0;
01566                   }
01567                 else
01568                   {
01569                     PC.hour = yyvsp[0].textintval.value / 100;
01570                     PC.minutes = yyvsp[0].textintval.value % 100;
01571                   }
01572                 PC.seconds = 0;
01573                 PC.meridian = MER24;
01574               }
01575           }
01576       }
01577     break;
01578 
01579   case 53:
01580 #line 439 "getdate.y"
01581     { yyval.intval = MER24; }
01582     break;
01583 
01584   case 54:
01585 #line 441 "getdate.y"
01586     { yyval.intval = yyvsp[0].intval; }
01587     break;
01588 
01589 
01590     }
01591 
01592 /* Line 999 of yacc.c.  */
01593 #line 1593 "getdate.c"
01594 
01595   yyvsp -= yylen;
01596   yyssp -= yylen;
01597 
01598 
01599   YY_STACK_PRINT (yyss, yyssp);
01600 
01601   *++yyvsp = yyval;
01602 
01603 
01604   /* Now `shift' the result of the reduction.  Determine what state
01605      that goes to, based on the state we popped back to and the rule
01606      number reduced by.  */
01607 
01608   yyn = yyr1[yyn];
01609 
01610   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
01611   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
01612     yystate = yytable[yystate];
01613   else
01614     yystate = yydefgoto[yyn - YYNTOKENS];
01615 
01616   goto yynewstate;
01617 
01618 
01619 /*------------------------------------.
01620 | yyerrlab -- here on detecting error |
01621 `------------------------------------*/
01622 yyerrlab:
01623   /* If not already recovering from an error, report this error.  */
01624   if (!yyerrstatus)
01625     {
01626       ++yynerrs;
01627 #if YYERROR_VERBOSE
01628       yyn = yypact[yystate];
01629 
01630       if (YYPACT_NINF < yyn && yyn < YYLAST)
01631         {
01632           YYSIZE_T yysize = 0;
01633           int yytype = YYTRANSLATE (yychar);
01634           char *yymsg;
01635           int yyx, yycount;
01636 
01637           yycount = 0;
01638           /* Start YYX at -YYN if negative to avoid negative indexes in
01639              YYCHECK.  */
01640           for (yyx = yyn < 0 ? -yyn : 0;
01641                yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
01642             if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01643               yysize += yystrlen (yytname[yyx]) + 15, yycount++;
01644           yysize += yystrlen ("syntax error, unexpected ") + 1;
01645           yysize += yystrlen (yytname[yytype]);
01646           yymsg = (char *) YYSTACK_ALLOC (yysize);
01647           if (yymsg != 0)
01648             {
01649               char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
01650               yyp = yystpcpy (yyp, yytname[yytype]);
01651 
01652               if (yycount < 5)
01653                 {
01654                   yycount = 0;
01655                   for (yyx = yyn < 0 ? -yyn : 0;
01656                        yyx < (int) (sizeof (yytname) / sizeof (char *));
01657                        yyx++)
01658                     if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
01659                       {
01660                         const char *yyq = ! yycount ? ", expecting " : " or ";
01661                         yyp = yystpcpy (yyp, yyq);
01662                         yyp = yystpcpy (yyp, yytname[yyx]);
01663                         yycount++;
01664                       }
01665                 }
01666               yyerror (yymsg);
01667               YYSTACK_FREE (yymsg);
01668             }
01669           else
01670             yyerror ("syntax error; also virtual memory exhausted");
01671         }
01672       else
01673 #endif /* YYERROR_VERBOSE */
01674         yyerror ("syntax error");
01675     }
01676 
01677 
01678 
01679   if (yyerrstatus == 3)
01680     {
01681       /* If just tried and failed to reuse lookahead token after an
01682          error, discard it.  */
01683 
01684       /* Return failure if at end of input.  */
01685       if (yychar == YYEOF)
01686         {
01687           /* Pop the error token.  */
01688           YYPOPSTACK;
01689           /* Pop the rest of the stack.  */
01690           while (yyss < yyssp)
01691             {
01692               YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
01693               yydestruct (yystos[*yyssp], yyvsp);
01694               YYPOPSTACK;
01695             }
01696           YYABORT;
01697         }
01698 
01699       YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
01700       yydestruct (yytoken, &yylval);
01701       yychar = YYEMPTY;
01702 
01703     }
01704 
01705   /* Else will try to reuse lookahead token after shifting the error
01706      token.  */
01707   goto yyerrlab1;
01708 
01709 
01710 /*----------------------------------------------------.
01711 | yyerrlab1 -- error raised explicitly by an action.  |
01712 `----------------------------------------------------*/
01713 yyerrlab1:
01714   yyerrstatus = 3;      /* Each real token shifted decrements this.  */
01715 
01716   for (;;)
01717     {
01718       yyn = yypact[yystate];
01719       if (yyn != YYPACT_NINF)
01720         {
01721           yyn += YYTERROR;
01722           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
01723             {
01724               yyn = yytable[yyn];
01725               if (0 < yyn)
01726                 break;
01727             }
01728         }
01729 
01730       /* Pop the current state because it cannot handle the error token.  */
01731       if (yyssp == yyss)
01732         YYABORT;
01733 
01734       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
01735       yydestruct (yystos[yystate], yyvsp);
01736       yyvsp--;
01737       yystate = *--yyssp;
01738 
01739       YY_STACK_PRINT (yyss, yyssp);
01740     }
01741 
01742   if (yyn == YYFINAL)
01743     YYACCEPT;
01744 
01745   YYDPRINTF ((stderr, "Shifting error token, "));
01746 
01747   *++yyvsp = yylval;
01748 
01749 
01750   yystate = yyn;
01751   goto yynewstate;
01752 
01753 
01754 /*-------------------------------------.
01755 | yyacceptlab -- YYACCEPT comes here.  |
01756 `-------------------------------------*/
01757 yyacceptlab:
01758   yyresult = 0;
01759   goto yyreturn;
01760 
01761 /*-----------------------------------.
01762 | yyabortlab -- YYABORT comes here.  |
01763 `-----------------------------------*/
01764 yyabortlab:
01765   yyresult = 1;
01766   goto yyreturn;
01767 
01768 #ifndef yyoverflow
01769 /*----------------------------------------------.
01770 | yyoverflowlab -- parser overflow comes here.  |
01771 `----------------------------------------------*/
01772 yyoverflowlab:
01773   yyerror ("parser stack overflow");
01774   yyresult = 2;
01775   /* Fall through.  */
01776 #endif
01777 
01778 yyreturn:
01779 #ifndef yyoverflow
01780   if (yyss != yyssa)
01781     YYSTACK_FREE (yyss);
01782 #endif
01783   return yyresult;
01784 }

int yyparse ( void *  YYPARSE_PARAM  ) 

struct tm* gmtime (  ) 

参照元 _reg_perfcount_init_data_block()_srv_net_remote_tod()construct_printer_info_0()fill_job_info_1()fill_job_info_2()get_time_zone()logon_hours_ok()make_dos_date()notify_system_time()print_time_access_check()spoolss_notify_submitted_time().

struct tm* localtime (  ) 

参照元 api_NetRemoteTOD()cmd_stat()current_timestring()dfs_auth()dump_name_record()EntryTime()get_date()get_time_zone()http_timestring()localtime_r()logon_hours_ok()LPRng_time()print_cache_entry()rep_mktime()systime()time_to_asc()timestring()wins_write_name_record().

time_t mktime (  ) 

参照元 EntryTime()LPRng_time().

static int to_hour ( int  hours,
int  meridian 
) [static]

getdate.c1983 行で定義されています。

参照先 MER24MERamMERpm.

01984 {
01985   switch (meridian)
01986     {
01987     case MER24:
01988       return 0 <= hours && hours < 24 ? hours : -1;
01989     case MERam:
01990       return 0 < hours && hours < 12 ? hours : hours == 12 ? 0 : -1;
01991     case MERpm:
01992       return 0 < hours && hours < 12 ? hours + 12 : hours == 12 ? 12 : -1;
01993     default:
01994       abort ();
01995     }
01996   /* NOTREACHED */
01997     return 0;
01998 }

static int to_year ( textint  textyear  )  [static]

getdate.c2001 行で定義されています。

参照先 textint::digitstextint::value.

02002 {
02003   int year = textyear.value;
02004 
02005   if (year < 0)
02006     year = -year;
02007 
02008   /* XPG4 suggests that years 00-68 map to 2000-2068, and
02009      years 69-99 map to 1969-1999.  */
02010   if (textyear.digits == 2)
02011     year += year < 69 ? 2000 : 1900;
02012 
02013   return year;
02014 }

static table const* lookup_zone ( parser_control const *  pc,
char const *  name 
) [static]

getdate.c2017 行で定義されています。

参照先 parser_control::local_time_zone_tabletime_zone_tabletp.

参照元 lookup_word().

02018 {
02019   table const *tp;
02020 
02021   /* Try local zone abbreviations first; they're more likely to be right.  */
02022   for (tp = pc->local_time_zone_table; tp->name; tp++)
02023     if (strcmp (name, tp->name) == 0)
02024       return tp;
02025 
02026   for (tp = time_zone_table; tp->name; tp++)
02027     if (strcmp (name, tp->name) == 0)
02028       return tp;
02029 
02030   return 0;
02031 }

static int tm_diff ( struct tm const *  a,
struct tm const *  b 
) [static]

getdate.c2039 行で定義されています。

02040 {
02041   /* Compute intervening leap days correctly even if year is negative.
02042      Take care to avoid int overflow in leap day calculations,
02043      but it's OK to assume that A and B are close to each other.  */
02044   int a4 = (a->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (a->tm_year & 3);
02045   int b4 = (b->tm_year >> 2) + (TM_YEAR_BASE >> 2) - ! (b->tm_year & 3);
02046   int a100 = a4 / 25 - (a4 % 25 < 0);
02047   int b100 = b4 / 25 - (b4 % 25 < 0);
02048   int a400 = a100 >> 2;
02049   int b400 = b100 >> 2;
02050   int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
02051   int years = a->tm_year - b->tm_year;
02052   int days = (365 * years + intervening_leap_days
02053               + (a->tm_yday - b->tm_yday));
02054   return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
02055                 + (a->tm_min - b->tm_min))
02056           + (a->tm_sec - b->tm_sec));
02057 }

static table const* lookup_word ( parser_control const *  pc,
char *  word 
) [static]

getdate.c2061 行で定義されています。

参照先 dst_tablelookup_zone()meridian_tablemilitary_tablemonth_and_day_tablenamerelative_time_tabletime_units_tabletp.

参照元 yylex().

02062 {
02063   char *p;
02064   char *q;
02065   size_t wordlen;
02066   table const *tp;
02067   int i;
02068   int abbrev;
02069 
02070   /* Make it uppercase.  */
02071   for (p = word; *p; p++)
02072     if (ISLOWER ((unsigned char) *p))
02073       *p = toupper ((unsigned char) *p);
02074 
02075   for (tp = meridian_table; tp->name; tp++)
02076     if (strcmp (word, tp->name) == 0)
02077       return tp;
02078 
02079   /* See if we have an abbreviation for a month. */
02080   wordlen = strlen (word);
02081   abbrev = wordlen == 3 || (wordlen == 4 && word[3] == '.');
02082 
02083   for (tp = month_and_day_table; tp->name; tp++)
02084     if ((abbrev ? strncmp (word, tp->name, 3) : strcmp (word, tp->name)) == 0)
02085       return tp;
02086 
02087   if ((tp = lookup_zone (pc, word)))
02088     return tp;
02089 
02090   if (strcmp (word, dst_table[0].name) == 0)
02091     return dst_table;
02092 
02093   for (tp = time_units_table; tp->name; tp++)
02094     if (strcmp (word, tp->name) == 0)
02095       return tp;
02096 
02097   /* Strip off any plural and try the units table again. */
02098   if (word[wordlen - 1] == 'S')
02099     {
02100       word[wordlen - 1] = '\0';
02101       for (tp = time_units_table; tp->name; tp++)
02102         if (strcmp (word, tp->name) == 0)
02103           return tp;
02104       word[wordlen - 1] = 'S';  /* For "this" in relative_time_table.  */
02105     }
02106 
02107   for (tp = relative_time_table; tp->name; tp++)
02108     if (strcmp (word, tp->name) == 0)
02109       return tp;
02110 
02111   /* Military time zones. */
02112   if (wordlen == 1)
02113     for (tp = military_table; tp->name; tp++)
02114       if (word[0] == tp->name[0])
02115         return tp;
02116 
02117   /* Drop out any periods and try the time zone table again. */
02118   for (i = 0, p = q = word; (*p = *q); q++)
02119     if (*q == '.')
02120       i = 1;
02121     else
02122       p++;
02123   if (i && (tp = lookup_zone (pc, word)))
02124     return tp;
02125 
02126   return 0;
02127 }

static int yylex ( YYSTYPE lvalp,
parser_control pc 
) [static]

getdate.c2130 行で定義されています。

参照先 ctextint::digitsparser_control::inputYYSTYPE::intvallookup_word()YYSTYPE::textintvaltptSNUMBERtUNUMBERtextint::value.

02131 {
02132   unsigned char c;
02133   int count;
02134 
02135   for (;;)
02136     {
02137       while (c = *pc->input, ISSPACE (c))
02138         pc->input++;
02139 
02140       if (ISDIGIT (c) || c == '-' || c == '+')
02141         {
02142           char const *p;
02143           int sign;
02144           int value;
02145           if (c == '-' || c == '+')
02146             {
02147               sign = c == '-' ? -1 : 1;
02148               c = *++pc->input;
02149               if (! ISDIGIT (c))
02150                 /* skip the '-' sign */
02151                 continue;
02152             }
02153           else
02154             sign = 0;
02155           p = pc->input;
02156           value = 0;
02157           do
02158             {
02159               value = 10 * value + c - '0';
02160               c = *++p;
02161             }
02162           while (ISDIGIT (c));
02163           lvalp->textintval.value = sign < 0 ? -value : value;
02164           lvalp->textintval.digits = p - pc->input;
02165           pc->input = p;
02166           return sign ? tSNUMBER : tUNUMBER;
02167         }
02168 
02169       if (ISALPHA (c))
02170         {
02171           char buff[20];
02172           char *p = buff;
02173           table const *tp;
02174 
02175           do
02176             {
02177               if (p < buff + sizeof buff - 1)
02178                 *p++ = c;
02179               c = *++pc->input;
02180             }
02181           while (ISALPHA (c) || c == '.');
02182 
02183           *p = '\0';
02184           tp = lookup_word (pc, buff);
02185           if (! tp)
02186             return '?';
02187           lvalp->intval = tp->value;
02188           return tp->type;
02189         }
02190 
02191       if (c != '(')
02192         return *pc->input++;
02193       count = 0;
02194       do
02195         {
02196           c = *pc->input++;
02197           if (c == '\0')
02198             return c;
02199           if (c == '(')
02200             count++;
02201           else if (c == ')')
02202             count--;
02203         }
02204       while (count > 0);
02205     }
02206 }

static int yyerror ( char *s  ATTRIBUTE_UNUSED  )  [static]

getdate.c2210 行で定義されています。

02211 {
02212   return 0;
02213 }

time_t get_date ( const char *  p,
const time_t *  now 
)

getdate.c2220 行で定義されています。

参照先 localtime()MER24tLOCAL_ZONE.

参照元 main()readonly_connect().

02221 {
02222   time_t Start = now ? *now : time (0);
02223   struct tm *tmp = localtime (&Start);
02224   struct tm tm;
02225   struct tm tm0;
02226   parser_control pc;
02227 
02228   if (! tmp)
02229     return -1;
02230 
02231   pc.input = p;
02232   pc.year.value = tmp->tm_year + TM_YEAR_BASE;
02233   pc.year.digits = 4;
02234   pc.month = tmp->tm_mon + 1;
02235   pc.day = tmp->tm_mday;
02236   pc.hour = tmp->tm_hour;
02237   pc.minutes = tmp->tm_min;
02238   pc.seconds = tmp->tm_sec;
02239   tm.tm_isdst = tmp->tm_isdst;
02240 
02241   pc.meridian = MER24;
02242   pc.rel_seconds = 0;
02243   pc.rel_minutes = 0;
02244   pc.rel_hour = 0;
02245   pc.rel_day = 0;
02246   pc.rel_month = 0;
02247   pc.rel_year = 0;
02248   pc.dates_seen = 0;
02249   pc.days_seen = 0;
02250   pc.rels_seen = 0;
02251   pc.times_seen = 0;
02252   pc.local_zones_seen = 0;
02253   pc.zones_seen = 0;
02254 
02255 #if HAVE_STRUCT_TM_TM_ZONE
02256   pc.local_time_zone_table[0].name = tmp->tm_zone;
02257   pc.local_time_zone_table[0].type = tLOCAL_ZONE;
02258   pc.local_time_zone_table[0].value = tmp->tm_isdst;
02259   pc.local_time_zone_table[1].name = 0;
02260 
02261   /* Probe the names used in the next three calendar quarters, looking
02262      for a tm_isdst different from the one we already have.  */
02263   {
02264     int quarter;
02265     for (quarter = 1; quarter <= 3; quarter++)
02266       {
02267         time_t probe = Start + quarter * (90 * 24 * 60 * 60);
02268         struct tm *probe_tm = localtime (&probe);
02269         if (probe_tm && probe_tm->tm_zone
02270             && probe_tm->tm_isdst != pc.local_time_zone_table[0].value)
02271           {
02272               {
02273                 pc.local_time_zone_table[1].name = probe_tm->tm_zone;
02274                 pc.local_time_zone_table[1].type = tLOCAL_ZONE;
02275                 pc.local_time_zone_table[1].value = probe_tm->tm_isdst;
02276                 pc.local_time_zone_table[2].name = 0;
02277               }
02278             break;
02279           }
02280       }
02281   }
02282 #else
02283 #if HAVE_TZNAME
02284   {
02285 # ifndef tzname
02286     extern char *tzname[];
02287 # endif
02288     int i;
02289     for (i = 0; i < 2; i++)
02290       {
02291         pc.local_time_zone_table[i].name = tzname[i];
02292         pc.local_time_zone_table[i].type = tLOCAL_ZONE;
02293         pc.local_time_zone_table[i].value = i;
02294       }
02295     pc.local_time_zone_table[i].name = 0;
02296   }
02297 #else
02298   pc.local_time_zone_table[0].name = 0;
02299 #endif
02300 #endif
02301 
02302   if (pc.local_time_zone_table[0].name && pc.local_time_zone_table[1].name
02303       && ! strcmp (pc.local_time_zone_table[0].name,
02304                    pc.local_time_zone_table[1].name))
02305     {
02306       /* This locale uses the same abbrevation for standard and
02307          daylight times.  So if we see that abbreviation, we don't
02308          know whether it's daylight time.  */
02309       pc.local_time_zone_table[0].value = -1;
02310       pc.local_time_zone_table[1].name = 0;
02311     }
02312 
02313   if (yyparse (&pc) != 0
02314       || 1 < pc.times_seen || 1 < pc.dates_seen || 1 < pc.days_seen
02315       || 1 < (pc.local_zones_seen + pc.zones_seen)
02316       || (pc.local_zones_seen && 1 < pc.local_isdst))
02317     return -1;
02318 
02319   tm.tm_year = to_year (pc.year) - TM_YEAR_BASE + pc.rel_year;
02320   tm.tm_mon = pc.month - 1 + pc.rel_month;
02321   tm.tm_mday = pc.day + pc.rel_day;
02322   if (pc.times_seen || (pc.rels_seen && ! pc.dates_seen && ! pc.days_seen))
02323     {
02324       tm.tm_hour = to_hour (pc.hour, pc.meridian);
02325       if (tm.tm_hour < 0)
02326         return -1;
02327       tm.tm_min = pc.minutes;
02328       tm.tm_sec = pc.seconds;
02329     }
02330   else
02331     {
02332       tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
02333     }
02334 
02335   /* Let mktime deduce tm_isdst if we have an absolute time stamp,
02336      or if the relative time stamp mentions days, months, or years.  */
02337   if (pc.dates_seen | pc.days_seen | pc.times_seen | pc.rel_day
02338       | pc.rel_month | pc.rel_year)
02339     tm.tm_isdst = -1;
02340 
02341   /* But if the input explicitly specifies local time with or without
02342      DST, give mktime that information.  */
02343   if (pc.local_zones_seen)
02344     tm.tm_isdst = pc.local_isdst;
02345 
02346   tm0 = tm;
02347 
02348   Start = mktime (&tm);
02349 
02350   if (Start == (time_t) -1)
02351     {
02352 
02353       /* Guard against falsely reporting errors near the time_t boundaries
02354          when parsing times in other time zones.  For example, if the min
02355          time_t value is 1970-01-01 00:00:00 UTC and we are 8 hours ahead
02356          of UTC, then the min localtime value is 1970-01-01 08:00:00; if
02357          we apply mktime to 1970-01-01 00:00:00 we will get an error, so
02358          we apply mktime to 1970-01-02 08:00:00 instead and adjust the time
02359          zone by 24 hours to compensate.  This algorithm assumes that
02360          there is no DST transition within a day of the time_t boundaries.  */
02361       if (pc.zones_seen)
02362         {
02363           tm = tm0;
02364           if (tm.tm_year <= EPOCH_YEAR - TM_YEAR_BASE)
02365             {
02366               tm.tm_mday++;
02367               pc.time_zone += 24 * 60;
02368             }
02369           else
02370             {
02371               tm.tm_mday--;
02372               pc.time_zone -= 24 * 60;
02373             }
02374           Start = mktime (&tm);
02375         }
02376 
02377       if (Start == (time_t) -1)
02378         return Start;
02379     }
02380 
02381   if (pc.days_seen && ! pc.dates_seen)
02382     {
02383       tm.tm_mday += ((pc.day_number - tm.tm_wday + 7) % 7
02384                      + 7 * (pc.day_ordinal - (0 < pc.day_ordinal)));
02385       tm.tm_isdst = -1;
02386       Start = mktime (&tm);
02387       if (Start == (time_t) -1)
02388         return Start;
02389     }
02390 
02391   if (pc.zones_seen)
02392     {
02393       int delta = pc.time_zone * 60;
02394 #ifdef HAVE_TM_GMTOFF
02395       delta -= tm.tm_gmtoff;
02396 #else
02397       struct tm *gmt = gmtime (&Start);
02398       if (! gmt)
02399         return -1;
02400       delta -= tm_diff (&tm, gmt);
02401 #endif
02402       if ((Start < Start - delta) != (delta < 0))
02403         return -1;      /* time_t overflow */
02404       Start -= delta;
02405     }
02406 
02407   /* Add relative hours, minutes, and seconds.  Ignore leap seconds;
02408      i.e. "+ 10 minutes" means 600 seconds, even if one of them is a
02409      leap second.  Typically this is not what the user wants, but it's
02410      too hard to do it the other way, because the time zone indicator
02411      must be applied before relative times, and if mktime is applied
02412      again the time zone will be lost.  */
02413   {
02414     time_t t0 = Start;
02415     long d1 = 60 * 60 * (long) pc.rel_hour;
02416     time_t t1 = t0 + d1;
02417     long d2 = 60 * (long) pc.rel_minutes;
02418     time_t t2 = t1 + d2;
02419     int d3 = pc.rel_seconds;
02420     time_t t3 = t2 + d3;
02421     if ((d1 / (60 * 60) ^ pc.rel_hour)
02422         | (d2 / 60 ^ pc.rel_minutes)
02423         | ((t0 + d1 < t0) ^ (d1 < 0))
02424         | ((t1 + d2 < t1) ^ (d2 < 0))
02425         | ((t2 + d3 < t2) ^ (d3 < 0)))
02426       return -1;
02427     Start = t3;
02428   }
02429 
02430   return Start;
02431 }

int main ( int  ac,
char **  av 
)

getdate.c2438 行で定義されています。

参照先 get_date()printf().

02439 {
02440   char buff[BUFSIZ];
02441   time_t d;
02442 
02443   printf ("Enter date, or blank line to exit.\n\t> ");
02444   fflush (stdout);
02445 
02446   buff[BUFSIZ - 1] = 0;
02447   while (fgets (buff, BUFSIZ - 1, stdin) && buff[0])
02448     {
02449       d = get_date (buff, 0);
02450       if (d == (time_t) -1)
02451         printf ("Bad format - couldn't convert.\n");
02452       else
02453         printf ("%s", ctime (&d));
02454       printf ("\t> ");
02455       fflush (stdout);
02456     }
02457   return 0;
02458 }


変数

const unsigned char yytranslate[] [static]

getdate.c411 行で定義されています。

const unsigned char yyprhs[] [static]

初期値:

{
       0,     0,     3,     4,     7,     9,    11,    13,    15,    17,
      19,    21,    24,    29,    34,    41,    48,    50,    53,    55,
      57,    60,    62,    65,    68,    72,    78,    82,    86,    89,
      94,    97,   101,   104,   106,   109,   112,   114,   117,   120,
     122,   125,   128,   130,   133,   136,   138,   141,   144,   146,
     149,   152,   154,   156,   157
}

getdate.c446 行で定義されています。

const yysigned_char yyrhs[] [static]

初期値:

{
      23,     0,    -1,    -1,    23,    24,    -1,    25,    -1,    26,
      -1,    27,    -1,    29,    -1,    28,    -1,    30,    -1,    32,
      -1,    18,    10,    -1,    18,    19,    18,    33,    -1,    18,
      19,    18,    17,    -1,    18,    19,    18,    19,    18,    33,
      -1,    18,    19,    18,    19,    18,    17,    -1,     9,    -1,
       9,     4,    -1,    16,    -1,     7,    -1,    16,     4,    -1,
       5,    -1,     5,    20,    -1,    18,     5,    -1,    18,    21,
      18,    -1,    18,    21,    18,    21,    18,    -1,    18,    17,
      17,    -1,    18,    12,    17,    -1,    12,    18,    -1,    12,
      18,    20,    18,    -1,    18,    12,    -1,    18,    12,    18,
      -1,    31,     3,    -1,    31,    -1,    18,    15,    -1,    17,
      15,    -1,    15,    -1,    18,    13,    -1,    17,    13,    -1,
      13,    -1,    18,     6,    -1,    17,     6,    -1,     6,    -1,
      18,     8,    -1,    17,     8,    -1,     8,    -1,    18,    11,
      -1,    17,    11,    -1,    11,    -1,    18,    14,    -1,    17,
      14,    -1,    14,    -1,    18,    -1,    -1,    10,    -1
}

getdate.c457 行で定義されています。

const unsigned short yyrline[] [static]

初期値:

{
       0,   188,   188,   190,   194,   196,   198,   200,   202,   204,
     206,   210,   217,   224,   232,   239,   251,   253,   258,   260,
     262,   267,   272,   277,   285,   290,   310,   317,   325,   330,
     336,   341,   350,   359,   363,   365,   367,   369,   371,   373,
     375,   377,   379,   381,   383,   385,   387,   389,   391,   393,
     395,   397,   402,   439,   440
}

getdate.c478 行で定義されています。

const char* const yytname[] [static]

初期値:

{
  "$end", "error", "$undefined", "tAGO", "tDST", "tDAY", "tDAY_UNIT", 
  "tDAYZONE", "tHOUR_UNIT", "tLOCAL_ZONE", "tMERIDIAN", "tMINUTE_UNIT", 
  "tMONTH", "tMONTH_UNIT", "tSEC_UNIT", "tYEAR_UNIT", "tZONE", "tSNUMBER", 
  "tUNUMBER", "':'", "','", "'/'", "$accept", "spec", "item", "time", 
  "local_zone", "zone", "day", "date", "rel", "relunit", "number", 
  "o_merid", 0
}

getdate.c492 行で定義されています。

参照元 yyparse().

const unsigned short yytoknum[] [static]

初期値:

{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,    58,
      44,    47
}

getdate.c506 行で定義されています。

const unsigned char yyr1[] [static]

初期値:

{
       0,    22,    23,    23,    24,    24,    24,    24,    24,    24,
      24,    25,    25,    25,    25,    25,    26,    26,    27,    27,
      27,    28,    28,    28,    29,    29,    29,    29,    29,    29,
      29,    29,    30,    30,    31,    31,    31,    31,    31,    31,
      31,    31,    31,    31,    31,    31,    31,    31,    31,    31,
      31,    31,    32,    33,    33
}

getdate.c515 行で定義されています。

参照元 yyparse().

const unsigned char yyr2[] [static]

初期値:

{
       0,     2,     0,     2,     1,     1,     1,     1,     1,     1,
       1,     2,     4,     4,     6,     6,     1,     2,     1,     1,
       2,     1,     2,     2,     3,     5,     3,     3,     2,     4,
       2,     3,     2,     1,     2,     2,     1,     2,     2,     1,
       2,     2,     1,     2,     2,     1,     2,     2,     1,     2,
       2,     1,     1,     0,     1
}

getdate.c526 行で定義されています。

参照元 yyparse().

const unsigned char yydefact[] [static]

初期値:

{
       2,     0,     1,    21,    42,    19,    45,    16,    48,     0,
      39,    51,    36,    18,     0,    52,     3,     4,     5,     6,
       8,     7,     9,    33,    10,    22,    17,    28,    20,    41,
      44,    47,    38,    50,    35,    23,    40,    43,    11,    46,
      30,    37,    49,    34,     0,     0,     0,    32,     0,    27,
      31,    26,    53,    24,    29,    54,    13,     0,    12,     0,
      53,    25,    15,    14
}

getdate.c539 行で定義されています。

参照元 yyparse().

const yysigned_char yydefgoto[] [static]

初期値:

{
      -1,     1,    16,    17,    18,    19,    20,    21,    22,    23,
      24,    58
}

getdate.c551 行で定義されています。

参照元 yyparse().

const yysigned_char yypact[] [static]

初期値:

{
     -17,     0,   -17,     1,   -17,   -17,   -17,    19,   -17,   -14,
     -17,   -17,   -17,    32,    26,    14,   -17,   -17,   -17,   -17,
     -17,   -17,   -17,    27,   -17,   -17,   -17,    22,   -17,   -17,
     -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17,
     -16,   -17,   -17,   -17,    29,    25,    30,   -17,    31,   -17,
     -17,   -17,    28,    23,   -17,   -17,   -17,    33,   -17,    34,
      -7,   -17,   -17,   -17
}

getdate.c560 行で定義されています。

参照元 yyparse().

const yysigned_char yypgoto[] [static]

初期値:

{
     -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17,   -17,
     -17,   -10
}

getdate.c572 行で定義されています。

参照元 yyparse().

const unsigned char yytable[] [static]

初期値:

{
       2,    49,    50,    55,    27,     3,     4,     5,     6,     7,
      62,     8,     9,    10,    11,    12,    13,    14,    15,    35,
      36,    25,    37,    26,    38,    39,    40,    41,    42,    43,
      47,    44,    29,    45,    30,    46,    28,    31,    55,    32,
      33,    34,    48,    52,    59,    56,    51,    57,    53,    54,
      63,    60,    61
}

getdate.c583 行で定義されています。

参照元 yyparse().

const unsigned char yycheck[] [static]

初期値:

{
       0,    17,    18,    10,    18,     5,     6,     7,     8,     9,
      17,    11,    12,    13,    14,    15,    16,    17,    18,     5,
       6,    20,     8,     4,    10,    11,    12,    13,    14,    15,
       3,    17,     6,    19,     8,    21,     4,    11,    10,    13,
      14,    15,    20,    18,    21,    17,    17,    19,    18,    18,
      60,    18,    18
}

getdate.c593 行で定義されています。

参照元 yyparse().

const unsigned char yystos[] [static]

初期値:

{
       0,    23,     0,     5,     6,     7,     8,     9,    11,    12,
      13,    14,    15,    16,    17,    18,    24,    25,    26,    27,
      28,    29,    30,    31,    32,    20,     4,    18,     4,     6,
       8,    11,    13,    14,    15,     5,     6,     8,    10,    11,
      12,    13,    14,    15,    17,    19,    21,     3,    20,    17,
      18,    17,    18,    18,    18,    10,    17,    19,    33,    21,
      18,    18,    17,    33
}

getdate.c605 行で定義されています。

参照元 yyparse().

void top short* bottom

getdate.c731 行で定義されています。

参照元 write_ntforms().

short* top

getdate.c732 行で定義されています。

参照元 tdb_dump_chain()test_free_parent_deny_child()test_lifeless()test_loop()test_talloc_ptrtype()write_ntforms().

const char* yysrc

getdate.c847 行で定義されています。

int yytype

getdate.c877 行で定義されています。

YYSTYPE* yyvaluep

getdate.c879 行で定義されています。

YYSTYPE* yyvaluep

getdate.c914 行で定義されています。

table const meridian_table[] [static]

初期値:

{
  { "AM",   tMERIDIAN, MERam },
  { "A.M.", tMERIDIAN, MERam },
  { "PM",   tMERIDIAN, MERpm },
  { "P.M.", tMERIDIAN, MERpm },
  { 0, 0, 0 }
}

getdate.c1805 行で定義されています。

参照元 lookup_word().

table const dst_table[] [static]

初期値:

{
  { "DST", tDST, 0 }
}

getdate.c1814 行で定義されています。

参照元 lookup_word().

table const month_and_day_table[] [static]

初期値:

{
  { "JANUARY",  tMONTH,  1 },
  { "FEBRUARY", tMONTH,  2 },
  { "MARCH",    tMONTH,  3 },
  { "APRIL",    tMONTH,  4 },
  { "MAY",      tMONTH,  5 },
  { "JUNE",     tMONTH,  6 },
  { "JULY",     tMONTH,  7 },
  { "AUGUST",   tMONTH,  8 },
  { "SEPTEMBER",tMONTH,  9 },
  { "SEPT",     tMONTH,  9 },
  { "OCTOBER",  tMONTH, 10 },
  { "NOVEMBER", tMONTH, 11 },
  { "DECEMBER", tMONTH, 12 },
  { "SUNDAY",   tDAY,    0 },
  { "MONDAY",   tDAY,    1 },
  { "TUESDAY",  tDAY,    2 },
  { "TUES",     tDAY,    2 },
  { "WEDNESDAY",tDAY,    3 },
  { "WEDNES",   tDAY,    3 },
  { "THURSDAY", tDAY,    4 },
  { "THUR",     tDAY,    4 },
  { "THURS",    tDAY,    4 },
  { "FRIDAY",   tDAY,    5 },
  { "SATURDAY", tDAY,    6 },
  { 0, 0, 0 }
}

getdate.c1819 行で定義されています。

参照元 lookup_word().

table const time_units_table[] [static]

初期値:

{
  { "YEAR",     tYEAR_UNIT,      1 },
  { "MONTH",    tMONTH_UNIT,     1 },
  { "FORTNIGHT",tDAY_UNIT,      14 },
  { "WEEK",     tDAY_UNIT,       7 },
  { "DAY",      tDAY_UNIT,       1 },
  { "HOUR",     tHOUR_UNIT,      1 },
  { "MINUTE",   tMINUTE_UNIT,    1 },
  { "MIN",      tMINUTE_UNIT,    1 },
  { "SECOND",   tSEC_UNIT,       1 },
  { "SEC",      tSEC_UNIT,       1 },
  { 0, 0, 0 }
}

getdate.c1848 行で定義されています。

参照元 lookup_word().

table const relative_time_table[] [static]

初期値:

{
  { "TOMORROW", tMINUTE_UNIT,   24 * 60 },
  { "YESTERDAY",tMINUTE_UNIT,   - (24 * 60) },
  { "TODAY",    tMINUTE_UNIT,    0 },
  { "NOW",      tMINUTE_UNIT,    0 },
  { "LAST",     tUNUMBER,       -1 },
  { "THIS",     tUNUMBER,        0 },
  { "NEXT",     tUNUMBER,        1 },
  { "FIRST",    tUNUMBER,        1 },

  { "THIRD",    tUNUMBER,        3 },
  { "FOURTH",   tUNUMBER,        4 },
  { "FIFTH",    tUNUMBER,        5 },
  { "SIXTH",    tUNUMBER,        6 },
  { "SEVENTH",  tUNUMBER,        7 },
  { "EIGHTH",   tUNUMBER,        8 },
  { "NINTH",    tUNUMBER,        9 },
  { "TENTH",    tUNUMBER,       10 },
  { "ELEVENTH", tUNUMBER,       11 },
  { "TWELFTH",  tUNUMBER,       12 },
  { "AGO",      tAGO,            1 },
  { 0, 0, 0 }
}

getdate.c1864 行で定義されています。

参照元 lookup_word().

table const time_zone_table[] [static]

getdate.c1894 行で定義されています。

参照元 lookup_zone().

table const military_table[] [static]

初期値:

{
  { "A", tZONE, -HOUR ( 1) },
  { "B", tZONE, -HOUR ( 2) },
  { "C", tZONE, -HOUR ( 3) },
  { "D", tZONE, -HOUR ( 4) },
  { "E", tZONE, -HOUR ( 5) },
  { "F", tZONE, -HOUR ( 6) },
  { "G", tZONE, -HOUR ( 7) },
  { "H", tZONE, -HOUR ( 8) },
  { "I", tZONE, -HOUR ( 9) },
  { "K", tZONE, -HOUR (10) },
  { "L", tZONE, -HOUR (11) },
  { "M", tZONE, -HOUR (12) },
  { "N", tZONE,  HOUR ( 1) },
  { "O", tZONE,  HOUR ( 2) },
  { "P", tZONE,  HOUR ( 3) },
  { "Q", tZONE,  HOUR ( 4) },
  { "R", tZONE,  HOUR ( 5) },
  { "S", tZONE,  HOUR ( 6) },
  { "T", tZONE,  HOUR ( 7) },
  { "U", tZONE,  HOUR ( 8) },
  { "V", tZONE,  HOUR ( 9) },
  { "W", tZONE,  HOUR (10) },
  { "X", tZONE,  HOUR (11) },
  { "Y", tZONE,  HOUR (12) },
  { "Z", tZONE,  HOUR ( 0) },
  { 0, 0, 0 }
}

getdate.c1950 行で定義されています。

参照元 lookup_word().


Sambaに対してSat Aug 29 21:23:50 2009に生成されました。  doxygen 1.4.7