Skip to content
Browse files

Introduce a simpler parser for the RFC3339 ISO8601 profile to be used.

  • Loading branch information...
1 parent cfe191c commit bd18060557a8947214241283712b43f6c381076a @jlouis committed Oct 20, 2010
Showing with 38 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +1 −1 ebin/webstuff.app
  3. +36 −0 src/inet_time_parser_simple.yrl
  4. 0 {src → src_stash}/inet_time_parser.yrl
View
1 .gitignore
@@ -2,3 +2,4 @@
deps
/src/inet_time_scanner.erl
/src/inet_time_parser.erl
+/src/inet_time_parser_simple.erl
View
2 ebin/webstuff.app
@@ -9,5 +9,5 @@
{modules,
[odata,odata_app,odata_sup,
atom,
- inet_time_scanner, inet_time_parser, inet_time,
+ inet_time_scanner, inet_time_parser_simple, inet_time,
uri,iri]}]}.
View
36 src/inet_time_parser_simple.yrl
@@ -0,0 +1,36 @@
+Nonterminals date_time full_time full_date partial_time time_offset
+ time_secfrac time_second time_minute time_hour
+ date_mday date_month date_fullyear time_numoffset
+
+ dir.
+
+Terminals integer 'T' 'Z' '+' '-' '.' ':'.
+
+Rootsymbol date_time.
+
+date_fullyear -> integer : $1.
+date_month -> integer : $1.
+date_mday -> integer : $1.
+
+time_hour -> integer : $1.
+time_minute -> integer : $1.
+time_second -> integer : $1.
+
+time_secfrac -> '$empty' : 0.
+time_secfrac -> '.' integer : $2.
+
+time_numoffset -> dir time_hour ':' time_minute : {$1, $2, $4}.
+
+dir -> '+' : '+'.
+dir -> '-' : '-'.
+
+time_offset -> 'Z' : 'Z'.
+time_offset -> time_numoffset : $1.
+
+partial_time -> time_hour ':' time_minute ':' time_second time_secfrac
+ : {$1, $3, $5, $6}.
+
+full_date -> date_fullyear '-' date_month '-' date_mday : {$1, $3, $5}.
+full_time -> partial_time time_offset : {$1, $2}.
+
+date_time -> full_date 'T' full_time : {$1, $3}.
View
0 src/inet_time_parser.yrl → src_stash/inet_time_parser.yrl
File renamed without changes.

0 comments on commit bd18060

Please sign in to comment.
Something went wrong with that request. Please try again.