X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fdtimep.lex;h=c35c9beffd36cfcbca1d94697c1e4d420330d905;hb=b47dac6540ed952b95dbdce78d2a5f48ff0db86b;hp=0a65672f3844bef0f2ab30344a0a578b31f8ed7d;hpb=62f8542a68c21c0ec009e9275cbe54f0c921f2ea;p=mmh diff --git a/sbr/dtimep.lex b/sbr/dtimep.lex index 0a65672..c35c9be 100644 --- a/sbr/dtimep.lex +++ b/sbr/dtimep.lex @@ -1,7 +1,12 @@ -%e 2000 -%p 5000 -%n 1000 -%a 4000 +/* dtimep.lex exceeds the default table capacities for some old versions + * of lex (and the minimum defaults as specified by POSIX). The following + * choices meet or exceed the lex defaults for older SunOS4.x, Solaris, + * HPUX, and AIX. + */ +%e4000 +%p7000 +%n2500 +%a5000 %{ #include #include @@ -32,9 +37,9 @@ if(!(tw.tw_flags & TW_SUCC)) { \ return (struct tws *)NULL; \ } \ - if(tw.tw_year < 1960) \ + if(tw.tw_year < 1970) \ tw.tw_year += 1900; \ - if(tw.tw_year < 1960) \ + if(tw.tw_year < 1970) \ tw.tw_year += 100; \ return(&tw) @@ -222,6 +227,7 @@ w ([ \t]*) W ([ \t]+) D ([0-9]?[0-9]) d [0-9] +nl [ \t\n()] %% %{ @@ -230,7 +236,7 @@ d [0-9] YY_BUFFER_STATE lexhandle; - register char *cp; + register unsigned char *cp; static struct tws tw; memset(&tw,0,sizeof(struct tws)); @@ -358,7 +364,7 @@ d [0-9] #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST zonehack (&tw); #endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ - // yyterminate(); + yyterminate(); } "-"{D}{d}{d} { INIT(); @@ -367,28 +373,28 @@ d [0-9] #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST zonehack (&tw); #endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */ - // yyterminate(); + yyterminate(); } -"-"?("ut"|"UT") INIT(); SETZONE(0); -"-"?("gmt"|"GMT") INIT(); SETZONE(0); -"-"?("jst"|"JST") INIT(); SETZONE(200); -"-"?("jdt"|"JDT") INIT(); SETDST(); SETZONE(2); -"-"?("est"|"EST") INIT(); SETZONE(-500); -"-"?("edt"|"EDT") INIT(); SETDST(); SETZONE(-500); -"-"?("cst"|"CST") INIT(); SETZONE(-600); -"-"?("cdt"|"CDT") INIT(); SETDST(); SETZONE(-600); -"-"?("mst"|"MST") INIT(); SETZONE(-700); -"-"?("mdt"|"MDT") INIT(); SETDST(); SETZONE(-700); -"-"?("pst"|"PST") INIT(); SETZONE(-800); -"-"?("pdt"|"PDT") INIT(); SETDST(); SETZONE(-800); -"-"?("nst"|"NST") INIT(); SETZONE(-330); -"-"?("ast"|"AST") INIT(); SETZONE(-400); -"-"?("adt"|"ADT") INIT(); SETDST(); SETZONE(-400); -"-"?("yst"|"YST") INIT(); SETZONE(-900); -"-"?("ydt"|"YDT") INIT(); SETDST(); SETZONE(-900); -"-"?("hst"|"HST") INIT(); SETZONE(-1000); -"-"?("hdt"|"HDT") INIT(); SETDST(); SETZONE(-1000); -"-"?("bst"|"BST") INIT(); SETDST(); SETZONE(-100); -"-"?([a-z]{3}|[A-Z]{3}) ; +{nl}("ut"|"UT") INIT(); SETZONE(0); yyterminate(); +{nl}("gmt"|"GMT") INIT(); SETZONE(0); yyterminate(); +{nl}("est"|"EST") INIT(); SETZONE(-500); yyterminate(); +{nl}("edt"|"EDT") { INIT(); SETDST(); SETZONE(-500); + yyterminate(); } +{nl}("cst"|"CST") INIT(); SETZONE(-600); yyterminate(); +{nl}("cdt"|"CDT") { INIT(); SETDST(); SETZONE(-600); + yyterminate(); } +{nl}("mst"|"MST") INIT(); SETZONE(-700); yyterminate(); +{nl}("mdt"|"MDT") { INIT(); SETDST(); SETZONE(-700); + yyterminate(); } +{nl}("pst"|"PST") INIT(); SETZONE(-800); yyterminate(); +{nl}("pdt"|"PDT") { INIT(); SETDST(); SETZONE(-800); + yyterminate(); } +{nl}("nst"|"NST") INIT(); SETZONE(-330); yyterminate(); +{nl}("ast"|"AST") INIT(); SETZONE(-400); yyterminate(); +{nl}("adt"|"ADT") { INIT(); SETDST(); SETZONE(-400); + yyterminate(); } +{nl}("hst"|"HST") INIT(); SETZONE(-1000); yyterminate(); +{nl}("hdt"|"HDT") { INIT(); SETDST(); SETZONE(-1000); + yyterminate(); } .|\n