|
@@ -1,4 +1,4 @@
|
|
|
-/* Generated by re2c 4.1 on Sun Aug 17 18:56:10 2025 */
|
|
|
+/* Generated by re2c 4.1 on Wed Aug 20 17:28:48 2025 */
|
|
|
#line 1 "lexer_ttl.re"
|
|
|
#include "volksdata/codec/parser_ttl.h"
|
|
|
#include "volksdata/codec/tokens_ttl.h"
|
|
@@ -19,23 +19,24 @@
|
|
|
|
|
|
|
|
|
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.
|
|
|
+ FILE * fh; ///< Input file handle.
|
|
|
+ const char * sh; ///< Input string. Exclusive with fh.
|
|
|
+ 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"
|
|
|
+#line 38 "parser_ttl.c"
|
|
|
YYCTYPE *yyt1;
|
|
|
-#line 33 "lexer_ttl.re"
|
|
|
+#line 34 "lexer_ttl.re"
|
|
|
|
|
|
} ParseIterator;
|
|
|
|
|
@@ -60,11 +61,13 @@ static int fill (ParseIterator *it)
|
|
|
it->cur -= shift;
|
|
|
it->mar -= shift;
|
|
|
it->tok -= shift;
|
|
|
- it->lim += fread(it->lim, 1, shift, it->fh);
|
|
|
+ if (it->fh) it->lim += fread (it->lim, 1, shift, it->fh);
|
|
|
+ // With a string handle, assume the whole input fits in CHUNK_SIZE.
|
|
|
+ else it->lim = memcpy (it->lim, it->sh, sizeof(it->buf));
|
|
|
|
|
|
-#line 66 "parser_ttl.c"
|
|
|
+#line 69 "parser_ttl.c"
|
|
|
if (it->yyt1) it->yyt1 -= shift;
|
|
|
-#line 58 "lexer_ttl.re"
|
|
|
+#line 61 "lexer_ttl.re"
|
|
|
|
|
|
it->lim[0] = 0;
|
|
|
it->eof |= it->lim < it->buf + CHUNK_SIZE - 1;
|
|
@@ -72,18 +75,19 @@ if (it->yyt1) it->yyt1 -= shift;
|
|
|
}
|
|
|
|
|
|
|
|
|
-static void parse_init (ParseIterator *it, FILE *fh)
|
|
|
+static void parse_init (ParseIterator *it, FILE *fh, const char *sh)
|
|
|
{
|
|
|
it->fh = fh;
|
|
|
+ it->sh = sh;
|
|
|
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"
|
|
|
+#line 89 "parser_ttl.c"
|
|
|
it->yyt1 = NULL;
|
|
|
-#line 73 "lexer_ttl.re"
|
|
|
+#line 77 "lexer_ttl.re"
|
|
|
|
|
|
fill (it);
|
|
|
}
|
|
@@ -110,7 +114,7 @@ static int lex (ParseIterator *it, YYCTYPE **token_p)
|
|
|
{
|
|
|
const YYCTYPE *pfx;
|
|
|
|
|
|
- #line 138 "lexer_ttl.re"
|
|
|
+ #line 142 "lexer_ttl.re"
|
|
|
|
|
|
|
|
|
loop: // Start new token.
|
|
@@ -119,7 +123,7 @@ loop: // Start new token.
|
|
|
*token_p = NULL;
|
|
|
|
|
|
|
|
|
-#line 123 "parser_ttl.c"
|
|
|
+#line 127 "parser_ttl.c"
|
|
|
{
|
|
|
YYCTYPE yych;
|
|
|
unsigned int yyaccept = 0;
|
|
@@ -178,7 +182,7 @@ yyFillLabel0:
|
|
|
yy1:
|
|
|
++YYCURSOR;
|
|
|
yy2:
|
|
|
-#line 147 "lexer_ttl.re"
|
|
|
+#line 151 "lexer_ttl.re"
|
|
|
{
|
|
|
log_warn (
|
|
|
"Invalid token @ %lu: %s (\\x%x)",
|
|
@@ -186,7 +190,7 @@ yy2:
|
|
|
|
|
|
return -1;
|
|
|
}
|
|
|
-#line 190 "parser_ttl.c"
|
|
|
+#line 194 "parser_ttl.c"
|
|
|
yy3:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel1:
|
|
@@ -208,7 +212,7 @@ yyFillLabel1:
|
|
|
goto yy4;
|
|
|
}
|
|
|
yy4:
|
|
|
-#line 215 "lexer_ttl.re"
|
|
|
+#line 219 "lexer_ttl.re"
|
|
|
{
|
|
|
uint8_t *ws = uint8_ndup (it->tok, YYCURSOR - it->tok);
|
|
|
LOG_TRACE("Whitespace: '%s'", ws);
|
|
@@ -221,7 +225,7 @@ yy4:
|
|
|
|
|
|
return T_WS;
|
|
|
}
|
|
|
-#line 225 "parser_ttl.c"
|
|
|
+#line 229 "parser_ttl.c"
|
|
|
yy5:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel2:
|
|
@@ -243,12 +247,12 @@ yyFillLabel2:
|
|
|
goto yy6;
|
|
|
}
|
|
|
yy6:
|
|
|
-#line 160 "lexer_ttl.re"
|
|
|
+#line 164 "lexer_ttl.re"
|
|
|
{
|
|
|
newline (it);
|
|
|
goto loop;
|
|
|
}
|
|
|
-#line 252 "parser_ttl.c"
|
|
|
+#line 256 "parser_ttl.c"
|
|
|
yy7:
|
|
|
yyaccept = 0;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -263,9 +267,9 @@ yyFillLabel3:
|
|
|
goto yy8;
|
|
|
}
|
|
|
yy8:
|
|
|
-#line 167 "lexer_ttl.re"
|
|
|
+#line 171 "lexer_ttl.re"
|
|
|
{ goto schar; }
|
|
|
-#line 269 "parser_ttl.c"
|
|
|
+#line 273 "parser_ttl.c"
|
|
|
yy9:
|
|
|
yyaccept = 1;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -292,12 +296,12 @@ yyFillLabel4:
|
|
|
default: goto yy10;
|
|
|
}
|
|
|
yy10:
|
|
|
-#line 210 "lexer_ttl.re"
|
|
|
+#line 214 "lexer_ttl.re"
|
|
|
{
|
|
|
LOG_TRACE("Comment: `%s`", it->tok);
|
|
|
goto loop;
|
|
|
}
|
|
|
-#line 301 "parser_ttl.c"
|
|
|
+#line 305 "parser_ttl.c"
|
|
|
yy11:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel5:
|
|
@@ -314,14 +318,14 @@ yyFillLabel5:
|
|
|
goto yy12;
|
|
|
}
|
|
|
yy12:
|
|
|
-#line 270 "lexer_ttl.re"
|
|
|
+#line 274 "lexer_ttl.re"
|
|
|
{ return T_LPAREN; }
|
|
|
-#line 320 "parser_ttl.c"
|
|
|
+#line 324 "parser_ttl.c"
|
|
|
yy13:
|
|
|
++YYCURSOR;
|
|
|
-#line 272 "lexer_ttl.re"
|
|
|
+#line 276 "lexer_ttl.re"
|
|
|
{ return T_RPAREN; }
|
|
|
-#line 325 "parser_ttl.c"
|
|
|
+#line 329 "parser_ttl.c"
|
|
|
yy14:
|
|
|
yyaccept = 2;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -352,9 +356,9 @@ yyFillLabel7:
|
|
|
goto yy16;
|
|
|
}
|
|
|
yy16:
|
|
|
-#line 286 "lexer_ttl.re"
|
|
|
+#line 290 "lexer_ttl.re"
|
|
|
{ return T_COMMA; }
|
|
|
-#line 358 "parser_ttl.c"
|
|
|
+#line 362 "parser_ttl.c"
|
|
|
yy17:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel8:
|
|
@@ -368,13 +372,13 @@ yyFillLabel8:
|
|
|
goto yy18;
|
|
|
}
|
|
|
yy18:
|
|
|
-#line 288 "lexer_ttl.re"
|
|
|
+#line 292 "lexer_ttl.re"
|
|
|
{
|
|
|
LOG_TRACE("End of statement #%u.", it->stmt);
|
|
|
it->stmt++;
|
|
|
return T_PERIOD;
|
|
|
}
|
|
|
-#line 378 "parser_ttl.c"
|
|
|
+#line 382 "parser_ttl.c"
|
|
|
yy19:
|
|
|
yyaccept = 3;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -392,7 +396,7 @@ yyFillLabel9:
|
|
|
goto yy20;
|
|
|
}
|
|
|
yy20:
|
|
|
-#line 235 "lexer_ttl.re"
|
|
|
+#line 239 "lexer_ttl.re"
|
|
|
{
|
|
|
// Normalize sign.
|
|
|
size_t offset = *it->tok == '+' ? 1 : 0;
|
|
@@ -402,7 +406,7 @@ yy20:
|
|
|
|
|
|
return T_INTEGER;
|
|
|
}
|
|
|
-#line 406 "parser_ttl.c"
|
|
|
+#line 410 "parser_ttl.c"
|
|
|
yy21:
|
|
|
yyaccept = 4;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -423,14 +427,14 @@ yyFillLabel10:
|
|
|
default: goto yy66;
|
|
|
}
|
|
|
yy22:
|
|
|
-#line 196 "lexer_ttl.re"
|
|
|
+#line 200 "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"
|
|
|
+#line 438 "parser_ttl.c"
|
|
|
yy23:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel11:
|
|
@@ -447,13 +451,13 @@ yyFillLabel11:
|
|
|
goto yy24;
|
|
|
}
|
|
|
yy24:
|
|
|
-#line 280 "lexer_ttl.re"
|
|
|
+#line 284 "lexer_ttl.re"
|
|
|
{
|
|
|
LOG_TRACE("End of object list.");
|
|
|
|
|
|
return T_SEMICOLON;
|
|
|
}
|
|
|
-#line 457 "parser_ttl.c"
|
|
|
+#line 461 "parser_ttl.c"
|
|
|
yy25:
|
|
|
yyaccept = 2;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -522,14 +526,14 @@ yyFillLabel15:
|
|
|
goto yy29;
|
|
|
}
|
|
|
yy29:
|
|
|
-#line 274 "lexer_ttl.re"
|
|
|
+#line 278 "lexer_ttl.re"
|
|
|
{ return T_LBRACKET; }
|
|
|
-#line 528 "parser_ttl.c"
|
|
|
+#line 532 "parser_ttl.c"
|
|
|
yy30:
|
|
|
++YYCURSOR;
|
|
|
-#line 276 "lexer_ttl.re"
|
|
|
+#line 280 "lexer_ttl.re"
|
|
|
{ return T_RBRACKET; }
|
|
|
-#line 533 "parser_ttl.c"
|
|
|
+#line 537 "parser_ttl.c"
|
|
|
yy31:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel16:
|
|
@@ -575,12 +579,12 @@ yyFillLabel18:
|
|
|
goto yy34;
|
|
|
}
|
|
|
yy34:
|
|
|
-#line 296 "lexer_ttl.re"
|
|
|
+#line 300 "lexer_ttl.re"
|
|
|
{
|
|
|
LOG_TRACE("RDF type shorthand 'a'.");
|
|
|
return T_RDF_TYPE;
|
|
|
}
|
|
|
-#line 584 "parser_ttl.c"
|
|
|
+#line 588 "parser_ttl.c"
|
|
|
yy35:
|
|
|
yyaccept = 2;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -1002,7 +1006,7 @@ yyFillLabel44:
|
|
|
goto yy63;
|
|
|
}
|
|
|
yy63:
|
|
|
-#line 255 "lexer_ttl.re"
|
|
|
+#line 259 "lexer_ttl.re"
|
|
|
{
|
|
|
// Normalize sign.
|
|
|
YYCTYPE offset = *it->tok == '+' ? 1 : 0;
|
|
@@ -1017,7 +1021,7 @@ yy63:
|
|
|
|
|
|
return T_DECIMAL;
|
|
|
}
|
|
|
-#line 1021 "parser_ttl.c"
|
|
|
+#line 1025 "parser_ttl.c"
|
|
|
yy64:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel45:
|
|
@@ -1272,14 +1276,14 @@ yy81:
|
|
|
yy82:
|
|
|
++YYCURSOR;
|
|
|
yy83:
|
|
|
-#line 176 "lexer_ttl.re"
|
|
|
+#line 180 "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"
|
|
|
+#line 1287 "parser_ttl.c"
|
|
|
yy84:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel61:
|
|
@@ -1416,14 +1420,14 @@ yy94:
|
|
|
goto yy95;
|
|
|
}
|
|
|
yy95:
|
|
|
-#line 228 "lexer_ttl.re"
|
|
|
+#line 232 "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"
|
|
|
+#line 1431 "parser_ttl.c"
|
|
|
yy96:
|
|
|
yyaccept = 11;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -1682,9 +1686,9 @@ yyFillLabel87:
|
|
|
}
|
|
|
yy114:
|
|
|
++YYCURSOR;
|
|
|
-#line 294 "lexer_ttl.re"
|
|
|
+#line 298 "lexer_ttl.re"
|
|
|
{ return T_DTYPE_MARKER; }
|
|
|
-#line 1688 "parser_ttl.c"
|
|
|
+#line 1692 "parser_ttl.c"
|
|
|
yy115:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel88:
|
|
@@ -1890,9 +1894,9 @@ yyFillLabel103:
|
|
|
}
|
|
|
yy131:
|
|
|
++YYCURSOR;
|
|
|
-#line 165 "lexer_ttl.re"
|
|
|
+#line 169 "lexer_ttl.re"
|
|
|
{ goto lchar; }
|
|
|
-#line 1896 "parser_ttl.c"
|
|
|
+#line 1900 "parser_ttl.c"
|
|
|
yy132:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel104:
|
|
@@ -2062,7 +2066,7 @@ yyFillLabel117:
|
|
|
goto yy146;
|
|
|
}
|
|
|
yy146:
|
|
|
-#line 245 "lexer_ttl.re"
|
|
|
+#line 249 "lexer_ttl.re"
|
|
|
{
|
|
|
// Normalize sign.
|
|
|
size_t offset = *it->tok == '+' ? 1 : 0;
|
|
@@ -2072,7 +2076,7 @@ yy146:
|
|
|
|
|
|
return T_DOUBLE;
|
|
|
}
|
|
|
-#line 2076 "parser_ttl.c"
|
|
|
+#line 2080 "parser_ttl.c"
|
|
|
yy147:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel118:
|
|
@@ -2497,14 +2501,14 @@ yy178:
|
|
|
goto yy179;
|
|
|
}
|
|
|
yy179:
|
|
|
-#line 203 "lexer_ttl.re"
|
|
|
+#line 207 "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"
|
|
|
+#line 2512 "parser_ttl.c"
|
|
|
yy180:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel149:
|
|
@@ -2932,24 +2936,24 @@ yyFillLabel180:
|
|
|
goto yy212;
|
|
|
}
|
|
|
yy212:
|
|
|
-#line 169 "lexer_ttl.re"
|
|
|
+#line 173 "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"
|
|
|
+#line 2947 "parser_ttl.c"
|
|
|
yy213:
|
|
|
++YYCURSOR;
|
|
|
yy214:
|
|
|
-#line 190 "lexer_ttl.re"
|
|
|
+#line 194 "lexer_ttl.re"
|
|
|
{
|
|
|
LOG_TRACE("'@base' keyword.");
|
|
|
|
|
|
return T_BASE;
|
|
|
}
|
|
|
-#line 2953 "parser_ttl.c"
|
|
|
+#line 2957 "parser_ttl.c"
|
|
|
yy215:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel181:
|
|
@@ -3170,14 +3174,14 @@ yy226:
|
|
|
++YYCURSOR;
|
|
|
yy227:
|
|
|
pfx = it->yyt1;
|
|
|
-#line 183 "lexer_ttl.re"
|
|
|
+#line 187 "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"
|
|
|
+#line 3185 "parser_ttl.c"
|
|
|
yy228:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel192:
|
|
@@ -3621,19 +3625,19 @@ yyFillLabel223:
|
|
|
goto yy52;
|
|
|
}
|
|
|
yy260:
|
|
|
-#line 155 "lexer_ttl.re"
|
|
|
+#line 159 "lexer_ttl.re"
|
|
|
{
|
|
|
LOG_TRACE("End of document.");
|
|
|
return T_EOF;
|
|
|
}
|
|
|
-#line 3630 "parser_ttl.c"
|
|
|
+#line 3634 "parser_ttl.c"
|
|
|
}
|
|
|
-#line 301 "lexer_ttl.re"
|
|
|
+#line 305 "lexer_ttl.re"
|
|
|
|
|
|
|
|
|
schar:
|
|
|
|
|
|
-#line 3637 "parser_ttl.c"
|
|
|
+#line 3641 "parser_ttl.c"
|
|
|
{
|
|
|
YYCTYPE yych;
|
|
|
unsigned int yyaccept = 0;
|
|
@@ -3661,7 +3665,7 @@ yyFillLabel224:
|
|
|
yy262:
|
|
|
++YYCURSOR;
|
|
|
yy263:
|
|
|
-#line 306 "lexer_ttl.re"
|
|
|
+#line 310 "lexer_ttl.re"
|
|
|
{
|
|
|
log_warn (
|
|
|
"Invalid token in string @ %lu: %s (\\x%x)",
|
|
@@ -3669,23 +3673,23 @@ yy263:
|
|
|
|
|
|
return -1;
|
|
|
}
|
|
|
-#line 3673 "parser_ttl.c"
|
|
|
+#line 3677 "parser_ttl.c"
|
|
|
yy264:
|
|
|
++YYCURSOR;
|
|
|
yy265:
|
|
|
-#line 320 "lexer_ttl.re"
|
|
|
+#line 324 "lexer_ttl.re"
|
|
|
{ goto schar; }
|
|
|
-#line 3679 "parser_ttl.c"
|
|
|
+#line 3683 "parser_ttl.c"
|
|
|
yy266:
|
|
|
++YYCURSOR;
|
|
|
-#line 322 "lexer_ttl.re"
|
|
|
+#line 326 "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"
|
|
|
+#line 3693 "parser_ttl.c"
|
|
|
yy267:
|
|
|
yyaccept = 0;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -3911,20 +3915,20 @@ yyFillLabel241:
|
|
|
goto yy275;
|
|
|
}
|
|
|
yy285:
|
|
|
-#line 314 "lexer_ttl.re"
|
|
|
+#line 318 "lexer_ttl.re"
|
|
|
{
|
|
|
log_warn ("Unterminated string!");
|
|
|
|
|
|
return -1;
|
|
|
}
|
|
|
-#line 3921 "parser_ttl.c"
|
|
|
+#line 3925 "parser_ttl.c"
|
|
|
}
|
|
|
-#line 329 "lexer_ttl.re"
|
|
|
+#line 333 "lexer_ttl.re"
|
|
|
|
|
|
|
|
|
lchar:
|
|
|
|
|
|
-#line 3928 "parser_ttl.c"
|
|
|
+#line 3932 "parser_ttl.c"
|
|
|
{
|
|
|
YYCTYPE yych;
|
|
|
unsigned int yyaccept = 0;
|
|
@@ -3954,7 +3958,7 @@ yyFillLabel242:
|
|
|
yy287:
|
|
|
++YYCURSOR;
|
|
|
yy288:
|
|
|
-#line 349 "lexer_ttl.re"
|
|
|
+#line 353 "lexer_ttl.re"
|
|
|
{
|
|
|
log_warn (
|
|
|
"Invalid token in long string @ %lu: %s (\\x%x)",
|
|
@@ -3962,13 +3966,13 @@ yy288:
|
|
|
|
|
|
return -1;
|
|
|
}
|
|
|
-#line 3966 "parser_ttl.c"
|
|
|
+#line 3970 "parser_ttl.c"
|
|
|
yy289:
|
|
|
++YYCURSOR;
|
|
|
yy290:
|
|
|
-#line 340 "lexer_ttl.re"
|
|
|
+#line 344 "lexer_ttl.re"
|
|
|
{ goto lchar; }
|
|
|
-#line 3972 "parser_ttl.c"
|
|
|
+#line 3976 "parser_ttl.c"
|
|
|
yy291:
|
|
|
yyaccept = 0;
|
|
|
YYMARKER = ++YYCURSOR;
|
|
@@ -4145,14 +4149,14 @@ yyFillLabel255:
|
|
|
}
|
|
|
yy305:
|
|
|
++YYCURSOR;
|
|
|
-#line 342 "lexer_ttl.re"
|
|
|
+#line 346 "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"
|
|
|
+#line 4160 "parser_ttl.c"
|
|
|
yy306:
|
|
|
++YYCURSOR;
|
|
|
yyFillLabel256:
|
|
@@ -4232,21 +4236,22 @@ yyFillLabel261:
|
|
|
goto yy300;
|
|
|
}
|
|
|
yy312:
|
|
|
-#line 334 "lexer_ttl.re"
|
|
|
+#line 338 "lexer_ttl.re"
|
|
|
{
|
|
|
log_warn ("Unterminated long string!");
|
|
|
|
|
|
return -1;
|
|
|
}
|
|
|
-#line 4242 "parser_ttl.c"
|
|
|
+#line 4246 "parser_ttl.c"
|
|
|
}
|
|
|
-#line 357 "lexer_ttl.re"
|
|
|
+#line 361 "lexer_ttl.re"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
VOLK_rc
|
|
|
-VOLK_ttl_parse_doc (FILE *fh, VOLK_Graph **gr_p, size_t *ct, char **err_p)
|
|
|
+VOLK_ttl_parse_doc (
|
|
|
+ FILE *fh, const char *sh, VOLK_Graph **gr_p, size_t *ct, char **err_p)
|
|
|
{
|
|
|
*err_p = NULL;
|
|
|
*gr_p = NULL;
|
|
@@ -4260,7 +4265,7 @@ VOLK_ttl_parse_doc (FILE *fh, VOLK_Graph **gr_p, size_t *ct, char **err_p)
|
|
|
state->rc = VOLK_NORESULT;
|
|
|
|
|
|
ParseIterator parse_it;
|
|
|
- parse_init (&parse_it, fh);
|
|
|
+ parse_init (&parse_it, fh, sh);
|
|
|
|
|
|
void *parser = TTLParseAlloc (malloc);
|
|
|
|