summaryrefslogtreecommitdiff
path: root/src/n3_parser.y
diff options
context:
space:
mode:
authorDave Beckett <dave@dajobe.org>2006-01-02 07:36:35 +0000
committerDave Beckett <dave@dajobe.org>2006-01-02 07:36:35 +0000
commitba59e4f384026d047092b51a26174e3542aef32c (patch)
tree100c3728601311d185a84d7c0f2198546f41def4 /src/n3_parser.y
parent6bf46a2d7a1c5325ee14d86dd50c5387733b618d (diff)
downloadraptor-ba59e4f384026d047092b51a26174e3542aef32c.tar.gz
Update N3 parser to turtle.
Diffstat (limited to 'src/n3_parser.y')
-rw-r--r--src/n3_parser.y19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/n3_parser.y b/src/n3_parser.y
index cb0edccb..3e18de60 100644
--- a/src/n3_parser.y
+++ b/src/n3_parser.y
@@ -4,9 +4,8 @@
*
* $Id$
*
- * Copyright (C) 2003-2005, David Beckett http://purl.org/net/dajobe/
- * Institute for Learning and Research Technology http://www.ilrt.bristol.ac.uk/
- * University of Bristol, UK http://www.bristol.ac.uk/
+ * Copyright (C) 2003-2006, David Beckett http://purl.org/net/dajobe/
+ * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/
*
* This package is Free Software and part of Redland http://librdf.org/
*
@@ -22,8 +21,6 @@
* complete terms and further detail along with the license texts for
* the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
*
- *
- *
* Made from a subset of the terms in
* http://www.w3.org/DesignIssues/Notation3.html
*
@@ -133,7 +130,7 @@ static void raptor_n3_generate_statement(raptor_parser *parser, raptor_triple *t
/*
* FIXME: Document these
*/
-%expect 9
+%expect 10
/* word symbols */
@@ -155,6 +152,7 @@ static void raptor_n3_generate_statement(raptor_parser *parser, raptor_triple *t
%token <string> IDENTIFIER
%token <integer> INTEGER_LITERAL
%token <floating> FLOATING_LITERAL
+%token <string> DECIMAL_LITERAL
/* syntax error */
%token ERROR_TOKEN
@@ -671,6 +669,15 @@ URI_LITERAL
#endif
$$=raptor_new_identifier_from_double($1);
}
+| DECIMAL_LITERAL
+{
+ raptor_uri *uri;
+#if RAPTOR_DEBUG > 1
+ printf("resource decimal=%s\n", $1);
+#endif
+ uri=raptor_new_uri((const unsigned char*)"http://www.w3.org/2001/XMLSchema#decimal");
+ $$=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, $1, uri, NULL);
+}
blank: BLANK_LITERAL