aboutsummaryrefslogtreecommitdiffstats
path: root/src/read_turtle.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/read_turtle.h')
-rw-r--r--src/read_turtle.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/read_turtle.h b/src/read_turtle.h
new file mode 100644
index 00000000..be3d961c
--- /dev/null
+++ b/src/read_turtle.h
@@ -0,0 +1,89 @@
+// Copyright 2011-2021 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef SERD_SRC_READ_TURTLE_H
+#define SERD_SRC_READ_TURTLE_H
+
+#include "reader.h"
+
+#include "serd/node.h"
+#include "serd/reader.h"
+#include "serd/status.h"
+
+#include <stdbool.h>
+
+/**
+ Read (skip) any amount of whitespace.
+
+ RDF 1.1 Turtle: [161s] WS (but here with a *)
+*/
+bool
+read_turtle_ws_star(SerdReader* reader);
+
+// Nonterminals
+
+/**
+ Read a Turtle prefix or base directive.
+
+ RDF 1.1 Turtle: [4] prefixId and [5] base
+*/
+SerdStatus
+read_turtle_directive(SerdReader* reader);
+
+/**
+ Read a Turtle base directive.
+
+ RDF 1.1 Turtle: [5] base
+*/
+SerdStatus
+read_turtle_base(SerdReader* reader, bool sparql, bool token);
+
+/**
+ Read a Turtle prefixID directive.
+
+ RDF 1.1 Turtle: [4] prefixID
+*/
+SerdStatus
+read_turtle_prefixID(SerdReader* reader, bool sparql, bool token);
+
+/**
+ Read a Turtle IRI node.
+
+ RDF 1.1 Turtle: [135s] iri
+*/
+SerdStatus
+read_turtle_iri(SerdReader* reader, SerdNode** dest, bool* ate_dot);
+
+/**
+ Read a Turtle subject node.
+
+ RDF 1.1 Turtle: [10] subject
+*/
+SerdStatus
+read_turtle_subject(SerdReader* reader,
+ ReadContext ctx,
+ SerdNode** dest,
+ int* s_type);
+/**
+ Read a single Turtle statement.
+*/
+SerdStatus
+read_turtle_statement(SerdReader* reader);
+
+/**
+ Read a series of Turtle triples.
+
+ RDF 1.1 Turtle: [6] triples
+*/
+SerdStatus
+read_turtle_triples(SerdReader* reader, ReadContext ctx, bool* ate_dot);
+
+/**
+ Read a complete Turtle document.
+
+ RDF 1.1 Turtle: [1] turtleDoc
+*/
+SerdStatus
+read_turtleDoc(SerdReader* reader);
+
+#endif // SERD_SRC_READ_TURTLE_H