/src/igraph/build/src/io/parsers/dl-parser.c
Line | Count | Source |
1 | | /* A Bison parser, made by GNU Bison 3.5.1. */ |
2 | | |
3 | | /* Bison implementation for Yacc-like parsers in C |
4 | | |
5 | | Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, |
6 | | Inc. |
7 | | |
8 | | This program is free software: you can redistribute it and/or modify |
9 | | it under the terms of the GNU General Public License as published by |
10 | | the Free Software Foundation, either version 3 of the License, or |
11 | | (at your option) any later version. |
12 | | |
13 | | This program is distributed in the hope that it will be useful, |
14 | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | | GNU General Public License for more details. |
17 | | |
18 | | You should have received a copy of the GNU General Public License |
19 | | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
20 | | |
21 | | /* As a special exception, you may create a larger work that contains |
22 | | part or all of the Bison parser skeleton and distribute that work |
23 | | under terms of your choice, so long as that work isn't itself a |
24 | | parser generator using the skeleton or a modified version thereof |
25 | | as a parser skeleton. Alternatively, if you modify or redistribute |
26 | | the parser skeleton itself, you may (at your option) remove this |
27 | | special exception, which will cause the skeleton and the resulting |
28 | | Bison output files to be licensed under the GNU General Public |
29 | | License without this special exception. |
30 | | |
31 | | This special exception was added by the Free Software Foundation in |
32 | | version 2.2 of Bison. */ |
33 | | |
34 | | /* C LALR(1) parser skeleton written by Richard Stallman, by |
35 | | simplifying the original so-called "semantic" parser. */ |
36 | | |
37 | | /* All symbols defined below should begin with yy or YY, to avoid |
38 | | infringing on user name space. This should be done even for local |
39 | | variables, as they might otherwise be expanded by user macros. |
40 | | There are some unavoidable exceptions within include files to |
41 | | define necessary library symbols; they are noted "INFRINGES ON |
42 | | USER NAME SPACE" below. */ |
43 | | |
44 | | /* Undocumented macros, especially those whose name start with YY_, |
45 | | are private implementation details. Do not rely on them. */ |
46 | | |
47 | | /* Identify Bison output. */ |
48 | | #define YYBISON 1 |
49 | | |
50 | | /* Bison version. */ |
51 | | #define YYBISON_VERSION "3.5.1" |
52 | | |
53 | | /* Skeleton name. */ |
54 | | #define YYSKELETON_NAME "yacc.c" |
55 | | |
56 | | /* Pure parsers. */ |
57 | | #define YYPURE 1 |
58 | | |
59 | | /* Push parsers. */ |
60 | | #define YYPUSH 0 |
61 | | |
62 | | /* Pull parsers. */ |
63 | | #define YYPULL 1 |
64 | | |
65 | | |
66 | | /* Substitute the variable and function names. */ |
67 | | #define yyparse igraph_dl_yyparse |
68 | 10.6M | #define yylex igraph_dl_yylex |
69 | 1.48k | #define yyerror igraph_dl_yyerror |
70 | | #define yydebug igraph_dl_yydebug |
71 | 3.22k | #define yynerrs igraph_dl_yynerrs |
72 | | |
73 | | /* First part of user prologue. */ |
74 | | #line 23 "/src/igraph/src/io/dl-parser.y" |
75 | | |
76 | | |
77 | | /* |
78 | | igraph library. |
79 | | Copyright (C) 2009-2012 Gabor Csardi <csardi.gabor@gmail.com> |
80 | | 334 Harvard st, Cambridge, MA, 02138 USA |
81 | | |
82 | | This program is free software; you can redistribute it and/or modify |
83 | | it under the terms of the GNU General Public License as published by |
84 | | the Free Software Foundation; either version 2 of the License, or |
85 | | (at your option) any later version. |
86 | | |
87 | | This program is distributed in the hope that it will be useful, |
88 | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
89 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
90 | | GNU General Public License for more details. |
91 | | |
92 | | You should have received a copy of the GNU General Public License |
93 | | along with this program; if not, write to the Free Software |
94 | | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
95 | | 02110-1301 USA |
96 | | |
97 | | */ |
98 | | |
99 | | #include "internal/hacks.h" |
100 | | #include "io/dl-header.h" |
101 | | #include "io/parsers/dl-parser.h" |
102 | | #include "io/parsers/dl-lexer.h" |
103 | | #include "io/parse_utils.h" |
104 | | |
105 | | int igraph_dl_yyerror(YYLTYPE* locp, igraph_i_dl_parsedata_t* context, |
106 | | const char *s); |
107 | | static igraph_error_t igraph_i_dl_add_str(char *newstr, yy_size_t length, |
108 | | igraph_i_dl_parsedata_t *context); |
109 | | static igraph_error_t igraph_i_dl_add_edge(igraph_int_t from, igraph_int_t to, |
110 | | igraph_i_dl_parsedata_t *context); |
111 | | static igraph_error_t igraph_i_dl_add_edge_w(igraph_int_t from, igraph_int_t to, |
112 | | igraph_real_t weight, |
113 | | igraph_i_dl_parsedata_t *context); |
114 | | static igraph_error_t igraph_i_dl_check_vid(igraph_int_t dl_vid); |
115 | | |
116 | 10.7M | #define scanner context->scanner |
117 | | |
118 | | |
119 | | #line 120 "/src/igraph/build/src/io/parsers/dl-parser.c" |
120 | | |
121 | | # ifndef YY_CAST |
122 | | # ifdef __cplusplus |
123 | | # define YY_CAST(Type, Val) static_cast<Type> (Val) |
124 | | # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) |
125 | | # else |
126 | 27.0M | # define YY_CAST(Type, Val) ((Type) (Val)) |
127 | | # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) |
128 | | # endif |
129 | | # endif |
130 | | # ifndef YY_NULLPTR |
131 | | # if defined __cplusplus |
132 | | # if 201103L <= __cplusplus |
133 | | # define YY_NULLPTR nullptr |
134 | | # else |
135 | | # define YY_NULLPTR 0 |
136 | | # endif |
137 | | # else |
138 | 3.04k | # define YY_NULLPTR ((void*)0) |
139 | | # endif |
140 | | # endif |
141 | | |
142 | | /* Enabling verbose error messages. */ |
143 | | #ifdef YYERROR_VERBOSE |
144 | | # undef YYERROR_VERBOSE |
145 | | # define YYERROR_VERBOSE 1 |
146 | | #else |
147 | | # define YYERROR_VERBOSE 1 |
148 | | #endif |
149 | | |
150 | | /* Use api.header.include to #include this header |
151 | | instead of duplicating it here. */ |
152 | | #ifndef YY_IGRAPH_DL_YY_SRC_IGRAPH_BUILD_SRC_IO_PARSERS_DL_PARSER_H_INCLUDED |
153 | | # define YY_IGRAPH_DL_YY_SRC_IGRAPH_BUILD_SRC_IO_PARSERS_DL_PARSER_H_INCLUDED |
154 | | /* Debug traces. */ |
155 | | #ifndef YYDEBUG |
156 | | # define YYDEBUG 0 |
157 | | #endif |
158 | | #if YYDEBUG |
159 | | extern int igraph_dl_yydebug; |
160 | | #endif |
161 | | |
162 | | /* Token type. */ |
163 | | #ifndef YYTOKENTYPE |
164 | | # define YYTOKENTYPE |
165 | | enum yytokentype |
166 | | { |
167 | | END = 0, |
168 | | NUM = 258, |
169 | | NEWLINE = 259, |
170 | | DL = 260, |
171 | | NEQ = 261, |
172 | | DATA = 262, |
173 | | LABELS = 263, |
174 | | LABELSEMBEDDED = 264, |
175 | | FORMATFULLMATRIX = 265, |
176 | | FORMATEDGELIST1 = 266, |
177 | | FORMATNODELIST1 = 267, |
178 | | DIGIT = 268, |
179 | | LABEL = 269, |
180 | | EOFF = 270, |
181 | | ERROR = 271 |
182 | | }; |
183 | | #endif |
184 | | |
185 | | /* Value type. */ |
186 | | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
187 | | union YYSTYPE |
188 | | { |
189 | | #line 78 "/src/igraph/src/io/dl-parser.y" |
190 | | |
191 | | igraph_int_t integer; |
192 | | igraph_real_t real; |
193 | | |
194 | | #line 195 "/src/igraph/build/src/io/parsers/dl-parser.c" |
195 | | |
196 | | }; |
197 | | typedef union YYSTYPE YYSTYPE; |
198 | | # define YYSTYPE_IS_TRIVIAL 1 |
199 | | # define YYSTYPE_IS_DECLARED 1 |
200 | | #endif |
201 | | |
202 | | /* Location type. */ |
203 | | #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED |
204 | | typedef struct YYLTYPE YYLTYPE; |
205 | | struct YYLTYPE |
206 | | { |
207 | | int first_line; |
208 | | int first_column; |
209 | | int last_line; |
210 | | int last_column; |
211 | | }; |
212 | | # define YYLTYPE_IS_DECLARED 1 |
213 | | # define YYLTYPE_IS_TRIVIAL 1 |
214 | | #endif |
215 | | |
216 | | |
217 | | |
218 | | int igraph_dl_yyparse (igraph_i_dl_parsedata_t* context); |
219 | | |
220 | | #endif /* !YY_IGRAPH_DL_YY_SRC_IGRAPH_BUILD_SRC_IO_PARSERS_DL_PARSER_H_INCLUDED */ |
221 | | |
222 | | |
223 | | |
224 | | #ifdef short |
225 | | # undef short |
226 | | #endif |
227 | | |
228 | | /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure |
229 | | <limits.h> and (if available) <stdint.h> are included |
230 | | so that the code can choose integer types of a good width. */ |
231 | | |
232 | | #ifndef __PTRDIFF_MAX__ |
233 | | # include <limits.h> /* INFRINGES ON USER NAME SPACE */ |
234 | | # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ |
235 | | # include <stdint.h> /* INFRINGES ON USER NAME SPACE */ |
236 | | # define YY_STDINT_H |
237 | | # endif |
238 | | #endif |
239 | | |
240 | | /* Narrow types that promote to a signed type and that can represent a |
241 | | signed or unsigned integer of at least N bits. In tables they can |
242 | | save space and decrease cache pressure. Promoting to a signed type |
243 | | helps avoid bugs in integer arithmetic. */ |
244 | | |
245 | | #ifdef __INT_LEAST8_MAX__ |
246 | | typedef __INT_LEAST8_TYPE__ yytype_int8; |
247 | | #elif defined YY_STDINT_H |
248 | | typedef int_least8_t yytype_int8; |
249 | | #else |
250 | | typedef signed char yytype_int8; |
251 | | #endif |
252 | | |
253 | | #ifdef __INT_LEAST16_MAX__ |
254 | | typedef __INT_LEAST16_TYPE__ yytype_int16; |
255 | | #elif defined YY_STDINT_H |
256 | | typedef int_least16_t yytype_int16; |
257 | | #else |
258 | | typedef short yytype_int16; |
259 | | #endif |
260 | | |
261 | | #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ |
262 | | typedef __UINT_LEAST8_TYPE__ yytype_uint8; |
263 | | #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ |
264 | | && UINT_LEAST8_MAX <= INT_MAX) |
265 | | typedef uint_least8_t yytype_uint8; |
266 | | #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX |
267 | | typedef unsigned char yytype_uint8; |
268 | | #else |
269 | | typedef short yytype_uint8; |
270 | | #endif |
271 | | |
272 | | #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ |
273 | | typedef __UINT_LEAST16_TYPE__ yytype_uint16; |
274 | | #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ |
275 | | && UINT_LEAST16_MAX <= INT_MAX) |
276 | | typedef uint_least16_t yytype_uint16; |
277 | | #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX |
278 | | typedef unsigned short yytype_uint16; |
279 | | #else |
280 | | typedef int yytype_uint16; |
281 | | #endif |
282 | | |
283 | | #ifndef YYPTRDIFF_T |
284 | | # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ |
285 | 11.7k | # define YYPTRDIFF_T __PTRDIFF_TYPE__ |
286 | | # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ |
287 | | # elif defined PTRDIFF_MAX |
288 | | # ifndef ptrdiff_t |
289 | | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
290 | | # endif |
291 | | # define YYPTRDIFF_T ptrdiff_t |
292 | | # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX |
293 | | # else |
294 | | # define YYPTRDIFF_T long |
295 | | # define YYPTRDIFF_MAXIMUM LONG_MAX |
296 | | # endif |
297 | | #endif |
298 | | |
299 | | #ifndef YYSIZE_T |
300 | | # ifdef __SIZE_TYPE__ |
301 | | # define YYSIZE_T __SIZE_TYPE__ |
302 | | # elif defined size_t |
303 | | # define YYSIZE_T size_t |
304 | | # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ |
305 | | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
306 | | # define YYSIZE_T size_t |
307 | | # else |
308 | | # define YYSIZE_T unsigned |
309 | | # endif |
310 | | #endif |
311 | | |
312 | | #define YYSIZE_MAXIMUM \ |
313 | 2.19k | YY_CAST (YYPTRDIFF_T, \ |
314 | | (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ |
315 | | ? YYPTRDIFF_MAXIMUM \ |
316 | | : YY_CAST (YYSIZE_T, -1))) |
317 | | |
318 | 0 | #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) |
319 | | |
320 | | /* Stored state numbers (used for stacks). */ |
321 | | typedef yytype_uint8 yy_state_t; |
322 | | |
323 | | /* State numbers in computations. */ |
324 | | typedef int yy_state_fast_t; |
325 | | |
326 | | #ifndef YY_ |
327 | | # if defined YYENABLE_NLS && YYENABLE_NLS |
328 | | # if ENABLE_NLS |
329 | | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
330 | | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
331 | | # endif |
332 | | # endif |
333 | | # ifndef YY_ |
334 | 844 | # define YY_(Msgid) Msgid |
335 | | # endif |
336 | | #endif |
337 | | |
338 | | #ifndef YY_ATTRIBUTE_PURE |
339 | | # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) |
340 | | # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) |
341 | | # else |
342 | | # define YY_ATTRIBUTE_PURE |
343 | | # endif |
344 | | #endif |
345 | | |
346 | | #ifndef YY_ATTRIBUTE_UNUSED |
347 | | # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) |
348 | | # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) |
349 | | # else |
350 | | # define YY_ATTRIBUTE_UNUSED |
351 | | # endif |
352 | | #endif |
353 | | |
354 | | /* Suppress unused-variable warnings by "using" E. */ |
355 | | #if ! defined lint || defined __GNUC__ |
356 | 61.8k | # define YYUSE(E) ((void) (E)) |
357 | | #else |
358 | | # define YYUSE(E) /* empty */ |
359 | | #endif |
360 | | |
361 | | #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ |
362 | | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
363 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
364 | | _Pragma ("GCC diagnostic push") \ |
365 | | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ |
366 | | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
367 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ |
368 | | _Pragma ("GCC diagnostic pop") |
369 | | #else |
370 | 4.76k | # define YY_INITIAL_VALUE(Value) Value |
371 | | #endif |
372 | | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
373 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
374 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END |
375 | | #endif |
376 | | #ifndef YY_INITIAL_VALUE |
377 | | # define YY_INITIAL_VALUE(Value) /* Nothing. */ |
378 | | #endif |
379 | | |
380 | | #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ |
381 | | # define YY_IGNORE_USELESS_CAST_BEGIN \ |
382 | | _Pragma ("GCC diagnostic push") \ |
383 | | _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") |
384 | | # define YY_IGNORE_USELESS_CAST_END \ |
385 | | _Pragma ("GCC diagnostic pop") |
386 | | #endif |
387 | | #ifndef YY_IGNORE_USELESS_CAST_BEGIN |
388 | | # define YY_IGNORE_USELESS_CAST_BEGIN |
389 | | # define YY_IGNORE_USELESS_CAST_END |
390 | | #endif |
391 | | |
392 | | |
393 | 27.0M | #define YY_ASSERT(E) ((void) (0 && (E))) |
394 | | |
395 | | #if ! defined yyoverflow || YYERROR_VERBOSE |
396 | | |
397 | | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
398 | | |
399 | | # ifdef YYSTACK_USE_ALLOCA |
400 | | # if YYSTACK_USE_ALLOCA |
401 | | # ifdef __GNUC__ |
402 | | # define YYSTACK_ALLOC __builtin_alloca |
403 | | # elif defined __BUILTIN_VA_ARG_INCR |
404 | | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
405 | | # elif defined _AIX |
406 | | # define YYSTACK_ALLOC __alloca |
407 | | # elif defined _MSC_VER |
408 | | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
409 | | # define alloca _alloca |
410 | | # else |
411 | | # define YYSTACK_ALLOC alloca |
412 | | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS |
413 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
414 | | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
415 | | # ifndef EXIT_SUCCESS |
416 | | # define EXIT_SUCCESS 0 |
417 | | # endif |
418 | | # endif |
419 | | # endif |
420 | | # endif |
421 | | # endif |
422 | | |
423 | | # ifdef YYSTACK_ALLOC |
424 | | /* Pacify GCC's 'empty if-body' warning. */ |
425 | | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
426 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
427 | | /* The OS might guarantee only one guard page at the bottom of the stack, |
428 | | and a page size can be as small as 4096 bytes. So we cannot safely |
429 | | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
430 | | to allow for a few compiler-allocated temporary stack slots. */ |
431 | | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
432 | | # endif |
433 | | # else |
434 | | # define YYSTACK_ALLOC YYMALLOC |
435 | 0 | # define YYSTACK_FREE YYFREE |
436 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
437 | 2.19k | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
438 | | # endif |
439 | | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
440 | | && ! ((defined YYMALLOC || defined malloc) \ |
441 | | && (defined YYFREE || defined free))) |
442 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
443 | | # ifndef EXIT_SUCCESS |
444 | | # define EXIT_SUCCESS 0 |
445 | | # endif |
446 | | # endif |
447 | | # ifndef YYMALLOC |
448 | | # define YYMALLOC malloc |
449 | | # if ! defined malloc && ! defined EXIT_SUCCESS |
450 | | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
451 | | # endif |
452 | | # endif |
453 | | # ifndef YYFREE |
454 | 0 | # define YYFREE free |
455 | | # if ! defined free && ! defined EXIT_SUCCESS |
456 | | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
457 | | # endif |
458 | | # endif |
459 | | # endif |
460 | | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
461 | | |
462 | | |
463 | | #if (! defined yyoverflow \ |
464 | | && (! defined __cplusplus \ |
465 | | || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ |
466 | | && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
467 | | |
468 | | /* A type that is properly aligned for any stack member. */ |
469 | | union yyalloc |
470 | | { |
471 | | yy_state_t yyss_alloc; |
472 | | YYSTYPE yyvs_alloc; |
473 | | YYLTYPE yyls_alloc; |
474 | | }; |
475 | | |
476 | | /* The size of the maximum gap between one aligned stack and the next. */ |
477 | 0 | # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) |
478 | | |
479 | | /* The size of an array large to enough to hold all stacks, each with |
480 | | N elements. */ |
481 | | # define YYSTACK_BYTES(N) \ |
482 | | ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \ |
483 | | + YYSIZEOF (YYLTYPE)) \ |
484 | | + 2 * YYSTACK_GAP_MAXIMUM) |
485 | | |
486 | | # define YYCOPY_NEEDED 1 |
487 | | |
488 | | /* Relocate STACK from its old location to the new one. The |
489 | | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
490 | | elements in the stack, and YYPTR gives the new location of the |
491 | | stack. Advance YYPTR to a properly aligned location for the next |
492 | | stack. */ |
493 | | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
494 | 0 | do \ |
495 | 0 | { \ |
496 | 0 | YYPTRDIFF_T yynewbytes; \ |
497 | 0 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
498 | 0 | Stack = &yyptr->Stack_alloc; \ |
499 | 0 | yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
500 | 0 | yyptr += yynewbytes / YYSIZEOF (*yyptr); \ |
501 | 0 | } \ |
502 | 0 | while (0) |
503 | | |
504 | | #endif |
505 | | |
506 | | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
507 | | /* Copy COUNT objects from SRC to DST. The source and destination do |
508 | | not overlap. */ |
509 | | # ifndef YYCOPY |
510 | | # if defined __GNUC__ && 1 < __GNUC__ |
511 | | # define YYCOPY(Dst, Src, Count) \ |
512 | 0 | __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) |
513 | | # else |
514 | | # define YYCOPY(Dst, Src, Count) \ |
515 | | do \ |
516 | | { \ |
517 | | YYPTRDIFF_T yyi; \ |
518 | | for (yyi = 0; yyi < (Count); yyi++) \ |
519 | | (Dst)[yyi] = (Src)[yyi]; \ |
520 | | } \ |
521 | | while (0) |
522 | | # endif |
523 | | # endif |
524 | | #endif /* !YYCOPY_NEEDED */ |
525 | | |
526 | | /* YYFINAL -- State number of the termination state. */ |
527 | 27.0M | #define YYFINAL 4 |
528 | | /* YYLAST -- Last index in YYTABLE. */ |
529 | 40.0M | #define YYLAST 118 |
530 | | |
531 | | /* YYNTOKENS -- Number of terminals. */ |
532 | 16.3M | #define YYNTOKENS 17 |
533 | | /* YYNNTS -- Number of nonterminals. */ |
534 | | #define YYNNTS 37 |
535 | | /* YYNRULES -- Number of rules. */ |
536 | | #define YYNRULES 66 |
537 | | /* YYNSTATES -- Number of states. */ |
538 | | #define YYNSTATES 138 |
539 | | |
540 | 0 | #define YYUNDEFTOK 2 |
541 | 12.2M | #define YYMAXUTOK 271 |
542 | | |
543 | | |
544 | | /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM |
545 | | as returned by yylex, with out-of-bounds checking. */ |
546 | | #define YYTRANSLATE(YYX) \ |
547 | 12.2M | (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
548 | | |
549 | | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
550 | | as returned by yylex. */ |
551 | | static const yytype_int8 yytranslate[] = |
552 | | { |
553 | | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
554 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
555 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
556 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
557 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
558 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
559 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
560 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
561 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
562 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
563 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
564 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
565 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
566 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
567 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
568 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
569 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
570 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
571 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
572 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
573 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
574 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
575 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
576 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
577 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
578 | | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
579 | | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
580 | | 15, 16 |
581 | | }; |
582 | | |
583 | | #if YYDEBUG |
584 | | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
585 | | static const yytype_int16 yyrline[] = |
586 | | { |
587 | | 0, 104, 104, 114, 114, 116, 116, 118, 119, 120, |
588 | | 123, 123, 125, 125, 127, 128, 129, 132, 133, 139, |
589 | | 139, 144, 144, 146, 161, 163, 165, 165, 167, 171, |
590 | | 175, 180, 184, 186, 187, 188, 189, 190, 193, 194, |
591 | | 197, 202, 209, 217, 218, 221, 223, 227, 235, 254, |
592 | | 256, 257, 258, 259, 260, 263, 264, 267, 269, 276, |
593 | | 276, 284, 285, 288, 290, 294, 294 |
594 | | }; |
595 | | #endif |
596 | | |
597 | | #if YYDEBUG || YYERROR_VERBOSE || 1 |
598 | | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
599 | | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
600 | | static const char *const yytname[] = |
601 | | { |
602 | | "\"end of file\"", "error", "$undefined", "\"number\"", |
603 | | "\"end of line\"", "\"DL\"", "\"n=vertexcount\"", "\"data:\"", |
604 | | "\"labels:\"", "\"labels embedded:\"", "FORMATFULLMATRIX", |
605 | | "FORMATEDGELIST1", "FORMATNODELIST1", "\"binary digit\"", "\"label\"", |
606 | | "EOFF", "ERROR", "$accept", "input", "trail", "eof", "rest", |
607 | | "formfullmatrix", "newline", "fullmatrix", "labels", "fullmatrixdata", |
608 | | "zerooneseq", "zeroone", "labeledfullmatrixdata", |
609 | | "reallabeledfullmatrixdata", "labelseq", "label", "labeledmatrixlines", |
610 | | "labeledmatrixline", "edgelist1", "edgelist1rest", "edgelist1data", |
611 | | "edgelist1dataline", "integer", "labelededgelist1data", |
612 | | "labelededgelist1dataline", "weight", "elabel", "nodelist1", |
613 | | "nodelist1rest", "nodelist1data", "nodelist1dataline", "from", "tolist", |
614 | | "labelednodelist1data", "labelednodelist1dataline", "fromelabel", |
615 | | "labeltolist", YY_NULLPTR |
616 | | }; |
617 | | #endif |
618 | | |
619 | | # ifdef YYPRINT |
620 | | /* YYTOKNUM[NUM] -- (External) token number corresponding to the |
621 | | (internal) symbol number NUM (which must be that of a token). */ |
622 | | static const yytype_int16 yytoknum[] = |
623 | | { |
624 | | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
625 | | 265, 266, 267, 268, 269, 270, 271 |
626 | | }; |
627 | | # endif |
628 | | |
629 | 27.0M | #define YYPACT_NINF (-114) |
630 | | |
631 | | #define yypact_value_is_default(Yyn) \ |
632 | 27.0M | ((Yyn) == YYPACT_NINF) |
633 | | |
634 | | #define YYTABLE_NINF (-22) |
635 | | |
636 | | #define yytable_value_is_error(Yyn) \ |
637 | 12.4k | 0 |
638 | | |
639 | | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
640 | | STATE-NUM. */ |
641 | | static const yytype_int8 yypact[] = |
642 | | { |
643 | | 8, 38, 11, 43, -114, -114, 44, 57, 46, 46, |
644 | | 46, 46, 46, 46, -114, -114, -114, -114, -114, -114, |
645 | | -114, -114, 69, 53, 63, 66, 6, 65, 46, 46, |
646 | | -114, 46, 46, 46, -114, -114, 46, 46, -114, -114, |
647 | | -114, -114, 5, 19, -114, -114, -114, 76, 84, -114, |
648 | | 82, -114, -114, -114, 46, -114, -114, -114, 93, 43, |
649 | | 46, 46, 46, -114, -114, -114, 46, 46, 46, -114, |
650 | | 85, 86, -114, 43, 23, -114, -114, 88, 33, -114, |
651 | | -114, 65, -114, 85, -114, -114, -114, 90, 46, 46, |
652 | | 87, 46, -114, -114, 46, 46, 87, 46, 25, -114, |
653 | | -114, -114, 94, -114, 95, -114, -114, 87, 29, -114, |
654 | | 96, -114, -114, -114, 49, -114, -114, 43, 46, 92, |
655 | | 46, 84, 46, 2, 46, -114, -114, 100, -114, -114, |
656 | | -114, -114, -114, 87, -114, 87, 87, 87 |
657 | | }; |
658 | | |
659 | | /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
660 | | Performed when YYTABLE does not specify something else to do. Zero |
661 | | means the default is an error. */ |
662 | | static const yytype_int8 yydefact[] = |
663 | | { |
664 | | 0, 0, 0, 0, 1, 42, 0, 0, 12, 12, |
665 | | 12, 12, 12, 12, 3, 7, 11, 8, 9, 13, |
666 | | 19, 17, 0, 0, 0, 0, 5, 14, 12, 12, |
667 | | 10, 12, 12, 12, 32, 55, 12, 12, 49, 6, |
668 | | 2, 4, 0, 0, 26, 38, 17, 0, 50, 17, |
669 | | 0, 20, 23, 22, 12, 18, 16, 24, 12, 33, |
670 | | 12, 12, 12, 58, 56, 59, 12, 12, 12, 19, |
671 | | 0, 0, 39, 0, 0, 43, 17, 0, 0, 61, |
672 | | 17, 15, 21, 25, 29, 28, 27, 0, 12, 12, |
673 | | 35, 12, 57, 60, 12, 12, 52, 12, 0, 30, |
674 | | 47, 41, 0, 38, 0, 48, 44, 0, 0, 55, |
675 | | 0, 64, 62, 65, 0, 31, 40, 34, 12, 0, |
676 | | 12, 51, 12, 0, 12, 43, 46, 0, 43, 61, |
677 | | 63, 66, 61, 36, 45, 37, 53, 54 |
678 | | }; |
679 | | |
680 | | /* YYPGOTO[NTERM-NUM]. */ |
681 | | static const yytype_int8 yypgoto[] = |
682 | | { |
683 | | -114, -114, -114, -114, -114, -114, -9, 83, -41, 36, |
684 | | 26, -114, -114, -114, -114, -114, -114, 24, -114, -114, |
685 | | 7, -114, 4, -113, -114, -7, -82, -114, -114, 9, |
686 | | -114, -114, -114, -98, -114, -114, -114 |
687 | | }; |
688 | | |
689 | | /* YYDEFGOTO[NTERM-NUM]. */ |
690 | | static const yytype_int8 yydefgoto[] = |
691 | | { |
692 | | -1, 2, 26, 40, 14, 15, 20, 16, 28, 27, |
693 | | 42, 53, 56, 57, 58, 86, 83, 84, 17, 34, |
694 | | 59, 72, 73, 90, 106, 102, 107, 18, 38, 48, |
695 | | 64, 65, 77, 96, 112, 113, 123 |
696 | | }; |
697 | | |
698 | | /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
699 | | positive, shift that token. If negative, reduce the rule whose |
700 | | number is the opposite. If YYTABLE_NINF, syntax error. */ |
701 | | static const yytype_int16 yytable[] = |
702 | | { |
703 | | 21, 22, 23, 24, 25, 60, 130, 6, 66, 51, |
704 | | 19, 4, 133, 1, 111, 135, 105, 41, 52, 43, |
705 | | 44, 39, 45, 46, 47, 119, 54, 49, 50, 115, |
706 | | 88, 136, 89, 55, 137, 91, 120, 55, 52, 97, |
707 | | 94, 131, 95, 55, 3, 69, 5, 55, 7, 71, |
708 | | 19, 74, 75, 76, 111, 111, 124, 78, 79, 80, |
709 | | 8, 9, 10, 55, 8, 9, 10, 11, 12, 13, |
710 | | 31, 32, 33, 35, 36, 37, 29, 87, -21, 103, |
711 | | 104, 93, 108, 61, 62, 109, 110, 63, 114, 67, |
712 | | 68, 5, 92, 100, 101, 100, 126, 70, 116, 82, |
713 | | 85, 105, 118, 122, 134, 81, 30, 99, 98, 125, |
714 | | 117, 128, 127, 129, 0, 132, 0, 0, 121 |
715 | | }; |
716 | | |
717 | | static const yytype_int16 yycheck[] = |
718 | | { |
719 | | 9, 10, 11, 12, 13, 46, 4, 3, 49, 4, |
720 | | 4, 0, 125, 5, 96, 128, 14, 26, 13, 28, |
721 | | 29, 15, 31, 32, 33, 107, 7, 36, 37, 4, |
722 | | 7, 129, 9, 14, 132, 76, 7, 14, 13, 80, |
723 | | 7, 123, 9, 14, 6, 54, 3, 14, 4, 58, |
724 | | 4, 60, 61, 62, 136, 137, 7, 66, 67, 68, |
725 | | 7, 8, 9, 14, 7, 8, 9, 10, 11, 12, |
726 | | 7, 8, 9, 7, 8, 9, 7, 73, 13, 88, |
727 | | 89, 77, 91, 7, 8, 94, 95, 3, 97, 7, |
728 | | 8, 3, 4, 3, 4, 3, 4, 4, 4, 14, |
729 | | 14, 14, 7, 7, 4, 69, 23, 83, 82, 118, |
730 | | 103, 120, 119, 122, -1, 124, -1, -1, 109 |
731 | | }; |
732 | | |
733 | | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
734 | | symbol of state STATE-NUM. */ |
735 | | static const yytype_int8 yystos[] = |
736 | | { |
737 | | 0, 5, 18, 6, 0, 3, 39, 4, 7, 8, |
738 | | 9, 10, 11, 12, 21, 22, 24, 35, 44, 4, |
739 | | 23, 23, 23, 23, 23, 23, 19, 26, 25, 7, |
740 | | 24, 7, 8, 9, 36, 7, 8, 9, 45, 15, |
741 | | 20, 23, 27, 23, 23, 23, 23, 23, 46, 23, |
742 | | 23, 4, 13, 28, 7, 14, 29, 30, 31, 37, |
743 | | 25, 7, 8, 3, 47, 48, 25, 7, 8, 23, |
744 | | 4, 23, 38, 39, 23, 23, 23, 49, 23, 23, |
745 | | 23, 26, 14, 33, 34, 14, 32, 39, 7, 9, |
746 | | 40, 25, 4, 39, 7, 9, 50, 25, 27, 34, |
747 | | 3, 4, 42, 23, 23, 14, 41, 43, 23, 23, |
748 | | 23, 43, 51, 52, 23, 4, 4, 37, 7, 43, |
749 | | 7, 46, 7, 53, 7, 23, 4, 42, 23, 23, |
750 | | 4, 43, 23, 40, 4, 40, 50, 50 |
751 | | }; |
752 | | |
753 | | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
754 | | static const yytype_int8 yyr1[] = |
755 | | { |
756 | | 0, 17, 18, 19, 19, 20, 20, 21, 21, 21, |
757 | | 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, |
758 | | 26, 27, 27, 28, 29, 30, 31, 31, 32, 33, |
759 | | 33, 34, 35, 36, 36, 36, 36, 36, 37, 37, |
760 | | 38, 38, 39, 40, 40, 41, 41, 42, 43, 44, |
761 | | 45, 45, 45, 45, 45, 46, 46, 47, 48, 49, |
762 | | 49, 50, 50, 51, 52, 53, 53 |
763 | | }; |
764 | | |
765 | | /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
766 | | static const yytype_int8 yyr2[] = |
767 | | { |
768 | | 0, 2, 7, 0, 2, 0, 1, 1, 1, 1, |
769 | | 3, 1, 0, 1, 3, 7, 5, 0, 3, 0, |
770 | | 3, 0, 2, 1, 1, 3, 0, 3, 1, 1, |
771 | | 2, 3, 3, 3, 7, 5, 9, 9, 0, 2, |
772 | | 4, 3, 1, 0, 2, 4, 3, 1, 1, 3, |
773 | | 2, 7, 5, 9, 9, 0, 2, 3, 1, 0, |
774 | | 2, 0, 2, 3, 1, 0, 2 |
775 | | }; |
776 | | |
777 | | |
778 | | #define yyerrok (yyerrstatus = 0) |
779 | | #define yyclearin (yychar = YYEMPTY) |
780 | 22.9M | #define YYEMPTY (-2) |
781 | 12.2M | #define YYEOF 0 |
782 | | |
783 | 845 | #define YYACCEPT goto yyacceptlab |
784 | 1.53k | #define YYABORT goto yyabortlab |
785 | 0 | #define YYERROR goto yyerrorlab |
786 | | |
787 | | |
788 | | #define YYRECOVERING() (!!yyerrstatus) |
789 | | |
790 | | #define YYBACKUP(Token, Value) \ |
791 | | do \ |
792 | | if (yychar == YYEMPTY) \ |
793 | | { \ |
794 | | yychar = (Token); \ |
795 | | yylval = (Value); \ |
796 | | YYPOPSTACK (yylen); \ |
797 | | yystate = *yyssp; \ |
798 | | goto yybackup; \ |
799 | | } \ |
800 | | else \ |
801 | | { \ |
802 | | yyerror (&yylloc, context, YY_("syntax error: cannot back up")); \ |
803 | | YYERROR; \ |
804 | | } \ |
805 | | while (0) |
806 | | |
807 | | /* Error token number */ |
808 | 29.9k | #define YYTERROR 1 |
809 | | #define YYERRCODE 256 |
810 | | |
811 | | |
812 | | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
813 | | If N is 0, then set CURRENT to the empty location which ends |
814 | | the previous symbol: RHS[0] (always defined). */ |
815 | | |
816 | | #ifndef YYLLOC_DEFAULT |
817 | | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
818 | 16.3M | do \ |
819 | 16.3M | if (N) \ |
820 | 16.3M | { \ |
821 | 14.7M | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ |
822 | 14.7M | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ |
823 | 14.7M | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ |
824 | 14.7M | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ |
825 | 14.7M | } \ |
826 | 16.3M | else \ |
827 | 16.3M | { \ |
828 | 1.59M | (Current).first_line = (Current).last_line = \ |
829 | 1.59M | YYRHSLOC (Rhs, 0).last_line; \ |
830 | 1.59M | (Current).first_column = (Current).last_column = \ |
831 | 1.59M | YYRHSLOC (Rhs, 0).last_column; \ |
832 | 1.59M | } \ |
833 | 16.3M | while (0) |
834 | | #endif |
835 | | |
836 | 62.0M | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
837 | | |
838 | | |
839 | | /* Enable debugging if requested. */ |
840 | | #if YYDEBUG |
841 | | |
842 | | # ifndef YYFPRINTF |
843 | | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
844 | | # define YYFPRINTF fprintf |
845 | | # endif |
846 | | |
847 | | # define YYDPRINTF(Args) \ |
848 | | do { \ |
849 | | if (yydebug) \ |
850 | | YYFPRINTF Args; \ |
851 | | } while (0) |
852 | | |
853 | | |
854 | | /* YY_LOCATION_PRINT -- Print the location on the stream. |
855 | | This macro was not mandated originally: define only if we know |
856 | | we won't break user code: when these are the locations we know. */ |
857 | | |
858 | | #ifndef YY_LOCATION_PRINT |
859 | | # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL |
860 | | |
861 | | /* Print *YYLOCP on YYO. Private, do not rely on its existence. */ |
862 | | |
863 | | YY_ATTRIBUTE_UNUSED |
864 | | static int |
865 | | yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) |
866 | | { |
867 | | int res = 0; |
868 | | int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; |
869 | | if (0 <= yylocp->first_line) |
870 | | { |
871 | | res += YYFPRINTF (yyo, "%d", yylocp->first_line); |
872 | | if (0 <= yylocp->first_column) |
873 | | res += YYFPRINTF (yyo, ".%d", yylocp->first_column); |
874 | | } |
875 | | if (0 <= yylocp->last_line) |
876 | | { |
877 | | if (yylocp->first_line < yylocp->last_line) |
878 | | { |
879 | | res += YYFPRINTF (yyo, "-%d", yylocp->last_line); |
880 | | if (0 <= end_col) |
881 | | res += YYFPRINTF (yyo, ".%d", end_col); |
882 | | } |
883 | | else if (0 <= end_col && yylocp->first_column < end_col) |
884 | | res += YYFPRINTF (yyo, "-%d", end_col); |
885 | | } |
886 | | return res; |
887 | | } |
888 | | |
889 | | # define YY_LOCATION_PRINT(File, Loc) \ |
890 | | yy_location_print_ (File, &(Loc)) |
891 | | |
892 | | # else |
893 | | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
894 | | # endif |
895 | | #endif |
896 | | |
897 | | |
898 | | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
899 | | do { \ |
900 | | if (yydebug) \ |
901 | | { \ |
902 | | YYFPRINTF (stderr, "%s ", Title); \ |
903 | | yy_symbol_print (stderr, \ |
904 | | Type, Value, Location, context); \ |
905 | | YYFPRINTF (stderr, "\n"); \ |
906 | | } \ |
907 | | } while (0) |
908 | | |
909 | | |
910 | | /*-----------------------------------. |
911 | | | Print this symbol's value on YYO. | |
912 | | `-----------------------------------*/ |
913 | | |
914 | | static void |
915 | | yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, igraph_i_dl_parsedata_t* context) |
916 | | { |
917 | | FILE *yyoutput = yyo; |
918 | | YYUSE (yyoutput); |
919 | | YYUSE (yylocationp); |
920 | | YYUSE (context); |
921 | | if (!yyvaluep) |
922 | | return; |
923 | | # ifdef YYPRINT |
924 | | if (yytype < YYNTOKENS) |
925 | | YYPRINT (yyo, yytoknum[yytype], *yyvaluep); |
926 | | # endif |
927 | | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
928 | | YYUSE (yytype); |
929 | | YY_IGNORE_MAYBE_UNINITIALIZED_END |
930 | | } |
931 | | |
932 | | |
933 | | /*---------------------------. |
934 | | | Print this symbol on YYO. | |
935 | | `---------------------------*/ |
936 | | |
937 | | static void |
938 | | yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, igraph_i_dl_parsedata_t* context) |
939 | | { |
940 | | YYFPRINTF (yyo, "%s %s (", |
941 | | yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); |
942 | | |
943 | | YY_LOCATION_PRINT (yyo, *yylocationp); |
944 | | YYFPRINTF (yyo, ": "); |
945 | | yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp, context); |
946 | | YYFPRINTF (yyo, ")"); |
947 | | } |
948 | | |
949 | | /*------------------------------------------------------------------. |
950 | | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
951 | | | TOP (included). | |
952 | | `------------------------------------------------------------------*/ |
953 | | |
954 | | static void |
955 | | yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) |
956 | | { |
957 | | YYFPRINTF (stderr, "Stack now"); |
958 | | for (; yybottom <= yytop; yybottom++) |
959 | | { |
960 | | int yybot = *yybottom; |
961 | | YYFPRINTF (stderr, " %d", yybot); |
962 | | } |
963 | | YYFPRINTF (stderr, "\n"); |
964 | | } |
965 | | |
966 | | # define YY_STACK_PRINT(Bottom, Top) \ |
967 | | do { \ |
968 | | if (yydebug) \ |
969 | | yy_stack_print ((Bottom), (Top)); \ |
970 | | } while (0) |
971 | | |
972 | | |
973 | | /*------------------------------------------------. |
974 | | | Report that the YYRULE is going to be reduced. | |
975 | | `------------------------------------------------*/ |
976 | | |
977 | | static void |
978 | | yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, igraph_i_dl_parsedata_t* context) |
979 | | { |
980 | | int yylno = yyrline[yyrule]; |
981 | | int yynrhs = yyr2[yyrule]; |
982 | | int yyi; |
983 | | YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", |
984 | | yyrule - 1, yylno); |
985 | | /* The symbols being reduced. */ |
986 | | for (yyi = 0; yyi < yynrhs; yyi++) |
987 | | { |
988 | | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
989 | | yy_symbol_print (stderr, |
990 | | yystos[+yyssp[yyi + 1 - yynrhs]], |
991 | | &yyvsp[(yyi + 1) - (yynrhs)] |
992 | | , &(yylsp[(yyi + 1) - (yynrhs)]) , context); |
993 | | YYFPRINTF (stderr, "\n"); |
994 | | } |
995 | | } |
996 | | |
997 | | # define YY_REDUCE_PRINT(Rule) \ |
998 | | do { \ |
999 | | if (yydebug) \ |
1000 | | yy_reduce_print (yyssp, yyvsp, yylsp, Rule, context); \ |
1001 | | } while (0) |
1002 | | |
1003 | | /* Nonzero means print parse trace. It is left uninitialized so that |
1004 | | multiple parsers can coexist. */ |
1005 | | int yydebug; |
1006 | | #else /* !YYDEBUG */ |
1007 | | # define YYDPRINTF(Args) |
1008 | | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
1009 | | # define YY_STACK_PRINT(Bottom, Top) |
1010 | | # define YY_REDUCE_PRINT(Rule) |
1011 | | #endif /* !YYDEBUG */ |
1012 | | |
1013 | | |
1014 | | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
1015 | | #ifndef YYINITDEPTH |
1016 | 2.38k | # define YYINITDEPTH 200 |
1017 | | #endif |
1018 | | |
1019 | | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
1020 | | if the built-in stack extension method is used). |
1021 | | |
1022 | | Do not make this value too large; the results are undefined if |
1023 | | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
1024 | | evaluated with infinite-precision integer arithmetic. */ |
1025 | | |
1026 | | #ifndef YYMAXDEPTH |
1027 | 0 | # define YYMAXDEPTH 10000 |
1028 | | #endif |
1029 | | |
1030 | | |
1031 | | #if YYERROR_VERBOSE |
1032 | | |
1033 | | # ifndef yystrlen |
1034 | | # if defined __GLIBC__ && defined _STRING_H |
1035 | 1.45k | # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) |
1036 | | # else |
1037 | | /* Return the length of YYSTR. */ |
1038 | | static YYPTRDIFF_T |
1039 | | yystrlen (const char *yystr) |
1040 | | { |
1041 | | YYPTRDIFF_T yylen; |
1042 | | for (yylen = 0; yystr[yylen]; yylen++) |
1043 | | continue; |
1044 | | return yylen; |
1045 | | } |
1046 | | # endif |
1047 | | # endif |
1048 | | |
1049 | | # ifndef yystpcpy |
1050 | | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
1051 | | # define yystpcpy stpcpy |
1052 | | # else |
1053 | | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
1054 | | YYDEST. */ |
1055 | | static char * |
1056 | | yystpcpy (char *yydest, const char *yysrc) |
1057 | 593 | { |
1058 | 593 | char *yyd = yydest; |
1059 | 593 | const char *yys = yysrc; |
1060 | | |
1061 | 3.14k | while ((*yyd++ = *yys++) != '\0') |
1062 | 2.55k | continue; |
1063 | | |
1064 | 593 | return yyd - 1; |
1065 | 593 | } |
1066 | | # endif |
1067 | | # endif |
1068 | | |
1069 | | # ifndef yytnamerr |
1070 | | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
1071 | | quotes and backslashes, so that it's suitable for yyerror. The |
1072 | | heuristic is that double-quoting is unnecessary unless the string |
1073 | | contains an apostrophe, a comma, or backslash (other than |
1074 | | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
1075 | | null, do not copy; instead, return the length of what the result |
1076 | | would have been. */ |
1077 | | static YYPTRDIFF_T |
1078 | | yytnamerr (char *yyres, const char *yystr) |
1079 | 4.34k | { |
1080 | 4.34k | if (*yystr == '"') |
1081 | 3.14k | { |
1082 | 3.14k | YYPTRDIFF_T yyn = 0; |
1083 | 3.14k | char const *yyp = yystr; |
1084 | | |
1085 | 3.14k | for (;;) |
1086 | 27.1k | switch (*++yyp) |
1087 | 27.1k | { |
1088 | 0 | case '\'': |
1089 | 0 | case ',': |
1090 | 0 | goto do_not_strip_quotes; |
1091 | | |
1092 | 0 | case '\\': |
1093 | 0 | if (*++yyp != '\\') |
1094 | 0 | goto do_not_strip_quotes; |
1095 | 0 | else |
1096 | 0 | goto append; |
1097 | | |
1098 | 0 | append: |
1099 | 23.9k | default: |
1100 | 23.9k | if (yyres) |
1101 | 11.8k | yyres[yyn] = *yyp; |
1102 | 23.9k | yyn++; |
1103 | 23.9k | break; |
1104 | | |
1105 | 3.14k | case '"': |
1106 | 3.14k | if (yyres) |
1107 | 1.55k | yyres[yyn] = '\0'; |
1108 | 3.14k | return yyn; |
1109 | 27.1k | } |
1110 | 0 | do_not_strip_quotes: ; |
1111 | 0 | } |
1112 | | |
1113 | 1.19k | if (yyres) |
1114 | 593 | return yystpcpy (yyres, yystr) - yyres; |
1115 | 606 | else |
1116 | 606 | return yystrlen (yystr); |
1117 | 1.19k | } |
1118 | | # endif |
1119 | | |
1120 | | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
1121 | | about the unexpected token YYTOKEN for the state stack whose top is |
1122 | | YYSSP. |
1123 | | |
1124 | | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
1125 | | not large enough to hold the message. In that case, also set |
1126 | | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
1127 | | required number of bytes is too large to store. */ |
1128 | | static int |
1129 | | yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, |
1130 | | yy_state_t *yyssp, int yytoken) |
1131 | 844 | { |
1132 | 844 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
1133 | | /* Internationalized format string. */ |
1134 | 844 | const char *yyformat = YY_NULLPTR; |
1135 | | /* Arguments of yyformat: reported tokens (one for the "unexpected", |
1136 | | one per "expected"). */ |
1137 | 844 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
1138 | | /* Actual size of YYARG. */ |
1139 | 844 | int yycount = 0; |
1140 | | /* Cumulated lengths of YYARG. */ |
1141 | 844 | YYPTRDIFF_T yysize = 0; |
1142 | | |
1143 | | /* There are many possibilities here to consider: |
1144 | | - If this state is a consistent state with a default action, then |
1145 | | the only way this function was invoked is if the default action |
1146 | | is an error action. In that case, don't check for expected |
1147 | | tokens because there are none. |
1148 | | - The only way there can be no lookahead present (in yychar) is if |
1149 | | this state is a consistent state with a default action. Thus, |
1150 | | detecting the absence of a lookahead is sufficient to determine |
1151 | | that there is no unexpected or expected token to report. In that |
1152 | | case, just report a simple "syntax error". |
1153 | | - Don't assume there isn't a lookahead just because this state is a |
1154 | | consistent state with a default action. There might have been a |
1155 | | previous inconsistent state, consistent state with a non-default |
1156 | | action, or user semantic action that manipulated yychar. |
1157 | | - Of course, the expected token list depends on states to have |
1158 | | correct lookahead information, and it depends on the parser not |
1159 | | to perform extra reductions after fetching a lookahead from the |
1160 | | scanner and before detecting a syntax error. Thus, state merging |
1161 | | (from LALR or IELR) and default reductions corrupt the expected |
1162 | | token list. However, the list is correct for canonical LR with |
1163 | | one exception: it will still contain any token that will not be |
1164 | | accepted due to an error action in a later state. |
1165 | | */ |
1166 | 844 | if (yytoken != YYEMPTY) |
1167 | 844 | { |
1168 | 844 | int yyn = yypact[+*yyssp]; |
1169 | 844 | YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); |
1170 | 844 | yysize = yysize0; |
1171 | 844 | yyarg[yycount++] = yytname[yytoken]; |
1172 | 844 | if (!yypact_value_is_default (yyn)) |
1173 | 844 | { |
1174 | | /* Start YYX at -YYN if negative to avoid negative indexes in |
1175 | | YYCHECK. In other words, skip the first -YYN actions for |
1176 | | this state because they are default actions. */ |
1177 | 844 | int yyxbegin = yyn < 0 ? -yyn : 0; |
1178 | | /* Stay within bounds of both yycheck and yytname. */ |
1179 | 844 | int yychecklim = YYLAST - yyn + 1; |
1180 | 844 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
1181 | 844 | int yyx; |
1182 | | |
1183 | 15.1k | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
1184 | 14.2k | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
1185 | 0 | && !yytable_value_is_error (yytable[yyx + yyn])) |
1186 | 1.36k | { |
1187 | 1.36k | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
1188 | 13 | { |
1189 | 13 | yycount = 1; |
1190 | 13 | yysize = yysize0; |
1191 | 13 | break; |
1192 | 13 | } |
1193 | 1.35k | yyarg[yycount++] = yytname[yyx]; |
1194 | 1.35k | { |
1195 | 1.35k | YYPTRDIFF_T yysize1 |
1196 | 1.35k | = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); |
1197 | 1.35k | if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) |
1198 | 1.35k | yysize = yysize1; |
1199 | 0 | else |
1200 | 0 | return 2; |
1201 | 1.35k | } |
1202 | 1.35k | } |
1203 | 844 | } |
1204 | 844 | } |
1205 | | |
1206 | 844 | switch (yycount) |
1207 | 844 | { |
1208 | 0 | # define YYCASE_(N, S) \ |
1209 | 844 | case N: \ |
1210 | 844 | yyformat = S; \ |
1211 | 844 | break |
1212 | 0 | default: /* Avoid compiler warnings. */ |
1213 | 0 | YYCASE_(0, YY_("syntax error")); |
1214 | 13 | YYCASE_(1, YY_("syntax error, unexpected %s")); |
1215 | 390 | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
1216 | 411 | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
1217 | 30 | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
1218 | 844 | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
1219 | 844 | # undef YYCASE_ |
1220 | 844 | } |
1221 | | |
1222 | 844 | { |
1223 | | /* Don't count the "%s"s in the final size, but reserve room for |
1224 | | the terminator. */ |
1225 | 844 | YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; |
1226 | 844 | if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) |
1227 | 844 | yysize = yysize1; |
1228 | 0 | else |
1229 | 0 | return 2; |
1230 | 844 | } |
1231 | | |
1232 | 844 | if (*yymsg_alloc < yysize) |
1233 | 0 | { |
1234 | 0 | *yymsg_alloc = 2 * yysize; |
1235 | 0 | if (! (yysize <= *yymsg_alloc |
1236 | 0 | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
1237 | 0 | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
1238 | 0 | return 1; |
1239 | 0 | } |
1240 | | |
1241 | | /* Avoid sprintf, as that infringes on the user's name space. |
1242 | | Don't have undefined behavior even if the translation |
1243 | | produced a string with the wrong number of "%s"s. */ |
1244 | 844 | { |
1245 | 844 | char *yyp = *yymsg; |
1246 | 844 | int yyi = 0; |
1247 | 35.9k | while ((*yyp = *yyformat) != '\0') |
1248 | 35.1k | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
1249 | 2.14k | { |
1250 | 2.14k | yyp += yytnamerr (yyp, yyarg[yyi++]); |
1251 | 2.14k | yyformat += 2; |
1252 | 2.14k | } |
1253 | 32.9k | else |
1254 | 32.9k | { |
1255 | 32.9k | ++yyp; |
1256 | 32.9k | ++yyformat; |
1257 | 32.9k | } |
1258 | 844 | } |
1259 | 844 | return 0; |
1260 | 844 | } |
1261 | | #endif /* YYERROR_VERBOSE */ |
1262 | | |
1263 | | /*-----------------------------------------------. |
1264 | | | Release the memory associated to this symbol. | |
1265 | | `-----------------------------------------------*/ |
1266 | | |
1267 | | static void |
1268 | | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, igraph_i_dl_parsedata_t* context) |
1269 | 15.4k | { |
1270 | 15.4k | YYUSE (yyvaluep); |
1271 | 15.4k | YYUSE (yylocationp); |
1272 | 15.4k | YYUSE (context); |
1273 | 15.4k | if (!yymsg) |
1274 | 0 | yymsg = "Deleting"; |
1275 | 15.4k | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
1276 | | |
1277 | 15.4k | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1278 | 15.4k | YYUSE (yytype); |
1279 | 15.4k | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1280 | 15.4k | } |
1281 | | |
1282 | | |
1283 | | |
1284 | | |
1285 | | /*----------. |
1286 | | | yyparse. | |
1287 | | `----------*/ |
1288 | | |
1289 | | int |
1290 | | yyparse (igraph_i_dl_parsedata_t* context) |
1291 | 2.38k | { |
1292 | | /* The lookahead symbol. */ |
1293 | 2.38k | int yychar; |
1294 | | |
1295 | | |
1296 | | /* The semantic value of the lookahead symbol. */ |
1297 | | /* Default value used for initialization, for pacifying older GCCs |
1298 | | or non-GCC compilers. */ |
1299 | 2.38k | YY_INITIAL_VALUE (static YYSTYPE yyval_default;) |
1300 | 2.38k | YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); |
1301 | | |
1302 | | /* Location data for the lookahead symbol. */ |
1303 | 2.38k | static YYLTYPE yyloc_default |
1304 | 2.38k | # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL |
1305 | 2.38k | = { 1, 1, 1, 1 } |
1306 | 2.38k | # endif |
1307 | 2.38k | ; |
1308 | 2.38k | YYLTYPE yylloc = yyloc_default; |
1309 | | |
1310 | | /* Number of syntax errors so far. */ |
1311 | 2.38k | int yynerrs; |
1312 | | |
1313 | 2.38k | yy_state_fast_t yystate; |
1314 | | /* Number of tokens to shift before error messages enabled. */ |
1315 | 2.38k | int yyerrstatus; |
1316 | | |
1317 | | /* The stacks and their tools: |
1318 | | 'yyss': related to states. |
1319 | | 'yyvs': related to semantic values. |
1320 | | 'yyls': related to locations. |
1321 | | |
1322 | | Refer to the stacks through separate pointers, to allow yyoverflow |
1323 | | to reallocate them elsewhere. */ |
1324 | | |
1325 | | /* The state stack. */ |
1326 | 2.38k | yy_state_t yyssa[YYINITDEPTH]; |
1327 | 2.38k | yy_state_t *yyss; |
1328 | 2.38k | yy_state_t *yyssp; |
1329 | | |
1330 | | /* The semantic value stack. */ |
1331 | 2.38k | YYSTYPE yyvsa[YYINITDEPTH]; |
1332 | 2.38k | YYSTYPE *yyvs; |
1333 | 2.38k | YYSTYPE *yyvsp; |
1334 | | |
1335 | | /* The location stack. */ |
1336 | 2.38k | YYLTYPE yylsa[YYINITDEPTH]; |
1337 | 2.38k | YYLTYPE *yyls; |
1338 | 2.38k | YYLTYPE *yylsp; |
1339 | | |
1340 | | /* The locations where the error started and ended. */ |
1341 | 2.38k | YYLTYPE yyerror_range[3]; |
1342 | | |
1343 | 2.38k | YYPTRDIFF_T yystacksize; |
1344 | | |
1345 | 2.38k | int yyn; |
1346 | 2.38k | int yyresult; |
1347 | | /* Lookahead token as an internal (translated) token number. */ |
1348 | 2.38k | int yytoken = 0; |
1349 | | /* The variables used to return semantic value and location from the |
1350 | | action routines. */ |
1351 | 2.38k | YYSTYPE yyval; |
1352 | 2.38k | YYLTYPE yyloc; |
1353 | | |
1354 | 2.38k | #if YYERROR_VERBOSE |
1355 | | /* Buffer for error messages, and its allocated size. */ |
1356 | 2.38k | char yymsgbuf[128]; |
1357 | 2.38k | char *yymsg = yymsgbuf; |
1358 | 2.38k | YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; |
1359 | 2.38k | #endif |
1360 | | |
1361 | 16.3M | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) |
1362 | | |
1363 | | /* The number of symbols on the RHS of the reduced rule. |
1364 | | Keep to zero when no symbol should be popped. */ |
1365 | 2.38k | int yylen = 0; |
1366 | | |
1367 | 2.38k | yyssp = yyss = yyssa; |
1368 | 2.38k | yyvsp = yyvs = yyvsa; |
1369 | 2.38k | yylsp = yyls = yylsa; |
1370 | 2.38k | yystacksize = YYINITDEPTH; |
1371 | | |
1372 | 2.38k | YYDPRINTF ((stderr, "Starting parse\n")); |
1373 | | |
1374 | 2.38k | yystate = 0; |
1375 | 2.38k | yyerrstatus = 0; |
1376 | 2.38k | yynerrs = 0; |
1377 | 2.38k | yychar = YYEMPTY; /* Cause a token to be read. */ |
1378 | 2.38k | yylsp[0] = yylloc; |
1379 | 2.38k | goto yysetstate; |
1380 | | |
1381 | | |
1382 | | /*------------------------------------------------------------. |
1383 | | | yynewstate -- push a new state, which is found in yystate. | |
1384 | | `------------------------------------------------------------*/ |
1385 | 26.9M | yynewstate: |
1386 | | /* In all cases, when you get here, the value and location stacks |
1387 | | have just been pushed. So pushing a state here evens the stacks. */ |
1388 | 26.9M | yyssp++; |
1389 | | |
1390 | | |
1391 | | /*--------------------------------------------------------------------. |
1392 | | | yysetstate -- set current state (the top of the stack) to yystate. | |
1393 | | `--------------------------------------------------------------------*/ |
1394 | 27.0M | yysetstate: |
1395 | 27.0M | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
1396 | 27.0M | YY_ASSERT (0 <= yystate && yystate < YYNSTATES); |
1397 | 27.0M | YY_IGNORE_USELESS_CAST_BEGIN |
1398 | 27.0M | *yyssp = YY_CAST (yy_state_t, yystate); |
1399 | 27.0M | YY_IGNORE_USELESS_CAST_END |
1400 | | |
1401 | 27.0M | if (yyss + yystacksize - 1 <= yyssp) |
1402 | | #if !defined yyoverflow && !defined YYSTACK_RELOCATE |
1403 | | goto yyexhaustedlab; |
1404 | | #else |
1405 | 0 | { |
1406 | | /* Get the current used size of the three stacks, in elements. */ |
1407 | 0 | YYPTRDIFF_T yysize = yyssp - yyss + 1; |
1408 | |
|
1409 | | # if defined yyoverflow |
1410 | | { |
1411 | | /* Give user a chance to reallocate the stack. Use copies of |
1412 | | these so that the &'s don't force the real ones into |
1413 | | memory. */ |
1414 | | yy_state_t *yyss1 = yyss; |
1415 | | YYSTYPE *yyvs1 = yyvs; |
1416 | | YYLTYPE *yyls1 = yyls; |
1417 | | |
1418 | | /* Each stack pointer address is followed by the size of the |
1419 | | data in use in that stack, in bytes. This used to be a |
1420 | | conditional around just the two extra args, but that might |
1421 | | be undefined if yyoverflow is a macro. */ |
1422 | | yyoverflow (YY_("memory exhausted"), |
1423 | | &yyss1, yysize * YYSIZEOF (*yyssp), |
1424 | | &yyvs1, yysize * YYSIZEOF (*yyvsp), |
1425 | | &yyls1, yysize * YYSIZEOF (*yylsp), |
1426 | | &yystacksize); |
1427 | | yyss = yyss1; |
1428 | | yyvs = yyvs1; |
1429 | | yyls = yyls1; |
1430 | | } |
1431 | | # else /* defined YYSTACK_RELOCATE */ |
1432 | | /* Extend the stack our own way. */ |
1433 | 0 | if (YYMAXDEPTH <= yystacksize) |
1434 | 0 | goto yyexhaustedlab; |
1435 | 0 | yystacksize *= 2; |
1436 | 0 | if (YYMAXDEPTH < yystacksize) |
1437 | 0 | yystacksize = YYMAXDEPTH; |
1438 | |
|
1439 | 0 | { |
1440 | 0 | yy_state_t *yyss1 = yyss; |
1441 | 0 | union yyalloc *yyptr = |
1442 | 0 | YY_CAST (union yyalloc *, |
1443 | 0 | YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); |
1444 | 0 | if (! yyptr) |
1445 | 0 | goto yyexhaustedlab; |
1446 | 0 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
1447 | 0 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
1448 | 0 | YYSTACK_RELOCATE (yyls_alloc, yyls); |
1449 | 0 | # undef YYSTACK_RELOCATE |
1450 | 0 | if (yyss1 != yyssa) |
1451 | 0 | YYSTACK_FREE (yyss1); |
1452 | 0 | } |
1453 | 0 | # endif |
1454 | | |
1455 | 0 | yyssp = yyss + yysize - 1; |
1456 | 0 | yyvsp = yyvs + yysize - 1; |
1457 | 0 | yylsp = yyls + yysize - 1; |
1458 | |
|
1459 | 0 | YY_IGNORE_USELESS_CAST_BEGIN |
1460 | 0 | YYDPRINTF ((stderr, "Stack size increased to %ld\n", |
1461 | 0 | YY_CAST (long, yystacksize))); |
1462 | 0 | YY_IGNORE_USELESS_CAST_END |
1463 | |
|
1464 | 0 | if (yyss + yystacksize - 1 <= yyssp) |
1465 | 0 | YYABORT; |
1466 | 0 | } |
1467 | 27.0M | #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ |
1468 | | |
1469 | 27.0M | if (yystate == YYFINAL) |
1470 | 845 | YYACCEPT; |
1471 | | |
1472 | 27.0M | goto yybackup; |
1473 | | |
1474 | | |
1475 | | /*-----------. |
1476 | | | yybackup. | |
1477 | | `-----------*/ |
1478 | 27.0M | yybackup: |
1479 | | /* Do appropriate processing given the current state. Read a |
1480 | | lookahead token if we need one and don't already have one. */ |
1481 | | |
1482 | | /* First try to decide what to do without reference to lookahead token. */ |
1483 | 27.0M | yyn = yypact[yystate]; |
1484 | 27.0M | if (yypact_value_is_default (yyn)) |
1485 | 14.7M | goto yydefault; |
1486 | | |
1487 | | /* Not known => get a lookahead token if don't already have one. */ |
1488 | | |
1489 | | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
1490 | 12.2M | if (yychar == YYEMPTY) |
1491 | 10.6M | { |
1492 | 10.6M | YYDPRINTF ((stderr, "Reading a token: ")); |
1493 | 10.6M | yychar = yylex (&yylval, &yylloc, scanner); |
1494 | 10.6M | } |
1495 | | |
1496 | 12.2M | if (yychar <= YYEOF) |
1497 | 1.06k | { |
1498 | 1.06k | yychar = yytoken = YYEOF; |
1499 | 1.06k | YYDPRINTF ((stderr, "Now at end of input.\n")); |
1500 | 1.06k | } |
1501 | 12.2M | else |
1502 | 12.2M | { |
1503 | 12.2M | yytoken = YYTRANSLATE (yychar); |
1504 | 12.2M | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
1505 | 12.2M | } |
1506 | | |
1507 | | /* If the proper action on seeing token YYTOKEN is to reduce or to |
1508 | | detect an error, take that action. */ |
1509 | 12.2M | yyn += yytoken; |
1510 | 12.2M | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
1511 | 1.57M | goto yydefault; |
1512 | 10.6M | yyn = yytable[yyn]; |
1513 | 10.6M | if (yyn <= 0) |
1514 | 12.4k | { |
1515 | 12.4k | if (yytable_value_is_error (yyn)) |
1516 | 0 | goto yyerrlab; |
1517 | 12.4k | yyn = -yyn; |
1518 | 12.4k | goto yyreduce; |
1519 | 12.4k | } |
1520 | | |
1521 | | /* Count tokens shifted since error; after three, turn off error |
1522 | | status. */ |
1523 | 10.6M | if (yyerrstatus) |
1524 | 0 | yyerrstatus--; |
1525 | | |
1526 | | /* Shift the lookahead token. */ |
1527 | 10.6M | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
1528 | 10.6M | yystate = yyn; |
1529 | 10.6M | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1530 | 10.6M | *++yyvsp = yylval; |
1531 | 10.6M | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1532 | 10.6M | *++yylsp = yylloc; |
1533 | | |
1534 | | /* Discard the shifted token. */ |
1535 | 10.6M | yychar = YYEMPTY; |
1536 | 10.6M | goto yynewstate; |
1537 | | |
1538 | | |
1539 | | /*-----------------------------------------------------------. |
1540 | | | yydefault -- do the default action for the current state. | |
1541 | | `-----------------------------------------------------------*/ |
1542 | 16.3M | yydefault: |
1543 | 16.3M | yyn = yydefact[yystate]; |
1544 | 16.3M | if (yyn == 0) |
1545 | 844 | goto yyerrlab; |
1546 | 16.3M | goto yyreduce; |
1547 | | |
1548 | | |
1549 | | /*-----------------------------. |
1550 | | | yyreduce -- do a reduction. | |
1551 | | `-----------------------------*/ |
1552 | 16.3M | yyreduce: |
1553 | | /* yyn is the number of a rule to reduce with. */ |
1554 | 16.3M | yylen = yyr2[yyn]; |
1555 | | |
1556 | | /* If YYLEN is nonzero, implement the default value of the action: |
1557 | | '$$ = $1'. |
1558 | | |
1559 | | Otherwise, the following line sets YYVAL to garbage. |
1560 | | This behavior is undocumented and Bison |
1561 | | users should not rely upon it. Assigning to YYVAL |
1562 | | unconditionally makes the parser a bit smaller, and it avoids a |
1563 | | GCC warning that YYVAL may be used uninitialized. */ |
1564 | 16.3M | yyval = yyvsp[1-yylen]; |
1565 | | |
1566 | | /* Default location. */ |
1567 | 16.3M | YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); |
1568 | 16.3M | yyerror_range[1] = yyloc; |
1569 | 16.3M | YY_REDUCE_PRINT (yyn); |
1570 | 16.3M | switch (yyn) |
1571 | 16.3M | { |
1572 | 931 | case 2: |
1573 | 931 | #line 104 "/src/igraph/src/io/dl-parser.y" |
1574 | 931 | { |
1575 | 931 | context->n=(yyvsp[-4].integer); |
1576 | 931 | if (context->n < 0) { |
1577 | 0 | IGRAPH_YY_ERRORF("Invalid vertex count in DL file (%" IGRAPH_PRId ").", IGRAPH_EINVAL, context->n); |
1578 | 0 | } |
1579 | 931 | if (context->n > IGRAPH_DL_MAX_VERTEX_COUNT) { |
1580 | 48 | IGRAPH_YY_ERRORF("Vertex count too large in DL file (%" IGRAPH_PRId ").", IGRAPH_EINVAL, context->n); |
1581 | 48 | } |
1582 | 931 | } |
1583 | 883 | #line 1584 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1584 | 883 | break; |
1585 | | |
1586 | 883 | case 7: |
1587 | 462 | #line 118 "/src/igraph/src/io/dl-parser.y" |
1588 | 462 | { context->type=IGRAPH_DL_MATRIX; } |
1589 | 462 | #line 1590 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1590 | 462 | break; |
1591 | | |
1592 | 358 | case 8: |
1593 | 358 | #line 119 "/src/igraph/src/io/dl-parser.y" |
1594 | 358 | { context->type=IGRAPH_DL_EDGELIST1; } |
1595 | 358 | #line 1596 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1596 | 358 | break; |
1597 | | |
1598 | 111 | case 9: |
1599 | 111 | #line 120 "/src/igraph/src/io/dl-parser.y" |
1600 | 111 | { context->type=IGRAPH_DL_NODELIST1; } |
1601 | 111 | #line 1602 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1602 | 111 | break; |
1603 | | |
1604 | 0 | case 10: |
1605 | 0 | #line 123 "/src/igraph/src/io/dl-parser.y" |
1606 | 0 | {} |
1607 | 0 | #line 1608 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1608 | 0 | break; |
1609 | | |
1610 | 462 | case 11: |
1611 | 462 | #line 123 "/src/igraph/src/io/dl-parser.y" |
1612 | 462 | {} |
1613 | 462 | #line 1614 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1614 | 462 | break; |
1615 | | |
1616 | 362 | case 14: |
1617 | 362 | #line 127 "/src/igraph/src/io/dl-parser.y" |
1618 | 362 | { } |
1619 | 362 | #line 1620 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1620 | 362 | break; |
1621 | | |
1622 | 84 | case 15: |
1623 | 84 | #line 128 "/src/igraph/src/io/dl-parser.y" |
1624 | 84 | { } |
1625 | 84 | #line 1626 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1626 | 84 | break; |
1627 | | |
1628 | 16 | case 16: |
1629 | 16 | #line 129 "/src/igraph/src/io/dl-parser.y" |
1630 | 16 | { } |
1631 | 16 | #line 1632 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1632 | 16 | break; |
1633 | | |
1634 | 352 | case 17: |
1635 | 352 | #line 132 "/src/igraph/src/io/dl-parser.y" |
1636 | 352 | {} |
1637 | 352 | #line 1638 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1638 | 352 | break; |
1639 | | |
1640 | 1.62M | case 18: |
1641 | 1.62M | #line 133 "/src/igraph/src/io/dl-parser.y" |
1642 | 1.62M | { |
1643 | 1.62M | IGRAPH_YY_CHECK(igraph_i_dl_add_str(igraph_dl_yyget_text(scanner), |
1644 | 1.62M | igraph_dl_yyget_leng(scanner), |
1645 | 1.62M | context)); } |
1646 | 1.62M | #line 1647 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1647 | 1.62M | break; |
1648 | | |
1649 | 1.62M | case 19: |
1650 | 473 | #line 139 "/src/igraph/src/io/dl-parser.y" |
1651 | 473 | {} |
1652 | 473 | #line 1653 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1653 | 473 | break; |
1654 | | |
1655 | 12.3k | case 20: |
1656 | 12.3k | #line 139 "/src/igraph/src/io/dl-parser.y" |
1657 | 12.3k | { |
1658 | 12.3k | context->from += 1; |
1659 | 12.3k | context->to = 0; |
1660 | 12.3k | } |
1661 | 12.3k | #line 1662 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1662 | 12.3k | break; |
1663 | | |
1664 | 57.5k | case 22: |
1665 | 57.5k | #line 144 "/src/igraph/src/io/dl-parser.y" |
1666 | 57.5k | { } |
1667 | 57.5k | #line 1668 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1668 | 57.5k | break; |
1669 | | |
1670 | 57.5k | case 23: |
1671 | 57.5k | #line 146 "/src/igraph/src/io/dl-parser.y" |
1672 | 57.5k | { |
1673 | | /* TODO: What if the digit is neither 0 or 1? Are multigraphs allowed? */ |
1674 | 57.5k | char c = igraph_dl_yyget_text(scanner)[0]; |
1675 | 57.5k | if (c == '1') { |
1676 | 56.4k | IGRAPH_YY_CHECK(igraph_vector_int_push_back(&context->edges, |
1677 | 56.4k | context->from)); |
1678 | 56.4k | IGRAPH_YY_CHECK(igraph_vector_int_push_back(&context->edges, |
1679 | 56.4k | context->to)); |
1680 | 56.4k | } else if (c != '0') { |
1681 | 3 | IGRAPH_YY_ERRORF("Unexpected digit '%c' in adjacency matrix in DL file.", |
1682 | 3 | IGRAPH_EINVAL, c); |
1683 | 3 | } |
1684 | 57.5k | context->to += 1; |
1685 | 57.5k | } |
1686 | 0 | #line 1687 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1687 | 0 | break; |
1688 | | |
1689 | 16 | case 24: |
1690 | 16 | #line 161 "/src/igraph/src/io/dl-parser.y" |
1691 | 16 | {} |
1692 | 16 | #line 1693 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1693 | 16 | break; |
1694 | | |
1695 | 16 | case 25: |
1696 | 16 | #line 163 "/src/igraph/src/io/dl-parser.y" |
1697 | 16 | {} |
1698 | 16 | #line 1699 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1699 | 16 | break; |
1700 | | |
1701 | 2.04k | case 28: |
1702 | 2.04k | #line 167 "/src/igraph/src/io/dl-parser.y" |
1703 | 2.04k | { IGRAPH_YY_CHECK(igraph_i_dl_add_str(igraph_dl_yyget_text(scanner), |
1704 | 2.04k | igraph_dl_yyget_leng(scanner), |
1705 | 2.04k | context)); } |
1706 | 2.04k | #line 1707 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1707 | 2.04k | break; |
1708 | | |
1709 | 2.04k | case 29: |
1710 | 17 | #line 171 "/src/igraph/src/io/dl-parser.y" |
1711 | 17 | { |
1712 | 17 | context->from += 1; |
1713 | 17 | context->to = 0; |
1714 | 17 | } |
1715 | 17 | #line 1716 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1716 | 17 | break; |
1717 | | |
1718 | 195 | case 30: |
1719 | 195 | #line 175 "/src/igraph/src/io/dl-parser.y" |
1720 | 195 | { |
1721 | 195 | context->from += 1; |
1722 | 195 | context->to = 0; |
1723 | 195 | } |
1724 | 195 | #line 1725 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1725 | 195 | break; |
1726 | | |
1727 | 212 | case 31: |
1728 | 212 | #line 180 "/src/igraph/src/io/dl-parser.y" |
1729 | 212 | { } |
1730 | 212 | #line 1731 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1731 | 212 | break; |
1732 | | |
1733 | 358 | case 32: |
1734 | 358 | #line 184 "/src/igraph/src/io/dl-parser.y" |
1735 | 358 | {} |
1736 | 358 | #line 1737 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1737 | 358 | break; |
1738 | | |
1739 | 329 | case 33: |
1740 | 329 | #line 186 "/src/igraph/src/io/dl-parser.y" |
1741 | 329 | {} |
1742 | 329 | #line 1743 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1743 | 329 | break; |
1744 | | |
1745 | 3 | case 34: |
1746 | 3 | #line 187 "/src/igraph/src/io/dl-parser.y" |
1747 | 3 | {} |
1748 | 3 | #line 1749 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1749 | 3 | break; |
1750 | | |
1751 | 21 | case 35: |
1752 | 21 | #line 188 "/src/igraph/src/io/dl-parser.y" |
1753 | 21 | {} |
1754 | 21 | #line 1755 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1755 | 21 | break; |
1756 | | |
1757 | 5 | case 36: |
1758 | 5 | #line 189 "/src/igraph/src/io/dl-parser.y" |
1759 | 5 | {} |
1760 | 5 | #line 1761 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1761 | 5 | break; |
1762 | | |
1763 | 0 | case 37: |
1764 | 0 | #line 190 "/src/igraph/src/io/dl-parser.y" |
1765 | 0 | {} |
1766 | 0 | #line 1767 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1767 | 0 | break; |
1768 | | |
1769 | 900 | case 38: |
1770 | 900 | #line 193 "/src/igraph/src/io/dl-parser.y" |
1771 | 900 | {} |
1772 | 900 | #line 1773 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1773 | 900 | break; |
1774 | | |
1775 | 2.44M | case 39: |
1776 | 2.44M | #line 194 "/src/igraph/src/io/dl-parser.y" |
1777 | 2.44M | {} |
1778 | 2.44M | #line 1779 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1779 | 2.44M | break; |
1780 | | |
1781 | 37.1k | case 40: |
1782 | 37.1k | #line 197 "/src/igraph/src/io/dl-parser.y" |
1783 | 37.1k | { |
1784 | 37.1k | igraph_int_t from = (yyvsp[-3].integer), to = (yyvsp[-2].integer); |
1785 | 37.1k | IGRAPH_YY_CHECK(igraph_i_dl_check_vid(from)); |
1786 | 36.9k | IGRAPH_YY_CHECK(igraph_i_dl_check_vid(to)); |
1787 | 36.8k | IGRAPH_YY_CHECK(igraph_i_dl_add_edge_w(from-1, to-1, (yyvsp[-1].real), context)); } |
1788 | 36.8k | #line 1789 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1789 | 36.8k | break; |
1790 | | |
1791 | 2.41M | case 41: |
1792 | 2.41M | #line 202 "/src/igraph/src/io/dl-parser.y" |
1793 | 2.41M | { |
1794 | 2.41M | igraph_int_t from = (yyvsp[-2].integer), to = (yyvsp[-1].integer); |
1795 | 2.41M | IGRAPH_YY_CHECK(igraph_i_dl_check_vid(from)); |
1796 | 2.41M | IGRAPH_YY_CHECK(igraph_i_dl_check_vid(to)); |
1797 | 2.41M | IGRAPH_YY_CHECK(igraph_i_dl_add_edge(from-1, to-1, context)); |
1798 | 2.41M | } |
1799 | 2.41M | #line 1800 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1800 | 2.41M | break; |
1801 | | |
1802 | 6.42M | case 42: |
1803 | 6.42M | #line 209 "/src/igraph/src/io/dl-parser.y" |
1804 | 6.42M | { |
1805 | 6.42M | igraph_int_t val; |
1806 | 6.42M | IGRAPH_YY_CHECK(igraph_i_parse_integer(igraph_dl_yyget_text(scanner), |
1807 | 6.42M | igraph_dl_yyget_leng(scanner), |
1808 | 6.42M | &val)); |
1809 | 6.42M | (yyval.integer)=val; |
1810 | 6.42M | } |
1811 | 0 | #line 1812 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1812 | 0 | break; |
1813 | | |
1814 | 119 | case 43: |
1815 | 119 | #line 217 "/src/igraph/src/io/dl-parser.y" |
1816 | 119 | {} |
1817 | 119 | #line 1818 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1818 | 119 | break; |
1819 | | |
1820 | 653 | case 44: |
1821 | 653 | #line 218 "/src/igraph/src/io/dl-parser.y" |
1822 | 653 | {} |
1823 | 653 | #line 1824 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1824 | 653 | break; |
1825 | | |
1826 | 195 | case 45: |
1827 | 195 | #line 221 "/src/igraph/src/io/dl-parser.y" |
1828 | 195 | { |
1829 | 195 | IGRAPH_YY_CHECK(igraph_i_dl_add_edge_w((yyvsp[-3].integer), (yyvsp[-2].integer), (yyvsp[-1].real), context)); } |
1830 | 195 | #line 1831 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1831 | 195 | break; |
1832 | | |
1833 | 458 | case 46: |
1834 | 458 | #line 223 "/src/igraph/src/io/dl-parser.y" |
1835 | 458 | { |
1836 | 458 | IGRAPH_YY_CHECK(igraph_i_dl_add_edge((yyvsp[-2].integer), (yyvsp[-1].integer), context)); |
1837 | 458 | } |
1838 | 458 | #line 1839 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1839 | 458 | break; |
1840 | | |
1841 | 37.3k | case 47: |
1842 | 37.3k | #line 227 "/src/igraph/src/io/dl-parser.y" |
1843 | 37.3k | { |
1844 | 37.3k | igraph_real_t val; |
1845 | 37.3k | IGRAPH_YY_CHECK(igraph_i_parse_real(igraph_dl_yyget_text(scanner), |
1846 | 37.3k | igraph_dl_yyget_leng(scanner), |
1847 | 37.3k | &val)); |
1848 | 37.3k | (yyval.real)=val; |
1849 | 37.3k | } |
1850 | 0 | #line 1851 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1851 | 0 | break; |
1852 | | |
1853 | 7.58k | case 48: |
1854 | 7.58k | #line 235 "/src/igraph/src/io/dl-parser.y" |
1855 | 7.58k | { |
1856 | 7.58k | igraph_int_t trie_id; |
1857 | | |
1858 | | /* Copy label list to trie, if needed */ |
1859 | 7.58k | if (igraph_strvector_size(&context->labels) != 0) { |
1860 | 152 | igraph_int_t i, id, n=igraph_strvector_size(&context->labels); |
1861 | 543k | for (i=0; i<n; i++) { |
1862 | 543k | IGRAPH_YY_CHECK(igraph_trie_get(&context->trie, igraph_strvector_get(&context->labels, i), &id)); |
1863 | 543k | } |
1864 | 152 | igraph_strvector_clear(&context->labels); |
1865 | 152 | } |
1866 | 7.58k | IGRAPH_YY_CHECK(igraph_trie_get_len(&context->trie, igraph_dl_yyget_text(scanner), |
1867 | 7.58k | igraph_dl_yyget_leng(scanner), &trie_id)); |
1868 | 7.58k | IGRAPH_ASSERT(0 <= trie_id && trie_id < IGRAPH_DL_MAX_VERTEX_COUNT); |
1869 | 7.58k | (yyval.integer) = trie_id; |
1870 | 7.58k | } |
1871 | 0 | #line 1872 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1872 | 0 | break; |
1873 | | |
1874 | 111 | case 49: |
1875 | 111 | #line 254 "/src/igraph/src/io/dl-parser.y" |
1876 | 111 | {} |
1877 | 111 | #line 1878 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1878 | 111 | break; |
1879 | | |
1880 | 60 | case 50: |
1881 | 60 | #line 256 "/src/igraph/src/io/dl-parser.y" |
1882 | 60 | {} |
1883 | 60 | #line 1884 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1884 | 60 | break; |
1885 | | |
1886 | 2 | case 51: |
1887 | 2 | #line 257 "/src/igraph/src/io/dl-parser.y" |
1888 | 2 | {} |
1889 | 2 | #line 1890 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1890 | 2 | break; |
1891 | | |
1892 | 32 | case 52: |
1893 | 32 | #line 258 "/src/igraph/src/io/dl-parser.y" |
1894 | 32 | {} |
1895 | 32 | #line 1896 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1896 | 32 | break; |
1897 | | |
1898 | 17 | case 53: |
1899 | 17 | #line 259 "/src/igraph/src/io/dl-parser.y" |
1900 | 17 | {} |
1901 | 17 | #line 1902 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1902 | 17 | break; |
1903 | | |
1904 | 0 | case 54: |
1905 | 0 | #line 260 "/src/igraph/src/io/dl-parser.y" |
1906 | 0 | {} |
1907 | 0 | #line 1908 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1908 | 0 | break; |
1909 | | |
1910 | 289 | case 55: |
1911 | 289 | #line 263 "/src/igraph/src/io/dl-parser.y" |
1912 | 289 | {} |
1913 | 289 | #line 1914 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1914 | 289 | break; |
1915 | | |
1916 | 461 | case 56: |
1917 | 461 | #line 264 "/src/igraph/src/io/dl-parser.y" |
1918 | 461 | {} |
1919 | 461 | #line 1920 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1920 | 461 | break; |
1921 | | |
1922 | 461 | case 57: |
1923 | 461 | #line 267 "/src/igraph/src/io/dl-parser.y" |
1924 | 461 | {} |
1925 | 461 | #line 1926 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1926 | 461 | break; |
1927 | | |
1928 | 688 | case 58: |
1929 | 688 | #line 269 "/src/igraph/src/io/dl-parser.y" |
1930 | 688 | { |
1931 | 688 | IGRAPH_YY_CHECK(igraph_i_parse_integer(igraph_dl_yyget_text(scanner), |
1932 | 688 | igraph_dl_yyget_leng(scanner), |
1933 | 688 | &context->from)); |
1934 | 680 | IGRAPH_YY_CHECK(igraph_i_dl_check_vid(context->from)); |
1935 | 680 | } |
1936 | 628 | #line 1937 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1937 | 628 | break; |
1938 | | |
1939 | 628 | case 59: |
1940 | 628 | #line 276 "/src/igraph/src/io/dl-parser.y" |
1941 | 628 | {} |
1942 | 628 | #line 1943 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1943 | 628 | break; |
1944 | | |
1945 | 1.52M | case 60: |
1946 | 1.52M | #line 276 "/src/igraph/src/io/dl-parser.y" |
1947 | 1.52M | { |
1948 | 1.52M | igraph_int_t to = (yyvsp[0].integer); |
1949 | 1.52M | IGRAPH_YY_CHECK(igraph_i_dl_check_vid(to)); |
1950 | 1.52M | IGRAPH_YY_CHECK(igraph_vector_int_push_back(&context->edges, |
1951 | 1.52M | context->from-1)); |
1952 | 1.52M | IGRAPH_YY_CHECK(igraph_vector_int_push_back(&context->edges, to-1)); |
1953 | 1.52M | } |
1954 | 1.52M | #line 1955 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1955 | 1.52M | break; |
1956 | | |
1957 | 1.52M | case 61: |
1958 | 230 | #line 284 "/src/igraph/src/io/dl-parser.y" |
1959 | 230 | {} |
1960 | 230 | #line 1961 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1961 | 230 | break; |
1962 | | |
1963 | 2.67k | case 62: |
1964 | 2.67k | #line 285 "/src/igraph/src/io/dl-parser.y" |
1965 | 2.67k | {} |
1966 | 2.67k | #line 1967 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1967 | 2.67k | break; |
1968 | | |
1969 | 2.67k | case 63: |
1970 | 2.67k | #line 288 "/src/igraph/src/io/dl-parser.y" |
1971 | 2.67k | { } |
1972 | 2.67k | #line 1973 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1973 | 2.67k | break; |
1974 | | |
1975 | 2.85k | case 64: |
1976 | 2.85k | #line 290 "/src/igraph/src/io/dl-parser.y" |
1977 | 2.85k | { |
1978 | 2.85k | context->from=(yyvsp[0].integer); |
1979 | 2.85k | } |
1980 | 2.85k | #line 1981 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1981 | 2.85k | break; |
1982 | | |
1983 | 3.30k | case 66: |
1984 | 3.30k | #line 294 "/src/igraph/src/io/dl-parser.y" |
1985 | 3.30k | { |
1986 | 3.30k | IGRAPH_YY_CHECK(igraph_vector_int_push_back(&context->edges, |
1987 | 3.30k | context->from)); |
1988 | 3.30k | IGRAPH_YY_CHECK(igraph_vector_int_push_back(&context->edges, (yyvsp[0].integer))); |
1989 | 3.30k | } |
1990 | 3.30k | #line 1991 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1991 | 3.30k | break; |
1992 | | |
1993 | | |
1994 | 3.30k | #line 1995 "/src/igraph/build/src/io/parsers/dl-parser.c" |
1995 | | |
1996 | 1.64M | default: break; |
1997 | 16.3M | } |
1998 | | /* User semantic actions sometimes alter yychar, and that requires |
1999 | | that yytoken be updated with the new translation. We take the |
2000 | | approach of translating immediately before every use of yytoken. |
2001 | | One alternative is translating here after every semantic action, |
2002 | | but that translation would be missed if the semantic action invokes |
2003 | | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
2004 | | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
2005 | | incorrect destructor might then be invoked immediately. In the |
2006 | | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
2007 | | to an incorrect destructor call or verbose syntax error message |
2008 | | before the lookahead is translated. */ |
2009 | 16.3M | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
2010 | | |
2011 | 16.3M | YYPOPSTACK (yylen); |
2012 | 16.3M | yylen = 0; |
2013 | 16.3M | YY_STACK_PRINT (yyss, yyssp); |
2014 | | |
2015 | 16.3M | *++yyvsp = yyval; |
2016 | 16.3M | *++yylsp = yyloc; |
2017 | | |
2018 | | /* Now 'shift' the result of the reduction. Determine what state |
2019 | | that goes to, based on the state we popped back to and the rule |
2020 | | number reduced by. */ |
2021 | 16.3M | { |
2022 | 16.3M | const int yylhs = yyr1[yyn] - YYNTOKENS; |
2023 | 16.3M | const int yyi = yypgoto[yylhs] + *yyssp; |
2024 | 16.3M | yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp |
2025 | 16.3M | ? yytable[yyi] |
2026 | 16.3M | : yydefgoto[yylhs]); |
2027 | 16.3M | } |
2028 | | |
2029 | 16.3M | goto yynewstate; |
2030 | | |
2031 | | |
2032 | | /*--------------------------------------. |
2033 | | | yyerrlab -- here on detecting error. | |
2034 | | `--------------------------------------*/ |
2035 | 844 | yyerrlab: |
2036 | | /* Make sure we have latest lookahead translation. See comments at |
2037 | | user semantic actions for why this is necessary. */ |
2038 | 844 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
2039 | | |
2040 | | /* If not already recovering from an error, report this error. */ |
2041 | 844 | if (!yyerrstatus) |
2042 | 844 | { |
2043 | 844 | ++yynerrs; |
2044 | | #if ! YYERROR_VERBOSE |
2045 | | yyerror (&yylloc, context, YY_("syntax error")); |
2046 | | #else |
2047 | 844 | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
2048 | 844 | yyssp, yytoken) |
2049 | 844 | { |
2050 | 844 | char const *yymsgp = YY_("syntax error"); |
2051 | 844 | int yysyntax_error_status; |
2052 | 844 | yysyntax_error_status = YYSYNTAX_ERROR; |
2053 | 844 | if (yysyntax_error_status == 0) |
2054 | 844 | yymsgp = yymsg; |
2055 | 0 | else if (yysyntax_error_status == 1) |
2056 | 0 | { |
2057 | 0 | if (yymsg != yymsgbuf) |
2058 | 0 | YYSTACK_FREE (yymsg); |
2059 | 0 | yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); |
2060 | 0 | if (!yymsg) |
2061 | 0 | { |
2062 | 0 | yymsg = yymsgbuf; |
2063 | 0 | yymsg_alloc = sizeof yymsgbuf; |
2064 | 0 | yysyntax_error_status = 2; |
2065 | 0 | } |
2066 | 0 | else |
2067 | 0 | { |
2068 | 0 | yysyntax_error_status = YYSYNTAX_ERROR; |
2069 | 0 | yymsgp = yymsg; |
2070 | 0 | } |
2071 | 0 | } |
2072 | 844 | yyerror (&yylloc, context, yymsgp); |
2073 | 844 | if (yysyntax_error_status == 2) |
2074 | 0 | goto yyexhaustedlab; |
2075 | 844 | } |
2076 | 844 | # undef YYSYNTAX_ERROR |
2077 | 844 | #endif |
2078 | 844 | } |
2079 | | |
2080 | 844 | yyerror_range[1] = yylloc; |
2081 | | |
2082 | 844 | if (yyerrstatus == 3) |
2083 | 0 | { |
2084 | | /* If just tried and failed to reuse lookahead token after an |
2085 | | error, discard it. */ |
2086 | |
|
2087 | 0 | if (yychar <= YYEOF) |
2088 | 0 | { |
2089 | | /* Return failure if at end of input. */ |
2090 | 0 | if (yychar == YYEOF) |
2091 | 0 | YYABORT; |
2092 | 0 | } |
2093 | 0 | else |
2094 | 0 | { |
2095 | 0 | yydestruct ("Error: discarding", |
2096 | 0 | yytoken, &yylval, &yylloc, context); |
2097 | 0 | yychar = YYEMPTY; |
2098 | 0 | } |
2099 | 0 | } |
2100 | | |
2101 | | /* Else will try to reuse lookahead token after shifting the error |
2102 | | token. */ |
2103 | 844 | goto yyerrlab1; |
2104 | | |
2105 | | |
2106 | | /*---------------------------------------------------. |
2107 | | | yyerrorlab -- error raised explicitly by YYERROR. | |
2108 | | `---------------------------------------------------*/ |
2109 | 844 | yyerrorlab: |
2110 | | /* Pacify compilers when the user code never invokes YYERROR and the |
2111 | | label yyerrorlab therefore never appears in user code. */ |
2112 | 0 | if (0) |
2113 | 0 | YYERROR; |
2114 | | |
2115 | | /* Do not reclaim the symbols of the rule whose action triggered |
2116 | | this YYERROR. */ |
2117 | 0 | YYPOPSTACK (yylen); |
2118 | 0 | yylen = 0; |
2119 | 0 | YY_STACK_PRINT (yyss, yyssp); |
2120 | 0 | yystate = *yyssp; |
2121 | 0 | goto yyerrlab1; |
2122 | | |
2123 | | |
2124 | | /*-------------------------------------------------------------. |
2125 | | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
2126 | | `-------------------------------------------------------------*/ |
2127 | 844 | yyerrlab1: |
2128 | 844 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
2129 | | |
2130 | 844 | for (;;) |
2131 | 8.16k | { |
2132 | 8.16k | yyn = yypact[yystate]; |
2133 | 8.16k | if (!yypact_value_is_default (yyn)) |
2134 | 7.14k | { |
2135 | 7.14k | yyn += YYTERROR; |
2136 | 7.14k | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
2137 | 0 | { |
2138 | 0 | yyn = yytable[yyn]; |
2139 | 0 | if (0 < yyn) |
2140 | 0 | break; |
2141 | 0 | } |
2142 | 7.14k | } |
2143 | | |
2144 | | /* Pop the current state because it cannot handle the error token. */ |
2145 | 8.16k | if (yyssp == yyss) |
2146 | 844 | YYABORT; |
2147 | | |
2148 | 7.32k | yyerror_range[1] = *yylsp; |
2149 | 7.32k | yydestruct ("Error: popping", |
2150 | 7.32k | yystos[yystate], yyvsp, yylsp, context); |
2151 | 7.32k | YYPOPSTACK (1); |
2152 | 7.32k | yystate = *yyssp; |
2153 | 7.32k | YY_STACK_PRINT (yyss, yyssp); |
2154 | 7.32k | } |
2155 | | |
2156 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
2157 | 0 | *++yyvsp = yylval; |
2158 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
2159 | |
|
2160 | 0 | yyerror_range[2] = yylloc; |
2161 | | /* Using YYLLOC is tempting, but would change the location of |
2162 | | the lookahead. YYLOC is available though. */ |
2163 | 0 | YYLLOC_DEFAULT (yyloc, yyerror_range, 2); |
2164 | 0 | *++yylsp = yyloc; |
2165 | | |
2166 | | /* Shift the error token. */ |
2167 | 0 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
2168 | |
|
2169 | 0 | yystate = yyn; |
2170 | 0 | goto yynewstate; |
2171 | | |
2172 | | |
2173 | | /*-------------------------------------. |
2174 | | | yyacceptlab -- YYACCEPT comes here. | |
2175 | | `-------------------------------------*/ |
2176 | 845 | yyacceptlab: |
2177 | 845 | yyresult = 0; |
2178 | 845 | goto yyreturn; |
2179 | | |
2180 | | |
2181 | | /*-----------------------------------. |
2182 | | | yyabortlab -- YYABORT comes here. | |
2183 | | `-----------------------------------*/ |
2184 | 1.53k | yyabortlab: |
2185 | 1.53k | yyresult = 1; |
2186 | 1.53k | goto yyreturn; |
2187 | | |
2188 | | |
2189 | 0 | #if !defined yyoverflow || YYERROR_VERBOSE |
2190 | | /*-------------------------------------------------. |
2191 | | | yyexhaustedlab -- memory exhaustion comes here. | |
2192 | | `-------------------------------------------------*/ |
2193 | 0 | yyexhaustedlab: |
2194 | 0 | yyerror (&yylloc, context, YY_("memory exhausted")); |
2195 | 0 | yyresult = 2; |
2196 | | /* Fall through. */ |
2197 | 0 | #endif |
2198 | | |
2199 | | |
2200 | | /*-----------------------------------------------------. |
2201 | | | yyreturn -- parsing is finished, return the result. | |
2202 | | `-----------------------------------------------------*/ |
2203 | 2.38k | yyreturn: |
2204 | 2.38k | if (yychar != YYEMPTY) |
2205 | 844 | { |
2206 | | /* Make sure we have latest lookahead translation. See comments at |
2207 | | user semantic actions for why this is necessary. */ |
2208 | 844 | yytoken = YYTRANSLATE (yychar); |
2209 | 844 | yydestruct ("Cleanup: discarding lookahead", |
2210 | 844 | yytoken, &yylval, &yylloc, context); |
2211 | 844 | } |
2212 | | /* Do not reclaim the symbols of the rule whose action triggered |
2213 | | this YYABORT or YYACCEPT. */ |
2214 | 2.38k | YYPOPSTACK (yylen); |
2215 | 2.38k | YY_STACK_PRINT (yyss, yyssp); |
2216 | 9.67k | while (yyssp != yyss) |
2217 | 7.28k | { |
2218 | 7.28k | yydestruct ("Cleanup: popping", |
2219 | 7.28k | yystos[+*yyssp], yyvsp, yylsp, context); |
2220 | 7.28k | YYPOPSTACK (1); |
2221 | 7.28k | } |
2222 | 2.38k | #ifndef yyoverflow |
2223 | 2.38k | if (yyss != yyssa) |
2224 | 0 | YYSTACK_FREE (yyss); |
2225 | 2.38k | #endif |
2226 | 2.38k | #if YYERROR_VERBOSE |
2227 | 2.38k | if (yymsg != yymsgbuf) |
2228 | 0 | YYSTACK_FREE (yymsg); |
2229 | 2.38k | #endif |
2230 | 2.38k | return yyresult; |
2231 | 0 | } |
2232 | | #line 300 "/src/igraph/src/io/dl-parser.y" |
2233 | | |
2234 | | |
2235 | | int igraph_dl_yyerror(YYLTYPE* locp, |
2236 | | igraph_i_dl_parsedata_t* context, |
2237 | 1.48k | const char *s) { |
2238 | 1.48k | snprintf(context->errmsg, sizeof(context->errmsg)/sizeof(char)-1, |
2239 | 1.48k | "Parse error in DL file, line %i (%s)", |
2240 | 1.48k | locp->first_line, s); |
2241 | 1.48k | return 0; |
2242 | 1.48k | } |
2243 | | |
2244 | | static igraph_error_t igraph_i_dl_add_str(char *newstr, yy_size_t length, |
2245 | 1.62M | igraph_i_dl_parsedata_t *context) { |
2246 | 1.62M | IGRAPH_CHECK(igraph_strvector_push_back_len(&context->labels, newstr, length)); |
2247 | 1.62M | return IGRAPH_SUCCESS; |
2248 | 1.62M | } |
2249 | | |
2250 | | static igraph_error_t igraph_i_dl_add_edge(igraph_int_t from, igraph_int_t to, |
2251 | 2.45M | igraph_i_dl_parsedata_t *context) { |
2252 | | //IGRAPH_CHECK(igraph_i_dl_check_vid(from+1)); |
2253 | | //IGRAPH_CHECK(igraph_i_dl_check_vid(to+1)); |
2254 | 2.45M | IGRAPH_CHECK(igraph_vector_int_push_back(&context->edges, from)); |
2255 | 2.45M | IGRAPH_CHECK(igraph_vector_int_push_back(&context->edges, to)); |
2256 | 2.45M | return IGRAPH_SUCCESS; |
2257 | 2.45M | } |
2258 | | |
2259 | | static igraph_error_t igraph_i_dl_add_edge_w(igraph_int_t from, igraph_int_t to, |
2260 | | igraph_real_t weight, |
2261 | 37.0k | igraph_i_dl_parsedata_t *context) { |
2262 | 37.0k | igraph_int_t n=igraph_vector_size(&context->weights); |
2263 | 37.0k | igraph_int_t n2=igraph_vector_int_size(&context->edges)/2; |
2264 | 37.0k | if (n != n2) { |
2265 | 35.3k | IGRAPH_CHECK(igraph_vector_resize(&context->weights, n2)); |
2266 | 2.43M | for (; n<n2; n++) { |
2267 | 2.40M | VECTOR(context->weights)[n]=IGRAPH_NAN; |
2268 | 2.40M | } |
2269 | 35.3k | } |
2270 | 37.0k | IGRAPH_CHECK(igraph_i_dl_add_edge(from, to, context)); |
2271 | 37.0k | IGRAPH_CHECK(igraph_vector_push_back(&context->weights, weight)); |
2272 | 37.0k | return IGRAPH_SUCCESS; |
2273 | 37.0k | } |
2274 | | |
2275 | | /* Raise an error if the vertex index is invalid in the DL file. |
2276 | | * DL files use 1-based vertex indices. */ |
2277 | 6.42M | static igraph_error_t igraph_i_dl_check_vid(igraph_int_t dl_vid) { |
2278 | 6.42M | if (dl_vid < 1) { |
2279 | 332 | IGRAPH_ERRORF("Invalid vertex index in DL file: %" IGRAPH_PRId ".", |
2280 | 332 | IGRAPH_EINVAL, dl_vid); |
2281 | 332 | } |
2282 | 6.42M | if (dl_vid > IGRAPH_DL_MAX_VERTEX_COUNT) { |
2283 | 247 | IGRAPH_ERRORF("Vertex index too large in DL file: %" IGRAPH_PRId ".", |
2284 | 247 | IGRAPH_EINVAL, dl_vid); |
2285 | 247 | } |
2286 | 6.42M | return IGRAPH_SUCCESS; |
2287 | 6.42M | } |