273
343
# if YYSTACK_USE_ALLOCA
275
345
# define YYSTACK_ALLOC __builtin_alloca
346
# elif defined __BUILTIN_VA_ARG_INCR
347
# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
349
# define YYSTACK_ALLOC __alloca
350
# elif defined _MSC_VER
351
# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
352
# define alloca _alloca
277
354
# define YYSTACK_ALLOC alloca
278
# if defined (__STDC__) || defined (__cplusplus)
355
# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
356
|| defined __cplusplus || defined _MSC_VER)
279
357
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
280
# define YYINCLUDED_STDLIB_H
286
366
# ifdef YYSTACK_ALLOC
287
/* Pacify GCC's `empty if-body' warning. */
288
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
367
/* Pacify GCC's `empty if-body' warning. */
368
# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
289
369
# ifndef YYSTACK_ALLOC_MAXIMUM
290
370
/* The OS might guarantee only one guard page at the bottom of the stack,
291
371
and a page size can be as small as 4096 bytes. So we cannot safely
292
372
invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
293
373
to allow for a few compiler-allocated temporary stack slots. */
294
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
374
# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
297
377
# define YYSTACK_ALLOC YYMALLOC
298
378
# define YYSTACK_FREE YYFREE
299
379
# ifndef YYSTACK_ALLOC_MAXIMUM
300
# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
380
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
382
# if (defined __cplusplus && ! defined _STDLIB_H \
383
&& ! ((defined YYMALLOC || defined malloc) \
384
&& (defined YYFREE || defined free)))
385
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
305
390
# ifndef YYMALLOC
306
391
# define YYMALLOC malloc
307
# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
308
&& (defined (__STDC__) || defined (__cplusplus)))
392
# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
393
|| defined __cplusplus || defined _MSC_VER)
312
397
# define YYFREE free
313
# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
314
&& (defined (__STDC__) || defined (__cplusplus)))
398
# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
399
|| defined __cplusplus || defined _MSC_VER)
321
#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
324
#if (! defined (yyoverflow) \
325
&& (! defined (__cplusplus) \
326
|| (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
403
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
406
#if (! defined yyoverflow \
407
&& (! defined __cplusplus \
408
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
328
410
/* A type that is properly aligned for any stack member. */
452
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
453
static const yysigned_char yyrhs[] =
528
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
529
static const yytype_int8 yyrhs[] =
455
531
24, 0, -1, 25, -1, 25, 26, -1, -1, 31,
456
-1, 32, 30, 7, -1, 1, 7, -1, 27, 8,
532
-1, 32, 30, 6, -1, 1, 6, -1, 27, 7,
457
533
34, -1, 34, -1, 28, 34, -1, 34, -1, 33,
458
-1, 4, -1, 30, 9, 29, 27, -1, 29, 27,
459
-1, -1, 30, 9, -1, 3, 18, 15, 7, -1,
534
-1, 3, -1, 30, 8, 29, 27, -1, 29, 27,
535
-1, -1, 30, 8, -1, 17, 18, 14, 6, -1,
460
536
36, -1, 37, -1, 36, -1, 36, -1, 37, -1,
461
35, -1, 14, 5, 18, -1, 14, 5, 18, 6,
462
15, -1, 14, 5, 18, 6, 17, -1, 14, 6,
463
15, -1, 14, 6, 17, -1, 14, -1, 19, -1,
464
20, -1, 21, -1, 15, -1, 17, -1, 16, -1,
465
10, 30, 11, -1, 38, -1, 12, 28, 13, -1,
537
35, -1, 13, 4, 18, -1, 13, 4, 18, 5,
538
14, -1, 13, 4, 18, 5, 16, -1, 13, 5,
539
14, -1, 13, 5, 16, -1, 13, -1, 19, -1,
540
20, -1, 21, -1, 14, -1, 16, -1, 15, -1,
541
9, 30, 10, -1, 38, -1, 11, 28, 12, -1,
469
545
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
470
static const unsigned short int yyrline[] =
546
static const yytype_uint16 yyrline[] =
472
0, 160, 160, 163, 164, 167, 168, 212, 216, 249,
473
283, 316, 350, 360, 374, 435, 471, 477, 488, 522,
474
526, 533, 540, 544, 548, 561, 569, 581, 593, 605,
475
616, 624, 636, 643, 655, 666, 681, 691, 732, 739,
548
0, 167, 167, 170, 171, 174, 175, 219, 223, 256,
549
290, 323, 357, 367, 381, 442, 478, 484, 495, 533,
550
537, 544, 551, 555, 559, 572, 580, 592, 604, 616,
551
627, 635, 647, 654, 666, 677, 692, 702, 743, 750,
480
556
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
481
557
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
482
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
558
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
483
559
static const char *const yytname[] =
485
"$end", "error", "$undefined", "PREFIX", "A", "AT", "HAT", "DOT",
486
"COMMA", "SEMICOLON", "LEFT_SQUARE", "RIGHT_SQUARE", "LEFT_ROUND",
487
"RIGHT_ROUND", "STRING_LITERAL", "URI_LITERAL", "BLANK_LITERAL",
488
"QNAME_LITERAL", "IDENTIFIER", "INTEGER_LITERAL", "FLOATING_LITERAL",
489
"DECIMAL_LITERAL", "ERROR_TOKEN", "$accept", "Document", "statementList",
490
"statement", "objectList", "itemList", "verb", "propertyList",
491
"directive", "subject", "predicate", "object", "literal", "resource",
492
"blank", "collection", 0
561
"$end", "error", "$undefined", "\"a\"", "\"@\"", "\"^\"", "\".\"",
562
"\",\"", "\";\"", "\"[\"", "\"]\"", "\"(\"", "\")\"",
563
"\"string literal\"", "\"URI literal\"", "\"blank node\"", "\"QName\"",
564
"\"@prefix\"", "\"identifier\"", "\"integer literal\"",
565
"\"floating point literal\"", "\"decimal literal\"", "ERROR_TOKEN",
566
"$accept", "Document", "statementList", "statement", "objectList",
567
"itemList", "verb", "propertyList", "directive", "subject", "predicate",
568
"object", "literal", "resource", "blank", "collection", 0
497
573
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
498
574
token YYLEX-NUM. */
499
static const unsigned short int yytoknum[] =
575
static const yytype_uint16 yytoknum[] =
501
577
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
502
578
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
527
603
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
528
604
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
529
605
means the default is an error. */
530
static const unsigned char yydefact[] =
606
static const yytype_uint8 yydefact[] =
532
4, 0, 0, 1, 0, 0, 16, 0, 34, 36,
533
35, 3, 5, 16, 19, 20, 38, 7, 0, 13,
534
0, 0, 12, 21, 40, 30, 31, 32, 33, 0,
535
11, 24, 22, 23, 0, 0, 15, 9, 17, 37,
536
0, 0, 39, 10, 6, 18, 0, 0, 25, 28,
608
4, 0, 0, 1, 0, 16, 0, 34, 36, 35,
609
0, 3, 5, 16, 19, 20, 38, 7, 13, 0,
610
0, 12, 21, 40, 30, 31, 32, 33, 0, 11,
611
24, 22, 23, 0, 0, 15, 9, 17, 37, 0,
612
0, 39, 10, 0, 6, 0, 0, 25, 28, 29,
540
/* YYDEFGOTO[NTERM-NUM]. */
541
static const yysigned_char yydefgoto[] =
616
/* YYDEFGOTO[NTERM-NUM]. */
617
static const yytype_int8 yydefgoto[] =
543
-1, 1, 2, 11, 36, 29, 20, 21, 12, 13,
544
22, 37, 31, 32, 33, 16
619
-1, 1, 2, 11, 35, 28, 19, 20, 12, 13,
620
21, 36, 30, 31, 32, 16
547
623
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
549
#define YYPACT_NINF -8
550
static const yysigned_char yypact[] =
625
#define YYPACT_NINF -13
626
static const yytype_int8 yypact[] =
552
-8, 2, 3, -8, 1, 18, 6, 14, -8, -8,
553
-8, -8, -8, 6, -8, -8, -8, -8, -4, -8,
554
40, -2, -8, -8, -8, 60, -8, -8, -8, 28,
555
-8, -8, -8, -8, 7, 10, 17, -8, 6, -8,
556
45, 36, -8, -8, -8, -8, 40, 40, 26, -8,
557
-8, -8, 17, 47, -8, -8
628
-13, 9, 2, -13, 8, 7, 29, -13, -13, -13,
629
12, -13, -13, 7, -13, -13, -13, -13, -13, 55,
630
-3, -13, -13, -13, 24, -13, -13, -13, 42, -13,
631
-13, -13, -13, 1, 0, 13, -13, 7, -13, 14,
632
10, -13, -13, 25, -13, 55, 55, 28, -13, -13,
633
-13, -13, 13, 11, -13, -13
560
636
/* YYPGOTO[NTERM-NUM]. */
561
static const yysigned_char yypgoto[] =
637
static const yytype_int8 yypgoto[] =
563
-8, -8, -8, -8, 11, -8, 8, 54, -8, -8,
564
-8, -7, -8, -1, 66, -8
639
-13, -13, -13, -13, -12, -13, -2, 33, -13, -13,
640
-13, -6, -13, -1, 35, -13
567
643
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
569
645
number is the opposite. If zero, do what YYDEFACT says.
570
646
If YYTABLE_NINF, syntax error. */
571
647
#define YYTABLE_NINF -3
572
static const yysigned_char yytable[] =
648
static const yytype_int8 yytable[] =
574
30, 14, 3, -2, 4, 23, 5, 38, 17, 39,
575
19, 35, 23, 6, 44, 7, 38, 45, 8, 9,
576
10, 8, 43, 10, 6, 46, 7, 24, 25, 8,
577
9, 10, 53, 26, 27, 28, 18, 23, 6, 51,
578
7, 42, 25, 8, 9, 10, 47, 26, 27, 28,
579
6, 49, 7, 50, 25, 8, 9, 10, 52, 26,
580
27, 28, 54, 48, 55, 40, 41, 34, 15
650
29, 14, -2, 4, 22, 37, 44, 38, 37, 3,
651
18, 5, 22, 6, 17, 43, 7, 8, 9, 10,
652
45, 7, 42, 9, 48, 54, 49, 55, 39, 40,
653
33, 50, 47, 53, 52, 46, 22, 15, 5, 51,
654
6, 23, 24, 7, 8, 9, 34, 0, 25, 26,
655
27, 5, 0, 6, 41, 24, 7, 8, 9, 0,
656
0, 25, 26, 27, 5, 0, 6, 0, 24, 7,
657
8, 9, 0, 0, 25, 26, 27
583
static const unsigned char yycheck[] =
660
static const yytype_int8 yycheck[] =
585
7, 2, 0, 0, 1, 6, 3, 9, 7, 11,
586
4, 15, 13, 10, 7, 12, 9, 7, 15, 16,
587
17, 15, 29, 17, 10, 8, 12, 13, 14, 15,
588
16, 17, 6, 19, 20, 21, 18, 38, 10, 46,
589
12, 13, 14, 15, 16, 17, 38, 19, 20, 21,
590
10, 15, 12, 17, 14, 15, 16, 17, 47, 19,
591
20, 21, 15, 18, 17, 5, 6, 13, 2
662
6, 2, 0, 1, 5, 8, 6, 10, 8, 0,
663
3, 9, 13, 11, 6, 14, 14, 15, 16, 17,
664
7, 14, 28, 16, 14, 14, 16, 16, 4, 5,
665
18, 6, 18, 5, 46, 37, 37, 2, 9, 45,
666
11, 12, 13, 14, 15, 16, 13, -1, 19, 20,
667
21, 9, -1, 11, 12, 13, 14, 15, 16, -1,
668
-1, 19, 20, 21, 9, -1, 11, -1, 13, 14,
669
15, 16, -1, -1, 19, 20, 21
594
672
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
595
673
symbol of state STATE-NUM. */
596
static const unsigned char yystos[] =
674
static const yytype_uint8 yystos[] =
598
0, 24, 25, 0, 1, 3, 10, 12, 15, 16,
599
17, 26, 31, 32, 36, 37, 38, 7, 18, 4,
600
29, 30, 33, 36, 13, 14, 19, 20, 21, 28,
601
34, 35, 36, 37, 30, 15, 27, 34, 9, 11,
602
5, 6, 13, 34, 7, 7, 8, 29, 18, 15,
603
17, 34, 27, 6, 15, 17
676
0, 24, 25, 0, 1, 9, 11, 14, 15, 16,
677
17, 26, 31, 32, 36, 37, 38, 6, 3, 29,
678
30, 33, 36, 12, 13, 19, 20, 21, 28, 34,
679
35, 36, 37, 18, 30, 27, 34, 8, 10, 4,
680
5, 12, 34, 14, 6, 7, 29, 18, 14, 16,
606
684
#define yyerrok (yyerrstatus = 0)
707
785
YYFPRINTF Args; \
710
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
714
YYFPRINTF (stderr, "%s ", Title); \
715
yysymprint (stderr, \
717
YYFPRINTF (stderr, "\n"); \
788
# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
792
YYFPRINTF (stderr, "%s ", Title); \
793
yy_symbol_print (stderr, \
795
YYFPRINTF (stderr, "\n"); \
800
/*--------------------------------.
801
| Print this symbol on YYOUTPUT. |
802
`--------------------------------*/
805
#if (defined __STDC__ || defined __C99__FUNC__ \
806
|| defined __cplusplus || defined _MSC_VER)
808
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
811
yy_symbol_value_print (yyoutput, yytype, yyvaluep)
814
YYSTYPE const * const yyvaluep;
820
if (yytype < YYNTOKENS)
821
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
833
/*--------------------------------.
834
| Print this symbol on YYOUTPUT. |
835
`--------------------------------*/
837
#if (defined __STDC__ || defined __C99__FUNC__ \
838
|| defined __cplusplus || defined _MSC_VER)
840
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
843
yy_symbol_print (yyoutput, yytype, yyvaluep)
846
YYSTYPE const * const yyvaluep;
849
if (yytype < YYNTOKENS)
850
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
852
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
854
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
855
YYFPRINTF (yyoutput, ")");
721
858
/*------------------------------------------------------------------.
722
859
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
723
860
| TOP (included). |
724
861
`------------------------------------------------------------------*/
726
#if defined (__STDC__) || defined (__cplusplus)
863
#if (defined __STDC__ || defined __C99__FUNC__ \
864
|| defined __cplusplus || defined _MSC_VER)
728
yy_stack_print (short int *bottom, short int *top)
866
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
731
869
yy_stack_print (bottom, top)
870
yytype_int16 *bottom;
736
874
YYFPRINTF (stderr, "Stack now");
737
for (/* Nothing. */; bottom <= top; ++bottom)
875
for (; bottom <= top; ++bottom)
738
876
YYFPRINTF (stderr, " %d", *bottom);
739
877
YYFPRINTF (stderr, "\n");
906
#endif /* YYERROR_VERBOSE */
911
/*--------------------------------.
912
| Print this symbol on YYOUTPUT. |
913
`--------------------------------*/
915
#if defined (__STDC__) || defined (__cplusplus)
917
yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
920
yysymprint (yyoutput, yytype, yyvaluep)
1054
/* Copy into YYRESULT an error message about the unexpected token
1055
YYCHAR while in state YYSTATE. Return the number of bytes copied,
1056
including the terminating null byte. If YYRESULT is null, do not
1057
copy anything; just return the number of bytes that would be
1058
copied. As a special case, return 0 if an ordinary "syntax error"
1059
message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1060
size calculation. */
1062
yysyntax_error (char *yyresult, int yystate, int yychar)
926
/* Pacify ``unused variable'' warnings. */
1064
int yyn = yypact[yystate];
929
if (yytype < YYNTOKENS)
930
YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1066
if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
932
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
936
if (yytype < YYNTOKENS)
937
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1070
int yytype = YYTRANSLATE (yychar);
1071
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1072
YYSIZE_T yysize = yysize0;
1074
int yysize_overflow = 0;
1075
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1076
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1080
/* This is so xgettext sees the translatable formats that are
1081
constructed on the fly. */
1082
YY_("syntax error, unexpected %s");
1083
YY_("syntax error, unexpected %s, expecting %s");
1084
YY_("syntax error, unexpected %s, expecting %s or %s");
1085
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1086
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1090
static char const yyunexpected[] = "syntax error, unexpected %s";
1091
static char const yyexpecting[] = ", expecting %s";
1092
static char const yyor[] = " or %s";
1093
char yyformat[sizeof yyunexpected
1094
+ sizeof yyexpecting - 1
1095
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1096
* (sizeof yyor - 1))];
1097
char const *yyprefix = yyexpecting;
1099
/* Start YYX at -YYN if negative to avoid negative indexes in
1101
int yyxbegin = yyn < 0 ? -yyn : 0;
1103
/* Stay within bounds of both yycheck and yytname. */
1104
int yychecklim = YYLAST - yyn + 1;
1105
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1108
yyarg[0] = yytname[yytype];
1109
yyfmt = yystpcpy (yyformat, yyunexpected);
1111
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1112
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1114
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1118
yyformat[sizeof yyunexpected - 1] = '\0';
1121
yyarg[yycount++] = yytname[yyx];
1122
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1123
yysize_overflow |= (yysize1 < yysize);
1125
yyfmt = yystpcpy (yyfmt, yyprefix);
1129
yyf = YY_(yyformat);
1130
yysize1 = yysize + yystrlen (yyf);
1131
yysize_overflow |= (yysize1 < yysize);
1134
if (yysize_overflow)
1135
return YYSIZE_MAXIMUM;
1139
/* Avoid sprintf, as that infringes on the user's name space.
1140
Don't have undefined behavior even if the translation
1141
produced a string with the wrong number of "%s"s. */
1142
char *yyp = yyresult;
1144
while ((*yyp = *yyf) != '\0')
1146
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1148
yyp += yytnamerr (yyp, yyarg[yyi++]);
944
YYFPRINTF (yyoutput, ")");
1161
#endif /* YYERROR_VERBOSE */
947
#endif /* ! YYDEBUG */
948
1164
/*-----------------------------------------------.
949
1165
| Release the memory associated to this symbol. |
950
1166
`-----------------------------------------------*/
952
#if defined (__STDC__) || defined (__cplusplus)
1169
#if (defined __STDC__ || defined __C99__FUNC__ \
1170
|| defined __cplusplus || defined _MSC_VER)
954
1172
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1273
#line 169 "./n3_parser.y"
1526
#line 176 "./n3_parser.y"
1277
1530
#if RAPTOR_DEBUG > 1
1278
1531
printf("statement 2\n subject=");
1279
if((yyvsp[-2].identifier))
1280
raptor_identifier_print(stdout, (yyvsp[-2].identifier));
1532
if((yyvsp[(1) - (3)].identifier))
1533
raptor_identifier_print(stdout, (yyvsp[(1) - (3)].identifier));
1282
1535
fputs("NULL", stdout);
1283
if((yyvsp[-1].sequence)) {
1536
if((yyvsp[(2) - (3)].sequence)) {
1284
1537
printf("\n propertyList (reverse order to syntax)=");
1285
raptor_sequence_print((yyvsp[-1].sequence), stdout);
1538
raptor_sequence_print((yyvsp[(2) - (3)].sequence), stdout);
1288
1541
printf("\n and empty propertyList\n");
1291
if((yyvsp[-2].identifier) && (yyvsp[-1].sequence)) {
1544
if((yyvsp[(1) - (3)].identifier) && (yyvsp[(2) - (3)].sequence)) {
1292
1545
/* have subject and non-empty property list, handle it */
1293
for(i=0; i<raptor_sequence_size((yyvsp[-1].sequence)); i++) {
1294
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[-1].sequence), i);
1546
for(i=0; i<raptor_sequence_size((yyvsp[(2) - (3)].sequence)); i++) {
1547
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[(2) - (3)].sequence), i);
1295
1548
raptor_identifier *i2=(raptor_identifier*)RAPTOR_CALLOC(raptor_identifier, 1, sizeof(raptor_identifier));
1296
raptor_copy_identifier(i2, (yyvsp[-2].identifier));
1549
raptor_copy_identifier(i2, (yyvsp[(1) - (3)].identifier));
1297
1550
t2->subject=i2;
1298
1551
t2->subject->is_malloced=1;
1300
1553
#if RAPTOR_DEBUG > 1
1301
1554
printf(" after substitution propertyList=");
1302
raptor_sequence_print((yyvsp[-1].sequence), stdout);
1555
raptor_sequence_print((yyvsp[(2) - (3)].sequence), stdout);
1303
1556
printf("\n\n");
1305
for(i=0; i<raptor_sequence_size((yyvsp[-1].sequence)); i++) {
1306
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[-1].sequence), i);
1558
for(i=0; i<raptor_sequence_size((yyvsp[(2) - (3)].sequence)); i++) {
1559
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[(2) - (3)].sequence), i);
1307
1560
raptor_n3_generate_statement((raptor_parser*)rdf_parser, t2);
1311
if((yyvsp[-1].sequence))
1312
raptor_free_sequence((yyvsp[-1].sequence));
1564
if((yyvsp[(2) - (3)].sequence))
1565
raptor_free_sequence((yyvsp[(2) - (3)].sequence));
1314
if((yyvsp[-2].identifier))
1315
raptor_free_identifier((yyvsp[-2].identifier));
1567
if((yyvsp[(1) - (3)].identifier))
1568
raptor_free_identifier((yyvsp[(1) - (3)].identifier));
1320
#line 217 "./n3_parser.y"
1573
#line 224 "./n3_parser.y"
1322
1575
raptor_triple *triple;
1324
1577
#if RAPTOR_DEBUG > 1
1325
1578
printf("objectList 1\n");
1326
if((yyvsp[0].identifier)) {
1579
if((yyvsp[(3) - (3)].identifier)) {
1327
1580
printf(" object=\n");
1328
raptor_identifier_print(stdout, (yyvsp[0].identifier));
1581
raptor_identifier_print(stdout, (yyvsp[(3) - (3)].identifier));
1331
1584
printf(" and empty object\n");
1332
if((yyvsp[-2].sequence)) {
1585
if((yyvsp[(1) - (3)].sequence)) {
1333
1586
printf(" objectList=");
1334
raptor_sequence_print((yyvsp[-2].sequence), stdout);
1587
raptor_sequence_print((yyvsp[(1) - (3)].sequence), stdout);
1337
1590
printf(" and empty objectList\n");
1340
if(!(yyvsp[0].identifier))
1593
if(!(yyvsp[(3) - (3)].identifier))
1341
1594
(yyval.sequence)=NULL;
1343
triple=raptor_n3_new_triple(NULL, NULL, (yyvsp[0].identifier));
1344
(yyval.sequence)=(yyvsp[-2].sequence);
1596
triple=raptor_n3_new_triple(NULL, NULL, (yyvsp[(3) - (3)].identifier));
1597
(yyval.sequence)=(yyvsp[(1) - (3)].sequence);
1345
1598
raptor_sequence_push((yyval.sequence), triple);
1346
1599
#if RAPTOR_DEBUG > 1
1347
1600
printf(" objectList is now ");
1489
#line 375 "./n3_parser.y"
1742
#line 382 "./n3_parser.y"
1493
1746
#if RAPTOR_DEBUG > 1
1494
1747
printf("propertyList 1\n verb=");
1495
raptor_identifier_print(stdout, (yyvsp[-1].identifier));
1748
raptor_identifier_print(stdout, (yyvsp[(3) - (4)].identifier));
1496
1749
printf("\n objectList=");
1497
raptor_sequence_print((yyvsp[0].sequence), stdout);
1750
raptor_sequence_print((yyvsp[(4) - (4)].sequence), stdout);
1498
1751
printf("\n propertyList=");
1499
raptor_sequence_print((yyvsp[-3].sequence), stdout);
1752
raptor_sequence_print((yyvsp[(1) - (4)].sequence), stdout);
1500
1753
printf("\n\n");
1503
if((yyvsp[0].sequence) == NULL) {
1756
if((yyvsp[(4) - (4)].sequence) == NULL) {
1504
1757
#if RAPTOR_DEBUG > 1
1505
1758
printf(" empty objectList not processed\n");
1507
} else if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) {
1760
} else if((yyvsp[(3) - (4)].identifier) && (yyvsp[(4) - (4)].sequence)) {
1508
1761
/* non-empty property list, handle it */
1509
for(i=0; i<raptor_sequence_size((yyvsp[0].sequence)); i++) {
1510
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[0].sequence), i);
1762
for(i=0; i<raptor_sequence_size((yyvsp[(4) - (4)].sequence)); i++) {
1763
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[(4) - (4)].sequence), i);
1511
1764
raptor_identifier *i2=(raptor_identifier*)RAPTOR_CALLOC(raptor_identifier, 1, sizeof(raptor_identifier));
1512
raptor_copy_identifier(i2, (yyvsp[-1].identifier));
1765
raptor_copy_identifier(i2, (yyvsp[(3) - (4)].identifier));
1513
1766
t2->predicate=i2;
1514
1767
t2->predicate->is_malloced=1;
1517
1770
#if RAPTOR_DEBUG > 1
1518
1771
printf(" after substitution objectList=");
1519
raptor_sequence_print((yyvsp[0].sequence), stdout);
1772
raptor_sequence_print((yyvsp[(4) - (4)].sequence), stdout);
1524
if((yyvsp[-3].sequence) == NULL) {
1777
if((yyvsp[(1) - (4)].sequence) == NULL) {
1525
1778
#if RAPTOR_DEBUG > 1
1526
1779
printf(" empty propertyList not copied\n\n");
1528
} else if ((yyvsp[-1].identifier) && (yyvsp[0].sequence) && (yyvsp[-3].sequence)) {
1529
for(i=0; i<raptor_sequence_size((yyvsp[0].sequence)); i++) {
1530
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[0].sequence), i);
1531
raptor_sequence_push((yyvsp[-3].sequence), t2);
1781
} else if ((yyvsp[(3) - (4)].identifier) && (yyvsp[(4) - (4)].sequence) && (yyvsp[(1) - (4)].sequence)) {
1782
for(i=0; i<raptor_sequence_size((yyvsp[(4) - (4)].sequence)); i++) {
1783
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[(4) - (4)].sequence), i);
1784
raptor_sequence_push((yyvsp[(1) - (4)].sequence), t2);
1533
while(raptor_sequence_size((yyvsp[0].sequence)))
1534
raptor_sequence_pop((yyvsp[0].sequence));
1786
while(raptor_sequence_size((yyvsp[(4) - (4)].sequence)))
1787
raptor_sequence_pop((yyvsp[(4) - (4)].sequence));
1536
1789
#if RAPTOR_DEBUG > 1
1537
1790
printf(" after appending objectList (reverse order)=");
1538
raptor_sequence_print((yyvsp[-3].sequence), stdout);
1791
raptor_sequence_print((yyvsp[(1) - (4)].sequence), stdout);
1539
1792
printf("\n\n");
1542
raptor_free_sequence((yyvsp[0].sequence));
1795
raptor_free_sequence((yyvsp[(4) - (4)].sequence));
1545
if((yyvsp[-1].identifier))
1546
raptor_free_identifier((yyvsp[-1].identifier));
1798
if((yyvsp[(3) - (4)].identifier))
1799
raptor_free_identifier((yyvsp[(3) - (4)].identifier));
1548
(yyval.sequence)=(yyvsp[-3].sequence);
1801
(yyval.sequence)=(yyvsp[(1) - (4)].sequence);
1553
#line 436 "./n3_parser.y"
1806
#line 443 "./n3_parser.y"
1556
1809
#if RAPTOR_DEBUG > 1
1557
1810
printf("propertyList 2\n verb=");
1558
raptor_identifier_print(stdout, (yyvsp[-1].identifier));
1559
if((yyvsp[0].sequence)) {
1811
raptor_identifier_print(stdout, (yyvsp[(1) - (2)].identifier));
1812
if((yyvsp[(2) - (2)].sequence)) {
1560
1813
printf("\n objectList=");
1561
raptor_sequence_print((yyvsp[0].sequence), stdout);
1814
raptor_sequence_print((yyvsp[(2) - (2)].sequence), stdout);
1564
1817
printf("\n and empty objectList\n");
1567
if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) {
1568
for(i=0; i<raptor_sequence_size((yyvsp[0].sequence)); i++) {
1569
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[0].sequence), i);
1820
if((yyvsp[(1) - (2)].identifier) && (yyvsp[(2) - (2)].sequence)) {
1821
for(i=0; i<raptor_sequence_size((yyvsp[(2) - (2)].sequence)); i++) {
1822
raptor_triple* t2=(raptor_triple*)raptor_sequence_get_at((yyvsp[(2) - (2)].sequence), i);
1570
1823
raptor_identifier *i2=(raptor_identifier*)RAPTOR_CALLOC(raptor_identifier, 1, sizeof(raptor_identifier));
1571
raptor_copy_identifier(i2, (yyvsp[-1].identifier));
1824
raptor_copy_identifier(i2, (yyvsp[(1) - (2)].identifier));
1572
1825
t2->predicate=i2;
1573
1826
t2->predicate->is_malloced=1;
1576
1829
#if RAPTOR_DEBUG > 1
1577
1830
printf(" after substitution objectList=");
1578
raptor_sequence_print((yyvsp[0].sequence), stdout);
1831
raptor_sequence_print((yyvsp[(2) - (2)].sequence), stdout);
1579
1832
printf("\n\n");
1583
if((yyvsp[-1].identifier))
1584
raptor_free_identifier((yyvsp[-1].identifier));
1836
if((yyvsp[(1) - (2)].identifier))
1837
raptor_free_identifier((yyvsp[(1) - (2)].identifier));
1586
(yyval.sequence)=(yyvsp[0].sequence);
1839
(yyval.sequence)=(yyvsp[(2) - (2)].sequence);
1591
#line 471 "./n3_parser.y"
1844
#line 478 "./n3_parser.y"
1593
1846
#if RAPTOR_DEBUG > 1
1594
1847
printf("propertyList 4\n empty returning NULL\n\n");
1634
ns=raptor_new_namespace_from_uri(&n3_parser->namespaces, prefix, (yyvsp[-1].uri), 0);
1891
ns=raptor_new_namespace_from_uri(&n3_parser->namespaces, prefix, (yyvsp[(3) - (4)].uri), 0);
1636
1893
raptor_namespaces_start_namespace(&n3_parser->namespaces, ns);
1637
1894
raptor_parser_start_namespace((raptor_parser*)rdf_parser, ns);
1640
if((yyvsp[-2].string))
1641
RAPTOR_FREE(cstring, (yyvsp[-2].string));
1642
raptor_free_uri((yyvsp[-1].uri));
1897
if((yyvsp[(2) - (4)].string))
1898
RAPTOR_FREE(cstring, (yyvsp[(2) - (4)].string));
1899
raptor_free_uri((yyvsp[(3) - (4)].uri));
1647
#line 523 "./n3_parser.y"
1904
#line 534 "./n3_parser.y"
1649
(yyval.identifier)=(yyvsp[0].identifier);
1906
(yyval.identifier)=(yyvsp[(1) - (1)].identifier);
1654
#line 527 "./n3_parser.y"
1911
#line 538 "./n3_parser.y"
1656
(yyval.identifier)=(yyvsp[0].identifier);
1913
(yyval.identifier)=(yyvsp[(1) - (1)].identifier);
1661
#line 534 "./n3_parser.y"
1918
#line 545 "./n3_parser.y"
1663
(yyval.identifier)=(yyvsp[0].identifier);
1920
(yyval.identifier)=(yyvsp[(1) - (1)].identifier);
1668
#line 541 "./n3_parser.y"
1925
#line 552 "./n3_parser.y"
1670
(yyval.identifier)=(yyvsp[0].identifier);
1927
(yyval.identifier)=(yyvsp[(1) - (1)].identifier);
1675
#line 545 "./n3_parser.y"
1932
#line 556 "./n3_parser.y"
1677
(yyval.identifier)=(yyvsp[0].identifier);
1934
(yyval.identifier)=(yyvsp[(1) - (1)].identifier);
1682
#line 549 "./n3_parser.y"
1939
#line 560 "./n3_parser.y"
1684
1941
#if RAPTOR_DEBUG > 1
1685
1942
printf("object literal=");
1686
raptor_identifier_print(stdout, (yyvsp[0].identifier));
1943
raptor_identifier_print(stdout, (yyvsp[(1) - (1)].identifier));
1690
(yyval.identifier)=(yyvsp[0].identifier);
1947
(yyval.identifier)=(yyvsp[(1) - (1)].identifier);
1695
#line 562 "./n3_parser.y"
1952
#line 573 "./n3_parser.y"
1697
1954
#if RAPTOR_DEBUG > 1
1698
printf("literal + language string=\"%s\"\n", (yyvsp[-2].string));
1955
printf("literal + language string=\"%s\"\n", (yyvsp[(1) - (3)].string));
1701
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[-2].string), NULL, (yyvsp[0].string));
1958
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[(1) - (3)].string), NULL, (yyvsp[(3) - (3)].string));
1706
#line 570 "./n3_parser.y"
1963
#line 581 "./n3_parser.y"
1708
1965
#if RAPTOR_DEBUG > 1
1709
printf("literal + language=\"%s\" datatype string=\"%s\" uri=\"%s\"\n", (yyvsp[-4].string), (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri)));
1966
printf("literal + language=\"%s\" datatype string=\"%s\" uri=\"%s\"\n", (yyvsp[(1) - (5)].string), (yyvsp[(3) - (5)].string), raptor_uri_as_string((yyvsp[(5) - (5)].uri)));
1713
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[-4].string), (yyvsp[0].uri), (yyvsp[-2].string));
1969
if((yyvsp[(5) - (5)].uri))
1970
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[(1) - (5)].string), (yyvsp[(5) - (5)].uri), (yyvsp[(3) - (5)].string));
1715
1972
(yyval.identifier)=NULL;
1751
#line 606 "./n3_parser.y"
2008
#line 617 "./n3_parser.y"
1753
2010
#if RAPTOR_DEBUG > 1
1754
printf("literal + datatype string=\"%s\" qname URI=<%s>\n", (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri)));
2011
printf("literal + datatype string=\"%s\" qname URI=<%s>\n", (yyvsp[(1) - (3)].string), raptor_uri_as_string((yyvsp[(3) - (3)].uri)));
1757
if((yyvsp[0].uri)) {
1758
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[-2].string), (yyvsp[0].uri), NULL);
2014
if((yyvsp[(3) - (3)].uri)) {
2015
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[(1) - (3)].string), (yyvsp[(3) - (3)].uri), NULL);
1760
2017
(yyval.identifier)=NULL;
1765
#line 617 "./n3_parser.y"
2022
#line 628 "./n3_parser.y"
1767
2024
#if RAPTOR_DEBUG > 1
1768
printf("literal string=\"%s\"\n", (yyvsp[0].string));
2025
printf("literal string=\"%s\"\n", (yyvsp[(1) - (1)].string));
1771
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[0].string), NULL, NULL);
2028
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[(1) - (1)].string), NULL, NULL);
1776
#line 625 "./n3_parser.y"
2033
#line 636 "./n3_parser.y"
1778
2035
unsigned char *string;
1779
2036
raptor_uri *uri;
1780
2037
#if RAPTOR_DEBUG > 1
1781
printf("resource integer=%d\n", (yyvsp[0].integer));
2038
printf("resource integer=%d\n", (yyvsp[(1) - (1)].integer));
1783
2040
string=(unsigned char*)RAPTOR_MALLOC(cstring, 32); /* FIXME */
1784
sprintf((char*)string, "%d", (yyvsp[0].integer));
2041
sprintf((char*)string, "%d", (yyvsp[(1) - (1)].integer));
1785
2042
uri=raptor_new_uri((const unsigned char*)"http://www.w3.org/2001/XMLSchema#integer");
1786
2043
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, string, uri, NULL);
1791
#line 637 "./n3_parser.y"
2048
#line 648 "./n3_parser.y"
1793
2050
#if RAPTOR_DEBUG > 1
1794
printf("resource double=%1g\n", (yyvsp[0].floating));
2051
printf("resource double=%1g\n", (yyvsp[(1) - (1)].floating));
1796
(yyval.identifier)=raptor_new_identifier_from_double((yyvsp[0].floating));
2053
(yyval.identifier)=raptor_new_identifier_from_double((yyvsp[(1) - (1)].floating));
1801
#line 644 "./n3_parser.y"
2058
#line 655 "./n3_parser.y"
1803
2060
raptor_uri *uri;
1804
2061
#if RAPTOR_DEBUG > 1
1805
printf("resource decimal=%s\n", (yyvsp[0].string));
2062
printf("resource decimal=%s\n", (yyvsp[(1) - (1)].string));
1807
2064
uri=raptor_new_uri((const unsigned char*)"http://www.w3.org/2001/XMLSchema#decimal");
1808
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[0].string), uri, NULL);
2065
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_LITERAL, NULL, RAPTOR_URI_SOURCE_ELEMENT, NULL, (yyvsp[(1) - (1)].string), uri, NULL);
1813
#line 656 "./n3_parser.y"
2070
#line 667 "./n3_parser.y"
1815
2072
#if RAPTOR_DEBUG > 1
1816
printf("resource URI=<%s>\n", raptor_uri_as_string((yyvsp[0].uri)));
2073
printf("resource URI=<%s>\n", raptor_uri_as_string((yyvsp[(1) - (1)].uri)));
1820
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_RESOURCE, (yyvsp[0].uri), RAPTOR_URI_SOURCE_URI, NULL, NULL, NULL, NULL);
2076
if((yyvsp[(1) - (1)].uri))
2077
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_RESOURCE, (yyvsp[(1) - (1)].uri), RAPTOR_URI_SOURCE_URI, NULL, NULL, NULL, NULL);
1822
2079
(yyval.identifier)=NULL;
1827
#line 667 "./n3_parser.y"
2084
#line 678 "./n3_parser.y"
1829
2086
#if RAPTOR_DEBUG > 1
1830
printf("resource qname URI=<%s>\n", raptor_uri_as_string((yyvsp[0].uri)));
2087
printf("resource qname URI=<%s>\n", raptor_uri_as_string((yyvsp[(1) - (1)].uri)));
1834
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_RESOURCE, (yyvsp[0].uri), RAPTOR_URI_SOURCE_ELEMENT, NULL, NULL, NULL, NULL);
2090
if((yyvsp[(1) - (1)].uri))
2091
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_RESOURCE, (yyvsp[(1) - (1)].uri), RAPTOR_URI_SOURCE_ELEMENT, NULL, NULL, NULL, NULL);
1836
2093
(yyval.identifier)=NULL;
1841
#line 682 "./n3_parser.y"
2098
#line 693 "./n3_parser.y"
1843
2100
const unsigned char *id;
1844
2101
#if RAPTOR_DEBUG > 1
1845
printf("subject blank=\"%s\"\n", (yyvsp[0].string));
2102
printf("subject blank=\"%s\"\n", (yyvsp[(1) - (1)].string));
1847
id=raptor_generate_id((raptor_parser*)rdf_parser, 0, (yyvsp[0].string));
2104
id=raptor_generate_id((raptor_parser*)rdf_parser, 0, (yyvsp[(1) - (1)].string));
1849
2106
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_ANONYMOUS, NULL, RAPTOR_URI_SOURCE_BLANK_ID, id, NULL, NULL, NULL);
1854
#line 692 "./n3_parser.y"
2111
#line 703 "./n3_parser.y"
1857
2114
const unsigned char *id=raptor_generate_id((raptor_parser*)rdf_parser, 0, NULL);
1859
2116
(yyval.identifier)=raptor_new_identifier(RAPTOR_IDENTIFIER_TYPE_ANONYMOUS, NULL, RAPTOR_URI_SOURCE_GENERATED, id, NULL, NULL, NULL);
1861
if((yyvsp[-1].sequence) == NULL) {
2118
if((yyvsp[(2) - (3)].sequence) == NULL) {
1862
2119
#if RAPTOR_DEBUG > 1
1863
2120
printf("resource\n propertyList=");
1864
2121
raptor_identifier_print(stdout, (yyval.identifier));
2022
2277
if (!yyerrstatus)
2026
yyn = yypact[yystate];
2028
if (YYPACT_NINF < yyn && yyn < YYLAST)
2030
int yytype = YYTRANSLATE (yychar);
2031
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
2032
YYSIZE_T yysize = yysize0;
2034
int yysize_overflow = 0;
2036
# define YYERROR_VERBOSE_ARGS_MAXIMUM 5
2037
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2041
/* This is so xgettext sees the translatable formats that are
2042
constructed on the fly. */
2043
YY_("syntax error, unexpected %s");
2044
YY_("syntax error, unexpected %s, expecting %s");
2045
YY_("syntax error, unexpected %s, expecting %s or %s");
2046
YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2047
YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2051
static char const yyunexpected[] = "syntax error, unexpected %s";
2052
static char const yyexpecting[] = ", expecting %s";
2053
static char const yyor[] = " or %s";
2054
char yyformat[sizeof yyunexpected
2055
+ sizeof yyexpecting - 1
2056
+ ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2057
* (sizeof yyor - 1))];
2058
char const *yyprefix = yyexpecting;
2060
/* Start YYX at -YYN if negative to avoid negative indexes in
2062
int yyxbegin = yyn < 0 ? -yyn : 0;
2064
/* Stay within bounds of both yycheck and yytname. */
2065
int yychecklim = YYLAST - yyn;
2066
int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2069
yyarg[0] = yytname[yytype];
2070
yyfmt = yystpcpy (yyformat, yyunexpected);
2072
for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2073
if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2075
if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2079
yyformat[sizeof yyunexpected - 1] = '\0';
2082
yyarg[yycount++] = yytname[yyx];
2083
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2084
yysize_overflow |= yysize1 < yysize;
2086
yyfmt = yystpcpy (yyfmt, yyprefix);
2090
yyf = YY_(yyformat);
2091
yysize1 = yysize + yystrlen (yyf);
2092
yysize_overflow |= yysize1 < yysize;
2095
if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
2096
yymsg = (char *) YYSTACK_ALLOC (yysize);
2099
/* Avoid sprintf, as that infringes on the user's name space.
2100
Don't have undefined behavior even if the translation
2101
produced a string with the wrong number of "%s"s. */
2104
while ((*yyp = *yyf))
2106
if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2108
yyp += yytnamerr (yyp, yyarg[yyi++]);
2280
#if ! YYERROR_VERBOSE
2281
yyerror (YY_("syntax error"));
2284
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
2285
if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
2287
YYSIZE_T yyalloc = 2 * yysize;
2288
if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
2289
yyalloc = YYSTACK_ALLOC_MAXIMUM;
2290
if (yymsg != yymsgbuf)
2118
2291
YYSTACK_FREE (yymsg);
2122
yyerror (YY_("syntax error"));
2292
yymsg = (char *) YYSTACK_ALLOC (yyalloc);
2294
yymsg_alloc = yyalloc;
2298
yymsg_alloc = sizeof yymsgbuf;
2302
if (0 < yysize && yysize <= yymsg_alloc)
2304
(void) yysyntax_error (yymsg, yystate, yychar);
2309
yyerror (YY_("syntax error"));
2123
2311
goto yyexhaustedlab;
2127
#endif /* YYERROR_VERBOSE */
2128
yyerror (YY_("syntax error"));