Parse a time with fractional seconds
[libacl.git] / src / dateyacc.y
index 1a7555f..b851aa8 100644 (file)
@@ -71,6 +71,7 @@ int yylex();
 %token MONTH_NAME
 %token NUM9 NUM23 NUM59 NUM99 NUM2359 NUM9999 NUM235959
 %token NUM991231 NUM99991231                           /* ajs */
+%token  NUM999999
 %token AMPM
 %token STD_ZONE DST_ZONE DST_SUFFIX
 
@@ -78,6 +79,7 @@ int yylex();
 %type  <IntVal>        MONTH_NAME
 %type  <IntVal>        NUM9 NUM23 NUM59 NUM99 NUM2359 NUM9999 NUM235959
 %type  <IntVal>        NUM991231 NUM99991231           /* ajs */
+%type  <IntVal>        NUM999999
 %type  <IntVal>        AMPM
 %type  <IntVal>        STD_ZONE DST_ZONE
 %type  <IntVal>        num59 num zone.offset
@@ -95,6 +97,18 @@ num:
   | num59
   ;
 
+anynumber:
+    NUM9
+  | NUM23
+  | NUM59
+  | NUM99
+  | NUM2359
+  | NUM9999
+  | NUM235959
+  | NUM991231
+  | NUM999999
+  ;
+
 goal:
     date
   | date dayname
@@ -296,6 +310,11 @@ hour.alone:
          yyans.minute = $3;
          yyans.second = $5;
        }
+  | NUM23 ':' num59 ':' num59 '.' anynumber
+       { yyans.hour   = $1;
+         yyans.minute = $3;
+         yyans.second = $5;
+       }
   | NUM23 '.' num59 '.' num59
        { yyans.hour   = $1;
          yyans.minute = $3;