Coverage Report

Created: 2026-11-11 06:46

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/igraph/build/src/io/parsers/lgl-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_lgl_yyparse
68
15.8M
#define yylex           igraph_lgl_yylex
69
222
#define yyerror         igraph_lgl_yyerror
70
#define yydebug         igraph_lgl_yydebug
71
10.4k
#define yynerrs         igraph_lgl_yynerrs
72
73
/* First part of user prologue.  */
74
#line 23 "/src/igraph/src/io/lgl-parser.y"
75
76
77
/*
78
   igraph library.
79
   Copyright (C) 2006-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 "igraph_types.h"
100
#include "igraph_memory.h"
101
#include "igraph_error.h"
102
103
#include "io/lgl-header.h"
104
#include "io/parsers/lgl-parser.h"
105
#include "io/parsers/lgl-lexer.h"
106
#include "io/parse_utils.h"
107
#include "internal/hacks.h"
108
109
#include <stdio.h>
110
#include <string.h>
111
112
int igraph_lgl_yyerror(YYLTYPE* locp, igraph_i_lgl_parsedata_t *context,
113
                       const char *s);
114
115
15.8M
#define scanner context->scanner
116
117
#line 118 "/src/igraph/build/src/io/parsers/lgl-parser.c"
118
119
# ifndef YY_CAST
120
#  ifdef __cplusplus
121
#   define YY_CAST(Type, Val) static_cast<Type> (Val)
122
#   define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
123
#  else
124
38.9M
#   define YY_CAST(Type, Val) ((Type) (Val))
125
#   define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
126
#  endif
127
# endif
128
# ifndef YY_NULLPTR
129
#  if defined __cplusplus
130
#   if 201103L <= __cplusplus
131
#    define YY_NULLPTR nullptr
132
#   else
133
#    define YY_NULLPTR 0
134
#   endif
135
#  else
136
786
#   define YY_NULLPTR ((void*)0)
137
#  endif
138
# endif
139
140
/* Enabling verbose error messages.  */
141
#ifdef YYERROR_VERBOSE
142
# undef YYERROR_VERBOSE
143
# define YYERROR_VERBOSE 1
144
#else
145
# define YYERROR_VERBOSE 1
146
#endif
147
148
/* Use api.header.include to #include this header
149
   instead of duplicating it here.  */
150
#ifndef YY_IGRAPH_LGL_YY_SRC_IGRAPH_BUILD_SRC_IO_PARSERS_LGL_PARSER_H_INCLUDED
151
# define YY_IGRAPH_LGL_YY_SRC_IGRAPH_BUILD_SRC_IO_PARSERS_LGL_PARSER_H_INCLUDED
152
/* Debug traces.  */
153
#ifndef YYDEBUG
154
# define YYDEBUG 0
155
#endif
156
#if YYDEBUG
157
extern int igraph_lgl_yydebug;
158
#endif
159
160
/* Token type.  */
161
#ifndef YYTOKENTYPE
162
# define YYTOKENTYPE
163
  enum yytokentype
164
  {
165
    END = 0,
166
    ALNUM = 258,
167
    NEWLINE = 259,
168
    HASH = 260,
169
    ERROR = 261
170
  };
171
#endif
172
173
/* Value type.  */
174
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
175
union YYSTYPE
176
{
177
#line 76 "/src/igraph/src/io/lgl-parser.y"
178
179
  igraph_int_t edgenum;
180
  igraph_real_t weightnum;
181
182
#line 183 "/src/igraph/build/src/io/parsers/lgl-parser.c"
183
184
};
185
typedef union YYSTYPE YYSTYPE;
186
# define YYSTYPE_IS_TRIVIAL 1
187
# define YYSTYPE_IS_DECLARED 1
188
#endif
189
190
/* Location type.  */
191
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
192
typedef struct YYLTYPE YYLTYPE;
193
struct YYLTYPE
194
{
195
  int first_line;
196
  int first_column;
197
  int last_line;
198
  int last_column;
199
};
200
# define YYLTYPE_IS_DECLARED 1
201
# define YYLTYPE_IS_TRIVIAL 1
202
#endif
203
204
205
206
int igraph_lgl_yyparse (igraph_i_lgl_parsedata_t* context);
207
208
#endif /* !YY_IGRAPH_LGL_YY_SRC_IGRAPH_BUILD_SRC_IO_PARSERS_LGL_PARSER_H_INCLUDED  */
209
210
211
212
#ifdef short
213
# undef short
214
#endif
215
216
/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
217
   <limits.h> and (if available) <stdint.h> are included
218
   so that the code can choose integer types of a good width.  */
219
220
#ifndef __PTRDIFF_MAX__
221
# include <limits.h> /* INFRINGES ON USER NAME SPACE */
222
# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
223
#  include <stdint.h> /* INFRINGES ON USER NAME SPACE */
224
#  define YY_STDINT_H
225
# endif
226
#endif
227
228
/* Narrow types that promote to a signed type and that can represent a
229
   signed or unsigned integer of at least N bits.  In tables they can
230
   save space and decrease cache pressure.  Promoting to a signed type
231
   helps avoid bugs in integer arithmetic.  */
232
233
#ifdef __INT_LEAST8_MAX__
234
typedef __INT_LEAST8_TYPE__ yytype_int8;
235
#elif defined YY_STDINT_H
236
typedef int_least8_t yytype_int8;
237
#else
238
typedef signed char yytype_int8;
239
#endif
240
241
#ifdef __INT_LEAST16_MAX__
242
typedef __INT_LEAST16_TYPE__ yytype_int16;
243
#elif defined YY_STDINT_H
244
typedef int_least16_t yytype_int16;
245
#else
246
typedef short yytype_int16;
247
#endif
248
249
#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
250
typedef __UINT_LEAST8_TYPE__ yytype_uint8;
251
#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
252
       && UINT_LEAST8_MAX <= INT_MAX)
253
typedef uint_least8_t yytype_uint8;
254
#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
255
typedef unsigned char yytype_uint8;
256
#else
257
typedef short yytype_uint8;
258
#endif
259
260
#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
261
typedef __UINT_LEAST16_TYPE__ yytype_uint16;
262
#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
263
       && UINT_LEAST16_MAX <= INT_MAX)
264
typedef uint_least16_t yytype_uint16;
265
#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
266
typedef unsigned short yytype_uint16;
267
#else
268
typedef int yytype_uint16;
269
#endif
270
271
#ifndef YYPTRDIFF_T
272
# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
273
22.5k
#  define YYPTRDIFF_T __PTRDIFF_TYPE__
274
#  define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
275
# elif defined PTRDIFF_MAX
276
#  ifndef ptrdiff_t
277
#   include <stddef.h> /* INFRINGES ON USER NAME SPACE */
278
#  endif
279
#  define YYPTRDIFF_T ptrdiff_t
280
#  define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
281
# else
282
#  define YYPTRDIFF_T long
283
#  define YYPTRDIFF_MAXIMUM LONG_MAX
284
# endif
285
#endif
286
287
#ifndef YYSIZE_T
288
# ifdef __SIZE_TYPE__
289
#  define YYSIZE_T __SIZE_TYPE__
290
# elif defined size_t
291
#  define YYSIZE_T size_t
292
# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
293
#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
294
#  define YYSIZE_T size_t
295
# else
296
#  define YYSIZE_T unsigned
297
# endif
298
#endif
299
300
#define YYSIZE_MAXIMUM                                  \
301
609
  YY_CAST (YYPTRDIFF_T,                                 \
302
           (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1)  \
303
            ? YYPTRDIFF_MAXIMUM                         \
304
            : YY_CAST (YYSIZE_T, -1)))
305
306
0
#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
307
308
/* Stored state numbers (used for stacks). */
309
typedef yytype_int8 yy_state_t;
310
311
/* State numbers in computations.  */
312
typedef int yy_state_fast_t;
313
314
#ifndef YY_
315
# if defined YYENABLE_NLS && YYENABLE_NLS
316
#  if ENABLE_NLS
317
#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
318
#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
319
#  endif
320
# endif
321
# ifndef YY_
322
177
#  define YY_(Msgid) Msgid
323
# endif
324
#endif
325
326
#ifndef YY_ATTRIBUTE_PURE
327
# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
328
#  define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
329
# else
330
#  define YY_ATTRIBUTE_PURE
331
# endif
332
#endif
333
334
#ifndef YY_ATTRIBUTE_UNUSED
335
# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
336
#  define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
337
# else
338
#  define YY_ATTRIBUTE_UNUSED
339
# endif
340
#endif
341
342
/* Suppress unused-variable warnings by "using" E.  */
343
#if ! defined lint || defined __GNUC__
344
82.8k
# define YYUSE(E) ((void) (E))
345
#else
346
# define YYUSE(E) /* empty */
347
#endif
348
349
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
350
/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
351
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
352
    _Pragma ("GCC diagnostic push")                                     \
353
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
354
    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
355
# define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
356
    _Pragma ("GCC diagnostic pop")
357
#else
358
20.4k
# define YY_INITIAL_VALUE(Value) Value
359
#endif
360
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
361
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
362
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
363
#endif
364
#ifndef YY_INITIAL_VALUE
365
# define YY_INITIAL_VALUE(Value) /* Nothing. */
366
#endif
367
368
#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
369
# define YY_IGNORE_USELESS_CAST_BEGIN                          \
370
    _Pragma ("GCC diagnostic push")                            \
371
    _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
372
# define YY_IGNORE_USELESS_CAST_END            \
373
    _Pragma ("GCC diagnostic pop")
374
#endif
375
#ifndef YY_IGNORE_USELESS_CAST_BEGIN
376
# define YY_IGNORE_USELESS_CAST_BEGIN
377
# define YY_IGNORE_USELESS_CAST_END
378
#endif
379
380
381
38.9M
#define YY_ASSERT(E) ((void) (0 && (E)))
382
383
#if ! defined yyoverflow || YYERROR_VERBOSE
384
385
/* The parser invokes alloca or malloc; define the necessary symbols.  */
386
387
# ifdef YYSTACK_USE_ALLOCA
388
#  if YYSTACK_USE_ALLOCA
389
#   ifdef __GNUC__
390
#    define YYSTACK_ALLOC __builtin_alloca
391
#   elif defined __BUILTIN_VA_ARG_INCR
392
#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
393
#   elif defined _AIX
394
#    define YYSTACK_ALLOC __alloca
395
#   elif defined _MSC_VER
396
#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
397
#    define alloca _alloca
398
#   else
399
#    define YYSTACK_ALLOC alloca
400
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
401
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
402
      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
403
#     ifndef EXIT_SUCCESS
404
#      define EXIT_SUCCESS 0
405
#     endif
406
#    endif
407
#   endif
408
#  endif
409
# endif
410
411
# ifdef YYSTACK_ALLOC
412
   /* Pacify GCC's 'empty if-body' warning.  */
413
#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
414
#  ifndef YYSTACK_ALLOC_MAXIMUM
415
    /* The OS might guarantee only one guard page at the bottom of the stack,
416
       and a page size can be as small as 4096 bytes.  So we cannot safely
417
       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
418
       to allow for a few compiler-allocated temporary stack slots.  */
419
#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
420
#  endif
421
# else
422
#  define YYSTACK_ALLOC YYMALLOC
423
0
#  define YYSTACK_FREE YYFREE
424
#  ifndef YYSTACK_ALLOC_MAXIMUM
425
609
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
426
#  endif
427
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
428
       && ! ((defined YYMALLOC || defined malloc) \
429
             && (defined YYFREE || defined free)))
430
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
431
#   ifndef EXIT_SUCCESS
432
#    define EXIT_SUCCESS 0
433
#   endif
434
#  endif
435
#  ifndef YYMALLOC
436
#   define YYMALLOC malloc
437
#   if ! defined malloc && ! defined EXIT_SUCCESS
438
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
439
#   endif
440
#  endif
441
#  ifndef YYFREE
442
0
#   define YYFREE free
443
#   if ! defined free && ! defined EXIT_SUCCESS
444
void free (void *); /* INFRINGES ON USER NAME SPACE */
445
#   endif
446
#  endif
447
# endif
448
#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
449
450
451
#if (! defined yyoverflow \
452
     && (! defined __cplusplus \
453
         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
454
             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
455
456
/* A type that is properly aligned for any stack member.  */
457
union yyalloc
458
{
459
  yy_state_t yyss_alloc;
460
  YYSTYPE yyvs_alloc;
461
  YYLTYPE yyls_alloc;
462
};
463
464
/* The size of the maximum gap between one aligned stack and the next.  */
465
0
# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
466
467
/* The size of an array large to enough to hold all stacks, each with
468
   N elements.  */
469
# define YYSTACK_BYTES(N) \
470
     ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
471
             + YYSIZEOF (YYLTYPE)) \
472
      + 2 * YYSTACK_GAP_MAXIMUM)
473
474
# define YYCOPY_NEEDED 1
475
476
/* Relocate STACK from its old location to the new one.  The
477
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
478
   elements in the stack, and YYPTR gives the new location of the
479
   stack.  Advance YYPTR to a properly aligned location for the next
480
   stack.  */
481
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
482
0
    do                                                                  \
483
0
      {                                                                 \
484
0
        YYPTRDIFF_T yynewbytes;                                         \
485
0
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
486
0
        Stack = &yyptr->Stack_alloc;                                    \
487
0
        yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
488
0
        yyptr += yynewbytes / YYSIZEOF (*yyptr);                        \
489
0
      }                                                                 \
490
0
    while (0)
491
492
#endif
493
494
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
495
/* Copy COUNT objects from SRC to DST.  The source and destination do
496
   not overlap.  */
497
# ifndef YYCOPY
498
#  if defined __GNUC__ && 1 < __GNUC__
499
#   define YYCOPY(Dst, Src, Count) \
500
0
      __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
501
#  else
502
#   define YYCOPY(Dst, Src, Count)              \
503
      do                                        \
504
        {                                       \
505
          YYPTRDIFF_T yyi;                      \
506
          for (yyi = 0; yyi < (Count); yyi++)   \
507
            (Dst)[yyi] = (Src)[yyi];            \
508
        }                                       \
509
      while (0)
510
#  endif
511
# endif
512
#endif /* !YYCOPY_NEEDED */
513
514
/* YYFINAL -- State number of the termination state.  */
515
38.9M
#define YYFINAL  2
516
/* YYLAST -- Last index in YYTABLE.  */
517
60.4M
#define YYLAST   10
518
519
/* YYNTOKENS -- Number of terminals.  */
520
23.0M
#define YYNTOKENS  7
521
/* YYNNTS -- Number of nonterminals.  */
522
#define YYNNTS  8
523
/* YYNRULES -- Number of rules.  */
524
#define YYNRULES  12
525
/* YYNSTATES -- Number of states.  */
526
#define YYNSTATES  17
527
528
0
#define YYUNDEFTOK  2
529
15.8M
#define YYMAXUTOK   261
530
531
532
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
533
   as returned by yylex, with out-of-bounds checking.  */
534
#define YYTRANSLATE(YYX)                                                \
535
15.8M
  (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
536
537
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
538
   as returned by yylex.  */
539
static const yytype_int8 yytranslate[] =
540
{
541
       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
542
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
543
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
544
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
545
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
546
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
547
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
548
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
549
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
550
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
551
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
552
       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
553
       2,     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,     1,     2,     3,     4,
567
       5,     6
568
};
569
570
#if YYDEBUG
571
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
572
static const yytype_int8 yyrline[] =
573
{
574
       0,    92,    92,    93,    94,    97,    99,   101,   101,   103,
575
     108,   117,   127
576
};
577
#endif
578
579
#if YYDEBUG || YYERROR_VERBOSE || 1
580
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
581
   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
582
static const char *const yytname[] =
583
{
584
  "\"end of file\"", "error", "$undefined", "\"alphanumeric\"",
585
  "\"end of line\"", "\"#\"", "ERROR", "$accept", "input", "vertex",
586
  "vertexdef", "edges", "edge", "edgeid", "weight", YY_NULLPTR
587
};
588
#endif
589
590
# ifdef YYPRINT
591
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
592
   (internal) symbol number NUM (which must be that of a token).  */
593
static const yytype_int16 yytoknum[] =
594
{
595
       0,   256,   257,   258,   259,   260,   261
596
};
597
# endif
598
599
38.9M
#define YYPACT_NINF (-3)
600
601
#define yypact_value_is_default(Yyn) \
602
38.9M
  ((Yyn) == YYPACT_NINF)
603
604
#define YYTABLE_NINF (-1)
605
606
#define yytable_value_is_error(Yyn) \
607
0
  0
608
609
  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
610
     STATE-NUM.  */
611
static const yytype_int8 yypact[] =
612
{
613
      -3,     0,    -3,    -3,     3,    -3,    -3,    -3,    -1,     3,
614
      -3,    -3,    -2,    -3,    -3,     4,    -3
615
};
616
617
  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
618
     Performed when YYTABLE does not specify something else to do.  Zero
619
     means the default is an error.  */
620
static const yytype_int8 yydefact[] =
621
{
622
       2,     0,     1,     3,     0,     4,     7,    11,     0,     5,
623
       6,     8,     0,    12,     9,     0,    10
624
};
625
626
  /* YYPGOTO[NTERM-NUM].  */
627
static const yytype_int8 yypgoto[] =
628
{
629
      -3,    -3,    -3,    -3,    -3,    -3,     1,    -3
630
};
631
632
  /* YYDEFGOTO[NTERM-NUM].  */
633
static const yytype_int8 yydefgoto[] =
634
{
635
      -1,     1,     5,     6,     9,    11,     8,    15
636
};
637
638
  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
639
     positive, shift that token.  If negative, reduce the rule whose
640
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
641
static const yytype_int8 yytable[] =
642
{
643
       2,    13,    14,    10,     3,     4,     7,     0,    16,     0,
644
      12
645
};
646
647
static const yytype_int8 yycheck[] =
648
{
649
       0,     3,     4,     4,     4,     5,     3,    -1,     4,    -1,
650
       9
651
};
652
653
  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
654
     symbol of state STATE-NUM.  */
655
static const yytype_int8 yystos[] =
656
{
657
       0,     8,     0,     4,     5,     9,    10,     3,    13,    11,
658
       4,    12,    13,     3,     4,    14,     4
659
};
660
661
  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
662
static const yytype_int8 yyr1[] =
663
{
664
       0,     7,     8,     8,     8,     9,    10,    11,    11,    12,
665
      12,    13,    14
666
};
667
668
  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
669
static const yytype_int8 yyr2[] =
670
{
671
       0,     2,     0,     2,     2,     2,     3,     0,     2,     2,
672
       3,     1,     1
673
};
674
675
676
#define yyerrok         (yyerrstatus = 0)
677
#define yyclearin       (yychar = YYEMPTY)
678
31.7M
#define YYEMPTY         (-2)
679
15.9M
#define YYEOF           0
680
681
10.0k
#define YYACCEPT        goto yyacceptlab
682
222
#define YYABORT         goto yyabortlab
683
0
#define YYERROR         goto yyerrorlab
684
685
686
#define YYRECOVERING()  (!!yyerrstatus)
687
688
#define YYBACKUP(Token, Value)                                    \
689
  do                                                              \
690
    if (yychar == YYEMPTY)                                        \
691
      {                                                           \
692
        yychar = (Token);                                         \
693
        yylval = (Value);                                         \
694
        YYPOPSTACK (yylen);                                       \
695
        yystate = *yyssp;                                         \
696
        goto yybackup;                                            \
697
      }                                                           \
698
    else                                                          \
699
      {                                                           \
700
        yyerror (&yylloc, context, YY_("syntax error: cannot back up")); \
701
        YYERROR;                                                  \
702
      }                                                           \
703
  while (0)
704
705
/* Error token number */
706
2.15k
#define YYTERROR        1
707
#define YYERRCODE       256
708
709
710
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
711
   If N is 0, then set CURRENT to the empty location which ends
712
   the previous symbol: RHS[0] (always defined).  */
713
714
#ifndef YYLLOC_DEFAULT
715
# define YYLLOC_DEFAULT(Current, Rhs, N)                                \
716
23.0M
    do                                                                  \
717
23.0M
      if (N)                                                            \
718
23.0M
        {                                                               \
719
22.9M
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
720
22.9M
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
721
22.9M
          (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
722
22.9M
          (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
723
22.9M
        }                                                               \
724
23.0M
      else                                                              \
725
23.0M
        {                                                               \
726
61.3k
          (Current).first_line   = (Current).last_line   =              \
727
61.3k
            YYRHSLOC (Rhs, 0).last_line;                                \
728
61.3k
          (Current).first_column = (Current).last_column =              \
729
61.3k
            YYRHSLOC (Rhs, 0).last_column;                              \
730
61.3k
        }                                                               \
731
23.0M
    while (0)
732
#endif
733
734
92.0M
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
735
736
737
/* Enable debugging if requested.  */
738
#if YYDEBUG
739
740
# ifndef YYFPRINTF
741
#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
742
#  define YYFPRINTF fprintf
743
# endif
744
745
# define YYDPRINTF(Args)                        \
746
do {                                            \
747
  if (yydebug)                                  \
748
    YYFPRINTF Args;                             \
749
} while (0)
750
751
752
/* YY_LOCATION_PRINT -- Print the location on the stream.
753
   This macro was not mandated originally: define only if we know
754
   we won't break user code: when these are the locations we know.  */
755
756
#ifndef YY_LOCATION_PRINT
757
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
758
759
/* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
760
761
YY_ATTRIBUTE_UNUSED
762
static int
763
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
764
{
765
  int res = 0;
766
  int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
767
  if (0 <= yylocp->first_line)
768
    {
769
      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
770
      if (0 <= yylocp->first_column)
771
        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
772
    }
773
  if (0 <= yylocp->last_line)
774
    {
775
      if (yylocp->first_line < yylocp->last_line)
776
        {
777
          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
778
          if (0 <= end_col)
779
            res += YYFPRINTF (yyo, ".%d", end_col);
780
        }
781
      else if (0 <= end_col && yylocp->first_column < end_col)
782
        res += YYFPRINTF (yyo, "-%d", end_col);
783
    }
784
  return res;
785
 }
786
787
#  define YY_LOCATION_PRINT(File, Loc)          \
788
  yy_location_print_ (File, &(Loc))
789
790
# else
791
#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
792
# endif
793
#endif
794
795
796
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
797
do {                                                                      \
798
  if (yydebug)                                                            \
799
    {                                                                     \
800
      YYFPRINTF (stderr, "%s ", Title);                                   \
801
      yy_symbol_print (stderr,                                            \
802
                  Type, Value, Location, context); \
803
      YYFPRINTF (stderr, "\n");                                           \
804
    }                                                                     \
805
} while (0)
806
807
808
/*-----------------------------------.
809
| Print this symbol's value on YYO.  |
810
`-----------------------------------*/
811
812
static void
813
yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, igraph_i_lgl_parsedata_t* context)
814
{
815
  FILE *yyoutput = yyo;
816
  YYUSE (yyoutput);
817
  YYUSE (yylocationp);
818
  YYUSE (context);
819
  if (!yyvaluep)
820
    return;
821
# ifdef YYPRINT
822
  if (yytype < YYNTOKENS)
823
    YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
824
# endif
825
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
826
  YYUSE (yytype);
827
  YY_IGNORE_MAYBE_UNINITIALIZED_END
828
}
829
830
831
/*---------------------------.
832
| Print this symbol on YYO.  |
833
`---------------------------*/
834
835
static void
836
yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, igraph_i_lgl_parsedata_t* context)
837
{
838
  YYFPRINTF (yyo, "%s %s (",
839
             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
840
841
  YY_LOCATION_PRINT (yyo, *yylocationp);
842
  YYFPRINTF (yyo, ": ");
843
  yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp, context);
844
  YYFPRINTF (yyo, ")");
845
}
846
847
/*------------------------------------------------------------------.
848
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
849
| TOP (included).                                                   |
850
`------------------------------------------------------------------*/
851
852
static void
853
yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
854
{
855
  YYFPRINTF (stderr, "Stack now");
856
  for (; yybottom <= yytop; yybottom++)
857
    {
858
      int yybot = *yybottom;
859
      YYFPRINTF (stderr, " %d", yybot);
860
    }
861
  YYFPRINTF (stderr, "\n");
862
}
863
864
# define YY_STACK_PRINT(Bottom, Top)                            \
865
do {                                                            \
866
  if (yydebug)                                                  \
867
    yy_stack_print ((Bottom), (Top));                           \
868
} while (0)
869
870
871
/*------------------------------------------------.
872
| Report that the YYRULE is going to be reduced.  |
873
`------------------------------------------------*/
874
875
static void
876
yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, igraph_i_lgl_parsedata_t* context)
877
{
878
  int yylno = yyrline[yyrule];
879
  int yynrhs = yyr2[yyrule];
880
  int yyi;
881
  YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
882
             yyrule - 1, yylno);
883
  /* The symbols being reduced.  */
884
  for (yyi = 0; yyi < yynrhs; yyi++)
885
    {
886
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
887
      yy_symbol_print (stderr,
888
                       yystos[+yyssp[yyi + 1 - yynrhs]],
889
                       &yyvsp[(yyi + 1) - (yynrhs)]
890
                       , &(yylsp[(yyi + 1) - (yynrhs)])                       , context);
891
      YYFPRINTF (stderr, "\n");
892
    }
893
}
894
895
# define YY_REDUCE_PRINT(Rule)          \
896
do {                                    \
897
  if (yydebug)                          \
898
    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, context); \
899
} while (0)
900
901
/* Nonzero means print parse trace.  It is left uninitialized so that
902
   multiple parsers can coexist.  */
903
int yydebug;
904
#else /* !YYDEBUG */
905
# define YYDPRINTF(Args)
906
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
907
# define YY_STACK_PRINT(Bottom, Top)
908
# define YY_REDUCE_PRINT(Rule)
909
#endif /* !YYDEBUG */
910
911
912
/* YYINITDEPTH -- initial size of the parser's stacks.  */
913
#ifndef YYINITDEPTH
914
10.2k
# define YYINITDEPTH 200
915
#endif
916
917
/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
918
   if the built-in stack extension method is used).
919
920
   Do not make this value too large; the results are undefined if
921
   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
922
   evaluated with infinite-precision integer arithmetic.  */
923
924
#ifndef YYMAXDEPTH
925
0
# define YYMAXDEPTH 10000
926
#endif
927
928
929
#if YYERROR_VERBOSE
930
931
# ifndef yystrlen
932
#  if defined __GLIBC__ && defined _STRING_H
933
241
#   define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
934
#  else
935
/* Return the length of YYSTR.  */
936
static YYPTRDIFF_T
937
yystrlen (const char *yystr)
938
{
939
  YYPTRDIFF_T yylen;
940
  for (yylen = 0; yystr[yylen]; yylen++)
941
    continue;
942
  return yylen;
943
}
944
#  endif
945
# endif
946
947
# ifndef yystpcpy
948
#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
949
#   define yystpcpy stpcpy
950
#  else
951
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
952
   YYDEST.  */
953
static char *
954
yystpcpy (char *yydest, const char *yysrc)
955
64
{
956
64
  char *yyd = yydest;
957
64
  const char *yys = yysrc;
958
959
384
  while ((*yyd++ = *yys++) != '\0')
960
320
    continue;
961
962
64
  return yyd - 1;
963
64
}
964
#  endif
965
# endif
966
967
# ifndef yytnamerr
968
/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
969
   quotes and backslashes, so that it's suitable for yyerror.  The
970
   heuristic is that double-quoting is unnecessary unless the string
971
   contains an apostrophe, a comma, or backslash (other than
972
   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
973
   null, do not copy; instead, return the length of what the result
974
   would have been.  */
975
static YYPTRDIFF_T
976
yytnamerr (char *yyres, const char *yystr)
977
1.21k
{
978
1.21k
  if (*yystr == '"')
979
1.09k
    {
980
1.09k
      YYPTRDIFF_T yyn = 0;
981
1.09k
      char const *yyp = yystr;
982
983
1.09k
      for (;;)
984
10.6k
        switch (*++yyp)
985
10.6k
          {
986
0
          case '\'':
987
0
          case ',':
988
0
            goto do_not_strip_quotes;
989
990
0
          case '\\':
991
0
            if (*++yyp != '\\')
992
0
              goto do_not_strip_quotes;
993
0
            else
994
0
              goto append;
995
996
0
          append:
997
9.60k
          default:
998
9.60k
            if (yyres)
999
4.80k
              yyres[yyn] = *yyp;
1000
9.60k
            yyn++;
1001
9.60k
            break;
1002
1003
1.09k
          case '"':
1004
1.09k
            if (yyres)
1005
545
              yyres[yyn] = '\0';
1006
1.09k
            return yyn;
1007
10.6k
          }
1008
0
    do_not_strip_quotes: ;
1009
0
    }
1010
1011
128
  if (yyres)
1012
64
    return yystpcpy (yyres, yystr) - yyres;
1013
64
  else
1014
64
    return yystrlen (yystr);
1015
128
}
1016
# endif
1017
1018
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1019
   about the unexpected token YYTOKEN for the state stack whose top is
1020
   YYSSP.
1021
1022
   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1023
   not large enough to hold the message.  In that case, also set
1024
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1025
   required number of bytes is too large to store.  */
1026
static int
1027
yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
1028
                yy_state_t *yyssp, int yytoken)
1029
177
{
1030
177
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1031
  /* Internationalized format string. */
1032
177
  const char *yyformat = YY_NULLPTR;
1033
  /* Arguments of yyformat: reported tokens (one for the "unexpected",
1034
     one per "expected"). */
1035
177
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1036
  /* Actual size of YYARG. */
1037
177
  int yycount = 0;
1038
  /* Cumulated lengths of YYARG.  */
1039
177
  YYPTRDIFF_T yysize = 0;
1040
1041
  /* There are many possibilities here to consider:
1042
     - If this state is a consistent state with a default action, then
1043
       the only way this function was invoked is if the default action
1044
       is an error action.  In that case, don't check for expected
1045
       tokens because there are none.
1046
     - The only way there can be no lookahead present (in yychar) is if
1047
       this state is a consistent state with a default action.  Thus,
1048
       detecting the absence of a lookahead is sufficient to determine
1049
       that there is no unexpected or expected token to report.  In that
1050
       case, just report a simple "syntax error".
1051
     - Don't assume there isn't a lookahead just because this state is a
1052
       consistent state with a default action.  There might have been a
1053
       previous inconsistent state, consistent state with a non-default
1054
       action, or user semantic action that manipulated yychar.
1055
     - Of course, the expected token list depends on states to have
1056
       correct lookahead information, and it depends on the parser not
1057
       to perform extra reductions after fetching a lookahead from the
1058
       scanner and before detecting a syntax error.  Thus, state merging
1059
       (from LALR or IELR) and default reductions corrupt the expected
1060
       token list.  However, the list is correct for canonical LR with
1061
       one exception: it will still contain any token that will not be
1062
       accepted due to an error action in a later state.
1063
  */
1064
177
  if (yytoken != YYEMPTY)
1065
177
    {
1066
177
      int yyn = yypact[+*yyssp];
1067
177
      YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
1068
177
      yysize = yysize0;
1069
177
      yyarg[yycount++] = yytname[yytoken];
1070
177
      if (!yypact_value_is_default (yyn))
1071
177
        {
1072
          /* Start YYX at -YYN if negative to avoid negative indexes in
1073
             YYCHECK.  In other words, skip the first -YYN actions for
1074
             this state because they are default actions.  */
1075
177
          int yyxbegin = yyn < 0 ? -yyn : 0;
1076
          /* Stay within bounds of both yycheck and yytname.  */
1077
177
          int yychecklim = YYLAST - yyn + 1;
1078
177
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1079
177
          int yyx;
1080
1081
1.35k
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1082
1.17k
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1083
0
                && !yytable_value_is_error (yytable[yyx + yyn]))
1084
432
              {
1085
432
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1086
0
                  {
1087
0
                    yycount = 1;
1088
0
                    yysize = yysize0;
1089
0
                    break;
1090
0
                  }
1091
432
                yyarg[yycount++] = yytname[yyx];
1092
432
                {
1093
432
                  YYPTRDIFF_T yysize1
1094
432
                    = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1095
432
                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1096
432
                    yysize = yysize1;
1097
0
                  else
1098
0
                    return 2;
1099
432
                }
1100
432
              }
1101
177
        }
1102
177
    }
1103
1104
177
  switch (yycount)
1105
177
    {
1106
0
# define YYCASE_(N, S)                      \
1107
177
      case N:                               \
1108
177
        yyformat = S;                       \
1109
177
      break
1110
0
    default: /* Avoid compiler warnings. */
1111
0
      YYCASE_(0, YY_("syntax error"));
1112
0
      YYCASE_(1, YY_("syntax error, unexpected %s"));
1113
39
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1114
21
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1115
117
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1116
177
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1117
177
# undef YYCASE_
1118
177
    }
1119
1120
177
  {
1121
    /* Don't count the "%s"s in the final size, but reserve room for
1122
       the terminator.  */
1123
177
    YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
1124
177
    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
1125
177
      yysize = yysize1;
1126
0
    else
1127
0
      return 2;
1128
177
  }
1129
1130
177
  if (*yymsg_alloc < yysize)
1131
0
    {
1132
0
      *yymsg_alloc = 2 * yysize;
1133
0
      if (! (yysize <= *yymsg_alloc
1134
0
             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1135
0
        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1136
0
      return 1;
1137
0
    }
1138
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
177
  {
1143
177
    char *yyp = *yymsg;
1144
177
    int yyi = 0;
1145
8.35k
    while ((*yyp = *yyformat) != '\0')
1146
8.17k
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1147
609
        {
1148
609
          yyp += yytnamerr (yyp, yyarg[yyi++]);
1149
609
          yyformat += 2;
1150
609
        }
1151
7.56k
      else
1152
7.56k
        {
1153
7.56k
          ++yyp;
1154
7.56k
          ++yyformat;
1155
7.56k
        }
1156
177
  }
1157
177
  return 0;
1158
177
}
1159
#endif /* YYERROR_VERBOSE */
1160
1161
/*-----------------------------------------------.
1162
| Release the memory associated to this symbol.  |
1163
`-----------------------------------------------*/
1164
1165
static void
1166
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, igraph_i_lgl_parsedata_t* context)
1167
20.7k
{
1168
20.7k
  YYUSE (yyvaluep);
1169
20.7k
  YYUSE (yylocationp);
1170
20.7k
  YYUSE (context);
1171
20.7k
  if (!yymsg)
1172
0
    yymsg = "Deleting";
1173
20.7k
  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1174
1175
20.7k
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1176
20.7k
  YYUSE (yytype);
1177
20.7k
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1178
20.7k
}
1179
1180
1181
1182
1183
/*----------.
1184
| yyparse.  |
1185
`----------*/
1186
1187
int
1188
yyparse (igraph_i_lgl_parsedata_t* context)
1189
10.2k
{
1190
/* The lookahead symbol.  */
1191
10.2k
int yychar;
1192
1193
1194
/* The semantic value of the lookahead symbol.  */
1195
/* Default value used for initialization, for pacifying older GCCs
1196
   or non-GCC compilers.  */
1197
10.2k
YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1198
10.2k
YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1199
1200
/* Location data for the lookahead symbol.  */
1201
10.2k
static YYLTYPE yyloc_default
1202
10.2k
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1203
10.2k
  = { 1, 1, 1, 1 }
1204
10.2k
# endif
1205
10.2k
;
1206
10.2k
YYLTYPE yylloc = yyloc_default;
1207
1208
    /* Number of syntax errors so far.  */
1209
10.2k
    int yynerrs;
1210
1211
10.2k
    yy_state_fast_t yystate;
1212
    /* Number of tokens to shift before error messages enabled.  */
1213
10.2k
    int yyerrstatus;
1214
1215
    /* The stacks and their tools:
1216
       'yyss': related to states.
1217
       'yyvs': related to semantic values.
1218
       'yyls': related to locations.
1219
1220
       Refer to the stacks through separate pointers, to allow yyoverflow
1221
       to reallocate them elsewhere.  */
1222
1223
    /* The state stack.  */
1224
10.2k
    yy_state_t yyssa[YYINITDEPTH];
1225
10.2k
    yy_state_t *yyss;
1226
10.2k
    yy_state_t *yyssp;
1227
1228
    /* The semantic value stack.  */
1229
10.2k
    YYSTYPE yyvsa[YYINITDEPTH];
1230
10.2k
    YYSTYPE *yyvs;
1231
10.2k
    YYSTYPE *yyvsp;
1232
1233
    /* The location stack.  */
1234
10.2k
    YYLTYPE yylsa[YYINITDEPTH];
1235
10.2k
    YYLTYPE *yyls;
1236
10.2k
    YYLTYPE *yylsp;
1237
1238
    /* The locations where the error started and ended.  */
1239
10.2k
    YYLTYPE yyerror_range[3];
1240
1241
10.2k
    YYPTRDIFF_T yystacksize;
1242
1243
10.2k
  int yyn;
1244
10.2k
  int yyresult;
1245
  /* Lookahead token as an internal (translated) token number.  */
1246
10.2k
  int yytoken = 0;
1247
  /* The variables used to return semantic value and location from the
1248
     action routines.  */
1249
10.2k
  YYSTYPE yyval;
1250
10.2k
  YYLTYPE yyloc;
1251
1252
10.2k
#if YYERROR_VERBOSE
1253
  /* Buffer for error messages, and its allocated size.  */
1254
10.2k
  char yymsgbuf[128];
1255
10.2k
  char *yymsg = yymsgbuf;
1256
10.2k
  YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
1257
10.2k
#endif
1258
1259
23.0M
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1260
1261
  /* The number of symbols on the RHS of the reduced rule.
1262
     Keep to zero when no symbol should be popped.  */
1263
10.2k
  int yylen = 0;
1264
1265
10.2k
  yyssp = yyss = yyssa;
1266
10.2k
  yyvsp = yyvs = yyvsa;
1267
10.2k
  yylsp = yyls = yylsa;
1268
10.2k
  yystacksize = YYINITDEPTH;
1269
1270
10.2k
  YYDPRINTF ((stderr, "Starting parse\n"));
1271
1272
10.2k
  yystate = 0;
1273
10.2k
  yyerrstatus = 0;
1274
10.2k
  yynerrs = 0;
1275
10.2k
  yychar = YYEMPTY; /* Cause a token to be read.  */
1276
10.2k
  yylsp[0] = yylloc;
1277
10.2k
  goto yysetstate;
1278
1279
1280
/*------------------------------------------------------------.
1281
| yynewstate -- push a new state, which is found in yystate.  |
1282
`------------------------------------------------------------*/
1283
38.9M
yynewstate:
1284
  /* In all cases, when you get here, the value and location stacks
1285
     have just been pushed.  So pushing a state here evens the stacks.  */
1286
38.9M
  yyssp++;
1287
1288
1289
/*--------------------------------------------------------------------.
1290
| yysetstate -- set current state (the top of the stack) to yystate.  |
1291
`--------------------------------------------------------------------*/
1292
38.9M
yysetstate:
1293
38.9M
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1294
38.9M
  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1295
38.9M
  YY_IGNORE_USELESS_CAST_BEGIN
1296
38.9M
  *yyssp = YY_CAST (yy_state_t, yystate);
1297
38.9M
  YY_IGNORE_USELESS_CAST_END
1298
1299
38.9M
  if (yyss + yystacksize - 1 <= yyssp)
1300
#if !defined yyoverflow && !defined YYSTACK_RELOCATE
1301
    goto yyexhaustedlab;
1302
#else
1303
0
    {
1304
      /* Get the current used size of the three stacks, in elements.  */
1305
0
      YYPTRDIFF_T yysize = yyssp - yyss + 1;
1306
1307
# if defined yyoverflow
1308
      {
1309
        /* Give user a chance to reallocate the stack.  Use copies of
1310
           these so that the &'s don't force the real ones into
1311
           memory.  */
1312
        yy_state_t *yyss1 = yyss;
1313
        YYSTYPE *yyvs1 = yyvs;
1314
        YYLTYPE *yyls1 = yyls;
1315
1316
        /* Each stack pointer address is followed by the size of the
1317
           data in use in that stack, in bytes.  This used to be a
1318
           conditional around just the two extra args, but that might
1319
           be undefined if yyoverflow is a macro.  */
1320
        yyoverflow (YY_("memory exhausted"),
1321
                    &yyss1, yysize * YYSIZEOF (*yyssp),
1322
                    &yyvs1, yysize * YYSIZEOF (*yyvsp),
1323
                    &yyls1, yysize * YYSIZEOF (*yylsp),
1324
                    &yystacksize);
1325
        yyss = yyss1;
1326
        yyvs = yyvs1;
1327
        yyls = yyls1;
1328
      }
1329
# else /* defined YYSTACK_RELOCATE */
1330
      /* Extend the stack our own way.  */
1331
0
      if (YYMAXDEPTH <= yystacksize)
1332
0
        goto yyexhaustedlab;
1333
0
      yystacksize *= 2;
1334
0
      if (YYMAXDEPTH < yystacksize)
1335
0
        yystacksize = YYMAXDEPTH;
1336
1337
0
      {
1338
0
        yy_state_t *yyss1 = yyss;
1339
0
        union yyalloc *yyptr =
1340
0
          YY_CAST (union yyalloc *,
1341
0
                   YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1342
0
        if (! yyptr)
1343
0
          goto yyexhaustedlab;
1344
0
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1345
0
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1346
0
        YYSTACK_RELOCATE (yyls_alloc, yyls);
1347
0
# undef YYSTACK_RELOCATE
1348
0
        if (yyss1 != yyssa)
1349
0
          YYSTACK_FREE (yyss1);
1350
0
      }
1351
0
# endif
1352
1353
0
      yyssp = yyss + yysize - 1;
1354
0
      yyvsp = yyvs + yysize - 1;
1355
0
      yylsp = yyls + yysize - 1;
1356
1357
0
      YY_IGNORE_USELESS_CAST_BEGIN
1358
0
      YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1359
0
                  YY_CAST (long, yystacksize)));
1360
0
      YY_IGNORE_USELESS_CAST_END
1361
1362
0
      if (yyss + yystacksize - 1 <= yyssp)
1363
0
        YYABORT;
1364
0
    }
1365
38.9M
#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1366
1367
38.9M
  if (yystate == YYFINAL)
1368
10.0k
    YYACCEPT;
1369
1370
38.9M
  goto yybackup;
1371
1372
1373
/*-----------.
1374
| yybackup.  |
1375
`-----------*/
1376
38.9M
yybackup:
1377
  /* Do appropriate processing given the current state.  Read a
1378
     lookahead token if we need one and don't already have one.  */
1379
1380
  /* First try to decide what to do without reference to lookahead token.  */
1381
38.9M
  yyn = yypact[yystate];
1382
38.9M
  if (yypact_value_is_default (yyn))
1383
22.9M
    goto yydefault;
1384
1385
  /* Not known => get a lookahead token if don't already have one.  */
1386
1387
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1388
15.9M
  if (yychar == YYEMPTY)
1389
15.8M
    {
1390
15.8M
      YYDPRINTF ((stderr, "Reading a token: "));
1391
15.8M
      yychar = yylex (&yylval, &yylloc, scanner);
1392
15.8M
    }
1393
1394
15.9M
  if (yychar <= YYEOF)
1395
14.9k
    {
1396
14.9k
      yychar = yytoken = YYEOF;
1397
14.9k
      YYDPRINTF ((stderr, "Now at end of input.\n"));
1398
14.9k
    }
1399
15.8M
  else
1400
15.8M
    {
1401
15.8M
      yytoken = YYTRANSLATE (yychar);
1402
15.8M
      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1403
15.8M
    }
1404
1405
  /* If the proper action on seeing token YYTOKEN is to reduce or to
1406
     detect an error, take that action.  */
1407
15.9M
  yyn += yytoken;
1408
15.9M
  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1409
51.2k
    goto yydefault;
1410
15.8M
  yyn = yytable[yyn];
1411
15.8M
  if (yyn <= 0)
1412
0
    {
1413
0
      if (yytable_value_is_error (yyn))
1414
0
        goto yyerrlab;
1415
0
      yyn = -yyn;
1416
0
      goto yyreduce;
1417
0
    }
1418
1419
  /* Count tokens shifted since error; after three, turn off error
1420
     status.  */
1421
15.8M
  if (yyerrstatus)
1422
0
    yyerrstatus--;
1423
1424
  /* Shift the lookahead token.  */
1425
15.8M
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1426
15.8M
  yystate = yyn;
1427
15.8M
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1428
15.8M
  *++yyvsp = yylval;
1429
15.8M
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1430
15.8M
  *++yylsp = yylloc;
1431
1432
  /* Discard the shifted token.  */
1433
15.8M
  yychar = YYEMPTY;
1434
15.8M
  goto yynewstate;
1435
1436
1437
/*-----------------------------------------------------------.
1438
| yydefault -- do the default action for the current state.  |
1439
`-----------------------------------------------------------*/
1440
23.0M
yydefault:
1441
23.0M
  yyn = yydefact[yystate];
1442
23.0M
  if (yyn == 0)
1443
177
    goto yyerrlab;
1444
23.0M
  goto yyreduce;
1445
1446
1447
/*-----------------------------.
1448
| yyreduce -- do a reduction.  |
1449
`-----------------------------*/
1450
23.0M
yyreduce:
1451
  /* yyn is the number of a rule to reduce with.  */
1452
23.0M
  yylen = yyr2[yyn];
1453
1454
  /* If YYLEN is nonzero, implement the default value of the action:
1455
     '$$ = $1'.
1456
1457
     Otherwise, the following line sets YYVAL to garbage.
1458
     This behavior is undocumented and Bison
1459
     users should not rely upon it.  Assigning to YYVAL
1460
     unconditionally makes the parser a bit smaller, and it avoids a
1461
     GCC warning that YYVAL may be used uninitialized.  */
1462
23.0M
  yyval = yyvsp[1-yylen];
1463
1464
  /* Default location. */
1465
23.0M
  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
1466
23.0M
  yyerror_range[1] = yyloc;
1467
23.0M
  YY_REDUCE_PRINT (yyn);
1468
23.0M
  switch (yyn)
1469
23.0M
    {
1470
51.1k
  case 6:
1471
51.1k
#line 99 "/src/igraph/src/io/lgl-parser.y"
1472
51.1k
                                      { context->actvertex=(yyvsp[-1].edgenum); }
1473
51.1k
#line 1474 "/src/igraph/build/src/io/parsers/lgl-parser.c"
1474
51.1k
    break;
1475
1476
6.96M
  case 9:
1477
6.96M
#line 103 "/src/igraph/src/io/lgl-parser.y"
1478
6.96M
                                    {
1479
6.96M
             IGRAPH_YY_CHECK(igraph_vector_int_push_back(context->vector, context->actvertex));
1480
6.96M
             IGRAPH_YY_CHECK(igraph_vector_int_push_back(context->vector, (yyvsp[-1].edgenum)));
1481
6.96M
             IGRAPH_YY_CHECK(igraph_vector_push_back(context->weights, 1.0));
1482
6.96M
           }
1483
6.96M
#line 1484 "/src/igraph/build/src/io/parsers/lgl-parser.c"
1484
6.96M
    break;
1485
1486
6.96M
  case 10:
1487
111k
#line 108 "/src/igraph/src/io/lgl-parser.y"
1488
111k
                                    {
1489
111k
             IGRAPH_YY_CHECK(igraph_vector_int_push_back(context->vector, context->actvertex));
1490
111k
             IGRAPH_YY_CHECK(igraph_vector_int_push_back(context->vector, (yyvsp[-2].edgenum)));
1491
111k
             IGRAPH_YY_CHECK(igraph_vector_push_back(context->weights, (yyvsp[-1].weightnum)));
1492
111k
             context->has_weights = 1;
1493
111k
           }
1494
0
#line 1495 "/src/igraph/build/src/io/parsers/lgl-parser.c"
1495
0
    break;
1496
1497
7.12M
  case 11:
1498
7.12M
#line 117 "/src/igraph/src/io/lgl-parser.y"
1499
7.12M
                {
1500
7.12M
  igraph_int_t trie_id;
1501
7.12M
  IGRAPH_YY_CHECK(igraph_trie_get_len(context->trie,
1502
7.12M
    igraph_lgl_yyget_text(scanner),
1503
7.12M
    igraph_lgl_yyget_leng(scanner),
1504
7.12M
    &trie_id
1505
7.12M
  ));
1506
7.12M
  (yyval.edgenum) = trie_id;
1507
7.12M
}
1508
0
#line 1509 "/src/igraph/build/src/io/parsers/lgl-parser.c"
1509
0
    break;
1510
1511
112k
  case 12:
1512
112k
#line 127 "/src/igraph/src/io/lgl-parser.y"
1513
112k
                {
1514
112k
    igraph_real_t val;
1515
112k
    IGRAPH_YY_CHECK(igraph_i_parse_real(igraph_lgl_yyget_text(scanner),
1516
112k
                                        igraph_lgl_yyget_leng(scanner),
1517
112k
                                        &val));
1518
111k
    (yyval.weightnum)=val;
1519
111k
}
1520
0
#line 1521 "/src/igraph/build/src/io/parsers/lgl-parser.c"
1521
0
    break;
1522
1523
1524
0
#line 1525 "/src/igraph/build/src/io/parsers/lgl-parser.c"
1525
1526
8.66M
      default: break;
1527
23.0M
    }
1528
  /* User semantic actions sometimes alter yychar, and that requires
1529
     that yytoken be updated with the new translation.  We take the
1530
     approach of translating immediately before every use of yytoken.
1531
     One alternative is translating here after every semantic action,
1532
     but that translation would be missed if the semantic action invokes
1533
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1534
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
1535
     incorrect destructor might then be invoked immediately.  In the
1536
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
1537
     to an incorrect destructor call or verbose syntax error message
1538
     before the lookahead is translated.  */
1539
23.0M
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1540
1541
23.0M
  YYPOPSTACK (yylen);
1542
23.0M
  yylen = 0;
1543
23.0M
  YY_STACK_PRINT (yyss, yyssp);
1544
1545
23.0M
  *++yyvsp = yyval;
1546
23.0M
  *++yylsp = yyloc;
1547
1548
  /* Now 'shift' the result of the reduction.  Determine what state
1549
     that goes to, based on the state we popped back to and the rule
1550
     number reduced by.  */
1551
23.0M
  {
1552
23.0M
    const int yylhs = yyr1[yyn] - YYNTOKENS;
1553
23.0M
    const int yyi = yypgoto[yylhs] + *yyssp;
1554
23.0M
    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1555
23.0M
               ? yytable[yyi]
1556
23.0M
               : yydefgoto[yylhs]);
1557
23.0M
  }
1558
1559
23.0M
  goto yynewstate;
1560
1561
1562
/*--------------------------------------.
1563
| yyerrlab -- here on detecting error.  |
1564
`--------------------------------------*/
1565
177
yyerrlab:
1566
  /* Make sure we have latest lookahead translation.  See comments at
1567
     user semantic actions for why this is necessary.  */
1568
177
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1569
1570
  /* If not already recovering from an error, report this error.  */
1571
177
  if (!yyerrstatus)
1572
177
    {
1573
177
      ++yynerrs;
1574
#if ! YYERROR_VERBOSE
1575
      yyerror (&yylloc, context, YY_("syntax error"));
1576
#else
1577
177
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1578
177
                                        yyssp, yytoken)
1579
177
      {
1580
177
        char const *yymsgp = YY_("syntax error");
1581
177
        int yysyntax_error_status;
1582
177
        yysyntax_error_status = YYSYNTAX_ERROR;
1583
177
        if (yysyntax_error_status == 0)
1584
177
          yymsgp = yymsg;
1585
0
        else if (yysyntax_error_status == 1)
1586
0
          {
1587
0
            if (yymsg != yymsgbuf)
1588
0
              YYSTACK_FREE (yymsg);
1589
0
            yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
1590
0
            if (!yymsg)
1591
0
              {
1592
0
                yymsg = yymsgbuf;
1593
0
                yymsg_alloc = sizeof yymsgbuf;
1594
0
                yysyntax_error_status = 2;
1595
0
              }
1596
0
            else
1597
0
              {
1598
0
                yysyntax_error_status = YYSYNTAX_ERROR;
1599
0
                yymsgp = yymsg;
1600
0
              }
1601
0
          }
1602
177
        yyerror (&yylloc, context, yymsgp);
1603
177
        if (yysyntax_error_status == 2)
1604
0
          goto yyexhaustedlab;
1605
177
      }
1606
177
# undef YYSYNTAX_ERROR
1607
177
#endif
1608
177
    }
1609
1610
177
  yyerror_range[1] = yylloc;
1611
1612
177
  if (yyerrstatus == 3)
1613
0
    {
1614
      /* If just tried and failed to reuse lookahead token after an
1615
         error, discard it.  */
1616
1617
0
      if (yychar <= YYEOF)
1618
0
        {
1619
          /* Return failure if at end of input.  */
1620
0
          if (yychar == YYEOF)
1621
0
            YYABORT;
1622
0
        }
1623
0
      else
1624
0
        {
1625
0
          yydestruct ("Error: discarding",
1626
0
                      yytoken, &yylval, &yylloc, context);
1627
0
          yychar = YYEMPTY;
1628
0
        }
1629
0
    }
1630
1631
  /* Else will try to reuse lookahead token after shifting the error
1632
     token.  */
1633
177
  goto yyerrlab1;
1634
1635
1636
/*---------------------------------------------------.
1637
| yyerrorlab -- error raised explicitly by YYERROR.  |
1638
`---------------------------------------------------*/
1639
177
yyerrorlab:
1640
  /* Pacify compilers when the user code never invokes YYERROR and the
1641
     label yyerrorlab therefore never appears in user code.  */
1642
0
  if (0)
1643
0
    YYERROR;
1644
1645
  /* Do not reclaim the symbols of the rule whose action triggered
1646
     this YYERROR.  */
1647
0
  YYPOPSTACK (yylen);
1648
0
  yylen = 0;
1649
0
  YY_STACK_PRINT (yyss, yyssp);
1650
0
  yystate = *yyssp;
1651
0
  goto yyerrlab1;
1652
1653
1654
/*-------------------------------------------------------------.
1655
| yyerrlab1 -- common code for both syntax error and YYERROR.  |
1656
`-------------------------------------------------------------*/
1657
177
yyerrlab1:
1658
177
  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
1659
1660
177
  for (;;)
1661
484
    {
1662
484
      yyn = yypact[yystate];
1663
484
      if (!yypact_value_is_default (yyn))
1664
284
        {
1665
284
          yyn += YYTERROR;
1666
284
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1667
0
            {
1668
0
              yyn = yytable[yyn];
1669
0
              if (0 < yyn)
1670
0
                break;
1671
0
            }
1672
284
        }
1673
1674
      /* Pop the current state because it cannot handle the error token.  */
1675
484
      if (yyssp == yyss)
1676
177
        YYABORT;
1677
1678
307
      yyerror_range[1] = *yylsp;
1679
307
      yydestruct ("Error: popping",
1680
307
                  yystos[yystate], yyvsp, yylsp, context);
1681
307
      YYPOPSTACK (1);
1682
307
      yystate = *yyssp;
1683
307
      YY_STACK_PRINT (yyss, yyssp);
1684
307
    }
1685
1686
0
  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1687
0
  *++yyvsp = yylval;
1688
0
  YY_IGNORE_MAYBE_UNINITIALIZED_END
1689
1690
0
  yyerror_range[2] = yylloc;
1691
  /* Using YYLLOC is tempting, but would change the location of
1692
     the lookahead.  YYLOC is available though.  */
1693
0
  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
1694
0
  *++yylsp = yyloc;
1695
1696
  /* Shift the error token.  */
1697
0
  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1698
1699
0
  yystate = yyn;
1700
0
  goto yynewstate;
1701
1702
1703
/*-------------------------------------.
1704
| yyacceptlab -- YYACCEPT comes here.  |
1705
`-------------------------------------*/
1706
10.0k
yyacceptlab:
1707
10.0k
  yyresult = 0;
1708
10.0k
  goto yyreturn;
1709
1710
1711
/*-----------------------------------.
1712
| yyabortlab -- YYABORT comes here.  |
1713
`-----------------------------------*/
1714
222
yyabortlab:
1715
222
  yyresult = 1;
1716
222
  goto yyreturn;
1717
1718
1719
0
#if !defined yyoverflow || YYERROR_VERBOSE
1720
/*-------------------------------------------------.
1721
| yyexhaustedlab -- memory exhaustion comes here.  |
1722
`-------------------------------------------------*/
1723
0
yyexhaustedlab:
1724
0
  yyerror (&yylloc, context, YY_("memory exhausted"));
1725
0
  yyresult = 2;
1726
  /* Fall through.  */
1727
0
#endif
1728
1729
1730
/*-----------------------------------------------------.
1731
| yyreturn -- parsing is finished, return the result.  |
1732
`-----------------------------------------------------*/
1733
10.2k
yyreturn:
1734
10.2k
  if (yychar != YYEMPTY)
1735
177
    {
1736
      /* Make sure we have latest lookahead translation.  See comments at
1737
         user semantic actions for why this is necessary.  */
1738
177
      yytoken = YYTRANSLATE (yychar);
1739
177
      yydestruct ("Cleanup: discarding lookahead",
1740
177
                  yytoken, &yylval, &yylloc, context);
1741
177
    }
1742
  /* Do not reclaim the symbols of the rule whose action triggered
1743
     this YYABORT or YYACCEPT.  */
1744
10.2k
  YYPOPSTACK (yylen);
1745
10.2k
  YY_STACK_PRINT (yyss, yyssp);
1746
30.4k
  while (yyssp != yyss)
1747
20.2k
    {
1748
20.2k
      yydestruct ("Cleanup: popping",
1749
20.2k
                  yystos[+*yyssp], yyvsp, yylsp, context);
1750
20.2k
      YYPOPSTACK (1);
1751
20.2k
    }
1752
10.2k
#ifndef yyoverflow
1753
10.2k
  if (yyss != yyssa)
1754
0
    YYSTACK_FREE (yyss);
1755
10.2k
#endif
1756
10.2k
#if YYERROR_VERBOSE
1757
10.2k
  if (yymsg != yymsgbuf)
1758
0
    YYSTACK_FREE (yymsg);
1759
10.2k
#endif
1760
10.2k
  return yyresult;
1761
0
}
1762
#line 135 "/src/igraph/src/io/lgl-parser.y"
1763
1764
1765
int igraph_lgl_yyerror(YYLTYPE* locp, igraph_i_lgl_parsedata_t *context,
1766
222
                       const char *s) {
1767
222
  snprintf(context->errmsg, sizeof(context->errmsg)/sizeof(char),
1768
222
           "Parse error in LGL file, line %i (%s)",
1769
222
           locp->first_line, s);
1770
222
  return 0;
1771
222
}