Bladeren bron

Track codec artifacts.

scossu 1 dag geleden
bovenliggende
commit
1b8f50ff78
5 gewijzigde bestanden met toevoegingen van 9067 en 7 verwijderingen
  1. 1 7
      .gitignore
  2. 1235 0
      src/codec/grammar_nt.c
  3. 1729 0
      src/codec/grammar_ttl.c
  4. 1768 0
      src/codec/parser_nt.c
  5. 4334 0
      src/codec/parser_ttl.c

+ 1 - 7
.gitignore

@@ -105,16 +105,10 @@ venv.bak/
 
 ## LOCAL ##
 
+scratch.*
 sandbox.c
 sandbox/
 
-# Lexer and parser artifacts.
-
-src/codec/grammar_*.c
-src/codec/grammar_*.h
-src/codec/parser_*.c
-include/codec/tokens_*.h
-
 # IDE
 .syntastic*
 .vimrc

+ 1235 - 0
src/codec/grammar_nt.c

@@ -0,0 +1,1235 @@
+/* This file is automatically generated by Lemon from input grammar
+** source file "grammar_nt.y". */
+/** @brief Lemon parser grammar for N-Triples.
+ *
+ * The `lemon' parser generator executable must be in your PATH:
+ * https://sqlite.org/src/doc/trunk/doc/lemon.html
+ *
+ * To generate the parser, run: `lemon ${FILE}'
+ */
+
+#include "volksdata/codec.h"
+#line 38 "../../build/grammar_nt.c"
+/**************** End of %include directives **********************************/
+/* These constants specify the various numeric values for terminal symbols.
+***************** Begin token definitions *************************************/
+#ifndef T_EOF
+#define T_EOF                             1
+#define T_DOT                             2
+#define T_IRIREF                          3
+#define T_BNODE                           4
+#define T_LITERAL                         5
+#define T_EOL                             6
+#define T_WS                              7
+#endif
+/**************** End token definitions ***************************************/
+
+/* The next sections is a series of control #defines.
+** various aspects of the generated parser.
+**    YYCODETYPE         is the data type used to store the integer codes
+**                       that represent terminal and non-terminal symbols.
+**                       "unsigned char" is used if there are fewer than
+**                       256 symbols.  Larger types otherwise.
+**    YYNOCODE           is a number of type YYCODETYPE that is not used for
+**                       any terminal or nonterminal symbol.
+**    YYFALLBACK         If defined, this indicates that one or more tokens
+**                       (also known as: "terminal symbols") have fall-back
+**                       values which should be used if the original symbol
+**                       would not parse.  This permits keywords to sometimes
+**                       be used as identifiers, for example.
+**    YYACTIONTYPE       is the data type used for "action codes" - numbers
+**                       that indicate what to do in response to the next
+**                       token.
+**    NTParseTOKENTYPE     is the data type used for minor type for terminal
+**                       symbols.  Background: A "minor type" is a semantic
+**                       value associated with a terminal or non-terminal
+**                       symbols.  For example, for an "ID" terminal symbol,
+**                       the minor type might be the name of the identifier.
+**                       Each non-terminal can have a different minor type.
+**                       Terminal symbols all have the same minor type, though.
+**                       This macros defines the minor type for terminal 
+**                       symbols.
+**    YYMINORTYPE        is the data type used for all minor types.
+**                       This is typically a union of many types, one of
+**                       which is NTParseTOKENTYPE.  The entry in the union
+**                       for terminal symbols is called "yy0".
+**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
+**                       zero the stack is dynamically sized using realloc()
+**    NTParseARG_SDECL     A static variable declaration for the %extra_argument
+**    NTParseARG_PDECL     A parameter declaration for the %extra_argument
+**    NTParseARG_PARAM     Code to pass %extra_argument as a subroutine parameter
+**    NTParseARG_STORE     Code to store %extra_argument into yypParser
+**    NTParseARG_FETCH     Code to extract %extra_argument from yypParser
+**    NTParseCTX_*         As NTParseARG_ except for %extra_context
+**    YYERRORSYMBOL      is the code number of the error symbol.  If not
+**                       defined, then do no error processing.
+**    YYNSTATE           the combined number of states.
+**    YYNRULE            the number of rules in the grammar
+**    YYNTOKEN           Number of terminal symbols
+**    YY_MAX_SHIFT       Maximum value for shift actions
+**    YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
+**    YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
+**    YY_ERROR_ACTION    The yy_action[] code for syntax error
+**    YY_ACCEPT_ACTION   The yy_action[] code for accept
+**    YY_NO_ACTION       The yy_action[] code for no-op
+**    YY_MIN_REDUCE      Minimum value for reduce actions
+**    YY_MAX_REDUCE      Maximum value for reduce actions
+*/
+#ifndef INTERFACE
+# define INTERFACE 1
+#endif
+/************* Begin control #defines *****************************************/
+#define YYCODETYPE unsigned char
+#define YYNOCODE 16
+#define YYACTIONTYPE unsigned char
+#define NTParseTOKENTYPE  VOLK_Term * 
+typedef union {
+  int yyinit;
+  NTParseTOKENTYPE yy0;
+  void * yy17;
+  VOLK_Triple * yy18;
+  VOLK_Term * yy22;
+} YYMINORTYPE;
+#ifndef YYSTACKDEPTH
+#define YYSTACKDEPTH 100
+#endif
+#define NTParseARG_SDECL  VOLK_GraphIterator *it ;
+#define NTParseARG_PDECL , VOLK_GraphIterator *it 
+#define NTParseARG_PARAM ,it 
+#define NTParseARG_FETCH  VOLK_GraphIterator *it =yypParser->it ;
+#define NTParseARG_STORE yypParser->it =it ;
+#define NTParseCTX_SDECL
+#define NTParseCTX_PDECL
+#define NTParseCTX_PARAM
+#define NTParseCTX_FETCH
+#define NTParseCTX_STORE
+#define YYNSTATE             15
+#define YYNRULE              15
+#define YYNRULE_WITH_ACTION  1
+#define YYNTOKEN             8
+#define YY_MAX_SHIFT         14
+#define YY_MIN_SHIFTREDUCE   25
+#define YY_MAX_SHIFTREDUCE   39
+#define YY_ERROR_ACTION      40
+#define YY_ACCEPT_ACTION     41
+#define YY_NO_ACTION         42
+#define YY_MIN_REDUCE        43
+#define YY_MAX_REDUCE        57
+/************* End control #defines *******************************************/
+#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
+
+/* Define the yytestcase() macro to be a no-op if is not already defined
+** otherwise.
+**
+** Applications can choose to define yytestcase() in the %include section
+** to a macro that can assist in verifying code coverage.  For production
+** code the yytestcase() macro should be turned off.  But it is useful
+** for testing.
+*/
+#ifndef yytestcase
+# define yytestcase(X)
+#endif
+
+
+/* Next are the tables used to determine what action to take based on the
+** current state and lookahead token.  These tables are used to implement
+** functions that take a state number and lookahead value and return an
+** action integer.  
+**
+** Suppose the action integer is N.  Then the action is determined as
+** follows
+**
+**   0 <= N <= YY_MAX_SHIFT             Shift N.  That is, push the lookahead
+**                                      token onto the stack and goto state N.
+**
+**   N between YY_MIN_SHIFTREDUCE       Shift to an arbitrary state then
+**     and YY_MAX_SHIFTREDUCE           reduce by rule N-YY_MIN_SHIFTREDUCE.
+**
+**   N == YY_ERROR_ACTION               A syntax error has occurred.
+**
+**   N == YY_ACCEPT_ACTION              The parser accepts its input.
+**
+**   N == YY_NO_ACTION                  No such action.  Denotes unused
+**                                      slots in the yy_action[] table.
+**
+**   N between YY_MIN_REDUCE            Reduce by rule N-YY_MIN_REDUCE
+**     and YY_MAX_REDUCE
+**
+** The action table is constructed as a single large table named yy_action[].
+** Given state S and lookahead X, the action is computed as either:
+**
+**    (A)   N = yy_action[ yy_shift_ofst[S] + X ]
+**    (B)   N = yy_default[S]
+**
+** The (A) formula is preferred.  The B formula is used instead if
+** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
+**
+** The formulas above are for computing the action when the lookahead is
+** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
+** a reduce action) then the yy_reduce_ofst[] array is used in place of
+** the yy_shift_ofst[] array.
+**
+** The following are the tables generated in this section:
+**
+**  yy_action[]        A single table containing all actions.
+**  yy_lookahead[]     A table containing the lookahead for each entry in
+**                     yy_action.  Used to detect hash collisions.
+**  yy_shift_ofst[]    For each state, the offset into yy_action for
+**                     shifting terminals.
+**  yy_reduce_ofst[]   For each state, the offset into yy_action for
+**                     shifting non-terminals after a reduce.
+**  yy_default[]       Default action for each state.
+**
+*********** Begin parsing tables **********************************************/
+#define YY_ACTTAB_COUNT (31)
+static const YYACTIONTYPE yy_action[] = {
+ /*     0 */    41,    1,   11,    4,    3,   33,   34,   35,   14,   36,
+ /*    10 */    39,    9,    3,    5,   39,   30,   31,    8,   10,   36,
+ /*    20 */    32,   39,   12,    2,   37,   25,   44,   42,    7,    6,
+ /*    30 */    13,
+};
+static const YYCODETYPE yy_lookahead[] = {
+ /*     0 */     8,    9,   10,   11,   12,    3,    4,    5,    1,    6,
+ /*    10 */     7,   11,   12,   15,    7,    3,    4,   13,   10,    6,
+ /*    20 */     3,    7,   12,   12,    6,    2,    0,   16,   12,   14,
+ /*    30 */    10,   16,   16,   16,   16,    8,    8,    8,    8,
+};
+#define YY_SHIFT_COUNT    (14)
+#define YY_SHIFT_MIN      (0)
+#define YY_SHIFT_MAX      (26)
+static const unsigned char yy_shift_ofst[] = {
+ /*     0 */     3,    7,    2,   12,   13,   14,   14,   17,   14,   13,
+ /*    10 */    18,   18,   23,   18,   26,
+};
+#define YY_REDUCE_COUNT (9)
+#define YY_REDUCE_MIN   (-8)
+#define YY_REDUCE_MAX   (20)
+static const signed char yy_reduce_ofst[] = {
+ /*     0 */    -8,    0,   -2,    4,    8,   10,   11,   15,   16,   20,
+};
+static const YYACTIONTYPE yy_default[] = {
+ /*     0 */    56,   56,   40,   40,   40,   56,   56,   40,   56,   40,
+ /*    10 */    46,   45,   40,   47,   40,
+};
+/********** End of lemon-generated parsing tables *****************************/
+
+/* The next table maps tokens (terminal symbols) into fallback tokens.  
+** If a construct like the following:
+** 
+**      %fallback ID X Y Z.
+**
+** appears in the grammar, then ID becomes a fallback token for X, Y,
+** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
+** but it does not parse, the type of the token is changed to ID and
+** the parse is retried before an error is thrown.
+**
+** This feature can be used, for example, to cause some keywords in a language
+** to revert to identifiers if they keyword does not apply in the context where
+** it appears.
+*/
+#ifdef YYFALLBACK
+static const YYCODETYPE yyFallback[] = {
+};
+#endif /* YYFALLBACK */
+
+/* The following structure represents a single element of the
+** parser's stack.  Information stored includes:
+**
+**   +  The state number for the parser at this level of the stack.
+**
+**   +  The value of the token stored at this level of the stack.
+**      (In other words, the "major" token.)
+**
+**   +  The semantic value stored at this level of the stack.  This is
+**      the information used by the action routines in the grammar.
+**      It is sometimes called the "minor" token.
+**
+** After the "shift" half of a SHIFTREDUCE action, the stateno field
+** actually contains the reduce action for the second half of the
+** SHIFTREDUCE.
+*/
+struct yyStackEntry {
+  YYACTIONTYPE stateno;  /* The state-number, or reduce action in SHIFTREDUCE */
+  YYCODETYPE major;      /* The major token value.  This is the code
+                         ** number for the token at this stack level */
+  YYMINORTYPE minor;     /* The user-supplied minor token value.  This
+                         ** is the value of the token  */
+};
+typedef struct yyStackEntry yyStackEntry;
+
+/* The state of the parser is completely contained in an instance of
+** the following structure */
+struct yyParser {
+  yyStackEntry *yytos;          /* Pointer to top element of the stack */
+#ifdef YYTRACKMAXSTACKDEPTH
+  int yyhwm;                    /* High-water mark of the stack */
+#endif
+#ifndef YYNOERRORRECOVERY
+  int yyerrcnt;                 /* Shifts left before out of the error */
+#endif
+  NTParseARG_SDECL                /* A place to hold %extra_argument */
+  NTParseCTX_SDECL                /* A place to hold %extra_context */
+#if YYSTACKDEPTH<=0
+  int yystksz;                  /* Current side of the stack */
+  yyStackEntry *yystack;        /* The parser's stack */
+  yyStackEntry yystk0;          /* First stack entry */
+#else
+  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
+  yyStackEntry *yystackEnd;            /* Last entry in the stack */
+#endif
+};
+typedef struct yyParser yyParser;
+
+#include <assert.h>
+#ifndef NDEBUG
+#include <stdio.h>
+static FILE *yyTraceFILE = 0;
+static char *yyTracePrompt = 0;
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/* 
+** Turn parser tracing on by giving a stream to which to write the trace
+** and a prompt to preface each trace message.  Tracing is turned off
+** by making either argument NULL 
+**
+** Inputs:
+** <ul>
+** <li> A FILE* to which trace output should be written.
+**      If NULL, then tracing is turned off.
+** <li> A prefix string written at the beginning of every
+**      line of trace output.  If NULL, then tracing is
+**      turned off.
+** </ul>
+**
+** Outputs:
+** None.
+*/
+void NTParseTrace(FILE *TraceFILE, char *zTracePrompt){
+  yyTraceFILE = TraceFILE;
+  yyTracePrompt = zTracePrompt;
+  if( yyTraceFILE==0 ) yyTracePrompt = 0;
+  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
+}
+#endif /* NDEBUG */
+
+#if defined(YYCOVERAGE) || !defined(NDEBUG)
+/* For tracing shifts, the names of all terminals and nonterminals
+** are required.  The following table supplies these names */
+static const char *const yyTokenName[] = { 
+  /*    0 */ "$",
+  /*    1 */ "EOF",
+  /*    2 */ "DOT",
+  /*    3 */ "IRIREF",
+  /*    4 */ "BNODE",
+  /*    5 */ "LITERAL",
+  /*    6 */ "EOL",
+  /*    7 */ "WS",
+  /*    8 */ "ntriplesDoc",
+  /*    9 */ "triples",
+  /*   10 */ "eol",
+  /*   11 */ "triple",
+  /*   12 */ "ws",
+  /*   13 */ "subject",
+  /*   14 */ "predicate",
+  /*   15 */ "object",
+};
+#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
+
+#ifndef NDEBUG
+/* For tracing reduce actions, the names of all rules are required.
+*/
+static const char *const yyRuleName[] = {
+ /*   0 */ "triple ::= ws subject ws predicate ws object ws DOT",
+ /*   1 */ "ntriplesDoc ::= triples EOF",
+ /*   2 */ "triples ::= eol",
+ /*   3 */ "triples ::= triple eol",
+ /*   4 */ "triples ::= triples triple eol",
+ /*   5 */ "subject ::= IRIREF",
+ /*   6 */ "subject ::= BNODE",
+ /*   7 */ "predicate ::= IRIREF",
+ /*   8 */ "object ::= IRIREF",
+ /*   9 */ "object ::= BNODE",
+ /*  10 */ "object ::= LITERAL",
+ /*  11 */ "eol ::= EOL",
+ /*  12 */ "eol ::= eol EOL",
+ /*  13 */ "ws ::=",
+ /*  14 */ "ws ::= WS",
+};
+#endif /* NDEBUG */
+
+
+#if YYSTACKDEPTH<=0
+/*
+** Try to increase the size of the parser stack.  Return the number
+** of errors.  Return 0 on success.
+*/
+static int yyGrowStack(yyParser *p){
+  int newSize;
+  int idx;
+  yyStackEntry *pNew;
+
+  newSize = p->yystksz*2 + 100;
+  idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
+  if( p->yystack==&p->yystk0 ){
+    pNew = malloc(newSize*sizeof(pNew[0]));
+    if( pNew ) pNew[0] = p->yystk0;
+  }else{
+    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
+  }
+  if( pNew ){
+    p->yystack = pNew;
+    p->yytos = &p->yystack[idx];
+#ifndef NDEBUG
+    if( yyTraceFILE ){
+      fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",
+              yyTracePrompt, p->yystksz, newSize);
+    }
+#endif
+    p->yystksz = newSize;
+  }
+  return pNew==0; 
+}
+#endif
+
+/* Datatype of the argument to the memory allocated passed as the
+** second argument to NTParseAlloc() below.  This can be changed by
+** putting an appropriate #define in the %include section of the input
+** grammar.
+*/
+#ifndef YYMALLOCARGTYPE
+# define YYMALLOCARGTYPE size_t
+#endif
+
+/* Initialize a new parser that has already been allocated.
+*/
+void NTParseInit(void *yypRawParser NTParseCTX_PDECL){
+  yyParser *yypParser = (yyParser*)yypRawParser;
+  NTParseCTX_STORE
+#ifdef YYTRACKMAXSTACKDEPTH
+  yypParser->yyhwm = 0;
+#endif
+#if YYSTACKDEPTH<=0
+  yypParser->yytos = NULL;
+  yypParser->yystack = NULL;
+  yypParser->yystksz = 0;
+  if( yyGrowStack(yypParser) ){
+    yypParser->yystack = &yypParser->yystk0;
+    yypParser->yystksz = 1;
+  }
+#endif
+#ifndef YYNOERRORRECOVERY
+  yypParser->yyerrcnt = -1;
+#endif
+  yypParser->yytos = yypParser->yystack;
+  yypParser->yystack[0].stateno = 0;
+  yypParser->yystack[0].major = 0;
+#if YYSTACKDEPTH>0
+  yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1];
+#endif
+}
+
+#ifndef NTParse_ENGINEALWAYSONSTACK
+/* 
+** This function allocates a new parser.
+** The only argument is a pointer to a function which works like
+** malloc.
+**
+** Inputs:
+** A pointer to the function used to allocate memory.
+**
+** Outputs:
+** A pointer to a parser.  This pointer is used in subsequent calls
+** to NTParse and NTParseFree.
+*/
+void *NTParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) NTParseCTX_PDECL){
+  yyParser *yypParser;
+  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
+  if( yypParser ){
+    NTParseCTX_STORE
+    NTParseInit(yypParser NTParseCTX_PARAM);
+  }
+  return (void*)yypParser;
+}
+#endif /* NTParse_ENGINEALWAYSONSTACK */
+
+
+/* The following function deletes the "minor type" or semantic value
+** associated with a symbol.  The symbol can be either a terminal
+** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
+** a pointer to the value to be deleted.  The code used to do the 
+** deletions is derived from the %destructor and/or %token_destructor
+** directives of the input grammar.
+*/
+static void yy_destructor(
+  yyParser *yypParser,    /* The parser */
+  YYCODETYPE yymajor,     /* Type code for object to destroy */
+  YYMINORTYPE *yypminor   /* The object to be destroyed */
+){
+  NTParseARG_FETCH
+  NTParseCTX_FETCH
+  switch( yymajor ){
+    /* Here is inserted the actions which take place when a
+    ** terminal or non-terminal is destroyed.  This can happen
+    ** when the symbol is popped from the stack during a
+    ** reduce or during error processing or when a parser is 
+    ** being destroyed before it is finished parsing.
+    **
+    ** Note: during a reduce, the only symbols destroyed are those
+    ** which appear on the RHS of the rule, but which are *not* used
+    ** inside the C code.
+    */
+/********* Begin destructor definitions ***************************************/
+    case 11: /* triple */
+{
+#line 32 "grammar_nt.y"
+ VOLK_triple_free ((yypminor->yy18)); 
+#line 512 "../../build/grammar_nt.c"
+}
+      break;
+    case 13: /* subject */
+{
+#line 39 "grammar_nt.y"
+ (void)(it); VOLK_term_free ((yypminor->yy22)); 
+#line 519 "../../build/grammar_nt.c"
+}
+      break;
+    case 14: /* predicate */
+    case 15: /* object */
+{
+#line 44 "grammar_nt.y"
+ VOLK_term_free ((yypminor->yy22)); 
+#line 527 "../../build/grammar_nt.c"
+}
+      break;
+/********* End destructor definitions *****************************************/
+    default:  break;   /* If no destructor action specified: do nothing */
+  }
+}
+
+/*
+** Pop the parser's stack once.
+**
+** If there is a destructor routine associated with the token which
+** is popped from the stack, then call it.
+*/
+static void yy_pop_parser_stack(yyParser *pParser){
+  yyStackEntry *yytos;
+  assert( pParser->yytos!=0 );
+  assert( pParser->yytos > pParser->yystack );
+  yytos = pParser->yytos--;
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    fprintf(yyTraceFILE,"%sPopping %s\n",
+      yyTracePrompt,
+      yyTokenName[yytos->major]);
+  }
+#endif
+  yy_destructor(pParser, yytos->major, &yytos->minor);
+}
+
+/*
+** Clear all secondary memory allocations from the parser
+*/
+void NTParseFinalize(void *p){
+  yyParser *pParser = (yyParser*)p;
+  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
+#if YYSTACKDEPTH<=0
+  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
+#endif
+}
+
+#ifndef NTParse_ENGINEALWAYSONSTACK
+/* 
+** Deallocate and destroy a parser.  Destructors are called for
+** all stack elements before shutting the parser down.
+**
+** If the YYPARSEFREENEVERNULL macro exists (for example because it
+** is defined in a %include section of the input grammar) then it is
+** assumed that the input pointer is never NULL.
+*/
+void NTParseFree(
+  void *p,                    /* The parser to be deleted */
+  void (*freeProc)(void*)     /* Function used to reclaim memory */
+){
+#ifndef YYPARSEFREENEVERNULL
+  if( p==0 ) return;
+#endif
+  NTParseFinalize(p);
+  (*freeProc)(p);
+}
+#endif /* NTParse_ENGINEALWAYSONSTACK */
+
+/*
+** Return the peak depth of the stack for a parser.
+*/
+#ifdef YYTRACKMAXSTACKDEPTH
+int NTParseStackPeak(void *p){
+  yyParser *pParser = (yyParser*)p;
+  return pParser->yyhwm;
+}
+#endif
+
+/* This array of booleans keeps track of the parser statement
+** coverage.  The element yycoverage[X][Y] is set when the parser
+** is in state X and has a lookahead token Y.  In a well-tested
+** systems, every element of this matrix should end up being set.
+*/
+#if defined(YYCOVERAGE)
+static unsigned char yycoverage[YYNSTATE][YYNTOKEN];
+#endif
+
+/*
+** Write into out a description of every state/lookahead combination that
+**
+**   (1)  has not been used by the parser, and
+**   (2)  is not a syntax error.
+**
+** Return the number of missed state/lookahead combinations.
+*/
+#if defined(YYCOVERAGE)
+int NTParseCoverage(FILE *out){
+  int stateno, iLookAhead, i;
+  int nMissed = 0;
+  for(stateno=0; stateno<YYNSTATE; stateno++){
+    i = yy_shift_ofst[stateno];
+    for(iLookAhead=0; iLookAhead<YYNTOKEN; iLookAhead++){
+      if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;
+      if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;
+      if( out ){
+        fprintf(out,"State %d lookahead %s %s\n", stateno,
+                yyTokenName[iLookAhead],
+                yycoverage[stateno][iLookAhead] ? "ok" : "missed");
+      }
+    }
+  }
+  return nMissed;
+}
+#endif
+
+/*
+** Find the appropriate action for a parser given the terminal
+** look-ahead token iLookAhead.
+*/
+static YYACTIONTYPE yy_find_shift_action(
+  YYCODETYPE iLookAhead,    /* The look-ahead token */
+  YYACTIONTYPE stateno      /* Current state number */
+){
+  int i;
+
+  if( stateno>YY_MAX_SHIFT ) return stateno;
+  assert( stateno <= YY_SHIFT_COUNT );
+#if defined(YYCOVERAGE)
+  yycoverage[stateno][iLookAhead] = 1;
+#endif
+  do{
+    i = yy_shift_ofst[stateno];
+    assert( i>=0 );
+    assert( i<=YY_ACTTAB_COUNT );
+    assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
+    assert( iLookAhead!=YYNOCODE );
+    assert( iLookAhead < YYNTOKEN );
+    i += iLookAhead;
+    assert( i<(int)YY_NLOOKAHEAD );
+    if( yy_lookahead[i]!=iLookAhead ){
+#ifdef YYFALLBACK
+      YYCODETYPE iFallback;            /* Fallback token */
+      assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
+      iFallback = yyFallback[iLookAhead];
+      if( iFallback!=0 ){
+#ifndef NDEBUG
+        if( yyTraceFILE ){
+          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
+             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
+        }
+#endif
+        assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
+        iLookAhead = iFallback;
+        continue;
+      }
+#endif
+#ifdef YYWILDCARD
+      {
+        int j = i - iLookAhead + YYWILDCARD;
+        assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
+        if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
+#ifndef NDEBUG
+          if( yyTraceFILE ){
+            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
+               yyTracePrompt, yyTokenName[iLookAhead],
+               yyTokenName[YYWILDCARD]);
+          }
+#endif /* NDEBUG */
+          return yy_action[j];
+        }
+      }
+#endif /* YYWILDCARD */
+      return yy_default[stateno];
+    }else{
+      assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) );
+      return yy_action[i];
+    }
+  }while(1);
+}
+
+/*
+** Find the appropriate action for a parser given the non-terminal
+** look-ahead token iLookAhead.
+*/
+static YYACTIONTYPE yy_find_reduce_action(
+  YYACTIONTYPE stateno,     /* Current state number */
+  YYCODETYPE iLookAhead     /* The look-ahead token */
+){
+  int i;
+#ifdef YYERRORSYMBOL
+  if( stateno>YY_REDUCE_COUNT ){
+    return yy_default[stateno];
+  }
+#else
+  assert( stateno<=YY_REDUCE_COUNT );
+#endif
+  i = yy_reduce_ofst[stateno];
+  assert( iLookAhead!=YYNOCODE );
+  i += iLookAhead;
+#ifdef YYERRORSYMBOL
+  if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
+    return yy_default[stateno];
+  }
+#else
+  assert( i>=0 && i<YY_ACTTAB_COUNT );
+  assert( yy_lookahead[i]==iLookAhead );
+#endif
+  return yy_action[i];
+}
+
+/*
+** The following routine is called if the stack overflows.
+*/
+static void yyStackOverflow(yyParser *yypParser){
+   NTParseARG_FETCH
+   NTParseCTX_FETCH
+#ifndef NDEBUG
+   if( yyTraceFILE ){
+     fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
+   }
+#endif
+   while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
+   /* Here code is inserted which will execute if the parser
+   ** stack every overflows */
+/******** Begin %stack_overflow code ******************************************/
+/******** End %stack_overflow code ********************************************/
+   NTParseARG_STORE /* Suppress warning about unused %extra_argument var */
+   NTParseCTX_STORE
+}
+
+/*
+** Print tracing information for a SHIFT action
+*/
+#ifndef NDEBUG
+static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
+  if( yyTraceFILE ){
+    if( yyNewState<YYNSTATE ){
+      fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",
+         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
+         yyNewState);
+    }else{
+      fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",
+         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
+         yyNewState - YY_MIN_REDUCE);
+    }
+  }
+}
+#else
+# define yyTraceShift(X,Y,Z)
+#endif
+
+/*
+** Perform a shift action.
+*/
+static void yy_shift(
+  yyParser *yypParser,          /* The parser to be shifted */
+  YYACTIONTYPE yyNewState,      /* The new state to shift in */
+  YYCODETYPE yyMajor,           /* The major token to shift in */
+  NTParseTOKENTYPE yyMinor        /* The minor token to shift in */
+){
+  yyStackEntry *yytos;
+  yypParser->yytos++;
+#ifdef YYTRACKMAXSTACKDEPTH
+  if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
+    yypParser->yyhwm++;
+    assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
+  }
+#endif
+#if YYSTACKDEPTH>0 
+  if( yypParser->yytos>yypParser->yystackEnd ){
+    yypParser->yytos--;
+    yyStackOverflow(yypParser);
+    return;
+  }
+#else
+  if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
+    if( yyGrowStack(yypParser) ){
+      yypParser->yytos--;
+      yyStackOverflow(yypParser);
+      return;
+    }
+  }
+#endif
+  if( yyNewState > YY_MAX_SHIFT ){
+    yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
+  }
+  yytos = yypParser->yytos;
+  yytos->stateno = yyNewState;
+  yytos->major = yyMajor;
+  yytos->minor.yy0 = yyMinor;
+  yyTraceShift(yypParser, yyNewState, "Shift");
+}
+
+/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
+** of that rule */
+static const YYCODETYPE yyRuleInfoLhs[] = {
+    11,  /* (0) triple ::= ws subject ws predicate ws object ws DOT */
+     8,  /* (1) ntriplesDoc ::= triples EOF */
+     9,  /* (2) triples ::= eol */
+     9,  /* (3) triples ::= triple eol */
+     9,  /* (4) triples ::= triples triple eol */
+    13,  /* (5) subject ::= IRIREF */
+    13,  /* (6) subject ::= BNODE */
+    14,  /* (7) predicate ::= IRIREF */
+    15,  /* (8) object ::= IRIREF */
+    15,  /* (9) object ::= BNODE */
+    15,  /* (10) object ::= LITERAL */
+    10,  /* (11) eol ::= EOL */
+    10,  /* (12) eol ::= eol EOL */
+    12,  /* (13) ws ::= */
+    12,  /* (14) ws ::= WS */
+};
+
+/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
+** of symbols on the right-hand side of that rule. */
+static const signed char yyRuleInfoNRhs[] = {
+   -8,  /* (0) triple ::= ws subject ws predicate ws object ws DOT */
+   -2,  /* (1) ntriplesDoc ::= triples EOF */
+   -1,  /* (2) triples ::= eol */
+   -2,  /* (3) triples ::= triple eol */
+   -3,  /* (4) triples ::= triples triple eol */
+   -1,  /* (5) subject ::= IRIREF */
+   -1,  /* (6) subject ::= BNODE */
+   -1,  /* (7) predicate ::= IRIREF */
+   -1,  /* (8) object ::= IRIREF */
+   -1,  /* (9) object ::= BNODE */
+   -1,  /* (10) object ::= LITERAL */
+   -1,  /* (11) eol ::= EOL */
+   -2,  /* (12) eol ::= eol EOL */
+    0,  /* (13) ws ::= */
+   -1,  /* (14) ws ::= WS */
+};
+
+static void yy_accept(yyParser*);  /* Forward Declaration */
+
+/*
+** Perform a reduce action and the shift that must immediately
+** follow the reduce.
+**
+** The yyLookahead and yyLookaheadToken parameters provide reduce actions
+** access to the lookahead token (if any).  The yyLookahead will be YYNOCODE
+** if the lookahead token has already been consumed.  As this procedure is
+** only called from one place, optimizing compilers will in-line it, which
+** means that the extra parameters have no performance impact.
+*/
+static YYACTIONTYPE yy_reduce(
+  yyParser *yypParser,         /* The parser */
+  unsigned int yyruleno,       /* Number of the rule by which to reduce */
+  int yyLookahead,             /* Lookahead token, or YYNOCODE if none */
+  NTParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
+  NTParseCTX_PDECL                   /* %extra_context */
+){
+  int yygoto;                     /* The next state */
+  YYACTIONTYPE yyact;             /* The next action */
+  yyStackEntry *yymsp;            /* The top of the parser's stack */
+  int yysize;                     /* Amount to pop the stack */
+  NTParseARG_FETCH
+  (void)yyLookahead;
+  (void)yyLookaheadToken;
+  yymsp = yypParser->yytos;
+
+  switch( yyruleno ){
+  /* Beginning here are the reduction cases.  A typical example
+  ** follows:
+  **   case 0:
+  **  #line <lineno> <grammarfile>
+  **     { ... }           // User supplied code
+  **  #line <lineno> <thisfile>
+  **     break;
+  */
+/********** Begin reduce actions **********************************************/
+      case 0: /* triple ::= ws subject ws predicate ws object ws DOT */
+#line 33 "grammar_nt.y"
+{
+                yymsp[-7].minor.yy18 = VOLK_triple_new (yymsp[-6].minor.yy22, yymsp[-4].minor.yy22, yymsp[-2].minor.yy22);
+                VOLK_graph_add_iter (it, yymsp[-7].minor.yy18);
+            }
+#line 897 "../../build/grammar_nt.c"
+        break;
+      case 3: /* triples ::= triple eol */
+{  yy_destructor(yypParser,11,&yymsp[-1].minor);
+#line 28 "grammar_nt.y"
+{
+}
+#line 904 "../../build/grammar_nt.c"
+}
+        break;
+      case 4: /* triples ::= triples triple eol */
+#line 29 "grammar_nt.y"
+{
+}
+#line 911 "../../build/grammar_nt.c"
+  yy_destructor(yypParser,11,&yymsp[-1].minor);
+        break;
+      default:
+      /* (1) ntriplesDoc ::= triples EOF */ yytestcase(yyruleno==1);
+      /* (2) triples ::= eol */ yytestcase(yyruleno==2);
+      /* (5) subject ::= IRIREF */ yytestcase(yyruleno==5);
+      /* (6) subject ::= BNODE */ yytestcase(yyruleno==6);
+      /* (7) predicate ::= IRIREF */ yytestcase(yyruleno==7);
+      /* (8) object ::= IRIREF */ yytestcase(yyruleno==8);
+      /* (9) object ::= BNODE */ yytestcase(yyruleno==9);
+      /* (10) object ::= LITERAL */ yytestcase(yyruleno==10);
+      /* (11) eol ::= EOL */ yytestcase(yyruleno==11);
+      /* (12) eol ::= eol EOL */ yytestcase(yyruleno==12);
+      /* (13) ws ::= */ yytestcase(yyruleno==13);
+      /* (14) ws ::= WS */ yytestcase(yyruleno==14);
+        break;
+/********** End reduce actions ************************************************/
+  };
+  assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
+  yygoto = yyRuleInfoLhs[yyruleno];
+  yysize = yyRuleInfoNRhs[yyruleno];
+  yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
+
+  /* There are no SHIFTREDUCE actions on nonterminals because the table
+  ** generator has simplified them to pure REDUCE actions. */
+  assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) );
+
+  /* It is not possible for a REDUCE to be followed by an error */
+  assert( yyact!=YY_ERROR_ACTION );
+
+  yymsp += yysize+1;
+  yypParser->yytos = yymsp;
+  yymsp->stateno = (YYACTIONTYPE)yyact;
+  yymsp->major = (YYCODETYPE)yygoto;
+  yyTraceShift(yypParser, yyact, "... then shift");
+  return yyact;
+}
+
+/*
+** The following code executes when the parse fails
+*/
+#ifndef YYNOERRORRECOVERY
+static void yy_parse_failed(
+  yyParser *yypParser           /* The parser */
+){
+  NTParseARG_FETCH
+  NTParseCTX_FETCH
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
+  }
+#endif
+  while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
+  /* Here code is inserted which will be executed whenever the
+  ** parser fails */
+/************ Begin %parse_failure code ***************************************/
+/************ End %parse_failure code *****************************************/
+  NTParseARG_STORE /* Suppress warning about unused %extra_argument variable */
+  NTParseCTX_STORE
+}
+#endif /* YYNOERRORRECOVERY */
+
+/*
+** The following code executes when a syntax error first occurs.
+*/
+static void yy_syntax_error(
+  yyParser *yypParser,           /* The parser */
+  int yymajor,                   /* The major type of the error token */
+  NTParseTOKENTYPE yyminor         /* The minor type of the error token */
+){
+  NTParseARG_FETCH
+  NTParseCTX_FETCH
+#define TOKEN yyminor
+/************ Begin %syntax_error code ****************************************/
+/************ End %syntax_error code ******************************************/
+  NTParseARG_STORE /* Suppress warning about unused %extra_argument variable */
+  NTParseCTX_STORE
+}
+
+/*
+** The following is executed when the parser accepts
+*/
+static void yy_accept(
+  yyParser *yypParser           /* The parser */
+){
+  NTParseARG_FETCH
+  NTParseCTX_FETCH
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
+  }
+#endif
+#ifndef YYNOERRORRECOVERY
+  yypParser->yyerrcnt = -1;
+#endif
+  assert( yypParser->yytos==yypParser->yystack );
+  /* Here code is inserted which will be executed whenever the
+  ** parser accepts */
+/*********** Begin %parse_accept code *****************************************/
+/*********** End %parse_accept code *******************************************/
+  NTParseARG_STORE /* Suppress warning about unused %extra_argument variable */
+  NTParseCTX_STORE
+}
+
+/* The main parser program.
+** The first argument is a pointer to a structure obtained from
+** "NTParseAlloc" which describes the current state of the parser.
+** The second argument is the major token number.  The third is
+** the minor token.  The fourth optional argument is whatever the
+** user wants (and specified in the grammar) and is available for
+** use by the action routines.
+**
+** Inputs:
+** <ul>
+** <li> A pointer to the parser (an opaque structure.)
+** <li> The major token number.
+** <li> The minor token number.
+** <li> An option argument of a grammar-specified type.
+** </ul>
+**
+** Outputs:
+** None.
+*/
+void NTParse(
+  void *yyp,                   /* The parser */
+  int yymajor,                 /* The major token code number */
+  NTParseTOKENTYPE yyminor       /* The value for the token */
+  NTParseARG_PDECL               /* Optional %extra_argument parameter */
+){
+  YYMINORTYPE yyminorunion;
+  YYACTIONTYPE yyact;   /* The parser action. */
+#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
+  int yyendofinput;     /* True if we are at the end of input */
+#endif
+#ifdef YYERRORSYMBOL
+  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
+#endif
+  yyParser *yypParser = (yyParser*)yyp;  /* The parser */
+  NTParseCTX_FETCH
+  NTParseARG_STORE
+
+  assert( yypParser->yytos!=0 );
+#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
+  yyendofinput = (yymajor==0);
+#endif
+
+  yyact = yypParser->yytos->stateno;
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    if( yyact < YY_MIN_REDUCE ){
+      fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
+              yyTracePrompt,yyTokenName[yymajor],yyact);
+    }else{
+      fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
+              yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE);
+    }
+  }
+#endif
+
+  while(1){ /* Exit by "break" */
+    assert( yypParser->yytos>=yypParser->yystack );
+    assert( yyact==yypParser->yytos->stateno );
+    yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
+    if( yyact >= YY_MIN_REDUCE ){
+      unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */
+#ifndef NDEBUG
+      assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) );
+      if( yyTraceFILE ){
+        int yysize = yyRuleInfoNRhs[yyruleno];
+        if( yysize ){
+          fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
+            yyTracePrompt,
+            yyruleno, yyRuleName[yyruleno],
+            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
+            yypParser->yytos[yysize].stateno);
+        }else{
+          fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
+            yyTracePrompt, yyruleno, yyRuleName[yyruleno],
+            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
+        }
+      }
+#endif /* NDEBUG */
+
+      /* Check that the stack is large enough to grow by a single entry
+      ** if the RHS of the rule is empty.  This ensures that there is room
+      ** enough on the stack to push the LHS value */
+      if( yyRuleInfoNRhs[yyruleno]==0 ){
+#ifdef YYTRACKMAXSTACKDEPTH
+        if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
+          yypParser->yyhwm++;
+          assert( yypParser->yyhwm ==
+                  (int)(yypParser->yytos - yypParser->yystack));
+        }
+#endif
+#if YYSTACKDEPTH>0 
+        if( yypParser->yytos>=yypParser->yystackEnd ){
+          yyStackOverflow(yypParser);
+          break;
+        }
+#else
+        if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
+          if( yyGrowStack(yypParser) ){
+            yyStackOverflow(yypParser);
+            break;
+          }
+        }
+#endif
+      }
+      yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor NTParseCTX_PARAM);
+    }else if( yyact <= YY_MAX_SHIFTREDUCE ){
+      yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
+#ifndef YYNOERRORRECOVERY
+      yypParser->yyerrcnt--;
+#endif
+      break;
+    }else if( yyact==YY_ACCEPT_ACTION ){
+      yypParser->yytos--;
+      yy_accept(yypParser);
+      return;
+    }else{
+      assert( yyact == YY_ERROR_ACTION );
+      yyminorunion.yy0 = yyminor;
+#ifdef YYERRORSYMBOL
+      int yymx;
+#endif
+#ifndef NDEBUG
+      if( yyTraceFILE ){
+        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
+      }
+#endif
+#ifdef YYERRORSYMBOL
+      /* A syntax error has occurred.
+      ** The response to an error depends upon whether or not the
+      ** grammar defines an error token "ERROR".  
+      **
+      ** This is what we do if the grammar does define ERROR:
+      **
+      **  * Call the %syntax_error function.
+      **
+      **  * Begin popping the stack until we enter a state where
+      **    it is legal to shift the error symbol, then shift
+      **    the error symbol.
+      **
+      **  * Set the error count to three.
+      **
+      **  * Begin accepting and shifting new tokens.  No new error
+      **    processing will occur until three tokens have been
+      **    shifted successfully.
+      **
+      */
+      if( yypParser->yyerrcnt<0 ){
+        yy_syntax_error(yypParser,yymajor,yyminor);
+      }
+      yymx = yypParser->yytos->major;
+      if( yymx==YYERRORSYMBOL || yyerrorhit ){
+#ifndef NDEBUG
+        if( yyTraceFILE ){
+          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
+             yyTracePrompt,yyTokenName[yymajor]);
+        }
+#endif
+        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
+        yymajor = YYNOCODE;
+      }else{
+        while( yypParser->yytos > yypParser->yystack ){
+          yyact = yy_find_reduce_action(yypParser->yytos->stateno,
+                                        YYERRORSYMBOL);
+          if( yyact<=YY_MAX_SHIFTREDUCE ) break;
+          yy_pop_parser_stack(yypParser);
+        }
+        if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){
+          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
+          yy_parse_failed(yypParser);
+#ifndef YYNOERRORRECOVERY
+          yypParser->yyerrcnt = -1;
+#endif
+          yymajor = YYNOCODE;
+        }else if( yymx!=YYERRORSYMBOL ){
+          yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
+        }
+      }
+      yypParser->yyerrcnt = 3;
+      yyerrorhit = 1;
+      if( yymajor==YYNOCODE ) break;
+      yyact = yypParser->yytos->stateno;
+#elif defined(YYNOERRORRECOVERY)
+      /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
+      ** do any kind of error recovery.  Instead, simply invoke the syntax
+      ** error routine and continue going as if nothing had happened.
+      **
+      ** Applications can set this macro (for example inside %include) if
+      ** they intend to abandon the parse upon the first syntax error seen.
+      */
+      yy_syntax_error(yypParser,yymajor, yyminor);
+      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
+      break;
+#else  /* YYERRORSYMBOL is not defined */
+      /* This is what we do if the grammar does not define ERROR:
+      **
+      **  * Report an error message, and throw away the input token.
+      **
+      **  * If the input token is $, then fail the parse.
+      **
+      ** As before, subsequent error messages are suppressed until
+      ** three input tokens have been successfully shifted.
+      */
+      if( yypParser->yyerrcnt<=0 ){
+        yy_syntax_error(yypParser,yymajor, yyminor);
+      }
+      yypParser->yyerrcnt = 3;
+      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
+      if( yyendofinput ){
+        yy_parse_failed(yypParser);
+#ifndef YYNOERRORRECOVERY
+        yypParser->yyerrcnt = -1;
+#endif
+      }
+      break;
+#endif
+    }
+  }
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    yyStackEntry *i;
+    char cDiv = '[';
+    fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);
+    for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){
+      fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);
+      cDiv = ' ';
+    }
+    fprintf(yyTraceFILE,"]\n");
+  }
+#endif
+  return;
+}
+
+/*
+** Return the fallback token corresponding to canonical token iToken, or
+** 0 if iToken has no fallback.
+*/
+int NTParseFallback(int iToken){
+#ifdef YYFALLBACK
+  assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
+  return yyFallback[iToken];
+#else
+  (void)iToken;
+  return 0;
+#endif
+}

+ 1729 - 0
src/codec/grammar_ttl.c

@@ -0,0 +1,1729 @@
+/* This file is automatically generated by Lemon from input grammar
+** source file "grammar_ttl.y". */
+/** @brief Lemon parser grammar for Turtle.
+ *
+ * The `lemon' parser generator executable must be in your PATH:
+ * https://sqlite.org/src/doc/trunk/doc/lemon.html
+ *
+ * TTL EBNF: https://www.w3.org/TeamSubmission/turtle/#sec-grammar-grammar
+ */
+
+#include "volksdata/codec.h"
+
+#line 39 "../../build/grammar_ttl.c"
+/**************** End of %include directives **********************************/
+/* These constants specify the various numeric values for terminal symbols.
+***************** Begin token definitions *************************************/
+#ifndef T_PERIOD
+#define T_PERIOD                          1
+#define T_SEMICOLON                       2
+#define T_COMMA                           3
+#define T_STRING                          4
+#define T_INTEGER                         5
+#define T_DOUBLE                          6
+#define T_DECIMAL                         7
+#define T_BOOLEAN                         8
+#define T_QNAME                           9
+#define T_BNODE_ID                       10
+#define T_IRIREF                         11
+#define T_LANGTAG                        12
+#define T_PREFIX                         13
+#define T_COLON                          14
+#define T_EOF                            15
+#define T_WS                             16
+#define T_BASE                           17
+#define T_RDF_TYPE                       18
+#define T_DTYPE_MARKER                   19
+#define T_LBRACKET                       20
+#define T_RBRACKET                       21
+#define T_LPAREN                         22
+#define T_RPAREN                         23
+#endif
+/**************** End token definitions ***************************************/
+
+/* The next sections is a series of control #defines.
+** various aspects of the generated parser.
+**    YYCODETYPE         is the data type used to store the integer codes
+**                       that represent terminal and non-terminal symbols.
+**                       "unsigned char" is used if there are fewer than
+**                       256 symbols.  Larger types otherwise.
+**    YYNOCODE           is a number of type YYCODETYPE that is not used for
+**                       any terminal or nonterminal symbol.
+**    YYFALLBACK         If defined, this indicates that one or more tokens
+**                       (also known as: "terminal symbols") have fall-back
+**                       values which should be used if the original symbol
+**                       would not parse.  This permits keywords to sometimes
+**                       be used as identifiers, for example.
+**    YYACTIONTYPE       is the data type used for "action codes" - numbers
+**                       that indicate what to do in response to the next
+**                       token.
+**    TTLParseTOKENTYPE     is the data type used for minor type for terminal
+**                       symbols.  Background: A "minor type" is a semantic
+**                       value associated with a terminal or non-terminal
+**                       symbols.  For example, for an "ID" terminal symbol,
+**                       the minor type might be the name of the identifier.
+**                       Each non-terminal can have a different minor type.
+**                       Terminal symbols all have the same minor type, though.
+**                       This macros defines the minor type for terminal 
+**                       symbols.
+**    YYMINORTYPE        is the data type used for all minor types.
+**                       This is typically a union of many types, one of
+**                       which is TTLParseTOKENTYPE.  The entry in the union
+**                       for terminal symbols is called "yy0".
+**    YYSTACKDEPTH       is the maximum depth of the parser's stack.  If
+**                       zero the stack is dynamically sized using realloc()
+**    TTLParseARG_SDECL     A static variable declaration for the %extra_argument
+**    TTLParseARG_PDECL     A parameter declaration for the %extra_argument
+**    TTLParseARG_PARAM     Code to pass %extra_argument as a subroutine parameter
+**    TTLParseARG_STORE     Code to store %extra_argument into yypParser
+**    TTLParseARG_FETCH     Code to extract %extra_argument from yypParser
+**    TTLParseCTX_*         As TTLParseARG_ except for %extra_context
+**    YYERRORSYMBOL      is the code number of the error symbol.  If not
+**                       defined, then do no error processing.
+**    YYNSTATE           the combined number of states.
+**    YYNRULE            the number of rules in the grammar
+**    YYNTOKEN           Number of terminal symbols
+**    YY_MAX_SHIFT       Maximum value for shift actions
+**    YY_MIN_SHIFTREDUCE Minimum value for shift-reduce actions
+**    YY_MAX_SHIFTREDUCE Maximum value for shift-reduce actions
+**    YY_ERROR_ACTION    The yy_action[] code for syntax error
+**    YY_ACCEPT_ACTION   The yy_action[] code for accept
+**    YY_NO_ACTION       The yy_action[] code for no-op
+**    YY_MIN_REDUCE      Minimum value for reduce actions
+**    YY_MAX_REDUCE      Maximum value for reduce actions
+*/
+#ifndef INTERFACE
+# define INTERFACE 1
+#endif
+/************* Begin control #defines *****************************************/
+#define YYCODETYPE unsigned char
+#define YYNOCODE 41
+#define YYACTIONTYPE unsigned char
+#define TTLParseTOKENTYPE  char * 
+typedef union {
+  int yyinit;
+  TTLParseTOKENTYPE yy0;
+  VOLK_LinkMap * yy2;
+  VOLK_Term * yy12;
+  char * yy33;
+  VOLK_TermSet * yy60;
+} YYMINORTYPE;
+#ifndef YYSTACKDEPTH
+#define YYSTACKDEPTH 100
+#endif
+#define TTLParseARG_SDECL  VOLK_TTLParserState *state ;
+#define TTLParseARG_PDECL , VOLK_TTLParserState *state 
+#define TTLParseARG_PARAM ,state 
+#define TTLParseARG_FETCH  VOLK_TTLParserState *state =yypParser->state ;
+#define TTLParseARG_STORE yypParser->state =state ;
+#define TTLParseCTX_SDECL
+#define TTLParseCTX_PDECL
+#define TTLParseCTX_PARAM
+#define TTLParseCTX_FETCH
+#define TTLParseCTX_STORE
+#define YYNSTATE             28
+#define YYNRULE              41
+#define YYNRULE_WITH_ACTION  27
+#define YYNTOKEN             24
+#define YY_MAX_SHIFT         27
+#define YY_MIN_SHIFTREDUCE   63
+#define YY_MAX_SHIFTREDUCE   103
+#define YY_ERROR_ACTION      104
+#define YY_ACCEPT_ACTION     105
+#define YY_NO_ACTION         106
+#define YY_MIN_REDUCE        107
+#define YY_MAX_REDUCE        147
+/************* End control #defines *******************************************/
+#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
+
+/* Define the yytestcase() macro to be a no-op if is not already defined
+** otherwise.
+**
+** Applications can choose to define yytestcase() in the %include section
+** to a macro that can assist in verifying code coverage.  For production
+** code the yytestcase() macro should be turned off.  But it is useful
+** for testing.
+*/
+#ifndef yytestcase
+# define yytestcase(X)
+#endif
+
+
+/* Next are the tables used to determine what action to take based on the
+** current state and lookahead token.  These tables are used to implement
+** functions that take a state number and lookahead value and return an
+** action integer.  
+**
+** Suppose the action integer is N.  Then the action is determined as
+** follows
+**
+**   0 <= N <= YY_MAX_SHIFT             Shift N.  That is, push the lookahead
+**                                      token onto the stack and goto state N.
+**
+**   N between YY_MIN_SHIFTREDUCE       Shift to an arbitrary state then
+**     and YY_MAX_SHIFTREDUCE           reduce by rule N-YY_MIN_SHIFTREDUCE.
+**
+**   N == YY_ERROR_ACTION               A syntax error has occurred.
+**
+**   N == YY_ACCEPT_ACTION              The parser accepts its input.
+**
+**   N == YY_NO_ACTION                  No such action.  Denotes unused
+**                                      slots in the yy_action[] table.
+**
+**   N between YY_MIN_REDUCE            Reduce by rule N-YY_MIN_REDUCE
+**     and YY_MAX_REDUCE
+**
+** The action table is constructed as a single large table named yy_action[].
+** Given state S and lookahead X, the action is computed as either:
+**
+**    (A)   N = yy_action[ yy_shift_ofst[S] + X ]
+**    (B)   N = yy_default[S]
+**
+** The (A) formula is preferred.  The B formula is used instead if
+** yy_lookahead[yy_shift_ofst[S]+X] is not equal to X.
+**
+** The formulas above are for computing the action when the lookahead is
+** a terminal symbol.  If the lookahead is a non-terminal (as occurs after
+** a reduce action) then the yy_reduce_ofst[] array is used in place of
+** the yy_shift_ofst[] array.
+**
+** The following are the tables generated in this section:
+**
+**  yy_action[]        A single table containing all actions.
+**  yy_lookahead[]     A table containing the lookahead for each entry in
+**                     yy_action.  Used to detect hash collisions.
+**  yy_shift_ofst[]    For each state, the offset into yy_action for
+**                     shifting terminals.
+**  yy_reduce_ofst[]   For each state, the offset into yy_action for
+**                     shifting non-terminals after a reduce.
+**  yy_default[]       Default action for each state.
+**
+*********** Begin parsing tables **********************************************/
+#define YY_ACTTAB_COUNT (111)
+static const YYACTIONTYPE yy_action[] = {
+ /*     0 */   105,    1,   65,    9,   17,   77,   78,   79,   80,   89,
+ /*    10 */    81,   88,   17,   77,   78,   79,   80,   89,   81,   88,
+ /*    20 */     7,   14,    2,   84,   14,   89,   81,   88,    7,   26,
+ /*    30 */     2,   27,   96,   23,    5,  120,    7,  102,    2,  135,
+ /*    40 */   135,  135,  135,   15,  130,  130,  130,  130,  130,  115,
+ /*    50 */   116,    3,  116,  131,  131,  131,  131,  131,   11,   10,
+ /*    60 */    19,  114,  114,  114,  114,  114,   20,  114,  114,  114,
+ /*    70 */   114,  114,  113,  113,  113,  113,  113,   89,   83,   88,
+ /*    80 */    16,   13,    4,   89,   13,   88,   73,    8,   66,   82,
+ /*    90 */    18,   13,   73,  102,   13,   89,   89,   88,   88,    6,
+ /*   100 */    85,   75,   64,   21,   22,   73,   63,   25,   12,   24,
+ /*   110 */   134,
+};
+static const YYCODETYPE yy_lookahead[] = {
+ /*     0 */    24,   25,    1,    2,    4,    5,    6,    7,    8,    9,
+ /*    10 */    10,   11,    4,    5,    6,    7,    8,    9,   10,   11,
+ /*    20 */    20,   33,   22,   23,   36,    9,   10,   11,   20,   13,
+ /*    30 */    22,   15,   16,   17,   31,   36,   20,   16,   22,   26,
+ /*    40 */    27,   28,   29,   30,   35,   36,   37,   38,   39,   36,
+ /*    50 */    37,   31,   39,   35,   36,   37,   38,   39,   40,    2,
+ /*    60 */    34,   35,   36,   37,   38,   39,   34,   35,   36,   37,
+ /*    70 */    38,   39,   35,   36,   37,   38,   39,    9,   21,   11,
+ /*    80 */    32,   33,   31,    9,   36,   11,   18,   31,    1,   21,
+ /*    90 */    32,   33,   18,   16,   36,    9,    9,   11,   11,    3,
+ /*   100 */    23,   12,    1,   11,   16,   18,    1,   16,   19,   11,
+ /*   110 */     0,   41,   41,   41,   41,   41,   41,   41,   41,   41,
+ /*   120 */    41,   41,   41,   41,   41,   41,   41,   41,   41,   41,
+ /*   130 */    41,   41,   41,   41,   41,
+};
+#define YY_SHIFT_COUNT    (27)
+#define YY_SHIFT_MIN      (0)
+#define YY_SHIFT_MAX      (110)
+static const unsigned char yy_shift_ofst[] = {
+ /*     0 */   111,   16,    0,    8,    8,    8,    8,   68,   74,   87,
+ /*    10 */    74,   77,   86,   21,   21,   21,   57,   89,    1,   96,
+ /*    20 */    96,  101,   92,   88,  105,   98,   91,  110,
+};
+#define YY_REDUCE_COUNT (15)
+#define YY_REDUCE_MIN   (-24)
+#define YY_REDUCE_MAX   (58)
+static const signed char yy_reduce_ofst[] = {
+ /*     0 */   -24,   13,   18,   26,   32,    9,   37,   48,   58,  -12,
+ /*    10 */   -12,    3,   -1,   20,   51,   56,
+};
+static const YYACTIONTYPE yy_default[] = {
+ /*     0 */   136,  104,  104,  104,  104,  104,  104,  104,  104,  104,
+ /*    10 */   104,  147,  104,  147,  147,  147,  104,  118,  104,  111,
+ /*    20 */   112,  104,  104,  104,  104,  104,  104,  104,
+};
+/********** End of lemon-generated parsing tables *****************************/
+
+/* The next table maps tokens (terminal symbols) into fallback tokens.  
+** If a construct like the following:
+** 
+**      %fallback ID X Y Z.
+**
+** appears in the grammar, then ID becomes a fallback token for X, Y,
+** and Z.  Whenever one of the tokens X, Y, or Z is input to the parser
+** but it does not parse, the type of the token is changed to ID and
+** the parse is retried before an error is thrown.
+**
+** This feature can be used, for example, to cause some keywords in a language
+** to revert to identifiers if they keyword does not apply in the context where
+** it appears.
+*/
+#ifdef YYFALLBACK
+static const YYCODETYPE yyFallback[] = {
+};
+#endif /* YYFALLBACK */
+
+/* The following structure represents a single element of the
+** parser's stack.  Information stored includes:
+**
+**   +  The state number for the parser at this level of the stack.
+**
+**   +  The value of the token stored at this level of the stack.
+**      (In other words, the "major" token.)
+**
+**   +  The semantic value stored at this level of the stack.  This is
+**      the information used by the action routines in the grammar.
+**      It is sometimes called the "minor" token.
+**
+** After the "shift" half of a SHIFTREDUCE action, the stateno field
+** actually contains the reduce action for the second half of the
+** SHIFTREDUCE.
+*/
+struct yyStackEntry {
+  YYACTIONTYPE stateno;  /* The state-number, or reduce action in SHIFTREDUCE */
+  YYCODETYPE major;      /* The major token value.  This is the code
+                         ** number for the token at this stack level */
+  YYMINORTYPE minor;     /* The user-supplied minor token value.  This
+                         ** is the value of the token  */
+};
+typedef struct yyStackEntry yyStackEntry;
+
+/* The state of the parser is completely contained in an instance of
+** the following structure */
+struct yyParser {
+  yyStackEntry *yytos;          /* Pointer to top element of the stack */
+#ifdef YYTRACKMAXSTACKDEPTH
+  int yyhwm;                    /* High-water mark of the stack */
+#endif
+#ifndef YYNOERRORRECOVERY
+  int yyerrcnt;                 /* Shifts left before out of the error */
+#endif
+  TTLParseARG_SDECL                /* A place to hold %extra_argument */
+  TTLParseCTX_SDECL                /* A place to hold %extra_context */
+#if YYSTACKDEPTH<=0
+  int yystksz;                  /* Current side of the stack */
+  yyStackEntry *yystack;        /* The parser's stack */
+  yyStackEntry yystk0;          /* First stack entry */
+#else
+  yyStackEntry yystack[YYSTACKDEPTH];  /* The parser's stack */
+  yyStackEntry *yystackEnd;            /* Last entry in the stack */
+#endif
+};
+typedef struct yyParser yyParser;
+
+#include <assert.h>
+#ifndef NDEBUG
+#include <stdio.h>
+static FILE *yyTraceFILE = 0;
+static char *yyTracePrompt = 0;
+#endif /* NDEBUG */
+
+#ifndef NDEBUG
+/* 
+** Turn parser tracing on by giving a stream to which to write the trace
+** and a prompt to preface each trace message.  Tracing is turned off
+** by making either argument NULL 
+**
+** Inputs:
+** <ul>
+** <li> A FILE* to which trace output should be written.
+**      If NULL, then tracing is turned off.
+** <li> A prefix string written at the beginning of every
+**      line of trace output.  If NULL, then tracing is
+**      turned off.
+** </ul>
+**
+** Outputs:
+** None.
+*/
+void TTLParseTrace(FILE *TraceFILE, char *zTracePrompt){
+  yyTraceFILE = TraceFILE;
+  yyTracePrompt = zTracePrompt;
+  if( yyTraceFILE==0 ) yyTracePrompt = 0;
+  else if( yyTracePrompt==0 ) yyTraceFILE = 0;
+}
+#endif /* NDEBUG */
+
+#if defined(YYCOVERAGE) || !defined(NDEBUG)
+/* For tracing shifts, the names of all terminals and nonterminals
+** are required.  The following table supplies these names */
+static const char *const yyTokenName[] = { 
+  /*    0 */ "$",
+  /*    1 */ "PERIOD",
+  /*    2 */ "SEMICOLON",
+  /*    3 */ "COMMA",
+  /*    4 */ "STRING",
+  /*    5 */ "INTEGER",
+  /*    6 */ "DOUBLE",
+  /*    7 */ "DECIMAL",
+  /*    8 */ "BOOLEAN",
+  /*    9 */ "QNAME",
+  /*   10 */ "BNODE_ID",
+  /*   11 */ "IRIREF",
+  /*   12 */ "LANGTAG",
+  /*   13 */ "PREFIX",
+  /*   14 */ "COLON",
+  /*   15 */ "EOF",
+  /*   16 */ "WS",
+  /*   17 */ "BASE",
+  /*   18 */ "RDF_TYPE",
+  /*   19 */ "DTYPE_MARKER",
+  /*   20 */ "LBRACKET",
+  /*   21 */ "RBRACKET",
+  /*   22 */ "LPAREN",
+  /*   23 */ "RPAREN",
+  /*   24 */ "turtleDoc",
+  /*   25 */ "statements",
+  /*   26 */ "statement",
+  /*   27 */ "prefixID",
+  /*   28 */ "base",
+  /*   29 */ "triples",
+  /*   30 */ "subject",
+  /*   31 */ "ows",
+  /*   32 */ "predObjList",
+  /*   33 */ "predicate",
+  /*   34 */ "objectList",
+  /*   35 */ "object",
+  /*   36 */ "resource",
+  /*   37 */ "blank",
+  /*   38 */ "literal",
+  /*   39 */ "collection",
+  /*   40 */ "itemList",
+};
+#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
+
+#ifndef NDEBUG
+/* For tracing reduce actions, the names of all rules are required.
+*/
+static const char *const yyRuleName[] = {
+ /*   0 */ "prefixID ::= PREFIX WS IRIREF PERIOD",
+ /*   1 */ "base ::= BASE WS IRIREF PERIOD",
+ /*   2 */ "triples ::= subject ows predObjList PERIOD",
+ /*   3 */ "triples ::= subject ows predObjList SEMICOLON PERIOD",
+ /*   4 */ "predObjList ::= predicate ows objectList",
+ /*   5 */ "predObjList ::= predObjList SEMICOLON predicate ows objectList",
+ /*   6 */ "objectList ::= objectList COMMA object",
+ /*   7 */ "objectList ::= object",
+ /*   8 */ "subject ::= resource",
+ /*   9 */ "subject ::= blank",
+ /*  10 */ "predicate ::= RDF_TYPE",
+ /*  11 */ "literal ::= STRING",
+ /*  12 */ "literal ::= STRING LANGTAG",
+ /*  13 */ "literal ::= STRING DTYPE_MARKER resource",
+ /*  14 */ "literal ::= INTEGER",
+ /*  15 */ "literal ::= DOUBLE",
+ /*  16 */ "literal ::= DECIMAL",
+ /*  17 */ "literal ::= BOOLEAN",
+ /*  18 */ "blank ::= BNODE_ID",
+ /*  19 */ "blank ::= LBRACKET RBRACKET",
+ /*  20 */ "blank ::= LBRACKET predObjList RBRACKET",
+ /*  21 */ "blank ::= LPAREN RPAREN",
+ /*  22 */ "collection ::= LPAREN itemList RPAREN",
+ /*  23 */ "itemList ::= itemList ows object",
+ /*  24 */ "itemList ::= object",
+ /*  25 */ "resource ::= IRIREF",
+ /*  26 */ "resource ::= QNAME",
+ /*  27 */ "turtleDoc ::= statements EOF",
+ /*  28 */ "statements ::= statements statement",
+ /*  29 */ "statements ::=",
+ /*  30 */ "statement ::= prefixID",
+ /*  31 */ "statement ::= base",
+ /*  32 */ "statement ::= triples",
+ /*  33 */ "statement ::= WS",
+ /*  34 */ "predicate ::= resource",
+ /*  35 */ "object ::= resource",
+ /*  36 */ "object ::= blank",
+ /*  37 */ "object ::= literal",
+ /*  38 */ "blank ::= collection",
+ /*  39 */ "ows ::= WS",
+ /*  40 */ "ows ::=",
+};
+#endif /* NDEBUG */
+
+
+#if YYSTACKDEPTH<=0
+/*
+** Try to increase the size of the parser stack.  Return the number
+** of errors.  Return 0 on success.
+*/
+static int yyGrowStack(yyParser *p){
+  int newSize;
+  int idx;
+  yyStackEntry *pNew;
+
+  newSize = p->yystksz*2 + 100;
+  idx = p->yytos ? (int)(p->yytos - p->yystack) : 0;
+  if( p->yystack==&p->yystk0 ){
+    pNew = malloc(newSize*sizeof(pNew[0]));
+    if( pNew ) pNew[0] = p->yystk0;
+  }else{
+    pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
+  }
+  if( pNew ){
+    p->yystack = pNew;
+    p->yytos = &p->yystack[idx];
+#ifndef NDEBUG
+    if( yyTraceFILE ){
+      fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n",
+              yyTracePrompt, p->yystksz, newSize);
+    }
+#endif
+    p->yystksz = newSize;
+  }
+  return pNew==0; 
+}
+#endif
+
+/* Datatype of the argument to the memory allocated passed as the
+** second argument to TTLParseAlloc() below.  This can be changed by
+** putting an appropriate #define in the %include section of the input
+** grammar.
+*/
+#ifndef YYMALLOCARGTYPE
+# define YYMALLOCARGTYPE size_t
+#endif
+
+/* Initialize a new parser that has already been allocated.
+*/
+void TTLParseInit(void *yypRawParser TTLParseCTX_PDECL){
+  yyParser *yypParser = (yyParser*)yypRawParser;
+  TTLParseCTX_STORE
+#ifdef YYTRACKMAXSTACKDEPTH
+  yypParser->yyhwm = 0;
+#endif
+#if YYSTACKDEPTH<=0
+  yypParser->yytos = NULL;
+  yypParser->yystack = NULL;
+  yypParser->yystksz = 0;
+  if( yyGrowStack(yypParser) ){
+    yypParser->yystack = &yypParser->yystk0;
+    yypParser->yystksz = 1;
+  }
+#endif
+#ifndef YYNOERRORRECOVERY
+  yypParser->yyerrcnt = -1;
+#endif
+  yypParser->yytos = yypParser->yystack;
+  yypParser->yystack[0].stateno = 0;
+  yypParser->yystack[0].major = 0;
+#if YYSTACKDEPTH>0
+  yypParser->yystackEnd = &yypParser->yystack[YYSTACKDEPTH-1];
+#endif
+}
+
+#ifndef TTLParse_ENGINEALWAYSONSTACK
+/* 
+** This function allocates a new parser.
+** The only argument is a pointer to a function which works like
+** malloc.
+**
+** Inputs:
+** A pointer to the function used to allocate memory.
+**
+** Outputs:
+** A pointer to a parser.  This pointer is used in subsequent calls
+** to TTLParse and TTLParseFree.
+*/
+void *TTLParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) TTLParseCTX_PDECL){
+  yyParser *yypParser;
+  yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
+  if( yypParser ){
+    TTLParseCTX_STORE
+    TTLParseInit(yypParser TTLParseCTX_PARAM);
+  }
+  return (void*)yypParser;
+}
+#endif /* TTLParse_ENGINEALWAYSONSTACK */
+
+
+/* The following function deletes the "minor type" or semantic value
+** associated with a symbol.  The symbol can be either a terminal
+** or nonterminal. "yymajor" is the symbol code, and "yypminor" is
+** a pointer to the value to be deleted.  The code used to do the 
+** deletions is derived from the %destructor and/or %token_destructor
+** directives of the input grammar.
+*/
+static void yy_destructor(
+  yyParser *yypParser,    /* The parser */
+  YYCODETYPE yymajor,     /* Type code for object to destroy */
+  YYMINORTYPE *yypminor   /* The object to be destroyed */
+){
+  TTLParseARG_FETCH
+  TTLParseCTX_FETCH
+  switch( yymajor ){
+    /* Here is inserted the actions which take place when a
+    ** terminal or non-terminal is destroyed.  This can happen
+    ** when the symbol is popped from the stack during a
+    ** reduce or during error processing or when a parser is 
+    ** being destroyed before it is finished parsing.
+    **
+    ** Note: during a reduce, the only symbols destroyed are those
+    ** which appear on the RHS of the rule, but which are *not* used
+    ** inside the C code.
+    */
+/********* Begin destructor definitions ***************************************/
+      /* TERMINAL Destructor */
+    case 1: /* PERIOD */
+    case 2: /* SEMICOLON */
+    case 3: /* COMMA */
+    case 4: /* STRING */
+    case 5: /* INTEGER */
+    case 6: /* DOUBLE */
+    case 7: /* DECIMAL */
+    case 8: /* BOOLEAN */
+    case 9: /* QNAME */
+    case 10: /* BNODE_ID */
+    case 11: /* IRIREF */
+    case 12: /* LANGTAG */
+    case 13: /* PREFIX */
+    case 14: /* COLON */
+    case 15: /* EOF */
+    case 16: /* WS */
+    case 17: /* BASE */
+    case 18: /* RDF_TYPE */
+    case 19: /* DTYPE_MARKER */
+    case 20: /* LBRACKET */
+    case 21: /* RBRACKET */
+    case 22: /* LPAREN */
+    case 23: /* RPAREN */
+{
+#line 36 "grammar_ttl.y"
+ (void) state; free ((yypminor->yy0)); 
+#line 625 "../../build/grammar_ttl.c"
+}
+      break;
+    case 30: /* subject */
+    case 33: /* predicate */
+    case 35: /* object */
+    case 36: /* resource */
+    case 37: /* blank */
+    case 38: /* literal */
+    case 39: /* collection */
+{
+#line 120 "grammar_ttl.y"
+ VOLK_term_free ((yypminor->yy12)); 
+#line 638 "../../build/grammar_ttl.c"
+}
+      break;
+    case 32: /* predObjList */
+{
+#line 97 "grammar_ttl.y"
+ VOLK_link_map_free ((yypminor->yy2)); 
+#line 645 "../../build/grammar_ttl.c"
+}
+      break;
+    case 34: /* objectList */
+    case 40: /* itemList */
+{
+#line 108 "grammar_ttl.y"
+ VOLK_term_set_free ((yypminor->yy60)); 
+#line 653 "../../build/grammar_ttl.c"
+}
+      break;
+/********* End destructor definitions *****************************************/
+    default:  break;   /* If no destructor action specified: do nothing */
+  }
+}
+
+/*
+** Pop the parser's stack once.
+**
+** If there is a destructor routine associated with the token which
+** is popped from the stack, then call it.
+*/
+static void yy_pop_parser_stack(yyParser *pParser){
+  yyStackEntry *yytos;
+  assert( pParser->yytos!=0 );
+  assert( pParser->yytos > pParser->yystack );
+  yytos = pParser->yytos--;
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    fprintf(yyTraceFILE,"%sPopping %s\n",
+      yyTracePrompt,
+      yyTokenName[yytos->major]);
+  }
+#endif
+  yy_destructor(pParser, yytos->major, &yytos->minor);
+}
+
+/*
+** Clear all secondary memory allocations from the parser
+*/
+void TTLParseFinalize(void *p){
+  yyParser *pParser = (yyParser*)p;
+  while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
+#if YYSTACKDEPTH<=0
+  if( pParser->yystack!=&pParser->yystk0 ) free(pParser->yystack);
+#endif
+}
+
+#ifndef TTLParse_ENGINEALWAYSONSTACK
+/* 
+** Deallocate and destroy a parser.  Destructors are called for
+** all stack elements before shutting the parser down.
+**
+** If the YYPARSEFREENEVERNULL macro exists (for example because it
+** is defined in a %include section of the input grammar) then it is
+** assumed that the input pointer is never NULL.
+*/
+void TTLParseFree(
+  void *p,                    /* The parser to be deleted */
+  void (*freeProc)(void*)     /* Function used to reclaim memory */
+){
+#ifndef YYPARSEFREENEVERNULL
+  if( p==0 ) return;
+#endif
+  TTLParseFinalize(p);
+  (*freeProc)(p);
+}
+#endif /* TTLParse_ENGINEALWAYSONSTACK */
+
+/*
+** Return the peak depth of the stack for a parser.
+*/
+#ifdef YYTRACKMAXSTACKDEPTH
+int TTLParseStackPeak(void *p){
+  yyParser *pParser = (yyParser*)p;
+  return pParser->yyhwm;
+}
+#endif
+
+/* This array of booleans keeps track of the parser statement
+** coverage.  The element yycoverage[X][Y] is set when the parser
+** is in state X and has a lookahead token Y.  In a well-tested
+** systems, every element of this matrix should end up being set.
+*/
+#if defined(YYCOVERAGE)
+static unsigned char yycoverage[YYNSTATE][YYNTOKEN];
+#endif
+
+/*
+** Write into out a description of every state/lookahead combination that
+**
+**   (1)  has not been used by the parser, and
+**   (2)  is not a syntax error.
+**
+** Return the number of missed state/lookahead combinations.
+*/
+#if defined(YYCOVERAGE)
+int TTLParseCoverage(FILE *out){
+  int stateno, iLookAhead, i;
+  int nMissed = 0;
+  for(stateno=0; stateno<YYNSTATE; stateno++){
+    i = yy_shift_ofst[stateno];
+    for(iLookAhead=0; iLookAhead<YYNTOKEN; iLookAhead++){
+      if( yy_lookahead[i+iLookAhead]!=iLookAhead ) continue;
+      if( yycoverage[stateno][iLookAhead]==0 ) nMissed++;
+      if( out ){
+        fprintf(out,"State %d lookahead %s %s\n", stateno,
+                yyTokenName[iLookAhead],
+                yycoverage[stateno][iLookAhead] ? "ok" : "missed");
+      }
+    }
+  }
+  return nMissed;
+}
+#endif
+
+/*
+** Find the appropriate action for a parser given the terminal
+** look-ahead token iLookAhead.
+*/
+static YYACTIONTYPE yy_find_shift_action(
+  YYCODETYPE iLookAhead,    /* The look-ahead token */
+  YYACTIONTYPE stateno      /* Current state number */
+){
+  int i;
+
+  if( stateno>YY_MAX_SHIFT ) return stateno;
+  assert( stateno <= YY_SHIFT_COUNT );
+#if defined(YYCOVERAGE)
+  yycoverage[stateno][iLookAhead] = 1;
+#endif
+  do{
+    i = yy_shift_ofst[stateno];
+    assert( i>=0 );
+    assert( i<=YY_ACTTAB_COUNT );
+    assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
+    assert( iLookAhead!=YYNOCODE );
+    assert( iLookAhead < YYNTOKEN );
+    i += iLookAhead;
+    assert( i<(int)YY_NLOOKAHEAD );
+    if( yy_lookahead[i]!=iLookAhead ){
+#ifdef YYFALLBACK
+      YYCODETYPE iFallback;            /* Fallback token */
+      assert( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0]) );
+      iFallback = yyFallback[iLookAhead];
+      if( iFallback!=0 ){
+#ifndef NDEBUG
+        if( yyTraceFILE ){
+          fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n",
+             yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]);
+        }
+#endif
+        assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */
+        iLookAhead = iFallback;
+        continue;
+      }
+#endif
+#ifdef YYWILDCARD
+      {
+        int j = i - iLookAhead + YYWILDCARD;
+        assert( j<(int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])) );
+        if( yy_lookahead[j]==YYWILDCARD && iLookAhead>0 ){
+#ifndef NDEBUG
+          if( yyTraceFILE ){
+            fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n",
+               yyTracePrompt, yyTokenName[iLookAhead],
+               yyTokenName[YYWILDCARD]);
+          }
+#endif /* NDEBUG */
+          return yy_action[j];
+        }
+      }
+#endif /* YYWILDCARD */
+      return yy_default[stateno];
+    }else{
+      assert( i>=0 && i<(int)(sizeof(yy_action)/sizeof(yy_action[0])) );
+      return yy_action[i];
+    }
+  }while(1);
+}
+
+/*
+** Find the appropriate action for a parser given the non-terminal
+** look-ahead token iLookAhead.
+*/
+static YYACTIONTYPE yy_find_reduce_action(
+  YYACTIONTYPE stateno,     /* Current state number */
+  YYCODETYPE iLookAhead     /* The look-ahead token */
+){
+  int i;
+#ifdef YYERRORSYMBOL
+  if( stateno>YY_REDUCE_COUNT ){
+    return yy_default[stateno];
+  }
+#else
+  assert( stateno<=YY_REDUCE_COUNT );
+#endif
+  i = yy_reduce_ofst[stateno];
+  assert( iLookAhead!=YYNOCODE );
+  i += iLookAhead;
+#ifdef YYERRORSYMBOL
+  if( i<0 || i>=YY_ACTTAB_COUNT || yy_lookahead[i]!=iLookAhead ){
+    return yy_default[stateno];
+  }
+#else
+  assert( i>=0 && i<YY_ACTTAB_COUNT );
+  assert( yy_lookahead[i]==iLookAhead );
+#endif
+  return yy_action[i];
+}
+
+/*
+** The following routine is called if the stack overflows.
+*/
+static void yyStackOverflow(yyParser *yypParser){
+   TTLParseARG_FETCH
+   TTLParseCTX_FETCH
+#ifndef NDEBUG
+   if( yyTraceFILE ){
+     fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt);
+   }
+#endif
+   while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
+   /* Here code is inserted which will execute if the parser
+   ** stack every overflows */
+/******** Begin %stack_overflow code ******************************************/
+#line 17 "grammar_ttl.y"
+
+    log_error ("Stack oveflow in TTL parsing.");
+    state->rc = VOLK_MEM_ERR;
+#line 875 "../../build/grammar_ttl.c"
+/******** End %stack_overflow code ********************************************/
+   TTLParseARG_STORE /* Suppress warning about unused %extra_argument var */
+   TTLParseCTX_STORE
+}
+
+/*
+** Print tracing information for a SHIFT action
+*/
+#ifndef NDEBUG
+static void yyTraceShift(yyParser *yypParser, int yyNewState, const char *zTag){
+  if( yyTraceFILE ){
+    if( yyNewState<YYNSTATE ){
+      fprintf(yyTraceFILE,"%s%s '%s', go to state %d\n",
+         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
+         yyNewState);
+    }else{
+      fprintf(yyTraceFILE,"%s%s '%s', pending reduce %d\n",
+         yyTracePrompt, zTag, yyTokenName[yypParser->yytos->major],
+         yyNewState - YY_MIN_REDUCE);
+    }
+  }
+}
+#else
+# define yyTraceShift(X,Y,Z)
+#endif
+
+/*
+** Perform a shift action.
+*/
+static void yy_shift(
+  yyParser *yypParser,          /* The parser to be shifted */
+  YYACTIONTYPE yyNewState,      /* The new state to shift in */
+  YYCODETYPE yyMajor,           /* The major token to shift in */
+  TTLParseTOKENTYPE yyMinor        /* The minor token to shift in */
+){
+  yyStackEntry *yytos;
+  yypParser->yytos++;
+#ifdef YYTRACKMAXSTACKDEPTH
+  if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
+    yypParser->yyhwm++;
+    assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack) );
+  }
+#endif
+#if YYSTACKDEPTH>0 
+  if( yypParser->yytos>yypParser->yystackEnd ){
+    yypParser->yytos--;
+    yyStackOverflow(yypParser);
+    return;
+  }
+#else
+  if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz] ){
+    if( yyGrowStack(yypParser) ){
+      yypParser->yytos--;
+      yyStackOverflow(yypParser);
+      return;
+    }
+  }
+#endif
+  if( yyNewState > YY_MAX_SHIFT ){
+    yyNewState += YY_MIN_REDUCE - YY_MIN_SHIFTREDUCE;
+  }
+  yytos = yypParser->yytos;
+  yytos->stateno = yyNewState;
+  yytos->major = yyMajor;
+  yytos->minor.yy0 = yyMinor;
+  yyTraceShift(yypParser, yyNewState, "Shift");
+}
+
+/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
+** of that rule */
+static const YYCODETYPE yyRuleInfoLhs[] = {
+    27,  /* (0) prefixID ::= PREFIX WS IRIREF PERIOD */
+    28,  /* (1) base ::= BASE WS IRIREF PERIOD */
+    29,  /* (2) triples ::= subject ows predObjList PERIOD */
+    29,  /* (3) triples ::= subject ows predObjList SEMICOLON PERIOD */
+    32,  /* (4) predObjList ::= predicate ows objectList */
+    32,  /* (5) predObjList ::= predObjList SEMICOLON predicate ows objectList */
+    34,  /* (6) objectList ::= objectList COMMA object */
+    34,  /* (7) objectList ::= object */
+    30,  /* (8) subject ::= resource */
+    30,  /* (9) subject ::= blank */
+    33,  /* (10) predicate ::= RDF_TYPE */
+    38,  /* (11) literal ::= STRING */
+    38,  /* (12) literal ::= STRING LANGTAG */
+    38,  /* (13) literal ::= STRING DTYPE_MARKER resource */
+    38,  /* (14) literal ::= INTEGER */
+    38,  /* (15) literal ::= DOUBLE */
+    38,  /* (16) literal ::= DECIMAL */
+    38,  /* (17) literal ::= BOOLEAN */
+    37,  /* (18) blank ::= BNODE_ID */
+    37,  /* (19) blank ::= LBRACKET RBRACKET */
+    37,  /* (20) blank ::= LBRACKET predObjList RBRACKET */
+    37,  /* (21) blank ::= LPAREN RPAREN */
+    39,  /* (22) collection ::= LPAREN itemList RPAREN */
+    40,  /* (23) itemList ::= itemList ows object */
+    40,  /* (24) itemList ::= object */
+    36,  /* (25) resource ::= IRIREF */
+    36,  /* (26) resource ::= QNAME */
+    24,  /* (27) turtleDoc ::= statements EOF */
+    25,  /* (28) statements ::= statements statement */
+    25,  /* (29) statements ::= */
+    26,  /* (30) statement ::= prefixID */
+    26,  /* (31) statement ::= base */
+    26,  /* (32) statement ::= triples */
+    26,  /* (33) statement ::= WS */
+    33,  /* (34) predicate ::= resource */
+    35,  /* (35) object ::= resource */
+    35,  /* (36) object ::= blank */
+    35,  /* (37) object ::= literal */
+    37,  /* (38) blank ::= collection */
+    31,  /* (39) ows ::= WS */
+    31,  /* (40) ows ::= */
+};
+
+/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
+** of symbols on the right-hand side of that rule. */
+static const signed char yyRuleInfoNRhs[] = {
+   -4,  /* (0) prefixID ::= PREFIX WS IRIREF PERIOD */
+   -4,  /* (1) base ::= BASE WS IRIREF PERIOD */
+   -4,  /* (2) triples ::= subject ows predObjList PERIOD */
+   -5,  /* (3) triples ::= subject ows predObjList SEMICOLON PERIOD */
+   -3,  /* (4) predObjList ::= predicate ows objectList */
+   -5,  /* (5) predObjList ::= predObjList SEMICOLON predicate ows objectList */
+   -3,  /* (6) objectList ::= objectList COMMA object */
+   -1,  /* (7) objectList ::= object */
+   -1,  /* (8) subject ::= resource */
+   -1,  /* (9) subject ::= blank */
+   -1,  /* (10) predicate ::= RDF_TYPE */
+   -1,  /* (11) literal ::= STRING */
+   -2,  /* (12) literal ::= STRING LANGTAG */
+   -3,  /* (13) literal ::= STRING DTYPE_MARKER resource */
+   -1,  /* (14) literal ::= INTEGER */
+   -1,  /* (15) literal ::= DOUBLE */
+   -1,  /* (16) literal ::= DECIMAL */
+   -1,  /* (17) literal ::= BOOLEAN */
+   -1,  /* (18) blank ::= BNODE_ID */
+   -2,  /* (19) blank ::= LBRACKET RBRACKET */
+   -3,  /* (20) blank ::= LBRACKET predObjList RBRACKET */
+   -2,  /* (21) blank ::= LPAREN RPAREN */
+   -3,  /* (22) collection ::= LPAREN itemList RPAREN */
+   -3,  /* (23) itemList ::= itemList ows object */
+   -1,  /* (24) itemList ::= object */
+   -1,  /* (25) resource ::= IRIREF */
+   -1,  /* (26) resource ::= QNAME */
+   -2,  /* (27) turtleDoc ::= statements EOF */
+   -2,  /* (28) statements ::= statements statement */
+    0,  /* (29) statements ::= */
+   -1,  /* (30) statement ::= prefixID */
+   -1,  /* (31) statement ::= base */
+   -1,  /* (32) statement ::= triples */
+   -1,  /* (33) statement ::= WS */
+   -1,  /* (34) predicate ::= resource */
+   -1,  /* (35) object ::= resource */
+   -1,  /* (36) object ::= blank */
+   -1,  /* (37) object ::= literal */
+   -1,  /* (38) blank ::= collection */
+   -1,  /* (39) ows ::= WS */
+    0,  /* (40) ows ::= */
+};
+
+static void yy_accept(yyParser*);  /* Forward Declaration */
+
+/*
+** Perform a reduce action and the shift that must immediately
+** follow the reduce.
+**
+** The yyLookahead and yyLookaheadToken parameters provide reduce actions
+** access to the lookahead token (if any).  The yyLookahead will be YYNOCODE
+** if the lookahead token has already been consumed.  As this procedure is
+** only called from one place, optimizing compilers will in-line it, which
+** means that the extra parameters have no performance impact.
+*/
+static YYACTIONTYPE yy_reduce(
+  yyParser *yypParser,         /* The parser */
+  unsigned int yyruleno,       /* Number of the rule by which to reduce */
+  int yyLookahead,             /* Lookahead token, or YYNOCODE if none */
+  TTLParseTOKENTYPE yyLookaheadToken  /* Value of the lookahead token */
+  TTLParseCTX_PDECL                   /* %extra_context */
+){
+  int yygoto;                     /* The next state */
+  YYACTIONTYPE yyact;             /* The next action */
+  yyStackEntry *yymsp;            /* The top of the parser's stack */
+  int yysize;                     /* Amount to pop the stack */
+  TTLParseARG_FETCH
+  (void)yyLookahead;
+  (void)yyLookaheadToken;
+  yymsp = yypParser->yytos;
+
+  switch( yyruleno ){
+  /* Beginning here are the reduction cases.  A typical example
+  ** follows:
+  **   case 0:
+  **  #line <lineno> <grammarfile>
+  **     { ... }           // User supplied code
+  **  #line <lineno> <thisfile>
+  **     break;
+  */
+/********** Begin reduce actions **********************************************/
+        YYMINORTYPE yylhsminor;
+      case 0: /* prefixID ::= PREFIX WS IRIREF PERIOD */
+#line 63 "grammar_ttl.y"
+{
+                VOLK_nsmap_add (yymsp[-3].minor.yy0, yymsp[-1].minor.yy0);
+
+                free (yymsp[-3].minor.yy0);
+                free (yymsp[-1].minor.yy0);
+            }
+#line 1083 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,16,&yymsp[-2].minor);
+  yy_destructor(yypParser,1,&yymsp[0].minor);
+        break;
+      case 1: /* base ::= BASE WS IRIREF PERIOD */
+{  yy_destructor(yypParser,17,&yymsp[-3].minor);
+#line 70 "grammar_ttl.y"
+{
+                VOLK_term_free (state->base);
+                state->base = VOLK_iriref_new (yymsp[-1].minor.yy0);
+
+                free (yymsp[-1].minor.yy0);
+            }
+#line 1096 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,16,&yymsp[-2].minor);
+  yy_destructor(yypParser,1,&yymsp[0].minor);
+}
+        break;
+      case 2: /* triples ::= subject ows predObjList PERIOD */
+#line 77 "grammar_ttl.y"
+{
+                size_t ct = VOLK_graph_add_link_map (state->it, yymsp[-1].minor.yy2);
+                state->ct += ct;
+                state->rc = VOLK_OK;
+                LOG_TRACE("Added %lu triples.", ct);
+
+                VOLK_term_free (yymsp[-3].minor.yy12);
+                VOLK_link_map_free (yymsp[-1].minor.yy2);
+            }
+#line 1112 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,1,&yymsp[0].minor);
+        break;
+      case 3: /* triples ::= subject ows predObjList SEMICOLON PERIOD */
+#line 86 "grammar_ttl.y"
+{
+                size_t ct = VOLK_graph_add_link_map (state->it, yymsp[-2].minor.yy2);
+                state->ct += ct;
+                state->rc = VOLK_OK;
+                LOG_TRACE("Added %lu triples.", ct);
+
+                VOLK_term_free (yymsp[-4].minor.yy12);
+                VOLK_link_map_free (yymsp[-2].minor.yy2);
+            }
+#line 1126 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,2,&yymsp[-1].minor);
+  yy_destructor(yypParser,1,&yymsp[0].minor);
+        break;
+      case 4: /* predObjList ::= predicate ows objectList */
+#line 98 "grammar_ttl.y"
+{
+                yylhsminor.yy2 = VOLK_link_map_new (state->lms, VOLK_LINK_OUTBOUND);
+                VOLK_link_map_add (yylhsminor.yy2, yymsp[-2].minor.yy12, yymsp[0].minor.yy60);
+            }
+#line 1136 "../../build/grammar_ttl.c"
+  yymsp[-2].minor.yy2 = yylhsminor.yy2;
+        break;
+      case 5: /* predObjList ::= predObjList SEMICOLON predicate ows objectList */
+#line 102 "grammar_ttl.y"
+{
+                VOLK_link_map_add (yymsp[-4].minor.yy2, yymsp[-2].minor.yy12, yymsp[0].minor.yy60);
+                yylhsminor.yy2 = yymsp[-4].minor.yy2;
+            }
+#line 1145 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,2,&yymsp[-3].minor);
+  yymsp[-4].minor.yy2 = yylhsminor.yy2;
+        break;
+      case 6: /* objectList ::= objectList COMMA object */
+#line 109 "grammar_ttl.y"
+{
+                if (VOLK_term_set_add (yymsp[-2].minor.yy60, yymsp[0].minor.yy12, NULL) == VOLK_NOACTION)
+                    VOLK_term_free (yymsp[0].minor.yy12);
+                yylhsminor.yy60 = yymsp[-2].minor.yy60;
+            }
+#line 1156 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,3,&yymsp[-1].minor);
+  yymsp[-2].minor.yy60 = yylhsminor.yy60;
+        break;
+      case 7: /* objectList ::= object */
+#line 114 "grammar_ttl.y"
+{
+                yylhsminor.yy60 = VOLK_term_set_new();
+                VOLK_term_set_add (yylhsminor.yy60, yymsp[0].minor.yy12, NULL);
+            }
+#line 1166 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy60 = yylhsminor.yy60;
+        break;
+      case 8: /* subject ::= resource */
+      case 9: /* subject ::= blank */ yytestcase(yyruleno==9);
+#line 121 "grammar_ttl.y"
+{ state->lms = yymsp[0].minor.yy12; }
+#line 1173 "../../build/grammar_ttl.c"
+        break;
+      case 10: /* predicate ::= RDF_TYPE */
+{  yy_destructor(yypParser,18,&yymsp[0].minor);
+#line 127 "grammar_ttl.y"
+{ yymsp[0].minor.yy12 = VOLK_iriref_new_ns ("rdf:type"); }
+#line 1179 "../../build/grammar_ttl.c"
+}
+        break;
+      case 11: /* literal ::= STRING */
+#line 137 "grammar_ttl.y"
+{
+                yylhsminor.yy12 = VOLK_literal_new (yymsp[0].minor.yy0, NULL);
+                LOG_TRACE("Created plain literal: \"%s\"", yylhsminor.yy12->data);
+                free (yymsp[0].minor.yy0);
+            }
+#line 1189 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 12: /* literal ::= STRING LANGTAG */
+#line 142 "grammar_ttl.y"
+{
+                yylhsminor.yy12 = VOLK_lt_literal_new (yymsp[-1].minor.yy0, yymsp[0].minor.yy0);
+                LOG_TRACE("Created LT-literal: \"%s\"@%s", yylhsminor.yy12->data, yylhsminor.yy12->lang);
+                free (yymsp[-1].minor.yy0);
+                free (yymsp[0].minor.yy0);
+            }
+#line 1200 "../../build/grammar_ttl.c"
+  yymsp[-1].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 13: /* literal ::= STRING DTYPE_MARKER resource */
+#line 148 "grammar_ttl.y"
+{
+                yylhsminor.yy12 = VOLK_literal_new (yymsp[-2].minor.yy0, yymsp[0].minor.yy12);
+                LOG_TRACE(
+                        "Created DT-literal: \"%s\"^^%s",
+                        yylhsminor.yy12->data, yylhsminor.yy12->datatype);
+                free (yymsp[-2].minor.yy0);
+            }
+#line 1212 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,19,&yymsp[-1].minor);
+  yymsp[-2].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 14: /* literal ::= INTEGER */
+#line 155 "grammar_ttl.y"
+{
+                yylhsminor.yy12 = VOLK_literal_new (yymsp[0].minor.yy0, VOLK_iriref_new_ns ("xsd:integer"));
+                free (yymsp[0].minor.yy0);
+            }
+#line 1222 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 15: /* literal ::= DOUBLE */
+#line 159 "grammar_ttl.y"
+{
+                yylhsminor.yy12 = VOLK_literal_new (yymsp[0].minor.yy0, VOLK_iriref_new_ns ("xsd:double"));
+                free (yymsp[0].minor.yy0);
+            }
+#line 1231 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 16: /* literal ::= DECIMAL */
+#line 163 "grammar_ttl.y"
+{
+                yylhsminor.yy12 = VOLK_literal_new (yymsp[0].minor.yy0, VOLK_iriref_new_ns ("xsd:decimal"));
+                free (yymsp[0].minor.yy0);
+            }
+#line 1240 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 17: /* literal ::= BOOLEAN */
+#line 167 "grammar_ttl.y"
+{
+                yylhsminor.yy12 = VOLK_literal_new (yymsp[0].minor.yy0, VOLK_iriref_new_ns ("xsd:boolean"));
+                free (yymsp[0].minor.yy0);
+            }
+#line 1249 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 18: /* blank ::= BNODE_ID */
+#line 174 "grammar_ttl.y"
+{
+                yylhsminor.yy12 = VOLK_bnode_new (yymsp[0].minor.yy0);
+                LOG_TRACE("Created blank node: _:%s", yylhsminor.yy12->data);
+                free (yymsp[0].minor.yy0);
+            }
+#line 1259 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 19: /* blank ::= LBRACKET RBRACKET */
+{  yy_destructor(yypParser,20,&yymsp[-1].minor);
+#line 179 "grammar_ttl.y"
+{
+                yymsp[-1].minor.yy12 = VOLK_bnode_new (NULL);
+                LOG_TRACE("Created empty list BN: _:%s", yymsp[-1].minor.yy12->data);
+            }
+#line 1269 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,21,&yymsp[0].minor);
+}
+        break;
+      case 20: /* blank ::= LBRACKET predObjList RBRACKET */
+{  yy_destructor(yypParser,20,&yymsp[-2].minor);
+#line 183 "grammar_ttl.y"
+{
+                yymsp[-2].minor.yy12 = VOLK_bnode_new (NULL);
+                state->lms = yymsp[-2].minor.yy12;
+                state->ct += VOLK_graph_add_link_map (state->it, yymsp[-1].minor.yy2);
+                LOG_TRACE("Created list BN: _:%s", yymsp[-2].minor.yy12->data);
+
+                VOLK_link_map_free (yymsp[-1].minor.yy2);
+            }
+#line 1284 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,21,&yymsp[0].minor);
+}
+        break;
+      case 21: /* blank ::= LPAREN RPAREN */
+{  yy_destructor(yypParser,22,&yymsp[-1].minor);
+#line 192 "grammar_ttl.y"
+{
+                yymsp[-1].minor.yy12 = VOLK_iriref_new_ns ("rdf:nil");
+                LOG_TRACE("Created list terminator: %s", yymsp[-1].minor.yy12->data);
+            }
+#line 1295 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,23,&yymsp[0].minor);
+}
+        break;
+      case 22: /* collection ::= LPAREN itemList RPAREN */
+{  yy_destructor(yypParser,22,&yymsp[-2].minor);
+#line 201 "grammar_ttl.y"
+{
+                yymsp[-2].minor.yy12 = VOLK_bnode_add_collection (state->it, yymsp[-1].minor.yy60);
+                VOLK_term_set_free (yymsp[-1].minor.yy60);
+            }
+#line 1306 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,23,&yymsp[0].minor);
+}
+        break;
+      case 23: /* itemList ::= itemList ows object */
+#line 208 "grammar_ttl.y"
+{
+                if (VOLK_term_set_add (yymsp[-2].minor.yy60, yymsp[0].minor.yy12, NULL) == VOLK_NOACTION)
+                    VOLK_term_free (yymsp[0].minor.yy12);
+                yylhsminor.yy60 = yymsp[-2].minor.yy60;
+            }
+#line 1317 "../../build/grammar_ttl.c"
+  yymsp[-2].minor.yy60 = yylhsminor.yy60;
+        break;
+      case 24: /* itemList ::= object */
+#line 213 "grammar_ttl.y"
+{
+                yylhsminor.yy60 = VOLK_term_set_new ();
+                VOLK_term_set_add (yylhsminor.yy60, yymsp[0].minor.yy12, NULL);
+            }
+#line 1326 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy60 = yylhsminor.yy60;
+        break;
+      case 25: /* resource ::= IRIREF */
+#line 220 "grammar_ttl.y"
+{
+                VOLK_Term *rel_iri = VOLK_iriref_new (yymsp[0].minor.yy0);
+                free (yymsp[0].minor.yy0);
+                if (state->base) {
+                    yylhsminor.yy12 = VOLK_iriref_new_abs (rel_iri, state->base);
+                    VOLK_term_free (rel_iri);
+                } else {
+                    yylhsminor.yy12 = rel_iri;
+                }
+                LOG_TRACE("Created IRI: <%s>", yylhsminor.yy12->data);
+            }
+#line 1342 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 26: /* resource ::= QNAME */
+#line 231 "grammar_ttl.y"
+{
+                yylhsminor.yy12 = VOLK_iriref_new_ns (yymsp[0].minor.yy0);
+                LOG_TRACE("Created IRI: %s", yylhsminor.yy12->data);
+                free (yymsp[0].minor.yy0);
+            }
+#line 1352 "../../build/grammar_ttl.c"
+  yymsp[0].minor.yy12 = yylhsminor.yy12;
+        break;
+      case 27: /* turtleDoc ::= statements EOF */
+#line 54 "grammar_ttl.y"
+{
+}
+#line 1359 "../../build/grammar_ttl.c"
+  yy_destructor(yypParser,15,&yymsp[0].minor);
+        break;
+      case 33: /* statement ::= WS */
+      case 39: /* ows ::= WS */ yytestcase(yyruleno==39);
+{  yy_destructor(yypParser,16,&yymsp[0].minor);
+#line 61 "grammar_ttl.y"
+{
+}
+#line 1368 "../../build/grammar_ttl.c"
+}
+        break;
+      case 34: /* predicate ::= resource */
+      case 35: /* object ::= resource */ yytestcase(yyruleno==35);
+{  yy_destructor(yypParser,36,&yymsp[0].minor);
+#line 126 "grammar_ttl.y"
+{
+}
+#line 1377 "../../build/grammar_ttl.c"
+}
+        break;
+      case 36: /* object ::= blank */
+{  yy_destructor(yypParser,37,&yymsp[0].minor);
+#line 132 "grammar_ttl.y"
+{
+}
+#line 1385 "../../build/grammar_ttl.c"
+}
+        break;
+      case 37: /* object ::= literal */
+{  yy_destructor(yypParser,38,&yymsp[0].minor);
+#line 133 "grammar_ttl.y"
+{
+}
+#line 1393 "../../build/grammar_ttl.c"
+}
+        break;
+      case 38: /* blank ::= collection */
+{  yy_destructor(yypParser,39,&yymsp[0].minor);
+#line 191 "grammar_ttl.y"
+{
+}
+#line 1401 "../../build/grammar_ttl.c"
+}
+        break;
+      default:
+      /* (28) statements ::= statements statement */ yytestcase(yyruleno==28);
+      /* (29) statements ::= */ yytestcase(yyruleno==29);
+      /* (30) statement ::= prefixID (OPTIMIZED OUT) */ assert(yyruleno!=30);
+      /* (31) statement ::= base (OPTIMIZED OUT) */ assert(yyruleno!=31);
+      /* (32) statement ::= triples (OPTIMIZED OUT) */ assert(yyruleno!=32);
+      /* (40) ows ::= */ yytestcase(yyruleno==40);
+        break;
+/********** End reduce actions ************************************************/
+  };
+  assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
+  yygoto = yyRuleInfoLhs[yyruleno];
+  yysize = yyRuleInfoNRhs[yyruleno];
+  yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
+
+  /* There are no SHIFTREDUCE actions on nonterminals because the table
+  ** generator has simplified them to pure REDUCE actions. */
+  assert( !(yyact>YY_MAX_SHIFT && yyact<=YY_MAX_SHIFTREDUCE) );
+
+  /* It is not possible for a REDUCE to be followed by an error */
+  assert( yyact!=YY_ERROR_ACTION );
+
+  yymsp += yysize+1;
+  yypParser->yytos = yymsp;
+  yymsp->stateno = (YYACTIONTYPE)yyact;
+  yymsp->major = (YYCODETYPE)yygoto;
+  yyTraceShift(yypParser, yyact, "... then shift");
+  return yyact;
+}
+
+/*
+** The following code executes when the parse fails
+*/
+#ifndef YYNOERRORRECOVERY
+static void yy_parse_failed(
+  yyParser *yypParser           /* The parser */
+){
+  TTLParseARG_FETCH
+  TTLParseCTX_FETCH
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt);
+  }
+#endif
+  while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser);
+  /* Here code is inserted which will be executed whenever the
+  ** parser fails */
+/************ Begin %parse_failure code ***************************************/
+#line 22 "grammar_ttl.y"
+
+    log_error ("TTL parse error. Cannot continue.");
+    state->rc = VOLK_PARSE_ERR;
+#line 1456 "../../build/grammar_ttl.c"
+/************ End %parse_failure code *****************************************/
+  TTLParseARG_STORE /* Suppress warning about unused %extra_argument variable */
+  TTLParseCTX_STORE
+}
+#endif /* YYNOERRORRECOVERY */
+
+/*
+** The following code executes when a syntax error first occurs.
+*/
+static void yy_syntax_error(
+  yyParser *yypParser,           /* The parser */
+  int yymajor,                   /* The major type of the error token */
+  TTLParseTOKENTYPE yyminor         /* The minor type of the error token */
+){
+  TTLParseARG_FETCH
+  TTLParseCTX_FETCH
+#define TOKEN yyminor
+/************ Begin %syntax_error code ****************************************/
+#line 27 "grammar_ttl.y"
+
+    // Fail immediately on first error.
+    yy_parse_failed (yypParser);
+#line 1479 "../../build/grammar_ttl.c"
+/************ End %syntax_error code ******************************************/
+  TTLParseARG_STORE /* Suppress warning about unused %extra_argument variable */
+  TTLParseCTX_STORE
+}
+
+/*
+** The following is executed when the parser accepts
+*/
+static void yy_accept(
+  yyParser *yypParser           /* The parser */
+){
+  TTLParseARG_FETCH
+  TTLParseCTX_FETCH
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt);
+  }
+#endif
+#ifndef YYNOERRORRECOVERY
+  yypParser->yyerrcnt = -1;
+#endif
+  assert( yypParser->yytos==yypParser->yystack );
+  /* Here code is inserted which will be executed whenever the
+  ** parser accepts */
+/*********** Begin %parse_accept code *****************************************/
+/*********** End %parse_accept code *******************************************/
+  TTLParseARG_STORE /* Suppress warning about unused %extra_argument variable */
+  TTLParseCTX_STORE
+}
+
+/* The main parser program.
+** The first argument is a pointer to a structure obtained from
+** "TTLParseAlloc" which describes the current state of the parser.
+** The second argument is the major token number.  The third is
+** the minor token.  The fourth optional argument is whatever the
+** user wants (and specified in the grammar) and is available for
+** use by the action routines.
+**
+** Inputs:
+** <ul>
+** <li> A pointer to the parser (an opaque structure.)
+** <li> The major token number.
+** <li> The minor token number.
+** <li> An option argument of a grammar-specified type.
+** </ul>
+**
+** Outputs:
+** None.
+*/
+void TTLParse(
+  void *yyp,                   /* The parser */
+  int yymajor,                 /* The major token code number */
+  TTLParseTOKENTYPE yyminor       /* The value for the token */
+  TTLParseARG_PDECL               /* Optional %extra_argument parameter */
+){
+  YYMINORTYPE yyminorunion;
+  YYACTIONTYPE yyact;   /* The parser action. */
+#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
+  int yyendofinput;     /* True if we are at the end of input */
+#endif
+#ifdef YYERRORSYMBOL
+  int yyerrorhit = 0;   /* True if yymajor has invoked an error */
+#endif
+  yyParser *yypParser = (yyParser*)yyp;  /* The parser */
+  TTLParseCTX_FETCH
+  TTLParseARG_STORE
+
+  assert( yypParser->yytos!=0 );
+#if !defined(YYERRORSYMBOL) && !defined(YYNOERRORRECOVERY)
+  yyendofinput = (yymajor==0);
+#endif
+
+  yyact = yypParser->yytos->stateno;
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    if( yyact < YY_MIN_REDUCE ){
+      fprintf(yyTraceFILE,"%sInput '%s' in state %d\n",
+              yyTracePrompt,yyTokenName[yymajor],yyact);
+    }else{
+      fprintf(yyTraceFILE,"%sInput '%s' with pending reduce %d\n",
+              yyTracePrompt,yyTokenName[yymajor],yyact-YY_MIN_REDUCE);
+    }
+  }
+#endif
+
+  while(1){ /* Exit by "break" */
+    assert( yypParser->yytos>=yypParser->yystack );
+    assert( yyact==yypParser->yytos->stateno );
+    yyact = yy_find_shift_action((YYCODETYPE)yymajor,yyact);
+    if( yyact >= YY_MIN_REDUCE ){
+      unsigned int yyruleno = yyact - YY_MIN_REDUCE; /* Reduce by this rule */
+#ifndef NDEBUG
+      assert( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) );
+      if( yyTraceFILE ){
+        int yysize = yyRuleInfoNRhs[yyruleno];
+        if( yysize ){
+          fprintf(yyTraceFILE, "%sReduce %d [%s]%s, pop back to state %d.\n",
+            yyTracePrompt,
+            yyruleno, yyRuleName[yyruleno],
+            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action",
+            yypParser->yytos[yysize].stateno);
+        }else{
+          fprintf(yyTraceFILE, "%sReduce %d [%s]%s.\n",
+            yyTracePrompt, yyruleno, yyRuleName[yyruleno],
+            yyruleno<YYNRULE_WITH_ACTION ? "" : " without external action");
+        }
+      }
+#endif /* NDEBUG */
+
+      /* Check that the stack is large enough to grow by a single entry
+      ** if the RHS of the rule is empty.  This ensures that there is room
+      ** enough on the stack to push the LHS value */
+      if( yyRuleInfoNRhs[yyruleno]==0 ){
+#ifdef YYTRACKMAXSTACKDEPTH
+        if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
+          yypParser->yyhwm++;
+          assert( yypParser->yyhwm ==
+                  (int)(yypParser->yytos - yypParser->yystack));
+        }
+#endif
+#if YYSTACKDEPTH>0 
+        if( yypParser->yytos>=yypParser->yystackEnd ){
+          yyStackOverflow(yypParser);
+          break;
+        }
+#else
+        if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
+          if( yyGrowStack(yypParser) ){
+            yyStackOverflow(yypParser);
+            break;
+          }
+        }
+#endif
+      }
+      yyact = yy_reduce(yypParser,yyruleno,yymajor,yyminor TTLParseCTX_PARAM);
+    }else if( yyact <= YY_MAX_SHIFTREDUCE ){
+      yy_shift(yypParser,yyact,(YYCODETYPE)yymajor,yyminor);
+#ifndef YYNOERRORRECOVERY
+      yypParser->yyerrcnt--;
+#endif
+      break;
+    }else if( yyact==YY_ACCEPT_ACTION ){
+      yypParser->yytos--;
+      yy_accept(yypParser);
+      return;
+    }else{
+      assert( yyact == YY_ERROR_ACTION );
+      yyminorunion.yy0 = yyminor;
+#ifdef YYERRORSYMBOL
+      int yymx;
+#endif
+#ifndef NDEBUG
+      if( yyTraceFILE ){
+        fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt);
+      }
+#endif
+#ifdef YYERRORSYMBOL
+      /* A syntax error has occurred.
+      ** The response to an error depends upon whether or not the
+      ** grammar defines an error token "ERROR".  
+      **
+      ** This is what we do if the grammar does define ERROR:
+      **
+      **  * Call the %syntax_error function.
+      **
+      **  * Begin popping the stack until we enter a state where
+      **    it is legal to shift the error symbol, then shift
+      **    the error symbol.
+      **
+      **  * Set the error count to three.
+      **
+      **  * Begin accepting and shifting new tokens.  No new error
+      **    processing will occur until three tokens have been
+      **    shifted successfully.
+      **
+      */
+      if( yypParser->yyerrcnt<0 ){
+        yy_syntax_error(yypParser,yymajor,yyminor);
+      }
+      yymx = yypParser->yytos->major;
+      if( yymx==YYERRORSYMBOL || yyerrorhit ){
+#ifndef NDEBUG
+        if( yyTraceFILE ){
+          fprintf(yyTraceFILE,"%sDiscard input token %s\n",
+             yyTracePrompt,yyTokenName[yymajor]);
+        }
+#endif
+        yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion);
+        yymajor = YYNOCODE;
+      }else{
+        while( yypParser->yytos > yypParser->yystack ){
+          yyact = yy_find_reduce_action(yypParser->yytos->stateno,
+                                        YYERRORSYMBOL);
+          if( yyact<=YY_MAX_SHIFTREDUCE ) break;
+          yy_pop_parser_stack(yypParser);
+        }
+        if( yypParser->yytos <= yypParser->yystack || yymajor==0 ){
+          yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
+          yy_parse_failed(yypParser);
+#ifndef YYNOERRORRECOVERY
+          yypParser->yyerrcnt = -1;
+#endif
+          yymajor = YYNOCODE;
+        }else if( yymx!=YYERRORSYMBOL ){
+          yy_shift(yypParser,yyact,YYERRORSYMBOL,yyminor);
+        }
+      }
+      yypParser->yyerrcnt = 3;
+      yyerrorhit = 1;
+      if( yymajor==YYNOCODE ) break;
+      yyact = yypParser->yytos->stateno;
+#elif defined(YYNOERRORRECOVERY)
+      /* If the YYNOERRORRECOVERY macro is defined, then do not attempt to
+      ** do any kind of error recovery.  Instead, simply invoke the syntax
+      ** error routine and continue going as if nothing had happened.
+      **
+      ** Applications can set this macro (for example inside %include) if
+      ** they intend to abandon the parse upon the first syntax error seen.
+      */
+      yy_syntax_error(yypParser,yymajor, yyminor);
+      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
+      break;
+#else  /* YYERRORSYMBOL is not defined */
+      /* This is what we do if the grammar does not define ERROR:
+      **
+      **  * Report an error message, and throw away the input token.
+      **
+      **  * If the input token is $, then fail the parse.
+      **
+      ** As before, subsequent error messages are suppressed until
+      ** three input tokens have been successfully shifted.
+      */
+      if( yypParser->yyerrcnt<=0 ){
+        yy_syntax_error(yypParser,yymajor, yyminor);
+      }
+      yypParser->yyerrcnt = 3;
+      yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion);
+      if( yyendofinput ){
+        yy_parse_failed(yypParser);
+#ifndef YYNOERRORRECOVERY
+        yypParser->yyerrcnt = -1;
+#endif
+      }
+      break;
+#endif
+    }
+  }
+#ifndef NDEBUG
+  if( yyTraceFILE ){
+    yyStackEntry *i;
+    char cDiv = '[';
+    fprintf(yyTraceFILE,"%sReturn. Stack=",yyTracePrompt);
+    for(i=&yypParser->yystack[1]; i<=yypParser->yytos; i++){
+      fprintf(yyTraceFILE,"%c%s", cDiv, yyTokenName[i->major]);
+      cDiv = ' ';
+    }
+    fprintf(yyTraceFILE,"]\n");
+  }
+#endif
+  return;
+}
+
+/*
+** Return the fallback token corresponding to canonical token iToken, or
+** 0 if iToken has no fallback.
+*/
+int TTLParseFallback(int iToken){
+#ifdef YYFALLBACK
+  assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );
+  return yyFallback[iToken];
+#else
+  (void)iToken;
+  return 0;
+#endif
+}

+ 1768 - 0
src/codec/parser_nt.c

@@ -0,0 +1,1768 @@
+/* Generated by re2c 4.1 on Fri Aug  1 19:39:10 2025 */
+#line 1 "lexer_nt.re"
+#include "volksdata/codec/parser_nt.h"
+#include "volksdata/codec/tokens_nt.h"
+
+
+#define YYCTYPE     uint8_t
+#define YYCURSOR    it->cur
+#define YYMARKER    it->mar
+#define YYLIMIT     it->lim
+#define YYFILL      fill(it) == 0
+
+
+typedef struct {
+    FILE *          fh;                 // Input file handle.
+    YYCTYPE         buf[CHUNK_SIZE],    // Start of buffer.
+            *       lim,                // Position after the last available
+                                        //   input character (YYLIMIT).
+            *       cur,                // Next input character to be read
+                                        //   (YYCURSOR)
+            *       mar,                // Most recent match (YYMARKER)
+            *       tok,                // Start of current token.
+            *       bol;                // Address of the beginning of the
+                                        //   current line (for debugging).
+    unsigned        line;               // Current line no. (for debugging).
+    unsigned        ct;                 // Number of parsed triples.
+    bool            eof;                // if we have reached EOF.
+    
+#line 30 "parser_nt.c"
+YYCTYPE *yyt1;YYCTYPE *yyt2;YYCTYPE *yyt3;
+#line 26 "lexer_nt.re"
+
+} ParseIterator;
+
+
+static int fill(ParseIterator *it)
+{
+    if (it->eof) {
+        return 1;
+    }
+    const size_t shift = it->tok - it->buf;
+    if (shift < 1) {
+        return 2;
+    }
+    LOG_DEBUG("Shifting bytes: %lu", shift);
+    memmove(it->buf, it->tok, it->lim - it->tok);
+    it->lim -= shift;
+    it->cur -= shift;
+    it->mar -= shift;
+    it->tok -= shift;
+    it->lim += fread(it->lim, 1, shift, it->fh);
+    
+#line 54 "parser_nt.c"
+if (it->yyt1) it->yyt1 -= shift; if (it->yyt2) it->yyt2 -= shift; if (it->yyt3) it->yyt3 -= shift; 
+#line 46 "lexer_nt.re"
+
+    it->lim[0] = 0;
+    it->eof |= it->lim < it->buf + CHUNK_SIZE - 1;
+    return 0;
+}
+
+
+static void parse_init(ParseIterator *it, FILE *fh)
+{
+    it->fh = fh;
+    it->cur = it->mar = it->tok = it->lim = it->buf + CHUNK_SIZE - 1;
+    it->line = 1;
+    it->bol = it->buf;
+    it->ct = 0;
+    it->eof = 0;
+    
+#line 73 "parser_nt.c"
+it->yyt1 = NULL; it->yyt2 = NULL; it->yyt3 = NULL; 
+#line 61 "lexer_nt.re"
+
+    fill (it);
+}
+
+
+// Parser interface. Required here to silence linters.
+void *NTParseAlloc();
+void NTParse();
+void NTParseFree();
+#ifdef DEBUG
+void NTParseTrace();
+#endif
+
+// Lexer.
+
+static int lex (ParseIterator *it, VOLK_Term **term)
+{
+    const YYCTYPE *lit_data_e, *dtype_s, *lang_s;
+
+loop:
+
+    it->tok = it->cur;
+
+    *term = NULL;
+
+    
+#line 102 "parser_nt.c"
+{
+	YYCTYPE yych;
+	unsigned int yyaccept = 0;
+yyFillLabel0:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t':
+		case ' ': goto yy3;
+		case '\n':
+		case '\r': goto yy5;
+		case '"': goto yy7;
+		case '#': goto yy8;
+		case '.': goto yy10;
+		case '<': goto yy11;
+		case '_': goto yy12;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel0;
+				goto yy110;
+			}
+			goto yy1;
+	}
+yy1:
+	++YYCURSOR;
+yy2:
+#line 218 "lexer_nt.re"
+	{
+        LOG_DEBUG(
+            "Invalid token @ %lu: %s (\\x%x)",
+            YYCURSOR - it->buf - 1, it->tok, *it->tok);
+
+        return -1;
+    }
+#line 136 "parser_nt.c"
+yy3:
+	++YYCURSOR;
+yyFillLabel1:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t':
+		case ' ': goto yy3;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel1;
+			}
+			goto yy4;
+	}
+yy4:
+#line 201 "lexer_nt.re"
+	{
+        LOG_DEBUG("Separator.");
+
+        return T_WS;
+    }
+#line 157 "parser_nt.c"
+yy5:
+	++YYCURSOR;
+yyFillLabel2:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy5;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel2;
+			}
+			goto yy6;
+	}
+yy6:
+#line 117 "lexer_nt.re"
+	{
+        it->line ++;
+        it->bol = YYCURSOR;
+        LOG_DEBUG("New line: #%u.", it->line);
+        return T_EOL;
+    }
+#line 180 "parser_nt.c"
+yy7:
+	yyaccept = 0;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel3:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel3;
+				goto yy2;
+			}
+			goto yy13;
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... 0x7F:
+		case 0xC2 ... 0xF4: goto yy14;
+		default: goto yy2;
+	}
+yy8:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel4:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel4;
+				goto yy9;
+			}
+			goto yy8;
+		case 0xC2 ... 0xDF: goto yy25;
+		case 0xE0: goto yy26;
+		case 0xE1 ... 0xEF: goto yy27;
+		case 0xF0: goto yy28;
+		case 0xF1 ... 0xF3: goto yy29;
+		case 0xF4: goto yy30;
+		default: goto yy9;
+	}
+yy9:
+#line 207 "lexer_nt.re"
+	{
+        size_t size = YYCURSOR - it->tok + 1;
+        YYCTYPE *data = malloc (size);
+        memcpy (data, it->tok, size);
+        data [size - 1] = '\0';
+        LOG_DEBUG("Comment: `%s`", data);
+        free (data);
+
+        goto loop;
+    }
+#line 233 "parser_nt.c"
+yy10:
+	++YYCURSOR;
+#line 194 "lexer_nt.re"
+	{
+        LOG_DEBUG("End of triple.");
+        it->ct ++;
+
+        return T_DOT;
+    }
+#line 243 "parser_nt.c"
+yy11:
+	yyaccept = 0;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel5:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '!':
+		case '#' ... ';':
+		case '=' ... ']':
+		case '_':
+		case 'a' ... 'z':
+		case '~' ... 0x7F:
+		case 0xC2 ... 0xF4: goto yy32;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel5;
+			}
+			goto yy2;
+	}
+yy12:
+	yyaccept = 0;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel6:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case ':': goto yy41;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel6;
+			}
+			goto yy2;
+	}
+yy13:
+	++YYCURSOR;
+yyFillLabel7:
+	yych = *YYCURSOR;
+yy14:
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... '!':
+		case '#' ... '[':
+		case ']' ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel7;
+				goto yy15;
+			}
+			goto yy13;
+		case '"': goto yy16;
+		case '\\': goto yy18;
+		case 0xC2 ... 0xDF: goto yy19;
+		case 0xE0: goto yy20;
+		case 0xE1 ... 0xEF: goto yy21;
+		case 0xF0: goto yy22;
+		case 0xF1 ... 0xF3: goto yy23;
+		case 0xF4: goto yy24;
+		default: goto yy15;
+	}
+yy15:
+	YYCURSOR = YYMARKER;
+	switch (yyaccept) {
+		case 0: goto yy2;
+		case 1: goto yy9;
+		case 2:
+			it->yyt1 = YYCURSOR;
+			it->yyt2 = NULL;
+			it->yyt3 = NULL;
+			goto yy17;
+		case 3:
+			it->yyt2 = NULL;
+			it->yyt3 = NULL;
+			goto yy17;
+		case 4: goto yy51;
+		default:
+			it->yyt2 = NULL;
+			goto yy17;
+	}
+yy16:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel8:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t':
+		case ' ':
+			it->yyt1 = YYCURSOR;
+			goto yy42;
+		case '@':
+			it->yyt1 = YYCURSOR;
+			it->yyt3 = YYCURSOR;
+			goto yy43;
+		case '^':
+			it->yyt1 = YYCURSOR;
+			goto yy44;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel8;
+			}
+			it->yyt1 = YYCURSOR;
+			it->yyt2 = NULL;
+			it->yyt3 = NULL;
+			goto yy17;
+	}
+yy17:
+	lit_data_e = it->yyt1;
+	dtype_s = it->yyt2;
+	lang_s = it->yyt3;
+#line 141 "lexer_nt.re"
+	{
+        // Only unescape Unicode from data.
+        size_t size = lit_data_e - it->tok - 2;
+        YYCTYPE *data = unescape_unicode (it->tok + 1, size);
+        LOG_TRACE("Literal data: %s", data);
+
+        char *metadata = NULL;
+        const YYCTYPE *md_marker;
+        VOLK_TermType type = VOLK_TERM_LITERAL;
+
+        if (dtype_s) {
+            md_marker = dtype_s;
+            size = YYCURSOR - md_marker - 1;
+        } else if (lang_s) {
+            type = VOLK_TERM_LT_LITERAL;
+            md_marker = lang_s;
+            size = YYCURSOR - md_marker;
+        } else md_marker = NULL;
+
+        if (md_marker) {
+            metadata = malloc (size);
+            memcpy (metadata, md_marker + 1, size);
+            metadata [size - 1] = '\0';
+            LOG_TRACE("metadata: %s", metadata);
+        }
+
+        if (type == VOLK_TERM_LITERAL) {
+            VOLK_Term *dtype;
+            dtype = (metadata ? VOLK_iriref_new ((char *) metadata) : NULL);
+
+            *term = VOLK_literal_new ((char *) data, dtype);
+
+        } else *term = VOLK_lt_literal_new ((char *) data, (char *) metadata);
+
+        free (data);
+        free (metadata);
+
+        if (!UNLIKELY (term)) return -1;
+        return T_LITERAL;
+    }
+#line 393 "parser_nt.c"
+yy18:
+	++YYCURSOR;
+yyFillLabel9:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '"':
+		case '\'':
+		case '\\':
+		case 'b':
+		case 'f':
+		case 'n':
+		case 'r':
+		case 't': goto yy13;
+		case 'U': goto yy45;
+		case 'u': goto yy46;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel9;
+			}
+			goto yy15;
+	}
+yy19:
+	++YYCURSOR;
+yyFillLabel10:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy13;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel10;
+			}
+			goto yy15;
+	}
+yy20:
+	++YYCURSOR;
+yyFillLabel11:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy19;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel11;
+			}
+			goto yy15;
+	}
+yy21:
+	++YYCURSOR;
+yyFillLabel12:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy19;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel12;
+			}
+			goto yy15;
+	}
+yy22:
+	++YYCURSOR;
+yyFillLabel13:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy21;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel13;
+			}
+			goto yy15;
+	}
+yy23:
+	++YYCURSOR;
+yyFillLabel14:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy21;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel14;
+			}
+			goto yy15;
+	}
+yy24:
+	++YYCURSOR;
+yyFillLabel15:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy21;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel15;
+			}
+			goto yy15;
+	}
+yy25:
+	++YYCURSOR;
+yyFillLabel16:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy8;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel16;
+			}
+			goto yy15;
+	}
+yy26:
+	++YYCURSOR;
+yyFillLabel17:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy25;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel17;
+			}
+			goto yy15;
+	}
+yy27:
+	++YYCURSOR;
+yyFillLabel18:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy25;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel18;
+			}
+			goto yy15;
+	}
+yy28:
+	++YYCURSOR;
+yyFillLabel19:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy27;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel19;
+			}
+			goto yy15;
+	}
+yy29:
+	++YYCURSOR;
+yyFillLabel20:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy27;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel20;
+			}
+			goto yy15;
+	}
+yy30:
+	++YYCURSOR;
+yyFillLabel21:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy27;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel21;
+			}
+			goto yy15;
+	}
+yy31:
+	++YYCURSOR;
+yyFillLabel22:
+	yych = *YYCURSOR;
+yy32:
+	switch (yych) {
+		case '!':
+		case '#' ... ';':
+		case '=':
+		case '?' ... '[':
+		case ']':
+		case '_':
+		case 'a' ... 'z':
+		case '~' ... 0x7F: goto yy31;
+		case '>': goto yy33;
+		case '\\': goto yy34;
+		case 0xC2 ... 0xDF: goto yy35;
+		case 0xE0: goto yy36;
+		case 0xE1 ... 0xEF: goto yy37;
+		case 0xF0: goto yy38;
+		case 0xF1 ... 0xF3: goto yy39;
+		case 0xF4: goto yy40;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel22;
+			}
+			goto yy15;
+	}
+yy33:
+	++YYCURSOR;
+#line 129 "lexer_nt.re"
+	{
+        YYCTYPE *data = unescape_unicode (it->tok + 1, YYCURSOR - it->tok - 2);
+
+        LOG_DEBUG("URI data: %s", data);
+
+        *term = VOLK_iriref_new ((char*)data);
+        free (data);
+
+        if (!UNLIKELY (term)) return -1;
+        return T_IRIREF;
+    }
+#line 601 "parser_nt.c"
+yy34:
+	++YYCURSOR;
+yyFillLabel23:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'U': goto yy47;
+		case 'u': goto yy48;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel23;
+			}
+			goto yy15;
+	}
+yy35:
+	++YYCURSOR;
+yyFillLabel24:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy31;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel24;
+			}
+			goto yy15;
+	}
+yy36:
+	++YYCURSOR;
+yyFillLabel25:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy35;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel25;
+			}
+			goto yy15;
+	}
+yy37:
+	++YYCURSOR;
+yyFillLabel26:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy35;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel26;
+			}
+			goto yy15;
+	}
+yy38:
+	++YYCURSOR;
+yyFillLabel27:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy37;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel27;
+			}
+			goto yy15;
+	}
+yy39:
+	++YYCURSOR;
+yyFillLabel28:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy37;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel28;
+			}
+			goto yy15;
+	}
+yy40:
+	++YYCURSOR;
+yyFillLabel29:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy37;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel29;
+			}
+			goto yy15;
+	}
+yy41:
+	++YYCURSOR;
+yyFillLabel30:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... ':':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z':
+		case 0xC3 ... 0xCB:
+		case 0xCE ... 0xE1:
+		case 0xE3 ... 0xED:
+		case 0xEF ... 0xF3: goto yy50;
+		case 0xCD: goto yy54;
+		case 0xE2: goto yy57;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel30;
+			}
+			goto yy15;
+	}
+yy42:
+	yyaccept = 3;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel31:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t':
+		case ' ': goto yy42;
+		case '@':
+			it->yyt3 = YYCURSOR;
+			goto yy43;
+		case '^': goto yy44;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel31;
+			}
+			it->yyt2 = NULL;
+			it->yyt3 = NULL;
+			goto yy17;
+	}
+yy43:
+	++YYCURSOR;
+yyFillLabel32:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'A' ... 'Z':
+		case 'a' ... 'z': goto yy64;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel32;
+			}
+			goto yy15;
+	}
+yy44:
+	++YYCURSOR;
+yyFillLabel33:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '^': goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel33;
+			}
+			goto yy15;
+	}
+yy45:
+	++YYCURSOR;
+yyFillLabel34:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy66;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel34;
+			}
+			goto yy15;
+	}
+yy46:
+	++YYCURSOR;
+yyFillLabel35:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy67;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel35;
+			}
+			goto yy15;
+	}
+yy47:
+	++YYCURSOR;
+yyFillLabel36:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy68;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel36;
+			}
+			goto yy15;
+	}
+yy48:
+	++YYCURSOR;
+yyFillLabel37:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy69;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel37;
+			}
+			goto yy15;
+	}
+yy49:
+	yyaccept = 4;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel38:
+	yych = *YYCURSOR;
+yy50:
+	switch (yych) {
+		case '-':
+		case '0' ... ':':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z': goto yy49;
+		case '.': goto yy70;
+		case 0xC2: goto yy71;
+		case 0xC3: goto yy52;
+		case 0xC4 ... 0xCC:
+		case 0xCE ... 0xDF: goto yy53;
+		case 0xCD: goto yy72;
+		case 0xE0: goto yy55;
+		case 0xE1:
+		case 0xE4 ... 0xEC: goto yy56;
+		case 0xE2: goto yy73;
+		case 0xE3: goto yy58;
+		case 0xED: goto yy59;
+		case 0xEF: goto yy60;
+		case 0xF0: goto yy61;
+		case 0xF1 ... 0xF2: goto yy62;
+		case 0xF3: goto yy63;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel38;
+			}
+			goto yy51;
+	}
+yy51:
+#line 182 "lexer_nt.re"
+	{
+        YYCTYPE *data = unescape_unicode (it->tok + 2, YYCURSOR - it->tok - 2);
+
+        LOG_DEBUG("BNode data: %s", data);
+
+        *term = VOLK_term_new (VOLK_TERM_BNODE, (char*)data, NULL);
+        free (data);
+
+        if (!UNLIKELY (term)) return -1;
+        return T_BNODE;
+    }
+#line 856 "parser_nt.c"
+yy52:
+	++YYCURSOR;
+yyFillLabel39:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x96:
+		case 0x98 ... 0xB6:
+		case 0xB8 ... 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel39;
+			}
+			goto yy15;
+	}
+yy53:
+	++YYCURSOR;
+yyFillLabel40:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel40;
+			}
+			goto yy15;
+	}
+yy54:
+	++YYCURSOR;
+yyFillLabel41:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBD:
+		case 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel41;
+			}
+			goto yy15;
+	}
+yy55:
+	++YYCURSOR;
+yyFillLabel42:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy53;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel42;
+			}
+			goto yy15;
+	}
+yy56:
+	++YYCURSOR;
+yyFillLabel43:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy53;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel43;
+			}
+			goto yy15;
+	}
+yy57:
+	++YYCURSOR;
+yyFillLabel44:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy74;
+		case 0x81: goto yy75;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy53;
+		case 0x86: goto yy76;
+		case 0xBF: goto yy77;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel44;
+			}
+			goto yy15;
+	}
+yy58:
+	++YYCURSOR;
+yyFillLabel45:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy78;
+		case 0x81 ... 0xBF: goto yy53;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel45;
+			}
+			goto yy15;
+	}
+yy59:
+	++YYCURSOR;
+yyFillLabel46:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x9F: goto yy53;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel46;
+			}
+			goto yy15;
+	}
+yy60:
+	++YYCURSOR;
+yyFillLabel47:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA4 ... 0xB6:
+		case 0xB8 ... 0xBE: goto yy53;
+		case 0xB7: goto yy79;
+		case 0xBF: goto yy80;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel47;
+			}
+			goto yy15;
+	}
+yy61:
+	++YYCURSOR;
+yyFillLabel48:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy56;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel48;
+			}
+			goto yy15;
+	}
+yy62:
+	++YYCURSOR;
+yyFillLabel49:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy56;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel49;
+			}
+			goto yy15;
+	}
+yy63:
+	++YYCURSOR;
+yyFillLabel50:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy56;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel50;
+			}
+			goto yy15;
+	}
+yy64:
+	yyaccept = 5;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel51:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-': goto yy81;
+		case 'A' ... 'Z':
+		case 'a' ... 'z': goto yy64;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel51;
+			}
+			it->yyt2 = NULL;
+			goto yy17;
+	}
+yy65:
+	++YYCURSOR;
+yyFillLabel52:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t':
+		case ' ': goto yy65;
+		case '<':
+			it->yyt2 = YYCURSOR;
+			goto yy82;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel52;
+			}
+			goto yy15;
+	}
+yy66:
+	++YYCURSOR;
+yyFillLabel53:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy83;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel53;
+			}
+			goto yy15;
+	}
+yy67:
+	++YYCURSOR;
+yyFillLabel54:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy84;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel54;
+			}
+			goto yy15;
+	}
+yy68:
+	++YYCURSOR;
+yyFillLabel55:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy85;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel55;
+			}
+			goto yy15;
+	}
+yy69:
+	++YYCURSOR;
+yyFillLabel56:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy86;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel56;
+			}
+			goto yy15;
+	}
+yy70:
+	++YYCURSOR;
+yyFillLabel57:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-':
+		case '0' ... ':':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z': goto yy49;
+		case '.': goto yy70;
+		case 0xC2: goto yy71;
+		case 0xC3: goto yy52;
+		case 0xC4 ... 0xCC:
+		case 0xCE ... 0xDF: goto yy53;
+		case 0xCD: goto yy72;
+		case 0xE0: goto yy55;
+		case 0xE1:
+		case 0xE4 ... 0xEC: goto yy56;
+		case 0xE2: goto yy73;
+		case 0xE3: goto yy58;
+		case 0xED: goto yy59;
+		case 0xEF: goto yy60;
+		case 0xF0: goto yy61;
+		case 0xF1 ... 0xF2: goto yy62;
+		case 0xF3: goto yy63;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel57;
+			}
+			goto yy15;
+	}
+yy71:
+	++YYCURSOR;
+yyFillLabel58:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB7: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel58;
+			}
+			goto yy15;
+	}
+yy72:
+	++YYCURSOR;
+yyFillLabel59:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD:
+		case 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel59;
+			}
+			goto yy15;
+	}
+yy73:
+	++YYCURSOR;
+yyFillLabel60:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy87;
+		case 0x81: goto yy88;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy53;
+		case 0x86: goto yy76;
+		case 0xBF: goto yy77;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel60;
+			}
+			goto yy15;
+	}
+yy74:
+	++YYCURSOR;
+yyFillLabel61:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel61;
+			}
+			goto yy15;
+	}
+yy75:
+	++YYCURSOR;
+yyFillLabel62:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel62;
+			}
+			goto yy15;
+	}
+yy76:
+	++YYCURSOR;
+yyFillLabel63:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel63;
+			}
+			goto yy15;
+	}
+yy77:
+	++YYCURSOR;
+yyFillLabel64:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel64;
+			}
+			goto yy15;
+	}
+yy78:
+	++YYCURSOR;
+yyFillLabel65:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x81 ... 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel65;
+			}
+			goto yy15;
+	}
+yy79:
+	++YYCURSOR;
+yyFillLabel66:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F:
+		case 0xB0 ... 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel66;
+			}
+			goto yy15;
+	}
+yy80:
+	++YYCURSOR;
+yyFillLabel67:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel67;
+			}
+			goto yy15;
+	}
+yy81:
+	++YYCURSOR;
+yyFillLabel68:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'Z':
+		case 'a' ... 'z': goto yy89;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel68;
+			}
+			goto yy15;
+	}
+yy82:
+	++YYCURSOR;
+yyFillLabel69:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '!':
+		case '#' ... ';':
+		case '=':
+		case '?' ... '[':
+		case ']':
+		case '_':
+		case 'a' ... 'z':
+		case '~' ... 0x7F: goto yy82;
+		case '>': goto yy90;
+		case '\\': goto yy91;
+		case 0xC2 ... 0xDF: goto yy92;
+		case 0xE0: goto yy93;
+		case 0xE1 ... 0xEF: goto yy94;
+		case 0xF0: goto yy95;
+		case 0xF1 ... 0xF3: goto yy96;
+		case 0xF4: goto yy97;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel69;
+			}
+			goto yy15;
+	}
+yy83:
+	++YYCURSOR;
+yyFillLabel70:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel70;
+			}
+			goto yy15;
+	}
+yy84:
+	++YYCURSOR;
+yyFillLabel71:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy99;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel71;
+			}
+			goto yy15;
+	}
+yy85:
+	++YYCURSOR;
+yyFillLabel72:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy100;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel72;
+			}
+			goto yy15;
+	}
+yy86:
+	++YYCURSOR;
+yyFillLabel73:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy101;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel73;
+			}
+			goto yy15;
+	}
+yy87:
+	++YYCURSOR;
+yyFillLabel74:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D:
+		case 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel74;
+			}
+			goto yy15;
+	}
+yy88:
+	++YYCURSOR;
+yyFillLabel75:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80:
+		case 0xB0 ... 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel75;
+			}
+			goto yy15;
+	}
+yy89:
+	yyaccept = 5;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel76:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-': goto yy81;
+		case '0' ... '9':
+		case 'A' ... 'Z':
+		case 'a' ... 'z': goto yy89;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel76;
+			}
+			it->yyt2 = NULL;
+			goto yy17;
+	}
+yy90:
+	++YYCURSOR;
+	it->yyt3 = NULL;
+	goto yy17;
+yy91:
+	++YYCURSOR;
+yyFillLabel77:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'U': goto yy102;
+		case 'u': goto yy103;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel77;
+			}
+			goto yy15;
+	}
+yy92:
+	++YYCURSOR;
+yyFillLabel78:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy82;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel78;
+			}
+			goto yy15;
+	}
+yy93:
+	++YYCURSOR;
+yyFillLabel79:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy92;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel79;
+			}
+			goto yy15;
+	}
+yy94:
+	++YYCURSOR;
+yyFillLabel80:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy92;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel80;
+			}
+			goto yy15;
+	}
+yy95:
+	++YYCURSOR;
+yyFillLabel81:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy94;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel81;
+			}
+			goto yy15;
+	}
+yy96:
+	++YYCURSOR;
+yyFillLabel82:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy94;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel82;
+			}
+			goto yy15;
+	}
+yy97:
+	++YYCURSOR;
+yyFillLabel83:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy94;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel83;
+			}
+			goto yy15;
+	}
+yy98:
+	++YYCURSOR;
+yyFillLabel84:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy46;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel84;
+			}
+			goto yy15;
+	}
+yy99:
+	++YYCURSOR;
+yyFillLabel85:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy13;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel85;
+			}
+			goto yy15;
+	}
+yy100:
+	++YYCURSOR;
+yyFillLabel86:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy48;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel86;
+			}
+			goto yy15;
+	}
+yy101:
+	++YYCURSOR;
+yyFillLabel87:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy31;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel87;
+			}
+			goto yy15;
+	}
+yy102:
+	++YYCURSOR;
+yyFillLabel88:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy104;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel88;
+			}
+			goto yy15;
+	}
+yy103:
+	++YYCURSOR;
+yyFillLabel89:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy105;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel89;
+			}
+			goto yy15;
+	}
+yy104:
+	++YYCURSOR;
+yyFillLabel90:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy106;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel90;
+			}
+			goto yy15;
+	}
+yy105:
+	++YYCURSOR;
+yyFillLabel91:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy107;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel91;
+			}
+			goto yy15;
+	}
+yy106:
+	++YYCURSOR;
+yyFillLabel92:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy108;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel92;
+			}
+			goto yy15;
+	}
+yy107:
+	++YYCURSOR;
+yyFillLabel93:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy109;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel93;
+			}
+			goto yy15;
+	}
+yy108:
+	++YYCURSOR;
+yyFillLabel94:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy103;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel94;
+			}
+			goto yy15;
+	}
+yy109:
+	++YYCURSOR;
+yyFillLabel95:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F':
+		case 'a' ... 'f': goto yy82;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel95;
+			}
+			goto yy15;
+	}
+yy110:
+#line 124 "lexer_nt.re"
+	{
+        LOG_DEBUG("End of buffer.");
+        return T_EOF;
+    }
+#line 1663 "parser_nt.c"
+}
+#line 226 "lexer_nt.re"
+
+}
+
+
+VOLK_rc
+VOLK_nt_parse_term (const char *rep, VOLK_Term **term)
+{
+    FILE *fh = fmemopen ((void *)rep, strlen (rep), "r");
+
+    ParseIterator it;
+    parse_init (&it, fh);
+
+    int ttype = lex (&it, term);
+
+    fclose (fh);
+
+    switch (ttype) {
+        case T_IRIREF:
+        case T_LITERAL:
+        case T_BNODE:
+            return VOLK_OK;
+        default:
+            return VOLK_PARSE_ERR;
+    }
+}
+
+VOLK_rc
+VOLK_nt_parse_doc (FILE *fh, VOLK_Graph **gr_p, size_t *ct, char **err_p)
+{
+    *err_p = NULL;
+    *gr_p = NULL;
+
+    ParseIterator parse_it;
+    parse_init (&parse_it, fh);
+
+#ifdef DEBUG
+    NTParseTrace (stdout, "NT Parser > ");
+#endif
+
+    void *parser = NTParseAlloc (malloc);
+
+    VOLK_rc rc;
+
+    VOLK_Graph *gr = VOLK_graph_new (NULL, NULL);
+    if (UNLIKELY (!gr)) return VOLK_MEM_ERR;
+
+    VOLK_GraphIterator *it = VOLK_graph_add_init (gr);
+    if (UNLIKELY (!it)) {
+        VOLK_graph_free (gr);
+        return VOLK_MEM_ERR;
+    }
+
+    VOLK_Term *term = NULL;
+
+    for (;;) {
+        int ttype = lex (&parse_it, &term);
+
+        if (ttype == -1) {
+            char token[16] = {};
+            strncpy (token, (const char *)parse_it.tok, 15);
+
+            char *err_start = "Parse error near token `";
+
+            char err_info [64];
+            sprintf(
+                    err_info, "[...]' at line %u, character %ld.\n",
+                    parse_it.line, parse_it.cur - parse_it.bol);
+
+            size_t err_size = strlen (err_start) + 16 + strlen(err_info);
+            char *err_str = malloc (err_size);
+            sprintf (err_str, "%s%s%s", err_start, token, err_info);
+
+            rc = VOLK_PARSE_ERR;
+            *err_p = err_str;
+            log_error (err_str);
+
+            goto finally;
+        }
+
+        NTParse (parser, ttype, term, it);
+
+        if (ttype == T_EOF) break;
+    };
+
+    if (ct) *ct = parse_it.ct;
+
+    log_info ("Parsed %u triples.", parse_it.ct);
+    LOG_DEBUG("Graph size: %lu", VOLK_graph_size (gr));
+
+    rc = parse_it.ct > 0 ? VOLK_OK : VOLK_NORESULT;
+    *gr_p = gr;
+
+finally: ;
+    NTParse (parser, 0, NULL, it);
+    NTParseFree (parser, free);
+
+    VOLK_graph_add_done (it);
+    VOLK_term_free (term);
+
+    if (rc < 0) VOLK_graph_free (gr);
+
+    return rc;
+}
+

+ 4334 - 0
src/codec/parser_ttl.c

@@ -0,0 +1,4334 @@
+/* Generated by re2c 4.1 on Fri Aug  1 19:39:10 2025 */
+#line 1 "lexer_ttl.re"
+#include "volksdata/codec/parser_ttl.h"
+#include "volksdata/codec/tokens_ttl.h"
+
+
+/** @brief TTL is UTF-8 encoded.
+ *
+ * @sa https://www.w3.org/TeamSubmission/turtle/#sec-grammar
+ *
+ * `char` should be considered to be UTF-8 throughout this library, however,
+ * setting YYCTYPE to char generates case labels outside of the char range.
+ */
+#define YYCTYPE     uint8_t
+#define YYCURSOR    it->cur
+#define YYMARKER    it->mar
+#define YYLIMIT     it->lim
+#define YYFILL      fill(it) == 0
+
+
+typedef struct {
+    FILE *          fh;                 // Input file handle.
+    YYCTYPE         buf[CHUNK_SIZE],    // Start of buffer.
+            *       lim,                // Position after the last available
+                                        //   input character (YYLIMIT).
+            *       cur,                // Next input character to be read
+                                        //   (YYCURSOR)
+            *       mar,                // Most recent match (YYMARKER)
+            *       tok,                // Start of current token.
+            *       bol;                // Address of the beginning of the
+                                        //   current line (for debugging).
+    unsigned        line;               // Current line no. (for debugging).
+    unsigned        stmt;               // Current statement.
+    bool            eof;                // if we have reached EOF.
+    
+#line 37 "parser_ttl.c"
+YYCTYPE *yyt1;
+#line 33 "lexer_ttl.re"
+
+} ParseIterator;
+
+typedef struct {
+    YYCTYPE *       data;
+    size_t          size;
+} ParserToken;
+
+
+static int fill (ParseIterator *it)
+{
+    if (it->eof) {
+        return 1;
+    }
+    const size_t shift = it->tok - it->buf;
+    if (shift < 1) {
+        return 2;
+    }
+    LOG_TRACE("Shifting bytes: %lu", shift);
+    memmove(it->buf, it->tok, it->lim - it->tok);
+    it->lim -= shift;
+    it->cur -= shift;
+    it->mar -= shift;
+    it->tok -= shift;
+    it->lim += fread(it->lim, 1, shift, it->fh);
+    
+#line 66 "parser_ttl.c"
+if (it->yyt1) it->yyt1 -= shift; 
+#line 58 "lexer_ttl.re"
+
+    it->lim[0] = 0;
+    it->eof |= it->lim < it->buf + CHUNK_SIZE - 1;
+    return 0;
+}
+
+
+static void parse_init (ParseIterator *it, FILE *fh)
+{
+    it->fh = fh;
+    it->cur = it->mar = it->tok = it->lim = it->buf + CHUNK_SIZE - 1;
+    it->line = 1;
+    it->stmt = 1;
+    it->bol = it->buf;
+    it->eof = 0;
+    
+#line 85 "parser_ttl.c"
+it->yyt1 = NULL; 
+#line 73 "lexer_ttl.re"
+
+    fill (it);
+}
+
+
+static inline void newline (ParseIterator *it) {
+    it->line ++;
+    it->bol = YYCURSOR;
+    LOG_TRACE("New line: #%u.", it->line);
+}
+
+
+// Parser interface. Required here to silence linters.
+void *TTLParseAlloc();
+void TTLParse();
+void TTLParseFree();
+#ifdef DEBUG
+void TTLParseTrace();
+#endif
+
+// Lexer.
+
+static int lex (ParseIterator *it, YYCTYPE **token_p)
+{
+    const YYCTYPE *pfx;
+
+    #line 138 "lexer_ttl.re"
+
+
+loop: // Start new token.
+    it->tok = it->cur;
+
+    *token_p = NULL;
+
+    
+#line 123 "parser_ttl.c"
+{
+	YYCTYPE yych;
+	unsigned int yyaccept = 0;
+yyFillLabel0:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t':
+		case ' ': goto yy3;
+		case '\n':
+		case '\r': goto yy5;
+		case '"': goto yy7;
+		case '#': goto yy9;
+		case '(': goto yy11;
+		case ')': goto yy13;
+		case '+':
+		case '-': goto yy14;
+		case ',': goto yy15;
+		case '.': goto yy17;
+		case '0' ... '9': goto yy19;
+		case ':': goto yy21;
+		case ';': goto yy23;
+		case '<': goto yy25;
+		case '@': goto yy26;
+		case 'A' ... 'Z':
+		case 'b' ... 'e':
+		case 'g' ... 's':
+		case 'u' ... 'z': goto yy27;
+		case '[': goto yy28;
+		case ']': goto yy30;
+		case '^': goto yy31;
+		case '_': goto yy32;
+		case 'a': goto yy33;
+		case 'f': goto yy35;
+		case 't': goto yy36;
+		case 0xC3: goto yy37;
+		case 0xC4 ... 0xCB:
+		case 0xCE ... 0xDF: goto yy38;
+		case 0xCD: goto yy39;
+		case 0xE0: goto yy40;
+		case 0xE1:
+		case 0xE4 ... 0xEC: goto yy41;
+		case 0xE2: goto yy42;
+		case 0xE3: goto yy43;
+		case 0xED: goto yy44;
+		case 0xEF: goto yy45;
+		case 0xF0: goto yy46;
+		case 0xF1 ... 0xF2: goto yy47;
+		case 0xF3: goto yy48;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel0;
+				goto yy260;
+			}
+			goto yy1;
+	}
+yy1:
+	++YYCURSOR;
+yy2:
+#line 147 "lexer_ttl.re"
+	{
+        log_warn (
+            "Invalid token @ %lu: %s (\\x%x)",
+            YYCURSOR - it->buf - 1, it->tok, *it->tok);
+
+        return -1;
+    }
+#line 190 "parser_ttl.c"
+yy3:
+	++YYCURSOR;
+yyFillLabel1:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy3;
+		case '#': goto yy49;
+		case ')': goto yy13;
+		case ',': goto yy15;
+		case '.': goto yy50;
+		case ';': goto yy23;
+		case ']': goto yy30;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel1;
+			}
+			goto yy4;
+	}
+yy4:
+#line 215 "lexer_ttl.re"
+	{
+        uint8_t *ws = uint8_ndup (it->tok, YYCURSOR - it->tok);
+        LOG_TRACE("Whitespace: '%s'", ws);
+        // Count newlines in mixed whitespace.
+        // That's not great because it scans through the whole whitespace again
+        // but it's the simplest and safest.
+        for (size_t i = 0; i < strlen ((char *)ws); i++)
+            if (ws[i] == '\n' || ws[i] == '\r') newline (it);
+        free (ws);
+
+        return T_WS;
+    }
+#line 225 "parser_ttl.c"
+yy5:
+	++YYCURSOR;
+yyFillLabel2:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy3;
+		case '#': goto yy49;
+		case ')': goto yy13;
+		case ',': goto yy15;
+		case '.': goto yy50;
+		case ';': goto yy23;
+		case ']': goto yy30;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel2;
+			}
+			goto yy6;
+	}
+yy6:
+#line 160 "lexer_ttl.re"
+	{
+        newline (it);
+        goto loop;
+    }
+#line 252 "parser_ttl.c"
+yy7:
+	yyaccept = 0;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel3:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '"': goto yy51;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel3;
+			}
+			goto yy8;
+	}
+yy8:
+#line 167 "lexer_ttl.re"
+	{ goto schar; }
+#line 269 "parser_ttl.c"
+yy9:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel4:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel4;
+				goto yy10;
+			}
+			goto yy9;
+		case '\n':
+		case '\r': goto yy3;
+		case 0xC2 ... 0xDF: goto yy53;
+		case 0xE0: goto yy54;
+		case 0xE1 ... 0xEF: goto yy55;
+		case 0xF0: goto yy56;
+		case 0xF1 ... 0xF3: goto yy57;
+		case 0xF4: goto yy58;
+		default: goto yy10;
+	}
+yy10:
+#line 210 "lexer_ttl.re"
+	{
+        LOG_TRACE("Comment: `%s`", it->tok);
+        goto loop;
+    }
+#line 301 "parser_ttl.c"
+yy11:
+	++YYCURSOR;
+yyFillLabel5:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy11;
+		case '#': goto yy59;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel5;
+			}
+			goto yy12;
+	}
+yy12:
+#line 270 "lexer_ttl.re"
+	{ return T_LPAREN; }
+#line 320 "parser_ttl.c"
+yy13:
+	++YYCURSOR;
+#line 272 "lexer_ttl.re"
+	{ return T_RPAREN; }
+#line 325 "parser_ttl.c"
+yy14:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel6:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '.': goto yy60;
+		case '0' ... '9': goto yy19;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel6;
+			}
+			goto yy2;
+	}
+yy15:
+	++YYCURSOR;
+yyFillLabel7:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy15;
+		case '#': goto yy61;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel7;
+			}
+			goto yy16;
+	}
+yy16:
+#line 286 "lexer_ttl.re"
+	{ return T_COMMA; }
+#line 358 "parser_ttl.c"
+yy17:
+	++YYCURSOR;
+yyFillLabel8:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9': goto yy62;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel8;
+			}
+			goto yy18;
+	}
+yy18:
+#line 288 "lexer_ttl.re"
+	{
+        LOG_TRACE("End of statement #%u.", it->stmt);
+        it->stmt++;
+        return T_PERIOD;
+    }
+#line 378 "parser_ttl.c"
+yy19:
+	yyaccept = 3;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel9:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '.': goto yy62;
+		case '0' ... '9': goto yy19;
+		case 'E':
+		case 'e': goto yy64;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel9;
+			}
+			goto yy20;
+	}
+yy20:
+#line 235 "lexer_ttl.re"
+	{
+        // Normalize sign.
+        size_t offset = *it->tok == '+' ? 1 : 0;
+
+        *token_p = uint8_ndup (it->tok + offset, YYCURSOR - it->tok - offset);
+        LOG_TRACE("Integer: %s", *token_p);
+
+        return T_INTEGER;
+    }
+#line 406 "parser_ttl.c"
+yy21:
+	yyaccept = 4;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel10:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case '-':
+		case '0' ... '9':
+		case 0xC2:
+		case 0xCC:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel10;
+			}
+			goto yy22;
+		case 0xCD: goto yy69;
+		case 0xE2: goto yy72;
+		default: goto yy66;
+	}
+yy22:
+#line 196 "lexer_ttl.re"
+	{
+        *token_p = uint8_ndup (it->tok, YYCURSOR - it->tok);
+        LOG_TRACE("ID name: %s", *token_p);
+
+        return T_QNAME;
+    }
+#line 434 "parser_ttl.c"
+yy23:
+	++YYCURSOR;
+yyFillLabel11:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy23;
+		case '#': goto yy79;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel11;
+			}
+			goto yy24;
+	}
+yy24:
+#line 280 "lexer_ttl.re"
+	{
+        LOG_TRACE("End of object list.");
+
+        return T_SEMICOLON;
+    }
+#line 457 "parser_ttl.c"
+yy25:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel12:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case ' ' ... 0x7F:
+		case 0xC2 ... 0xF4: goto yy81;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel12;
+			}
+			goto yy2;
+	}
+yy26:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel13:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'B': goto yy91;
+		case 'P': goto yy92;
+		case 'a':
+		case 'c' ... 'o':
+		case 'q' ... 'z': goto yy93;
+		case 'b': goto yy96;
+		case 'p': goto yy97;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel13;
+			}
+			goto yy2;
+	}
+yy27:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel14:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-':
+		case '0' ... ':':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z':
+		case 0xC2 ... 0xED:
+		case 0xEF ... 0xF3: goto yy99;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel14;
+			}
+			goto yy2;
+	}
+yy28:
+	++YYCURSOR;
+yyFillLabel15:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy28;
+		case '#': goto yy113;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel15;
+			}
+			goto yy29;
+	}
+yy29:
+#line 274 "lexer_ttl.re"
+	{ return T_LBRACKET; }
+#line 528 "parser_ttl.c"
+yy30:
+	++YYCURSOR;
+#line 276 "lexer_ttl.re"
+	{ return T_RBRACKET; }
+#line 533 "parser_ttl.c"
+yy31:
+	++YYCURSOR;
+yyFillLabel16:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '^': goto yy114;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel16;
+			}
+			goto yy2;
+	}
+yy32:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel17:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case ':': goto yy115;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel17;
+			}
+			goto yy2;
+	}
+yy33:
+	yyaccept = 5;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel18:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-':
+		case '0' ... ':':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z':
+		case 0xC2 ... 0xED:
+		case 0xEF ... 0xF3: goto yy99;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel18;
+			}
+			goto yy34;
+	}
+yy34:
+#line 296 "lexer_ttl.re"
+	{
+        LOG_TRACE("RDF type shorthand 'a'.");
+        return T_RDF_TYPE;
+    }
+#line 584 "parser_ttl.c"
+yy35:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel19:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-':
+		case '0' ... ':':
+		case 'A' ... 'Z':
+		case '_':
+		case 'b' ... 'z':
+		case 0xC2 ... 0xED:
+		case 0xEF ... 0xF3: goto yy99;
+		case 'a': goto yy116;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel19;
+			}
+			goto yy2;
+	}
+yy36:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel20:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-':
+		case '0' ... ':':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'q':
+		case 's' ... 'z':
+		case 0xC2 ... 0xED:
+		case 0xEF ... 0xF3: goto yy99;
+		case 'r': goto yy117;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel20;
+			}
+			goto yy2;
+	}
+yy37:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel21:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x96:
+		case 0x98 ... 0xB6:
+		case 0xB8 ... 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel21;
+			}
+			goto yy2;
+	}
+yy38:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel22:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel22;
+			}
+			goto yy2;
+	}
+yy39:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel23:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBD:
+		case 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel23;
+			}
+			goto yy2;
+	}
+yy40:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel24:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy102;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel24;
+			}
+			goto yy2;
+	}
+yy41:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel25:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy102;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel25;
+			}
+			goto yy2;
+	}
+yy42:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel26:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy118;
+		case 0x81: goto yy119;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy102;
+		case 0x86: goto yy120;
+		case 0xBF: goto yy121;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel26;
+			}
+			goto yy2;
+	}
+yy43:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel27:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy122;
+		case 0x81 ... 0xBF: goto yy102;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel27;
+			}
+			goto yy2;
+	}
+yy44:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel28:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x9F: goto yy102;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel28;
+			}
+			goto yy2;
+	}
+yy45:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel29:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA4 ... 0xB6:
+		case 0xB8 ... 0xBE: goto yy102;
+		case 0xB7: goto yy123;
+		case 0xBF: goto yy124;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel29;
+			}
+			goto yy2;
+	}
+yy46:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel30:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy105;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel30;
+			}
+			goto yy2;
+	}
+yy47:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel31:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy105;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel31;
+			}
+			goto yy2;
+	}
+yy48:
+	yyaccept = 2;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel32:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy105;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel32;
+			}
+			goto yy2;
+	}
+yy49:
+	yyaccept = 6;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel33:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel33;
+				goto yy4;
+			}
+			goto yy49;
+		case '\n':
+		case '\r': goto yy3;
+		case 0xC2 ... 0xDF: goto yy125;
+		case 0xE0: goto yy126;
+		case 0xE1 ... 0xEF: goto yy127;
+		case 0xF0: goto yy128;
+		case 0xF1 ... 0xF3: goto yy129;
+		case 0xF4: goto yy130;
+		default: goto yy4;
+	}
+yy50:
+	++YYCURSOR;
+	goto yy18;
+yy51:
+	++YYCURSOR;
+yyFillLabel34:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '"': goto yy131;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel34;
+			}
+			goto yy52;
+	}
+yy52:
+	YYCURSOR = YYMARKER;
+	switch (yyaccept) {
+		case 0: goto yy8;
+		case 1: goto yy10;
+		case 2: goto yy2;
+		case 3: goto yy20;
+		case 4: goto yy22;
+		case 5: goto yy34;
+		case 6: goto yy4;
+		case 7: goto yy12;
+		case 8: goto yy16;
+		case 9: goto yy63;
+		case 10: goto yy24;
+		case 11: goto yy95;
+		case 12: goto yy29;
+		case 13: goto yy83;
+		case 14: goto yy179;
+		case 15: goto yy212;
+		case 16: goto yy214;
+		default: goto yy227;
+	}
+yy53:
+	++YYCURSOR;
+yyFillLabel35:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy9;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel35;
+			}
+			goto yy52;
+	}
+yy54:
+	++YYCURSOR;
+yyFillLabel36:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy53;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel36;
+			}
+			goto yy52;
+	}
+yy55:
+	++YYCURSOR;
+yyFillLabel37:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy53;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel37;
+			}
+			goto yy52;
+	}
+yy56:
+	++YYCURSOR;
+yyFillLabel38:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy55;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel38;
+			}
+			goto yy52;
+	}
+yy57:
+	++YYCURSOR;
+yyFillLabel39:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy55;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel39;
+			}
+			goto yy52;
+	}
+yy58:
+	++YYCURSOR;
+yyFillLabel40:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy55;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel40;
+			}
+			goto yy52;
+	}
+yy59:
+	yyaccept = 7;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel41:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel41;
+				goto yy12;
+			}
+			goto yy59;
+		case '\n':
+		case '\r': goto yy11;
+		case 0xC2 ... 0xDF: goto yy132;
+		case 0xE0: goto yy133;
+		case 0xE1 ... 0xEF: goto yy134;
+		case 0xF0: goto yy135;
+		case 0xF1 ... 0xF3: goto yy136;
+		case 0xF4: goto yy137;
+		default: goto yy12;
+	}
+yy60:
+	++YYCURSOR;
+yyFillLabel42:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9': goto yy62;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel42;
+			}
+			goto yy52;
+	}
+yy61:
+	yyaccept = 8;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel43:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel43;
+				goto yy16;
+			}
+			goto yy61;
+		case '\n':
+		case '\r': goto yy15;
+		case 0xC2 ... 0xDF: goto yy138;
+		case 0xE0: goto yy139;
+		case 0xE1 ... 0xEF: goto yy140;
+		case 0xF0: goto yy141;
+		case 0xF1 ... 0xF3: goto yy142;
+		case 0xF4: goto yy143;
+		default: goto yy16;
+	}
+yy62:
+	yyaccept = 9;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel44:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9': goto yy62;
+		case 'E':
+		case 'e': goto yy64;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel44;
+			}
+			goto yy63;
+	}
+yy63:
+#line 255 "lexer_ttl.re"
+	{
+        // Normalize sign.
+        YYCTYPE offset = *it->tok == '+' ? 1 : 0;
+
+        // Normalize trailing zeros in fractional part.
+        size_t size = YYCURSOR - it->tok - offset;
+        if (strchr ((char *)it->tok, '.'))
+            for (YYCTYPE *i = YYCURSOR; *i == '0'; i--) size--;
+
+        *token_p = uint8_ndup (it->tok + offset, size);
+        LOG_TRACE("Integer: %s", *token_p);
+
+        return T_DECIMAL;
+    }
+#line 1021 "parser_ttl.c"
+yy64:
+	++YYCURSOR;
+yyFillLabel45:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '+':
+		case '-': goto yy144;
+		case '0' ... '9': goto yy145;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel45;
+			}
+			goto yy52;
+	}
+yy65:
+	yyaccept = 4;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel46:
+	yych = *YYCURSOR;
+yy66:
+	switch (yych) {
+		case '-':
+		case '0' ... '9':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z': goto yy65;
+		case 0xC2: goto yy147;
+		case 0xC3: goto yy67;
+		case 0xC4 ... 0xCC:
+		case 0xCE ... 0xDF: goto yy68;
+		case 0xCD: goto yy148;
+		case 0xE0: goto yy70;
+		case 0xE1:
+		case 0xE4 ... 0xEC: goto yy71;
+		case 0xE2: goto yy149;
+		case 0xE3: goto yy73;
+		case 0xED: goto yy74;
+		case 0xEF: goto yy75;
+		case 0xF0: goto yy76;
+		case 0xF1 ... 0xF2: goto yy77;
+		case 0xF3: goto yy78;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel46;
+			}
+			goto yy22;
+	}
+yy67:
+	++YYCURSOR;
+yyFillLabel47:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x96:
+		case 0x98 ... 0xB6:
+		case 0xB8 ... 0xBF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel47;
+			}
+			goto yy52;
+	}
+yy68:
+	++YYCURSOR;
+yyFillLabel48:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel48;
+			}
+			goto yy52;
+	}
+yy69:
+	++YYCURSOR;
+yyFillLabel49:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBD:
+		case 0xBF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel49;
+			}
+			goto yy52;
+	}
+yy70:
+	++YYCURSOR;
+yyFillLabel50:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy68;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel50;
+			}
+			goto yy52;
+	}
+yy71:
+	++YYCURSOR;
+yyFillLabel51:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy68;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel51;
+			}
+			goto yy52;
+	}
+yy72:
+	++YYCURSOR;
+yyFillLabel52:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy150;
+		case 0x81: goto yy151;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy68;
+		case 0x86: goto yy152;
+		case 0xBF: goto yy153;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel52;
+			}
+			goto yy52;
+	}
+yy73:
+	++YYCURSOR;
+yyFillLabel53:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy154;
+		case 0x81 ... 0xBF: goto yy68;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel53;
+			}
+			goto yy52;
+	}
+yy74:
+	++YYCURSOR;
+yyFillLabel54:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x9F: goto yy68;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel54;
+			}
+			goto yy52;
+	}
+yy75:
+	++YYCURSOR;
+yyFillLabel55:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA4 ... 0xB6:
+		case 0xB8 ... 0xBE: goto yy68;
+		case 0xB7: goto yy155;
+		case 0xBF: goto yy156;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel55;
+			}
+			goto yy52;
+	}
+yy76:
+	++YYCURSOR;
+yyFillLabel56:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy71;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel56;
+			}
+			goto yy52;
+	}
+yy77:
+	++YYCURSOR;
+yyFillLabel57:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy71;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel57;
+			}
+			goto yy52;
+	}
+yy78:
+	++YYCURSOR;
+yyFillLabel58:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy71;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel58;
+			}
+			goto yy52;
+	}
+yy79:
+	yyaccept = 10;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel59:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel59;
+				goto yy24;
+			}
+			goto yy79;
+		case '\n':
+		case '\r': goto yy23;
+		case 0xC2 ... 0xDF: goto yy157;
+		case 0xE0: goto yy158;
+		case 0xE1 ... 0xEF: goto yy159;
+		case 0xF0: goto yy160;
+		case 0xF1 ... 0xF3: goto yy161;
+		case 0xF4: goto yy162;
+		default: goto yy24;
+	}
+yy80:
+	++YYCURSOR;
+yyFillLabel60:
+	yych = *YYCURSOR;
+yy81:
+	switch (yych) {
+		case ' ' ... '=':
+		case '?' ... '[':
+		case ']' ... 0x7F: goto yy80;
+		case '>': goto yy82;
+		case '\\': goto yy84;
+		case 0xC2 ... 0xDF: goto yy85;
+		case 0xE0: goto yy86;
+		case 0xE1 ... 0xEF: goto yy87;
+		case 0xF0: goto yy88;
+		case 0xF1 ... 0xF3: goto yy89;
+		case 0xF4: goto yy90;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel60;
+			}
+			goto yy52;
+	}
+yy82:
+	++YYCURSOR;
+yy83:
+#line 176 "lexer_ttl.re"
+	{
+        *token_p = uint8_ndup (it->tok + 1, YYCURSOR - it->tok - 2);
+        LOG_TRACE("URI data: %s", *token_p);
+
+        return T_IRIREF;
+    }
+#line 1283 "parser_ttl.c"
+yy84:
+	++YYCURSOR;
+yyFillLabel61:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case ' ' ... '=':
+		case '?' ... '[':
+		case ']' ... 0x7F: goto yy80;
+		case '>': goto yy163;
+		case '\\': goto yy84;
+		case 0xC2 ... 0xDF: goto yy85;
+		case 0xE0: goto yy86;
+		case 0xE1 ... 0xEF: goto yy87;
+		case 0xF0: goto yy88;
+		case 0xF1 ... 0xF3: goto yy89;
+		case 0xF4: goto yy90;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel61;
+			}
+			goto yy52;
+	}
+yy85:
+	++YYCURSOR;
+yyFillLabel62:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy80;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel62;
+			}
+			goto yy52;
+	}
+yy86:
+	++YYCURSOR;
+yyFillLabel63:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy85;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel63;
+			}
+			goto yy52;
+	}
+yy87:
+	++YYCURSOR;
+yyFillLabel64:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy85;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel64;
+			}
+			goto yy52;
+	}
+yy88:
+	++YYCURSOR;
+yyFillLabel65:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy87;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel65;
+			}
+			goto yy52;
+	}
+yy89:
+	++YYCURSOR;
+yyFillLabel66:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy87;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel66;
+			}
+			goto yy52;
+	}
+yy90:
+	++YYCURSOR;
+yyFillLabel67:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy87;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel67;
+			}
+			goto yy52;
+	}
+yy91:
+	++YYCURSOR;
+yyFillLabel68:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'A':
+		case 'a': goto yy164;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel68;
+			}
+			goto yy52;
+	}
+yy92:
+	++YYCURSOR;
+yyFillLabel69:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'R':
+		case 'r': goto yy165;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel69;
+			}
+			goto yy52;
+	}
+yy93:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel70:
+	yych = *YYCURSOR;
+yy94:
+	switch (yych) {
+		case '-': goto yy166;
+		case 'a' ... 'z': goto yy93;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel70;
+			}
+			goto yy95;
+	}
+yy95:
+#line 228 "lexer_ttl.re"
+	{
+        *token_p = uint8_ndup (it->tok + 1, YYCURSOR - it->tok - 1);
+        LOG_TRACE("Lang tag: '%s'", *token_p);
+
+        return T_LANGTAG;
+    }
+#line 1427 "parser_ttl.c"
+yy96:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel71:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel71;
+			}
+			goto yy95;
+		case 'A': goto yy164;
+		case 'a': goto yy167;
+		default: goto yy94;
+	}
+yy97:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel72:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel72;
+			}
+			goto yy95;
+		case 'R': goto yy165;
+		case 'r': goto yy168;
+		default: goto yy94;
+	}
+yy98:
+	++YYCURSOR;
+yyFillLabel73:
+	yych = *YYCURSOR;
+yy99:
+	switch (yych) {
+		case '-':
+		case '0' ... '9':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z': goto yy98;
+		case ':': goto yy21;
+		case 0xC2: goto yy100;
+		case 0xC3: goto yy101;
+		case 0xC4 ... 0xCC:
+		case 0xCE ... 0xDF: goto yy102;
+		case 0xCD: goto yy103;
+		case 0xE0: goto yy104;
+		case 0xE1:
+		case 0xE4 ... 0xEC: goto yy105;
+		case 0xE2: goto yy106;
+		case 0xE3: goto yy107;
+		case 0xED: goto yy108;
+		case 0xEF: goto yy109;
+		case 0xF0: goto yy110;
+		case 0xF1 ... 0xF2: goto yy111;
+		case 0xF3: goto yy112;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel73;
+			}
+			goto yy52;
+	}
+yy100:
+	++YYCURSOR;
+yyFillLabel74:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB7: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel74;
+			}
+			goto yy52;
+	}
+yy101:
+	++YYCURSOR;
+yyFillLabel75:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x96:
+		case 0x98 ... 0xB6:
+		case 0xB8 ... 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel75;
+			}
+			goto yy52;
+	}
+yy102:
+	++YYCURSOR;
+yyFillLabel76:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel76;
+			}
+			goto yy52;
+	}
+yy103:
+	++YYCURSOR;
+yyFillLabel77:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD:
+		case 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel77;
+			}
+			goto yy52;
+	}
+yy104:
+	++YYCURSOR;
+yyFillLabel78:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy102;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel78;
+			}
+			goto yy52;
+	}
+yy105:
+	++YYCURSOR;
+yyFillLabel79:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy102;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel79;
+			}
+			goto yy52;
+	}
+yy106:
+	++YYCURSOR;
+yyFillLabel80:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy169;
+		case 0x81: goto yy170;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy102;
+		case 0x86: goto yy120;
+		case 0xBF: goto yy121;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel80;
+			}
+			goto yy52;
+	}
+yy107:
+	++YYCURSOR;
+yyFillLabel81:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy122;
+		case 0x81 ... 0xBF: goto yy102;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel81;
+			}
+			goto yy52;
+	}
+yy108:
+	++YYCURSOR;
+yyFillLabel82:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x9F: goto yy102;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel82;
+			}
+			goto yy52;
+	}
+yy109:
+	++YYCURSOR;
+yyFillLabel83:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA4 ... 0xB6:
+		case 0xB8 ... 0xBE: goto yy102;
+		case 0xB7: goto yy123;
+		case 0xBF: goto yy124;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel83;
+			}
+			goto yy52;
+	}
+yy110:
+	++YYCURSOR;
+yyFillLabel84:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy105;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel84;
+			}
+			goto yy52;
+	}
+yy111:
+	++YYCURSOR;
+yyFillLabel85:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy105;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel85;
+			}
+			goto yy52;
+	}
+yy112:
+	++YYCURSOR;
+yyFillLabel86:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy105;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel86;
+			}
+			goto yy52;
+	}
+yy113:
+	yyaccept = 12;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel87:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel87;
+				goto yy29;
+			}
+			goto yy113;
+		case '\n':
+		case '\r': goto yy28;
+		case 0xC2 ... 0xDF: goto yy171;
+		case 0xE0: goto yy172;
+		case 0xE1 ... 0xEF: goto yy173;
+		case 0xF0: goto yy174;
+		case 0xF1 ... 0xF3: goto yy175;
+		case 0xF4: goto yy176;
+		default: goto yy29;
+	}
+yy114:
+	++YYCURSOR;
+#line 294 "lexer_ttl.re"
+	{ return T_DTYPE_MARKER; }
+#line 1688 "parser_ttl.c"
+yy115:
+	++YYCURSOR;
+yyFillLabel88:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z':
+		case 0xC3 ... 0xCB:
+		case 0xCE ... 0xE1:
+		case 0xE3 ... 0xED:
+		case 0xEF ... 0xF3: goto yy178;
+		case 0xCD: goto yy182;
+		case 0xE2: goto yy185;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel88;
+			}
+			goto yy52;
+	}
+yy116:
+	++YYCURSOR;
+yyFillLabel89:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel89;
+			}
+			goto yy52;
+		case 'l': goto yy192;
+		default: goto yy99;
+	}
+yy117:
+	++YYCURSOR;
+yyFillLabel90:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel90;
+			}
+			goto yy52;
+		case 'u': goto yy193;
+		default: goto yy99;
+	}
+yy118:
+	++YYCURSOR;
+yyFillLabel91:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel91;
+			}
+			goto yy52;
+	}
+yy119:
+	++YYCURSOR;
+yyFillLabel92:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel92;
+			}
+			goto yy52;
+	}
+yy120:
+	++YYCURSOR;
+yyFillLabel93:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel93;
+			}
+			goto yy52;
+	}
+yy121:
+	++YYCURSOR;
+yyFillLabel94:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel94;
+			}
+			goto yy52;
+	}
+yy122:
+	++YYCURSOR;
+yyFillLabel95:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x81 ... 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel95;
+			}
+			goto yy52;
+	}
+yy123:
+	++YYCURSOR;
+yyFillLabel96:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F:
+		case 0xB0 ... 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel96;
+			}
+			goto yy52;
+	}
+yy124:
+	++YYCURSOR;
+yyFillLabel97:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel97;
+			}
+			goto yy52;
+	}
+yy125:
+	++YYCURSOR;
+yyFillLabel98:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy49;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel98;
+			}
+			goto yy52;
+	}
+yy126:
+	++YYCURSOR;
+yyFillLabel99:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy125;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel99;
+			}
+			goto yy52;
+	}
+yy127:
+	++YYCURSOR;
+yyFillLabel100:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy125;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel100;
+			}
+			goto yy52;
+	}
+yy128:
+	++YYCURSOR;
+yyFillLabel101:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy127;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel101;
+			}
+			goto yy52;
+	}
+yy129:
+	++YYCURSOR;
+yyFillLabel102:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy127;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel102;
+			}
+			goto yy52;
+	}
+yy130:
+	++YYCURSOR;
+yyFillLabel103:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy127;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel103;
+			}
+			goto yy52;
+	}
+yy131:
+	++YYCURSOR;
+#line 165 "lexer_ttl.re"
+	{ goto lchar; }
+#line 1896 "parser_ttl.c"
+yy132:
+	++YYCURSOR;
+yyFillLabel104:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy59;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel104;
+			}
+			goto yy52;
+	}
+yy133:
+	++YYCURSOR;
+yyFillLabel105:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy132;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel105;
+			}
+			goto yy52;
+	}
+yy134:
+	++YYCURSOR;
+yyFillLabel106:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy132;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel106;
+			}
+			goto yy52;
+	}
+yy135:
+	++YYCURSOR;
+yyFillLabel107:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy134;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel107;
+			}
+			goto yy52;
+	}
+yy136:
+	++YYCURSOR;
+yyFillLabel108:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy134;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel108;
+			}
+			goto yy52;
+	}
+yy137:
+	++YYCURSOR;
+yyFillLabel109:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy134;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel109;
+			}
+			goto yy52;
+	}
+yy138:
+	++YYCURSOR;
+yyFillLabel110:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy61;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel110;
+			}
+			goto yy52;
+	}
+yy139:
+	++YYCURSOR;
+yyFillLabel111:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy138;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel111;
+			}
+			goto yy52;
+	}
+yy140:
+	++YYCURSOR;
+yyFillLabel112:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy138;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel112;
+			}
+			goto yy52;
+	}
+yy141:
+	++YYCURSOR;
+yyFillLabel113:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy140;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel113;
+			}
+			goto yy52;
+	}
+yy142:
+	++YYCURSOR;
+yyFillLabel114:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy140;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel114;
+			}
+			goto yy52;
+	}
+yy143:
+	++YYCURSOR;
+yyFillLabel115:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy140;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel115;
+			}
+			goto yy52;
+	}
+yy144:
+	++YYCURSOR;
+yyFillLabel116:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9': goto yy145;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel116;
+			}
+			goto yy52;
+	}
+yy145:
+	++YYCURSOR;
+yyFillLabel117:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9': goto yy145;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel117;
+			}
+			goto yy146;
+	}
+yy146:
+#line 245 "lexer_ttl.re"
+	{
+        // Normalize sign.
+        size_t offset = *it->tok == '+' ? 1 : 0;
+
+        *token_p = uint8_ndup (it->tok + offset, YYCURSOR - it->tok - offset);
+        LOG_TRACE("Integer: %s", *token_p);
+
+        return T_DOUBLE;
+    }
+#line 2076 "parser_ttl.c"
+yy147:
+	++YYCURSOR;
+yyFillLabel118:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB7: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel118;
+			}
+			goto yy52;
+	}
+yy148:
+	++YYCURSOR;
+yyFillLabel119:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD:
+		case 0xBF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel119;
+			}
+			goto yy52;
+	}
+yy149:
+	++YYCURSOR;
+yyFillLabel120:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy194;
+		case 0x81: goto yy195;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy68;
+		case 0x86: goto yy152;
+		case 0xBF: goto yy153;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel120;
+			}
+			goto yy52;
+	}
+yy150:
+	++YYCURSOR;
+yyFillLabel121:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel121;
+			}
+			goto yy52;
+	}
+yy151:
+	++YYCURSOR;
+yyFillLabel122:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel122;
+			}
+			goto yy52;
+	}
+yy152:
+	++YYCURSOR;
+yyFillLabel123:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel123;
+			}
+			goto yy52;
+	}
+yy153:
+	++YYCURSOR;
+yyFillLabel124:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel124;
+			}
+			goto yy52;
+	}
+yy154:
+	++YYCURSOR;
+yyFillLabel125:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x81 ... 0xBF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel125;
+			}
+			goto yy52;
+	}
+yy155:
+	++YYCURSOR;
+yyFillLabel126:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F:
+		case 0xB0 ... 0xBF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel126;
+			}
+			goto yy52;
+	}
+yy156:
+	++YYCURSOR;
+yyFillLabel127:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel127;
+			}
+			goto yy52;
+	}
+yy157:
+	++YYCURSOR;
+yyFillLabel128:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy79;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel128;
+			}
+			goto yy52;
+	}
+yy158:
+	++YYCURSOR;
+yyFillLabel129:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy157;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel129;
+			}
+			goto yy52;
+	}
+yy159:
+	++YYCURSOR;
+yyFillLabel130:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy157;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel130;
+			}
+			goto yy52;
+	}
+yy160:
+	++YYCURSOR;
+yyFillLabel131:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy159;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel131;
+			}
+			goto yy52;
+	}
+yy161:
+	++YYCURSOR;
+yyFillLabel132:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy159;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel132;
+			}
+			goto yy52;
+	}
+yy162:
+	++YYCURSOR;
+yyFillLabel133:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy159;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel133;
+			}
+			goto yy52;
+	}
+yy163:
+	yyaccept = 13;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel134:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case ' ' ... '=':
+		case '?' ... '[':
+		case ']' ... 0x7F: goto yy80;
+		case '>': goto yy82;
+		case '\\': goto yy84;
+		case 0xC2 ... 0xDF: goto yy85;
+		case 0xE0: goto yy86;
+		case 0xE1 ... 0xEF: goto yy87;
+		case 0xF0: goto yy88;
+		case 0xF1 ... 0xF3: goto yy89;
+		case 0xF4: goto yy90;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel134;
+			}
+			goto yy83;
+	}
+yy164:
+	++YYCURSOR;
+yyFillLabel135:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'S':
+		case 's': goto yy196;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel135;
+			}
+			goto yy52;
+	}
+yy165:
+	++YYCURSOR;
+yyFillLabel136:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'E':
+		case 'e': goto yy197;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel136;
+			}
+			goto yy52;
+	}
+yy166:
+	++YYCURSOR;
+yyFillLabel137:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'Z':
+		case 'a' ... 'z': goto yy198;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel137;
+			}
+			goto yy52;
+	}
+yy167:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel138:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel138;
+			}
+			goto yy95;
+		case 'S': goto yy196;
+		case 's': goto yy199;
+		default: goto yy94;
+	}
+yy168:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel139:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel139;
+			}
+			goto yy95;
+		case 'E': goto yy197;
+		case 'e': goto yy200;
+		default: goto yy94;
+	}
+yy169:
+	++YYCURSOR;
+yyFillLabel140:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D:
+		case 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel140;
+			}
+			goto yy52;
+	}
+yy170:
+	++YYCURSOR;
+yyFillLabel141:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80:
+		case 0xB0 ... 0xBF: goto yy98;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel141;
+			}
+			goto yy52;
+	}
+yy171:
+	++YYCURSOR;
+yyFillLabel142:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy113;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel142;
+			}
+			goto yy52;
+	}
+yy172:
+	++YYCURSOR;
+yyFillLabel143:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy171;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel143;
+			}
+			goto yy52;
+	}
+yy173:
+	++YYCURSOR;
+yyFillLabel144:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy171;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel144;
+			}
+			goto yy52;
+	}
+yy174:
+	++YYCURSOR;
+yyFillLabel145:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy173;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel145;
+			}
+			goto yy52;
+	}
+yy175:
+	++YYCURSOR;
+yyFillLabel146:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy173;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel146;
+			}
+			goto yy52;
+	}
+yy176:
+	++YYCURSOR;
+yyFillLabel147:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy173;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel147;
+			}
+			goto yy52;
+	}
+yy177:
+	yyaccept = 14;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel148:
+	yych = *YYCURSOR;
+yy178:
+	switch (yych) {
+		case '-':
+		case '0' ... '9':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z': goto yy177;
+		case 0xC2: goto yy201;
+		case 0xC3: goto yy180;
+		case 0xC4 ... 0xCC:
+		case 0xCE ... 0xDF: goto yy181;
+		case 0xCD: goto yy202;
+		case 0xE0: goto yy183;
+		case 0xE1:
+		case 0xE4 ... 0xEC: goto yy184;
+		case 0xE2: goto yy203;
+		case 0xE3: goto yy186;
+		case 0xED: goto yy187;
+		case 0xEF: goto yy188;
+		case 0xF0: goto yy189;
+		case 0xF1 ... 0xF2: goto yy190;
+		case 0xF3: goto yy191;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel148;
+			}
+			goto yy179;
+	}
+yy179:
+#line 203 "lexer_ttl.re"
+	{
+        *token_p = uint8_ndup (it->tok + 2, YYCURSOR - it->tok - 2);
+        LOG_TRACE("BNode name: %s", *token_p);
+
+        return T_BNODE_ID;
+    }
+#line 2508 "parser_ttl.c"
+yy180:
+	++YYCURSOR;
+yyFillLabel149:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x96:
+		case 0x98 ... 0xB6:
+		case 0xB8 ... 0xBF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel149;
+			}
+			goto yy52;
+	}
+yy181:
+	++YYCURSOR;
+yyFillLabel150:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel150;
+			}
+			goto yy52;
+	}
+yy182:
+	++YYCURSOR;
+yyFillLabel151:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBD:
+		case 0xBF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel151;
+			}
+			goto yy52;
+	}
+yy183:
+	++YYCURSOR;
+yyFillLabel152:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy181;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel152;
+			}
+			goto yy52;
+	}
+yy184:
+	++YYCURSOR;
+yyFillLabel153:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy181;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel153;
+			}
+			goto yy52;
+	}
+yy185:
+	++YYCURSOR;
+yyFillLabel154:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy204;
+		case 0x81: goto yy205;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy181;
+		case 0x86: goto yy206;
+		case 0xBF: goto yy207;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel154;
+			}
+			goto yy52;
+	}
+yy186:
+	++YYCURSOR;
+yyFillLabel155:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy208;
+		case 0x81 ... 0xBF: goto yy181;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel155;
+			}
+			goto yy52;
+	}
+yy187:
+	++YYCURSOR;
+yyFillLabel156:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x9F: goto yy181;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel156;
+			}
+			goto yy52;
+	}
+yy188:
+	++YYCURSOR;
+yyFillLabel157:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA4 ... 0xB6:
+		case 0xB8 ... 0xBE: goto yy181;
+		case 0xB7: goto yy209;
+		case 0xBF: goto yy210;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel157;
+			}
+			goto yy52;
+	}
+yy189:
+	++YYCURSOR;
+yyFillLabel158:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy184;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel158;
+			}
+			goto yy52;
+	}
+yy190:
+	++YYCURSOR;
+yyFillLabel159:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy184;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel159;
+			}
+			goto yy52;
+	}
+yy191:
+	++YYCURSOR;
+yyFillLabel160:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy184;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel160;
+			}
+			goto yy52;
+	}
+yy192:
+	++YYCURSOR;
+yyFillLabel161:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel161;
+			}
+			goto yy52;
+		case 's': goto yy193;
+		default: goto yy99;
+	}
+yy193:
+	++YYCURSOR;
+yyFillLabel162:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel162;
+			}
+			goto yy52;
+		case 'e': goto yy211;
+		default: goto yy99;
+	}
+yy194:
+	++YYCURSOR;
+yyFillLabel163:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D:
+		case 0xBF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel163;
+			}
+			goto yy52;
+	}
+yy195:
+	++YYCURSOR;
+yyFillLabel164:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80:
+		case 0xB0 ... 0xBF: goto yy65;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel164;
+			}
+			goto yy52;
+	}
+yy196:
+	++YYCURSOR;
+yyFillLabel165:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'E':
+		case 'e': goto yy213;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel165;
+			}
+			goto yy52;
+	}
+yy197:
+	++YYCURSOR;
+yyFillLabel166:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'F':
+		case 'f': goto yy215;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel166;
+			}
+			goto yy52;
+	}
+yy198:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel167:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-': goto yy166;
+		case '0' ... '9':
+		case 'A' ... 'Z':
+		case 'a' ... 'z': goto yy198;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel167;
+			}
+			goto yy95;
+	}
+yy199:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel168:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel168;
+			}
+			goto yy95;
+		case 'E': goto yy213;
+		case 'e': goto yy216;
+		default: goto yy94;
+	}
+yy200:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel169:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel169;
+			}
+			goto yy95;
+		case 'F': goto yy215;
+		case 'f': goto yy217;
+		default: goto yy94;
+	}
+yy201:
+	++YYCURSOR;
+yyFillLabel170:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB7: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel170;
+			}
+			goto yy52;
+	}
+yy202:
+	++YYCURSOR;
+yyFillLabel171:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD:
+		case 0xBF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel171;
+			}
+			goto yy52;
+	}
+yy203:
+	++YYCURSOR;
+yyFillLabel172:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy218;
+		case 0x81: goto yy219;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy181;
+		case 0x86: goto yy206;
+		case 0xBF: goto yy207;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel172;
+			}
+			goto yy52;
+	}
+yy204:
+	++YYCURSOR;
+yyFillLabel173:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel173;
+			}
+			goto yy52;
+	}
+yy205:
+	++YYCURSOR;
+yyFillLabel174:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel174;
+			}
+			goto yy52;
+	}
+yy206:
+	++YYCURSOR;
+yyFillLabel175:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel175;
+			}
+			goto yy52;
+	}
+yy207:
+	++YYCURSOR;
+yyFillLabel176:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel176;
+			}
+			goto yy52;
+	}
+yy208:
+	++YYCURSOR;
+yyFillLabel177:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x81 ... 0xBF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel177;
+			}
+			goto yy52;
+	}
+yy209:
+	++YYCURSOR;
+yyFillLabel178:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F:
+		case 0xB0 ... 0xBF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel178;
+			}
+			goto yy52;
+	}
+yy210:
+	++YYCURSOR;
+yyFillLabel179:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel179;
+			}
+			goto yy52;
+	}
+yy211:
+	yyaccept = 15;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel180:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-':
+		case '0' ... ':':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z':
+		case 0xC2 ... 0xED:
+		case 0xEF ... 0xF3: goto yy99;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel180;
+			}
+			goto yy212;
+	}
+yy212:
+#line 169 "lexer_ttl.re"
+	{
+        *token_p = uint8_ndup (it->tok, YYCURSOR - it->tok);
+        LOG_TRACE("Boolean: %s", *token_p);
+
+        return T_BOOLEAN;
+    }
+#line 2943 "parser_ttl.c"
+yy213:
+	++YYCURSOR;
+yy214:
+#line 190 "lexer_ttl.re"
+	{
+        LOG_TRACE("'@base' keyword.");
+
+        return T_BASE;
+    }
+#line 2953 "parser_ttl.c"
+yy215:
+	++YYCURSOR;
+yyFillLabel181:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'I':
+		case 'i': goto yy220;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel181;
+			}
+			goto yy52;
+	}
+yy216:
+	yyaccept = 16;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel182:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-': goto yy166;
+		case 'a' ... 'z': goto yy93;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel182;
+			}
+			goto yy214;
+	}
+yy217:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel183:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel183;
+			}
+			goto yy95;
+		case 'I': goto yy220;
+		case 'i': goto yy221;
+		default: goto yy94;
+	}
+yy218:
+	++YYCURSOR;
+yyFillLabel184:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D:
+		case 0xBF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel184;
+			}
+			goto yy52;
+	}
+yy219:
+	++YYCURSOR;
+yyFillLabel185:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80:
+		case 0xB0 ... 0xBF: goto yy177;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel185;
+			}
+			goto yy52;
+	}
+yy220:
+	++YYCURSOR;
+yyFillLabel186:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 'X':
+		case 'x': goto yy222;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel186;
+			}
+			goto yy52;
+	}
+yy221:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel187:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel187;
+			}
+			goto yy95;
+		case 'X': goto yy222;
+		case 'x': goto yy223;
+		default: goto yy94;
+	}
+yy222:
+	++YYCURSOR;
+yyFillLabel188:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy224;
+		case '#': goto yy225;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel188;
+			}
+			goto yy52;
+	}
+yy223:
+	yyaccept = 11;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel189:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel189;
+			}
+			goto yy95;
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy224;
+		case '#': goto yy225;
+		default: goto yy94;
+	}
+yy224:
+	++YYCURSOR;
+yyFillLabel190:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ': goto yy224;
+		case '#': goto yy225;
+		case ':':
+			it->yyt1 = YYCURSOR;
+			goto yy226;
+		case 'A' ... 'Z':
+		case 'a' ... 'z':
+			it->yyt1 = YYCURSOR;
+			goto yy228;
+		case 0xC3:
+			it->yyt1 = YYCURSOR;
+			goto yy229;
+		case 0xC4 ... 0xCB:
+		case 0xCE ... 0xDF:
+			it->yyt1 = YYCURSOR;
+			goto yy230;
+		case 0xCD:
+			it->yyt1 = YYCURSOR;
+			goto yy231;
+		case 0xE0:
+			it->yyt1 = YYCURSOR;
+			goto yy232;
+		case 0xE1:
+		case 0xE4 ... 0xEC:
+			it->yyt1 = YYCURSOR;
+			goto yy233;
+		case 0xE2:
+			it->yyt1 = YYCURSOR;
+			goto yy234;
+		case 0xE3:
+			it->yyt1 = YYCURSOR;
+			goto yy235;
+		case 0xED:
+			it->yyt1 = YYCURSOR;
+			goto yy236;
+		case 0xEF:
+			it->yyt1 = YYCURSOR;
+			goto yy237;
+		case 0xF0:
+			it->yyt1 = YYCURSOR;
+			goto yy238;
+		case 0xF1 ... 0xF2:
+			it->yyt1 = YYCURSOR;
+			goto yy239;
+		case 0xF3:
+			it->yyt1 = YYCURSOR;
+			goto yy240;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel190;
+			}
+			goto yy52;
+	}
+yy225:
+	++YYCURSOR;
+yyFillLabel191:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... '9':
+		case ';' ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel191;
+				goto yy52;
+			}
+			goto yy225;
+		case '\n':
+		case '\r': goto yy224;
+		case ':':
+			it->yyt1 = YYCURSOR;
+			goto yy241;
+		case 0xC2 ... 0xDF: goto yy242;
+		case 0xE0: goto yy243;
+		case 0xE1 ... 0xEF: goto yy244;
+		case 0xF0: goto yy245;
+		case 0xF1 ... 0xF3: goto yy246;
+		case 0xF4: goto yy247;
+		default: goto yy52;
+	}
+yy226:
+	++YYCURSOR;
+yy227:
+	pfx = it->yyt1;
+#line 183 "lexer_ttl.re"
+	{
+        *token_p = uint8_ndup (pfx, YYCURSOR - pfx - 1);
+        LOG_TRACE("Prefix declaration: '%s'", *token_p);
+
+        return T_PREFIX;
+    }
+#line 3181 "parser_ttl.c"
+yy228:
+	++YYCURSOR;
+yyFillLabel192:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '-':
+		case '0' ... '9':
+		case 'A' ... 'Z':
+		case '_':
+		case 'a' ... 'z': goto yy228;
+		case ':': goto yy226;
+		case 0xC2: goto yy248;
+		case 0xC3: goto yy229;
+		case 0xC4 ... 0xCC:
+		case 0xCE ... 0xDF: goto yy230;
+		case 0xCD: goto yy249;
+		case 0xE0: goto yy232;
+		case 0xE1:
+		case 0xE4 ... 0xEC: goto yy233;
+		case 0xE2: goto yy250;
+		case 0xE3: goto yy235;
+		case 0xED: goto yy236;
+		case 0xEF: goto yy237;
+		case 0xF0: goto yy238;
+		case 0xF1 ... 0xF2: goto yy239;
+		case 0xF3: goto yy240;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel192;
+			}
+			goto yy52;
+	}
+yy229:
+	++YYCURSOR;
+yyFillLabel193:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x96:
+		case 0x98 ... 0xB6:
+		case 0xB8 ... 0xBF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel193;
+			}
+			goto yy52;
+	}
+yy230:
+	++YYCURSOR;
+yyFillLabel194:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel194;
+			}
+			goto yy52;
+	}
+yy231:
+	++YYCURSOR;
+yyFillLabel195:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBD:
+		case 0xBF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel195;
+			}
+			goto yy52;
+	}
+yy232:
+	++YYCURSOR;
+yyFillLabel196:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy230;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel196;
+			}
+			goto yy52;
+	}
+yy233:
+	++YYCURSOR;
+yyFillLabel197:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy230;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel197;
+			}
+			goto yy52;
+	}
+yy234:
+	++YYCURSOR;
+yyFillLabel198:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy251;
+		case 0x81: goto yy252;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy230;
+		case 0x86: goto yy253;
+		case 0xBF: goto yy254;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel198;
+			}
+			goto yy52;
+	}
+yy235:
+	++YYCURSOR;
+yyFillLabel199:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy255;
+		case 0x81 ... 0xBF: goto yy230;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel199;
+			}
+			goto yy52;
+	}
+yy236:
+	++YYCURSOR;
+yyFillLabel200:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x9F: goto yy230;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel200;
+			}
+			goto yy52;
+	}
+yy237:
+	++YYCURSOR;
+yyFillLabel201:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA4 ... 0xB6:
+		case 0xB8 ... 0xBE: goto yy230;
+		case 0xB7: goto yy256;
+		case 0xBF: goto yy257;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel201;
+			}
+			goto yy52;
+	}
+yy238:
+	++YYCURSOR;
+yyFillLabel202:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy233;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel202;
+			}
+			goto yy52;
+	}
+yy239:
+	++YYCURSOR;
+yyFillLabel203:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy233;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel203;
+			}
+			goto yy52;
+	}
+yy240:
+	++YYCURSOR;
+yyFillLabel204:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy233;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel204;
+			}
+			goto yy52;
+	}
+yy241:
+	yyaccept = 17;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel205:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x00:
+		case 0x01 ... '\t':
+		case '\v' ... '\f':
+		case 0x0E ... '9':
+		case ';' ... 0x7F:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel205;
+				goto yy227;
+			}
+			goto yy225;
+		case '\n':
+		case '\r': goto yy224;
+		case ':':
+			it->yyt1 = YYCURSOR;
+			goto yy241;
+		case 0xC2 ... 0xDF: goto yy242;
+		case 0xE0: goto yy243;
+		case 0xE1 ... 0xEF: goto yy244;
+		case 0xF0: goto yy245;
+		case 0xF1 ... 0xF3: goto yy246;
+		case 0xF4: goto yy247;
+		default: goto yy227;
+	}
+yy242:
+	++YYCURSOR;
+yyFillLabel206:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy225;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel206;
+			}
+			goto yy52;
+	}
+yy243:
+	++YYCURSOR;
+yyFillLabel207:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy242;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel207;
+			}
+			goto yy52;
+	}
+yy244:
+	++YYCURSOR;
+yyFillLabel208:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy242;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel208;
+			}
+			goto yy52;
+	}
+yy245:
+	++YYCURSOR;
+yyFillLabel209:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy244;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel209;
+			}
+			goto yy52;
+	}
+yy246:
+	++YYCURSOR;
+yyFillLabel210:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy244;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel210;
+			}
+			goto yy52;
+	}
+yy247:
+	++YYCURSOR;
+yyFillLabel211:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy244;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel211;
+			}
+			goto yy52;
+	}
+yy248:
+	++YYCURSOR;
+yyFillLabel212:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB7: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel212;
+			}
+			goto yy52;
+	}
+yy249:
+	++YYCURSOR;
+yyFillLabel213:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD:
+		case 0xBF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel213;
+			}
+			goto yy52;
+	}
+yy250:
+	++YYCURSOR;
+yyFillLabel214:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80: goto yy258;
+		case 0x81: goto yy259;
+		case 0x82 ... 0x85:
+		case 0xB0 ... 0xBE: goto yy230;
+		case 0x86: goto yy253;
+		case 0xBF: goto yy254;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel214;
+			}
+			goto yy52;
+	}
+yy251:
+	++YYCURSOR;
+yyFillLabel215:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel215;
+			}
+			goto yy52;
+	}
+yy252:
+	++YYCURSOR;
+yyFillLabel216:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xB0 ... 0xBF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel216;
+			}
+			goto yy52;
+	}
+yy253:
+	++YYCURSOR;
+yyFillLabel217:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel217;
+			}
+			goto yy52;
+	}
+yy254:
+	++YYCURSOR;
+yyFillLabel218:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xAF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel218;
+			}
+			goto yy52;
+	}
+yy255:
+	++YYCURSOR;
+yyFillLabel219:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x81 ... 0xBF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel219;
+			}
+			goto yy52;
+	}
+yy256:
+	++YYCURSOR;
+yyFillLabel220:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F:
+		case 0xB0 ... 0xBF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel220;
+			}
+			goto yy52;
+	}
+yy257:
+	++YYCURSOR;
+yyFillLabel221:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBD: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel221;
+			}
+			goto yy52;
+	}
+yy258:
+	++YYCURSOR;
+yyFillLabel222:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x8C ... 0x8D:
+		case 0xBF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel222;
+			}
+			goto yy52;
+	}
+yy259:
+	++YYCURSOR;
+yyFillLabel223:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80:
+		case 0xB0 ... 0xBF: goto yy228;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel223;
+			}
+			goto yy52;
+	}
+yy260:
+#line 155 "lexer_ttl.re"
+	{
+        LOG_TRACE("End of document.");
+        return T_EOF;
+    }
+#line 3630 "parser_ttl.c"
+}
+#line 301 "lexer_ttl.re"
+
+
+schar:
+    
+#line 3637 "parser_ttl.c"
+{
+	YYCTYPE yych;
+	unsigned int yyaccept = 0;
+yyFillLabel224:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case ' ' ... '!':
+		case '#' ... '[':
+		case ']' ... 0x7F: goto yy264;
+		case '"': goto yy266;
+		case '\\': goto yy267;
+		case 0xC2 ... 0xDF: goto yy268;
+		case 0xE0: goto yy269;
+		case 0xE1 ... 0xEF: goto yy270;
+		case 0xF0: goto yy271;
+		case 0xF1 ... 0xF3: goto yy272;
+		case 0xF4: goto yy273;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel224;
+				goto yy285;
+			}
+			goto yy262;
+	}
+yy262:
+	++YYCURSOR;
+yy263:
+#line 306 "lexer_ttl.re"
+	{
+        log_warn (
+            "Invalid token in string @ %lu: %s (\\x%x)",
+            YYCURSOR - it->buf - 1, it->tok, *it->tok);
+
+        return -1;
+    }
+#line 3673 "parser_ttl.c"
+yy264:
+	++YYCURSOR;
+yy265:
+#line 320 "lexer_ttl.re"
+	{ goto schar; }
+#line 3679 "parser_ttl.c"
+yy266:
+	++YYCURSOR;
+#line 322 "lexer_ttl.re"
+	{
+        *token_p = unescape_unicode (it->tok + 1, YYCURSOR - it->tok - 2);
+        LOG_TRACE("String: %s", *token_p);
+
+        return T_STRING;
+    }
+#line 3689 "parser_ttl.c"
+yy267:
+	yyaccept = 0;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel225:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '"': goto yy264;
+		case 'U': goto yy274;
+		case 'u': goto yy276;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel225;
+			}
+			goto yy265;
+	}
+yy268:
+	++YYCURSOR;
+yyFillLabel226:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy264;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel226;
+			}
+			goto yy263;
+	}
+yy269:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel227:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy277;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel227;
+			}
+			goto yy263;
+	}
+yy270:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel228:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy277;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel228;
+			}
+			goto yy263;
+	}
+yy271:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel229:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy278;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel229;
+			}
+			goto yy263;
+	}
+yy272:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel230:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy278;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel230;
+			}
+			goto yy263;
+	}
+yy273:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel231:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy278;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel231;
+			}
+			goto yy263;
+	}
+yy274:
+	++YYCURSOR;
+yyFillLabel232:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy279;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel232;
+			}
+			goto yy275;
+	}
+yy275:
+	YYCURSOR = YYMARKER;
+	if (yyaccept == 0) goto yy265;
+	else goto yy263;
+yy276:
+	++YYCURSOR;
+yyFillLabel233:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy280;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel233;
+			}
+			goto yy275;
+	}
+yy277:
+	++YYCURSOR;
+yyFillLabel234:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy264;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel234;
+			}
+			goto yy275;
+	}
+yy278:
+	++YYCURSOR;
+yyFillLabel235:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy277;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel235;
+			}
+			goto yy275;
+	}
+yy279:
+	++YYCURSOR;
+yyFillLabel236:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy281;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel236;
+			}
+			goto yy275;
+	}
+yy280:
+	++YYCURSOR;
+yyFillLabel237:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy282;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel237;
+			}
+			goto yy275;
+	}
+yy281:
+	++YYCURSOR;
+yyFillLabel238:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy283;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel238;
+			}
+			goto yy275;
+	}
+yy282:
+	++YYCURSOR;
+yyFillLabel239:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy284;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel239;
+			}
+			goto yy275;
+	}
+yy283:
+	++YYCURSOR;
+yyFillLabel240:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy276;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel240;
+			}
+			goto yy275;
+	}
+yy284:
+	++YYCURSOR;
+yyFillLabel241:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy264;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel241;
+			}
+			goto yy275;
+	}
+yy285:
+#line 314 "lexer_ttl.re"
+	{
+        log_warn ("Unterminated string!");
+
+        return -1;
+    }
+#line 3921 "parser_ttl.c"
+}
+#line 329 "lexer_ttl.re"
+
+
+lchar:
+    
+#line 3928 "parser_ttl.c"
+{
+	YYCTYPE yych;
+	unsigned int yyaccept = 0;
+yyFillLabel242:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '\t' ... '\n':
+		case '\r':
+		case ' ' ... '!':
+		case '#' ... '[':
+		case ']' ... 0x7F: goto yy289;
+		case '"': goto yy291;
+		case '\\': goto yy292;
+		case 0xC2 ... 0xDF: goto yy293;
+		case 0xE0: goto yy294;
+		case 0xE1 ... 0xEF: goto yy295;
+		case 0xF0: goto yy296;
+		case 0xF1 ... 0xF3: goto yy297;
+		case 0xF4: goto yy298;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel242;
+				goto yy312;
+			}
+			goto yy287;
+	}
+yy287:
+	++YYCURSOR;
+yy288:
+#line 349 "lexer_ttl.re"
+	{
+        log_warn (
+            "Invalid token in long string @ %lu: %s (\\x%x)",
+            YYCURSOR - it->buf - 1, it->tok, *it->tok);
+
+        return -1;
+    }
+#line 3966 "parser_ttl.c"
+yy289:
+	++YYCURSOR;
+yy290:
+#line 340 "lexer_ttl.re"
+	{ goto lchar; }
+#line 3972 "parser_ttl.c"
+yy291:
+	yyaccept = 0;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel243:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '"': goto yy299;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel243;
+			}
+			goto yy290;
+	}
+yy292:
+	yyaccept = 0;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel244:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '"':
+		case 'n':
+		case 'r':
+		case 't': goto yy289;
+		case 'U': goto yy301;
+		case 'u': goto yy302;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel244;
+			}
+			goto yy290;
+	}
+yy293:
+	++YYCURSOR;
+yyFillLabel245:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy289;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel245;
+			}
+			goto yy288;
+	}
+yy294:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel246:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0xA0 ... 0xBF: goto yy303;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel246;
+			}
+			goto yy288;
+	}
+yy295:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel247:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy303;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel247;
+			}
+			goto yy288;
+	}
+yy296:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel248:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x90 ... 0xBF: goto yy304;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel248;
+			}
+			goto yy288;
+	}
+yy297:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel249:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy304;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel249;
+			}
+			goto yy288;
+	}
+yy298:
+	yyaccept = 1;
+	YYMARKER = ++YYCURSOR;
+yyFillLabel250:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0x8F: goto yy304;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel250;
+			}
+			goto yy288;
+	}
+yy299:
+	++YYCURSOR;
+yyFillLabel251:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '"': goto yy305;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel251;
+			}
+			goto yy300;
+	}
+yy300:
+	YYCURSOR = YYMARKER;
+	if (yyaccept == 0) goto yy290;
+	else goto yy288;
+yy301:
+	++YYCURSOR;
+yyFillLabel252:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy306;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel252;
+			}
+			goto yy300;
+	}
+yy302:
+	++YYCURSOR;
+yyFillLabel253:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy307;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel253;
+			}
+			goto yy300;
+	}
+yy303:
+	++YYCURSOR;
+yyFillLabel254:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy289;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel254;
+			}
+			goto yy300;
+	}
+yy304:
+	++YYCURSOR;
+yyFillLabel255:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case 0x80 ... 0xBF: goto yy303;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel255;
+			}
+			goto yy300;
+	}
+yy305:
+	++YYCURSOR;
+#line 342 "lexer_ttl.re"
+	{
+        *token_p = unescape_unicode (it->tok + 3, YYCURSOR - it->tok - 6);
+        LOG_TRACE("Long string: %s", it->tok);
+
+        return T_STRING;
+    }
+#line 4156 "parser_ttl.c"
+yy306:
+	++YYCURSOR;
+yyFillLabel256:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy308;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel256;
+			}
+			goto yy300;
+	}
+yy307:
+	++YYCURSOR;
+yyFillLabel257:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy309;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel257;
+			}
+			goto yy300;
+	}
+yy308:
+	++YYCURSOR;
+yyFillLabel258:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy310;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel258;
+			}
+			goto yy300;
+	}
+yy309:
+	++YYCURSOR;
+yyFillLabel259:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy311;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel259;
+			}
+			goto yy300;
+	}
+yy310:
+	++YYCURSOR;
+yyFillLabel260:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy302;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel260;
+			}
+			goto yy300;
+	}
+yy311:
+	++YYCURSOR;
+yyFillLabel261:
+	yych = *YYCURSOR;
+	switch (yych) {
+		case '0' ... '9':
+		case 'A' ... 'F': goto yy289;
+		default:
+			if (YYLIMIT <= YYCURSOR) {
+				if (YYFILL) goto yyFillLabel261;
+			}
+			goto yy300;
+	}
+yy312:
+#line 334 "lexer_ttl.re"
+	{
+        log_warn ("Unterminated long string!");
+
+        return -1;
+    }
+#line 4242 "parser_ttl.c"
+}
+#line 357 "lexer_ttl.re"
+
+}
+
+
+VOLK_rc
+VOLK_ttl_parse_doc (FILE *fh, VOLK_Graph **gr_p, size_t *ct, char **err_p)
+{
+    *err_p = NULL;
+    *gr_p = NULL;
+
+    if (!fh) return VOLK_VALUE_ERR;
+
+    VOLK_TTLParserState *state = malloc (sizeof (*state));
+    if (UNLIKELY (!state)) return VOLK_MEM_ERR;
+    state->base = NULL;
+    state->ct = 0;
+    state->rc = VOLK_NORESULT;
+
+    ParseIterator parse_it;
+    parse_init (&parse_it, fh);
+
+    void *parser = TTLParseAlloc (malloc);
+
+    // TODO add basic NS, critically xsd: and rdf:
+    VOLK_Graph *gr = VOLK_graph_new (NULL, NULL);
+    if (UNLIKELY (!gr)) return VOLK_MEM_ERR;
+
+    state->it = VOLK_graph_add_init (gr);
+    if (UNLIKELY (!state->it)) {
+        VOLK_graph_free (gr);
+        return VOLK_MEM_ERR;
+    }
+
+    YYCTYPE *token;
+
+#ifdef DEBUG
+    TTLParseTrace (stdout, "TTL Parser > ");
+#endif
+
+    for (;;) {
+        int ttype = lex (&parse_it, &token);
+
+        if (ttype == -1) {
+            char err_token[16] = {'\0'};
+            strncpy (err_token, (const char *)parse_it.tok, 15);
+
+            char *err_start = "Lexer error near token `";
+
+            char err_info [64];
+            sprintf(
+                    err_info, "[...]' at line %u, character %ld.\n",
+                    parse_it.line, parse_it.cur - parse_it.bol);
+
+            size_t err_size = strlen (err_start) + 16 + strlen(err_info);
+            char *err_str = malloc (err_size);
+            sprintf (err_str, "%s%s%s", err_start, err_token, err_info);
+            log_error (err_str);
+
+            state->rc = VOLK_PARSE_ERR;
+            *err_p = err_str;
+
+            goto finally;
+        }
+
+        TTLParse (parser, ttype, token, state);
+
+        if (ttype == T_EOF) break;
+    };
+
+    if (ct) *ct = state->ct;
+
+    log_info ("Parsed %u triples.", state->ct);
+    LOG_DEBUG("Graph size: %lu", VOLK_graph_size (gr));
+
+    *gr_p = gr;
+
+finally: ;
+    VOLK_rc rc = state->rc;
+    LOG_TRACE("rc is %d", rc);
+
+    TTLParseFree (parser, free);
+
+    VOLK_graph_add_done (state->it);
+    VOLK_term_free (state->base);
+    free (state);
+
+    if (rc < 0) VOLK_graph_free (gr);
+
+    return rc;
+}
+