Permalink
Browse files

First shot at the parser.

  • Loading branch information...
1 parent 62db693 commit 784dc60f49f0e3ad663fb6f1ec9163bc725e027b @jlouis committed Oct 19, 2010
Showing with 20 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 ebin/webstuff.app
  3. +12 −0 src/inet_time_parser.yrl
  4. +6 −1 src/inet_time_scanner.xrl
View
@@ -1,3 +1,4 @@
*.beam
deps
/src/inet_time_scanner.erl
+/src/inet_time_parser.erl
View
@@ -9,5 +9,5 @@
{modules,
[odata,odata_app,odata_sup,
atom,
- inet_time_scanner, inet_time,
+ inet_time_scanner, inet_time_parser, inet_time,
uri,iri]}]}.
View
@@ -0,0 +1,12 @@
+Nonterminals iso_date_time iso_date iso_time.
+
+Terminals integer comma dot plus minus mminus mmminus colon z t h m s.
+
+Rootsymbol iso_date_time.
+
+iso_date -> integer : {date, $1}.
+
+iso_time -> integer : {time, $1}.
+
+iso_date_time -> iso_date t iso_time.
+
@@ -16,7 +16,12 @@ DIGIT+ :
(--) : {token, mminus}.
(---) : {token, mmminus}.
(:) : {token, colon}.
-ALPHA : {token, {alpha, TokenLine, TokenChars}}.
+ALPHA : {token, case TokenChars of
+ $Z -> z;
+ $T -> t;
+ $H -> h;
+ $M -> m;
+ $S -> s end}.
Erlang code.

0 comments on commit 784dc60

Please sign in to comment.