~ubuntu-branches/ubuntu/wily/igraph/wily-proposed

« back to all changes in this revision

Viewing changes to src/foreign-pajek-parser.c

  • Committer: Package Import Robot
  • Author(s): Tamás Nepusz, Andreas Tille, Tamas Nepusz
  • Date: 2014-08-29 08:39:02 UTC
  • mfrom: (7.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140829083902-y4k2iu2mlizkq0o0
Tags: 0.7.1-2
[ Andreas Tille ]
* Move packagiong from SVN to Git

[ Tamas Nepusz ]
* Remove debian/patches/link_f2c.patch; f2c linkage not needed if
  BLAS, LAPACK and ARPACK are all linked dynamically
  Closes: #702882
* debian/patches/remove_unused_test_target.patch added to make
  dh_auto_test work
* debian/patches/fix_failing_tests.patch added to fix some failing
  test cases 
* debian/patches/cppflags_restore.patch added to fix incorrect
  handling of CPPFLAGS in the configure script
* debian/patches/drl_spelling_fix.patch added to fix a spelling
  error in the source and silence a lintian warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* A Bison parser, made by GNU Bison 2.5.  */
2
 
 
3
 
/* Bison implementation for Yacc-like parsers in C
4
 
   
5
 
      Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
6
 
   
7
 
   This program is free software: you can redistribute it and/or modify
 
1
/* A Bison parser, made by GNU Bison 2.3.  */
 
2
 
 
3
/* Skeleton implementation for Bison's Yacc-like parsers in C
 
4
 
 
5
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
 
6
   Free Software Foundation, Inc.
 
7
 
 
8
   This program is free software; you can redistribute it and/or modify
8
9
   it under the terms of the GNU General Public License as published by
9
 
   the Free Software Foundation, either version 3 of the License, or
10
 
   (at your option) any later version.
11
 
   
 
10
   the Free Software Foundation; either version 2, or (at your option)
 
11
   any later version.
 
12
 
12
13
   This program is distributed in the hope that it will be useful,
13
14
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
16
   GNU General Public License for more details.
16
 
   
 
17
 
17
18
   You should have received a copy of the GNU General Public License
18
 
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
19
   along with this program; if not, write to the Free Software
 
20
   Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
21
   Boston, MA 02110-1301, USA.  */
19
22
 
20
23
/* As a special exception, you may create a larger work that contains
21
24
   part or all of the Bison parser skeleton and distribute that work
26
29
   special exception, which will cause the skeleton and the resulting
27
30
   Bison output files to be licensed under the GNU General Public
28
31
   License without this special exception.
29
 
   
 
32
 
30
33
   This special exception was added by the Free Software Foundation in
31
34
   version 2.2 of Bison.  */
32
35
 
44
47
#define YYBISON 1
45
48
 
46
49
/* Bison version.  */
47
 
#define YYBISON_VERSION "2.5"
 
50
#define YYBISON_VERSION "2.3"
48
51
 
49
52
/* Skeleton name.  */
50
53
#define YYSKELETON_NAME "yacc.c"
52
55
/* Pure parsers.  */
53
56
#define YYPURE 1
54
57
 
55
 
/* Push parsers.  */
56
 
#define YYPUSH 0
57
 
 
58
 
/* Pull parsers.  */
59
 
#define YYPULL 1
60
 
 
61
58
/* Using locations.  */
62
59
#define YYLSP_NEEDED 1
63
60
 
64
61
/* Substitute the variable and function names.  */
65
 
#define yyparse         igraph_pajek_yyparse
66
 
#define yylex           igraph_pajek_yylex
67
 
#define yyerror         igraph_pajek_yyerror
68
 
#define yylval          igraph_pajek_yylval
69
 
#define yychar          igraph_pajek_yychar
70
 
#define yydebug         igraph_pajek_yydebug
71
 
#define yynerrs         igraph_pajek_yynerrs
72
 
#define yylloc          igraph_pajek_yylloc
73
 
 
74
 
/* Copy the first part of user declarations.  */
75
 
 
76
 
/* Line 268 of yacc.c  */
77
 
#line 23 "foreign-pajek-parser.y"
78
 
 
79
 
 
80
 
/* 
81
 
   IGraph library.
82
 
   Copyright (C) 2006-2012  Gabor Csardi <csardi.gabor@gmail.com>
83
 
   334 Harvard st, Cambridge, MA, 02138 USA
84
 
   
85
 
   This program is free software; you can redistribute it and/or modify
86
 
   it under the terms of the GNU General Public License as published by
87
 
   the Free Software Foundation; either version 2 of the License, or
88
 
   (at your option) any later version.
89
 
   
90
 
   This program is distributed in the hope that it will be useful,
91
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
92
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
93
 
   GNU General Public License for more details.
94
 
   
95
 
   You should have received a copy of the GNU General Public License
96
 
   along with this program; if not, write to the Free Software
97
 
   Foundation, Inc.,  51 Franklin Street, Fifth Floor, Boston, MA 
98
 
   02110-1301 USA
99
 
 
100
 
*/
101
 
 
102
 
#include <stdio.h>
103
 
#include <string.h>
104
 
#include "igraph_hacks_internal.h"
105
 
#include "igraph_types.h"
106
 
#include "igraph_types_internal.h"
107
 
#include "igraph_memory.h"
108
 
#include "igraph_error.h"
109
 
#include "igraph_attributes.h"
110
 
#include "config.h"
111
 
#include "igraph_math.h"
112
 
#include <math.h>
113
 
#include "foreign-pajek-header.h"
114
 
#include "foreign-pajek-parser.h"
115
 
 
116
 
#define yyscan_t void*
117
 
 
118
 
int igraph_pajek_yylex(YYSTYPE* lvalp, YYLTYPE* llocp, 
119
 
                       void* scanner);
120
 
int igraph_pajek_yyerror(YYLTYPE* locp, 
121
 
                         igraph_i_pajek_parsedata_t *context, 
122
 
                         char *s);
123
 
char *igraph_pajek_yyget_text (yyscan_t yyscanner );
124
 
int igraph_pajek_yyget_leng (yyscan_t yyscanner );
125
 
 
126
 
int igraph_i_pajek_add_string_vertex_attribute(const char *name, 
127
 
                                               const char *value,
128
 
                                               int len, 
129
 
                                               igraph_i_pajek_parsedata_t *context);
130
 
int igraph_i_pajek_add_string_edge_attribute(const char *name, 
131
 
                                             const char *value,
132
 
                                             int len,
133
 
                                             igraph_i_pajek_parsedata_t *context);
134
 
int igraph_i_pajek_add_numeric_vertex_attribute(const char *name, 
135
 
                                                igraph_real_t value,
136
 
                                                igraph_i_pajek_parsedata_t *context);
137
 
int igraph_i_pajek_add_numeric_edge_attribute(const char *name, 
138
 
                                              igraph_real_t value, 
139
 
                                              igraph_i_pajek_parsedata_t *context);
140
 
int igraph_i_pajek_add_numeric_attribute(igraph_trie_t *names,
141
 
                                         igraph_vector_ptr_t *attrs,
142
 
                                         long int count,
143
 
                                         const char *attrname,
144
 
                                         igraph_integer_t vid,
145
 
                                         igraph_real_t number);
146
 
int igraph_i_pajek_add_string_attribute(igraph_trie_t *names,
147
 
                                        igraph_vector_ptr_t *attrs,
148
 
                                        long int count,
149
 
                                        const char *attrname,
150
 
                                        igraph_integer_t vid,
151
 
                                        const char *str);
152
 
 
153
 
int igraph_i_pajek_add_bipartite_type(igraph_i_pajek_parsedata_t *context);
154
 
int igraph_i_pajek_check_bipartite(igraph_i_pajek_parsedata_t *context);
155
 
 
156
 
extern igraph_real_t igraph_pajek_get_number(const char *str, long int len);
157
 
extern long int igraph_i_pajek_actvertex;
158
 
extern long int igraph_i_pajek_actedge;
159
 
 
160
 
#define scanner context->scanner
161
 
 
162
 
 
163
 
 
164
 
/* Line 268 of yacc.c  */
165
 
#line 166 "foreign-pajek-parser.c"
166
 
 
167
 
/* Enabling traces.  */
168
 
#ifndef YYDEBUG
169
 
# define YYDEBUG 0
170
 
#endif
171
 
 
172
 
/* Enabling verbose error messages.  */
173
 
#ifdef YYERROR_VERBOSE
174
 
# undef YYERROR_VERBOSE
175
 
# define YYERROR_VERBOSE 1
176
 
#else
177
 
# define YYERROR_VERBOSE 1
178
 
#endif
179
 
 
180
 
/* Enabling the token table.  */
181
 
#ifndef YYTOKEN_TABLE
182
 
# define YYTOKEN_TABLE 0
183
 
#endif
184
 
 
 
62
#define yyparse igraph_pajek_yyparse
 
63
#define yylex   igraph_pajek_yylex
 
64
#define yyerror igraph_pajek_yyerror
 
65
#define yylval  igraph_pajek_yylval
 
66
#define yychar  igraph_pajek_yychar
 
67
#define yydebug igraph_pajek_yydebug
 
68
#define yynerrs igraph_pajek_yynerrs
 
69
#define yylloc igraph_pajek_yylloc
185
70
 
186
71
/* Tokens.  */
187
72
#ifndef YYTOKENTYPE
292
177
 
293
178
 
294
179
 
 
180
/* Copy the first part of user declarations.  */
 
181
#line 23 "foreign-pajek-parser.y"
 
182
 
 
183
 
 
184
/* 
 
185
   IGraph library.
 
186
   Copyright (C) 2006-2012  Gabor Csardi <csardi.gabor@gmail.com>
 
187
   334 Harvard st, Cambridge, MA, 02138 USA
 
188
   
 
189
   This program is free software; you can redistribute it and/or modify
 
190
   it under the terms of the GNU General Public License as published by
 
191
   the Free Software Foundation; either version 2 of the License, or
 
192
   (at your option) any later version.
 
193
   
 
194
   This program is distributed in the hope that it will be useful,
 
195
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
196
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
197
   GNU General Public License for more details.
 
198
   
 
199
   You should have received a copy of the GNU General Public License
 
200
   along with this program; if not, write to the Free Software
 
201
   Foundation, Inc.,  51 Franklin Street, Fifth Floor, Boston, MA 
 
202
   02110-1301 USA
 
203
 
 
204
*/
 
205
 
 
206
#ifdef __clang__
 
207
#pragma clang diagnostic ignored "-Wconversion"
 
208
#pragma clang diagnostic ignored "-Wsign-conversion"
 
209
#endif
 
210
 
 
211
#include <stdio.h>
 
212
#include <string.h>
 
213
#include "igraph_hacks_internal.h"
 
214
#include "igraph_types.h"
 
215
#include "igraph_types_internal.h"
 
216
#include "igraph_memory.h"
 
217
#include "igraph_error.h"
 
218
#include "igraph_attributes.h"
 
219
#include "config.h"
 
220
#include "igraph_math.h"
 
221
#include <math.h>
 
222
#include "foreign-pajek-header.h"
 
223
#include "foreign-pajek-parser.h"
 
224
 
 
225
#define yyscan_t void*
 
226
 
 
227
int igraph_pajek_yylex(YYSTYPE* lvalp, YYLTYPE* llocp, 
 
228
                       void* scanner);
 
229
int igraph_pajek_yyerror(YYLTYPE* locp, 
 
230
                         igraph_i_pajek_parsedata_t *context, 
 
231
                         char *s);
 
232
char *igraph_pajek_yyget_text (yyscan_t yyscanner );
 
233
int igraph_pajek_yyget_leng (yyscan_t yyscanner );
 
234
 
 
235
int igraph_i_pajek_add_string_vertex_attribute(const char *name, 
 
236
                                               const char *value,
 
237
                                               int len, 
 
238
                                               igraph_i_pajek_parsedata_t *context);
 
239
int igraph_i_pajek_add_string_edge_attribute(const char *name, 
 
240
                                             const char *value,
 
241
                                             int len,
 
242
                                             igraph_i_pajek_parsedata_t *context);
 
243
int igraph_i_pajek_add_numeric_vertex_attribute(const char *name, 
 
244
                                                igraph_real_t value,
 
245
                                                igraph_i_pajek_parsedata_t *context);
 
246
int igraph_i_pajek_add_numeric_edge_attribute(const char *name, 
 
247
                                              igraph_real_t value, 
 
248
                                              igraph_i_pajek_parsedata_t *context);
 
249
int igraph_i_pajek_add_numeric_attribute(igraph_trie_t *names,
 
250
                                         igraph_vector_ptr_t *attrs,
 
251
                                         long int count,
 
252
                                         const char *attrname,
 
253
                                         igraph_integer_t vid,
 
254
                                         igraph_real_t number);
 
255
int igraph_i_pajek_add_string_attribute(igraph_trie_t *names,
 
256
                                        igraph_vector_ptr_t *attrs,
 
257
                                        long int count,
 
258
                                        const char *attrname,
 
259
                                        igraph_integer_t vid,
 
260
                                        const char *str);
 
261
 
 
262
int igraph_i_pajek_add_bipartite_type(igraph_i_pajek_parsedata_t *context);
 
263
int igraph_i_pajek_check_bipartite(igraph_i_pajek_parsedata_t *context);
 
264
 
 
265
extern igraph_real_t igraph_pajek_get_number(const char *str, long int len);
 
266
extern long int igraph_i_pajek_actvertex;
 
267
extern long int igraph_i_pajek_actedge;
 
268
 
 
269
#define scanner context->scanner
 
270
 
 
271
 
 
272
 
 
273
/* Enabling traces.  */
 
274
#ifndef YYDEBUG
 
275
# define YYDEBUG 0
 
276
#endif
 
277
 
 
278
/* Enabling verbose error messages.  */
 
279
#ifdef YYERROR_VERBOSE
 
280
# undef YYERROR_VERBOSE
 
281
# define YYERROR_VERBOSE 1
 
282
#else
 
283
# define YYERROR_VERBOSE 1
 
284
#endif
 
285
 
 
286
/* Enabling the token table.  */
 
287
#ifndef YYTOKEN_TABLE
 
288
# define YYTOKEN_TABLE 0
 
289
#endif
 
290
 
295
291
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
296
292
typedef union YYSTYPE
 
293
#line 123 "foreign-pajek-parser.y"
297
294
{
298
 
 
299
 
/* Line 293 of yacc.c  */
300
 
#line 118 "foreign-pajek-parser.y"
301
 
 
302
295
  long int intnum;
303
296
  double   realnum;  
304
297
  struct {
305
298
    char *str;
306
299
    int len;
307
300
  } string;  
308
 
 
309
 
 
310
 
 
311
 
/* Line 293 of yacc.c  */
312
 
#line 313 "foreign-pajek-parser.c"
313
 
} YYSTYPE;
314
 
# define YYSTYPE_IS_TRIVIAL 1
 
301
}
 
302
/* Line 193 of yacc.c.  */
 
303
#line 304 "foreign-pajek-parser.c"
 
304
        YYSTYPE;
315
305
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
316
306
# define YYSTYPE_IS_DECLARED 1
 
307
# define YYSTYPE_IS_TRIVIAL 1
317
308
#endif
318
309
 
319
310
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
333
324
/* Copy the second part of user declarations.  */
334
325
 
335
326
 
336
 
/* Line 343 of yacc.c  */
337
 
#line 338 "foreign-pajek-parser.c"
 
327
/* Line 216 of yacc.c.  */
 
328
#line 329 "foreign-pajek-parser.c"
338
329
 
339
330
#ifdef short
340
331
# undef short
409
400
#if (defined __STDC__ || defined __C99__FUNC__ \
410
401
     || defined __cplusplus || defined _MSC_VER)
411
402
static int
412
 
YYID (int yyi)
 
403
YYID (int i)
413
404
#else
414
405
static int
415
 
YYID (yyi)
416
 
    int yyi;
 
406
YYID (i)
 
407
    int i;
417
408
#endif
418
409
{
419
 
  return yyi;
 
410
  return i;
420
411
}
421
412
#endif
422
413
 
437
428
#    define alloca _alloca
438
429
#   else
439
430
#    define YYSTACK_ALLOC alloca
440
 
#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
 
431
#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
441
432
     || defined __cplusplus || defined _MSC_VER)
442
433
#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
443
 
#     ifndef EXIT_SUCCESS
444
 
#      define EXIT_SUCCESS 0
 
434
#     ifndef _STDLIB_H
 
435
#      define _STDLIB_H 1
445
436
#     endif
446
437
#    endif
447
438
#   endif
464
455
#  ifndef YYSTACK_ALLOC_MAXIMUM
465
456
#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
466
457
#  endif
467
 
#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
 
458
#  if (defined __cplusplus && ! defined _STDLIB_H \
468
459
       && ! ((defined YYMALLOC || defined malloc) \
469
460
             && (defined YYFREE || defined free)))
470
461
#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
471
 
#   ifndef EXIT_SUCCESS
472
 
#    define EXIT_SUCCESS 0
 
462
#   ifndef _STDLIB_H
 
463
#    define _STDLIB_H 1
473
464
#   endif
474
465
#  endif
475
466
#  ifndef YYMALLOC
476
467
#   define YYMALLOC malloc
477
 
#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
 
468
#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
478
469
     || defined __cplusplus || defined _MSC_VER)
479
470
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
480
471
#   endif
481
472
#  endif
482
473
#  ifndef YYFREE
483
474
#   define YYFREE free
484
 
#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
 
475
#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
485
476
     || defined __cplusplus || defined _MSC_VER)
486
477
void free (void *); /* INFRINGES ON USER NAME SPACE */
487
478
#   endif
498
489
/* A type that is properly aligned for any stack member.  */
499
490
union yyalloc
500
491
{
501
 
  yytype_int16 yyss_alloc;
502
 
  YYSTYPE yyvs_alloc;
503
 
  YYLTYPE yyls_alloc;
 
492
  yytype_int16 yyss;
 
493
  YYSTYPE yyvs;
 
494
    YYLTYPE yyls;
504
495
};
505
496
 
506
497
/* The size of the maximum gap between one aligned stack and the next.  */
512
503
     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
513
504
      + 2 * YYSTACK_GAP_MAXIMUM)
514
505
 
515
 
# define YYCOPY_NEEDED 1
516
 
 
517
 
/* Relocate STACK from its old location to the new one.  The
518
 
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
519
 
   elements in the stack, and YYPTR gives the new location of the
520
 
   stack.  Advance YYPTR to a properly aligned location for the next
521
 
   stack.  */
522
 
# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
523
 
    do                                                                  \
524
 
      {                                                                 \
525
 
        YYSIZE_T yynewbytes;                                            \
526
 
        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
527
 
        Stack = &yyptr->Stack_alloc;                                    \
528
 
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
529
 
        yyptr += yynewbytes / sizeof (*yyptr);                          \
530
 
      }                                                                 \
531
 
    while (YYID (0))
532
 
 
533
 
#endif
534
 
 
535
 
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
536
506
/* Copy COUNT objects from FROM to TO.  The source and destination do
537
507
   not overlap.  */
538
508
# ifndef YYCOPY
550
520
      while (YYID (0))
551
521
#  endif
552
522
# endif
553
 
#endif /* !YYCOPY_NEEDED */
 
523
 
 
524
/* Relocate STACK from its old location to the new one.  The
 
525
   local variables YYSIZE and YYSTACKSIZE give the old and new number of
 
526
   elements in the stack, and YYPTR gives the new location of the
 
527
   stack.  Advance YYPTR to a properly aligned location for the next
 
528
   stack.  */
 
529
# define YYSTACK_RELOCATE(Stack)                                        \
 
530
    do                                                                  \
 
531
      {                                                                 \
 
532
        YYSIZE_T yynewbytes;                                            \
 
533
        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
 
534
        Stack = &yyptr->Stack;                                          \
 
535
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
 
536
        yyptr += yynewbytes / sizeof (*yyptr);                          \
 
537
      }                                                                 \
 
538
    while (YYID (0))
 
539
 
 
540
#endif
554
541
 
555
542
/* YYFINAL -- State number of the termination state.  */
556
543
#define YYFINAL  5
668
655
     102,   103,    -1,     3,    -1,   105,   104,     3,    -1,    -1,
669
656
     104,   106,    -1,   113,    -1,   113,    -1,   108,     3,   109,
670
657
      -1,    14,    -1,    -1,   109,   110,    -1,   111,     3,    -1,
671
 
      -1,   112,   111,    -1,   113,    -1,     4,    -1,     4,    -1,
 
658
      -1,   112,   111,    -1,   114,    -1,     4,    -1,     4,    -1,
672
659
      -1,   115,   116,    -1,     5,    -1,     4,    -1,     6,    -1
673
660
};
674
661
 
675
662
/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
676
663
static const yytype_uint16 yyrline[] =
677
664
{
678
 
       0,   191,   191,   195,   195,   197,   199,   203,   209,   209,
679
 
     211,   212,   213,   213,   216,   218,   222,   223,   227,   233,
680
 
     233,   237,   237,   240,   241,   244,   247,   252,   257,   262,
681
 
     265,   268,   271,   274,   277,   280,   283,   286,   291,   291,
682
 
     295,   295,   299,   299,   303,   303,   308,   308,   315,   317,
683
 
     317,   317,   317,   317,   317,   319,   320,   322,   322,   324,
684
 
     325,   325,   331,   333,   335,   336,   338,   338,   340,   341,
685
 
     341,   347,   349,   351,   351,   355,   355,   358,   359,   364,
686
 
     367,   370,   373,   376,   379,   382,   385,   388,   391,   394,
687
 
     397,   400,   403,   406,   411,   411,   415,   415,   419,   419,
688
 
     423,   423,   427,   427,   433,   435,   437,   437,   439,   439,
689
 
     441,   441,   443,   445,   450,   452,   452,   454,   454,   456,
690
 
     456,   458,   460,   467,   469,   471,   471,   473,   475,   475,
691
 
     477,   487,   490,   493,   493,   495,   497,   499
 
665
       0,   196,   196,   200,   200,   202,   204,   208,   214,   214,
 
666
     216,   217,   218,   218,   221,   223,   227,   228,   232,   238,
 
667
     238,   242,   242,   245,   246,   249,   252,   257,   262,   267,
 
668
     270,   273,   276,   279,   282,   285,   288,   291,   296,   296,
 
669
     300,   300,   304,   304,   308,   308,   313,   313,   320,   322,
 
670
     322,   322,   322,   322,   322,   324,   325,   327,   327,   329,
 
671
     330,   330,   336,   338,   340,   341,   343,   343,   345,   346,
 
672
     346,   352,   354,   356,   356,   360,   360,   363,   364,   369,
 
673
     372,   375,   378,   381,   384,   387,   390,   393,   396,   399,
 
674
     402,   405,   408,   411,   416,   416,   420,   420,   424,   424,
 
675
     428,   428,   432,   432,   438,   440,   442,   442,   444,   444,
 
676
     446,   446,   448,   450,   455,   457,   457,   459,   459,   461,
 
677
     461,   463,   465,   472,   474,   479,   479,   481,   483,   483,
 
678
     485,   505,   508,   511,   511,   513,   515,   517
692
679
};
693
680
#endif
694
681
 
705
692
  "EP_C", "EP_S", "EP_A", "EP_W", "EP_H1", "EP_H2", "EP_A1", "EP_A2",
706
693
  "EP_K1", "EP_K2", "EP_AP", "EP_P", "EP_L", "EP_LP", "EP_LR", "EP_LPHI",
707
694
  "EP_LC", "EP_LA", "EP_SIZE", "EP_FOS", "$accept", "input", "nethead",
708
 
  "vertices", "verticeshead", "vertdefs", "vertexline", "$@1", "vertex",
709
 
  "vertexid", "vertexcoords", "shape", "params", "param", "vpword", "$@2",
710
 
  "$@3", "$@4", "$@5", "$@6", "vpwordpar", "edgeblock", "arcs", "arcsdefs",
711
 
  "arcsline", "$@7", "arcfrom", "arcto", "edges", "edgesdefs", "edgesline",
712
 
  "$@8", "edgefrom", "edgeto", "weight", "edgeparams", "edgeparam",
713
 
  "epword", "$@9", "$@10", "$@11", "$@12", "$@13", "epwordpar", "arcslist",
 
695
  "vertices", "verticeshead", "vertdefs", "vertexline", "@1", "vertex",
 
696
  "vertexid", "vertexcoords", "shape", "params", "param", "vpword", "@2",
 
697
  "@3", "@4", "@5", "@6", "vpwordpar", "edgeblock", "arcs", "arcsdefs",
 
698
  "arcsline", "@7", "arcfrom", "arcto", "edges", "edgesdefs", "edgesline",
 
699
  "@8", "edgefrom", "edgeto", "weight", "edgeparams", "edgeparam",
 
700
  "epword", "@9", "@10", "@11", "@12", "@13", "epwordpar", "arcslist",
714
701
  "arcslistlines", "arclistline", "arctolist", "arclistfrom", "arclistto",
715
702
  "edgeslist", "edgelistlines", "edgelistline", "edgetolist",
716
703
  "edgelistfrom", "edgelistto", "adjmatrix", "matrixline",
771
758
       1,     1,     1,     0,     2,     1,     1,     1
772
759
};
773
760
 
774
 
/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
775
 
   Performed when YYTABLE doesn't specify something else to do.  Zero
 
761
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
 
762
   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
776
763
   means the default is an error.  */
777
764
static const yytype_uint8 yydefact[] =
778
765
{
808
795
      58,    87,    59,    78,    97,   102,   144,   145,   169,   178,
809
796
     179,   183,   166,   196,    26,    47,    63,    80,    64,    89,
810
797
      27,    48,    67,    81,    68,    92,    28,    29,    49,    70,
811
 
      71,    72,    55,    98,     4,   188
 
798
      71,    72,    55,    73,     4,   188
812
799
};
813
800
 
814
801
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
816
803
#define YYPACT_NINF -167
817
804
static const yytype_int16 yypact[] =
818
805
{
819
 
      -4,  -167,     7,    36,    22,  -167,    48,  -167,    51,  -167,
820
 
    -167,  -167,  -167,  -167,  -167,    48,    10,  -167,  -167,    12,
821
 
      27,    56,    58,  -167,  -167,  -167,  -167,  -167,  -167,    59,
822
 
      29,  -167,  -167,    60,  -167,    61,  -167,  -167,  -167,  -167,
823
 
    -167,    62,  -167,    31,  -167,    33,  -167,    35,    37,    39,
824
 
    -167,     5,  -167,  -167,    48,  -167,    31,  -167,  -167,    48,
 
806
      -4,  -167,     7,    36,    22,  -167,    44,  -167,    49,  -167,
 
807
    -167,  -167,  -167,  -167,  -167,    44,    10,  -167,  -167,    12,
 
808
      27,    51,    56,  -167,  -167,  -167,  -167,  -167,  -167,    58,
 
809
      29,  -167,  -167,    59,  -167,    60,  -167,  -167,  -167,  -167,
 
810
    -167,    61,  -167,    31,  -167,    33,  -167,    35,    37,    39,
 
811
    -167,     5,  -167,  -167,    44,  -167,    31,  -167,  -167,    44,
825
812
    -167,    33,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,
826
 
    -167,    64,    48,  -167,    65,  -167,  -167,  -167,  -167,  -167,
 
813
    -167,    62,    65,  -167,    65,  -167,  -167,  -167,  -167,  -167,
827
814
      47,    53,  -167,  -167,     5,    65,    65,    65,  -167,  -167,
828
815
    -167,  -167,  -167,  -167,  -167,  -167,    65,  -167,  -167,  -167,
829
816
     220,  -167,   151,   172,  -167,    65,    65,    65,    65,    65,
844
831
{
845
832
    -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,
846
833
    -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,
847
 
    -145,  -167,  -167,    24,  -167,  -167,  -167,  -167,  -167,    26,
848
 
    -167,  -167,  -167,  -167,   -17,   -26,  -167,  -167,  -167,  -167,
 
834
    -145,  -167,  -167,    26,  -167,  -167,  -167,  -167,  -167,    25,
 
835
    -167,  -167,  -167,  -167,   -15,   -26,  -167,  -167,  -167,  -167,
849
836
    -167,  -167,  -167,  -166,  -167,  -167,  -167,  -167,  -167,  -167,
850
837
    -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,  -167,
851
838
       2,  -167,    -1,   -19,  -167,    -2
853
840
 
854
841
/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
855
842
   positive, shift that token.  If negative, reduce the rule which
856
 
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 
843
   number is the opposite.  If zero, do what YYDEFACT says.
 
844
   If YYTABLE_NINF, syntax error.  */
857
845
#define YYTABLE_NINF -129
858
846
static const yytype_int16 yytable[] =
859
847
{
861
849
      11,    12,   200,   201,    18,    31,    32,   202,   194,   195,
862
850
      19,    20,    21,    22,    23,     9,    10,    11,    12,    42,
863
851
      34,    32,    39,    14,    52,    14,    57,    14,    62,    14,
864
 
      66,    14,  -128,    14,    60,     6,    65,    69,    73,    75,
865
 
      88,    14,    14,    77,    17,    85,    91,    14,    79,    36,
866
 
      60,    37,    38,    44,    46,    50,    96,    82,    56,    32,
867
 
      99,    73,    61,   103,    83,     0,     0,   101,     0,    90,
 
852
      66,    14,  -128,    32,    60,     6,    65,    69,    14,    75,
 
853
      88,    14,    17,    77,    36,    85,    91,    14,    79,    37,
 
854
      60,    38,    44,    46,    50,    82,    96,    98,    98,    32,
 
855
      56,    61,    99,   103,    83,     0,     0,   101,     0,    90,
868
856
      93,     0,    95,     0,     0,     0,   147,   148,   150,   152,
869
857
     154,   155,   156,   157,   158,   159,   160,   161,   162,     0,
870
858
       0,   165,     0,     0,     0,   167,   168,     0,   170,   171,
885
873
     120
886
874
};
887
875
 
888
 
#define yypact_value_is_default(yystate) \
889
 
  ((yystate) == (-167))
890
 
 
891
 
#define yytable_value_is_error(yytable_value) \
892
 
  YYID (0)
893
 
 
894
876
static const yytype_int16 yycheck[] =
895
877
{
896
878
      19,    20,     4,   169,     8,     6,   151,     0,   153,     4,
897
879
       5,     6,   178,   179,    15,     3,     4,   183,   163,   164,
898
880
      10,    11,    12,    13,    14,     3,     4,     5,     6,    30,
899
881
       3,     4,     3,     4,     3,     4,     3,     4,     3,     4,
900
 
       3,     4,     3,     4,    45,     9,    47,    48,    49,    51,
901
 
       3,     4,     4,    54,     3,    74,     3,     4,    59,     3,
902
 
      61,     3,     3,     3,     3,     3,    85,     3,    44,     4,
903
 
      87,    72,    46,    99,    72,    -1,    -1,    96,    -1,    80,
 
882
       3,     4,     3,     4,    45,     9,    47,    48,     4,    51,
 
883
       3,     4,     3,    54,     3,    74,     3,     4,    59,     3,
 
884
      61,     3,     3,     3,     3,     3,    85,    86,    87,     4,
 
885
      44,    46,    87,    99,    72,    -1,    -1,    96,    -1,    80,
904
886
      81,    -1,    84,    -1,    -1,    -1,   105,   106,   107,   108,
905
887
     109,   110,   111,   112,   113,   114,   115,   116,   117,    -1,
906
888
      -1,   120,    -1,    -1,    -1,   124,   125,    -1,   127,   128,
932
914
      57,    59,   113,    74,     3,    80,     3,    96,   102,   109,
933
915
       3,    58,     3,    75,    77,   113,    74,     3,    81,    83,
934
916
     113,    80,     3,    97,    99,   113,     3,   103,   105,   113,
935
 
     110,   111,   112,   113,    60,   116,    78,   113,    84,   113,
 
917
     110,   111,   112,   114,    60,   116,    78,   113,    84,   113,
936
918
      98,   104,     3,   111,    61,   114,    76,    82,     3,   100,
937
919
     113,     3,   106,   113,    62,   116,   114,    85,   114,    85,
938
920
      63,   114,    86,    86,     3,    15,    16,    17,    18,    19,
960
942
 
961
943
/* Like YYERROR except do call yyerror.  This remains here temporarily
962
944
   to ease the transition to the new meaning of YYERROR, for GCC.
963
 
   Once GCC version 2 has supplanted version 1, this can go.  However,
964
 
   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
965
 
   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
966
 
   discussed.  */
 
945
   Once GCC version 2 has supplanted version 1, this can go.  */
967
946
 
968
947
#define YYFAIL          goto yyerrlab
969
 
#if defined YYFAIL
970
 
  /* This is here to suppress warnings from the GCC cpp's
971
 
     -Wunused-macros.  Normally we don't worry about that warning, but
972
 
     some users do, and we want to make it easy for users to remove
973
 
     YYFAIL uses, which will produce warnings from Bison 2.5.  */
974
 
#endif
975
948
 
976
949
#define YYRECOVERING()  (!!yyerrstatus)
977
950
 
981
954
    {                                                           \
982
955
      yychar = (Token);                                         \
983
956
      yylval = (Value);                                         \
 
957
      yytoken = YYTRANSLATE (yychar);                           \
984
958
      YYPOPSTACK (1);                                           \
985
959
      goto yybackup;                                            \
986
960
    }                                                           \
1146
1120
#if (defined __STDC__ || defined __C99__FUNC__ \
1147
1121
     || defined __cplusplus || defined _MSC_VER)
1148
1122
static void
1149
 
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
 
1123
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
1150
1124
#else
1151
1125
static void
1152
 
yy_stack_print (yybottom, yytop)
1153
 
    yytype_int16 *yybottom;
1154
 
    yytype_int16 *yytop;
 
1126
yy_stack_print (bottom, top)
 
1127
    yytype_int16 *bottom;
 
1128
    yytype_int16 *top;
1155
1129
#endif
1156
1130
{
1157
1131
  YYFPRINTF (stderr, "Stack now");
1158
 
  for (; yybottom <= yytop; yybottom++)
1159
 
    {
1160
 
      int yybot = *yybottom;
1161
 
      YYFPRINTF (stderr, " %d", yybot);
1162
 
    }
 
1132
  for (; bottom <= top; ++bottom)
 
1133
    YYFPRINTF (stderr, " %d", *bottom);
1163
1134
  YYFPRINTF (stderr, "\n");
1164
1135
}
1165
1136
 
1195
1166
  /* The symbols being reduced.  */
1196
1167
  for (yyi = 0; yyi < yynrhs; yyi++)
1197
1168
    {
1198
 
      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
 
1169
      fprintf (stderr, "   $%d = ", yyi + 1);
1199
1170
      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1200
1171
                       &(yyvsp[(yyi + 1) - (yynrhs)])
1201
1172
                       , &(yylsp[(yyi + 1) - (yynrhs)])                , context);
1202
 
      YYFPRINTF (stderr, "\n");
 
1173
      fprintf (stderr, "\n");
1203
1174
    }
1204
1175
}
1205
1176
 
1236
1207
# define YYMAXDEPTH 10000
1237
1208
#endif
1238
1209
 
 
1210
 
1239
1211
 
1240
1212
#if YYERROR_VERBOSE
1241
1213
 
1338
1310
}
1339
1311
# endif
1340
1312
 
1341
 
/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1342
 
   about the unexpected token YYTOKEN for the state stack whose top is
1343
 
   YYSSP.
1344
 
 
1345
 
   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
1346
 
   not large enough to hold the message.  In that case, also set
1347
 
   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
1348
 
   required number of bytes is too large to store.  */
1349
 
static int
1350
 
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1351
 
                yytype_int16 *yyssp, int yytoken)
 
1313
/* Copy into YYRESULT an error message about the unexpected token
 
1314
   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
 
1315
   including the terminating null byte.  If YYRESULT is null, do not
 
1316
   copy anything; just return the number of bytes that would be
 
1317
   copied.  As a special case, return 0 if an ordinary "syntax error"
 
1318
   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
 
1319
   size calculation.  */
 
1320
static YYSIZE_T
 
1321
yysyntax_error (char *yyresult, int yystate, int yychar)
1352
1322
{
1353
 
  YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
1354
 
  YYSIZE_T yysize = yysize0;
1355
 
  YYSIZE_T yysize1;
1356
 
  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1357
 
  /* Internationalized format string. */
1358
 
  const char *yyformat = 0;
1359
 
  /* Arguments of yyformat. */
1360
 
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1361
 
  /* Number of reported tokens (one for the "unexpected", one per
1362
 
     "expected"). */
1363
 
  int yycount = 0;
1364
 
 
1365
 
  /* There are many possibilities here to consider:
1366
 
     - Assume YYFAIL is not used.  It's too flawed to consider.  See
1367
 
       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1368
 
       for details.  YYERROR is fine as it does not invoke this
1369
 
       function.
1370
 
     - If this state is a consistent state with a default action, then
1371
 
       the only way this function was invoked is if the default action
1372
 
       is an error action.  In that case, don't check for expected
1373
 
       tokens because there are none.
1374
 
     - The only way there can be no lookahead present (in yychar) is if
1375
 
       this state is a consistent state with a default action.  Thus,
1376
 
       detecting the absence of a lookahead is sufficient to determine
1377
 
       that there is no unexpected or expected token to report.  In that
1378
 
       case, just report a simple "syntax error".
1379
 
     - Don't assume there isn't a lookahead just because this state is a
1380
 
       consistent state with a default action.  There might have been a
1381
 
       previous inconsistent state, consistent state with a non-default
1382
 
       action, or user semantic action that manipulated yychar.
1383
 
     - Of course, the expected token list depends on states to have
1384
 
       correct lookahead information, and it depends on the parser not
1385
 
       to perform extra reductions after fetching a lookahead from the
1386
 
       scanner and before detecting a syntax error.  Thus, state merging
1387
 
       (from LALR or IELR) and default reductions corrupt the expected
1388
 
       token list.  However, the list is correct for canonical LR with
1389
 
       one exception: it will still contain any token that will not be
1390
 
       accepted due to an error action in a later state.
1391
 
  */
1392
 
  if (yytoken != YYEMPTY)
1393
 
    {
1394
 
      int yyn = yypact[*yyssp];
1395
 
      yyarg[yycount++] = yytname[yytoken];
1396
 
      if (!yypact_value_is_default (yyn))
1397
 
        {
1398
 
          /* Start YYX at -YYN if negative to avoid negative indexes in
1399
 
             YYCHECK.  In other words, skip the first -YYN actions for
1400
 
             this state because they are default actions.  */
1401
 
          int yyxbegin = yyn < 0 ? -yyn : 0;
1402
 
          /* Stay within bounds of both yycheck and yytname.  */
1403
 
          int yychecklim = YYLAST - yyn + 1;
1404
 
          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1405
 
          int yyx;
1406
 
 
1407
 
          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1408
 
            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1409
 
                && !yytable_value_is_error (yytable[yyx + yyn]))
1410
 
              {
1411
 
                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1412
 
                  {
1413
 
                    yycount = 1;
1414
 
                    yysize = yysize0;
1415
 
                    break;
1416
 
                  }
1417
 
                yyarg[yycount++] = yytname[yyx];
1418
 
                yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1419
 
                if (! (yysize <= yysize1
1420
 
                       && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1421
 
                  return 2;
1422
 
                yysize = yysize1;
1423
 
              }
1424
 
        }
1425
 
    }
1426
 
 
1427
 
  switch (yycount)
1428
 
    {
1429
 
# define YYCASE_(N, S)                      \
1430
 
      case N:                               \
1431
 
        yyformat = S;                       \
1432
 
      break
1433
 
      YYCASE_(0, YY_("syntax error"));
1434
 
      YYCASE_(1, YY_("syntax error, unexpected %s"));
1435
 
      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1436
 
      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1437
 
      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1438
 
      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1439
 
# undef YYCASE_
1440
 
    }
1441
 
 
1442
 
  yysize1 = yysize + yystrlen (yyformat);
1443
 
  if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1444
 
    return 2;
1445
 
  yysize = yysize1;
1446
 
 
1447
 
  if (*yymsg_alloc < yysize)
1448
 
    {
1449
 
      *yymsg_alloc = 2 * yysize;
1450
 
      if (! (yysize <= *yymsg_alloc
1451
 
             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1452
 
        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1453
 
      return 1;
1454
 
    }
1455
 
 
1456
 
  /* Avoid sprintf, as that infringes on the user's name space.
1457
 
     Don't have undefined behavior even if the translation
1458
 
     produced a string with the wrong number of "%s"s.  */
1459
 
  {
1460
 
    char *yyp = *yymsg;
1461
 
    int yyi = 0;
1462
 
    while ((*yyp = *yyformat) != '\0')
1463
 
      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1464
 
        {
1465
 
          yyp += yytnamerr (yyp, yyarg[yyi++]);
1466
 
          yyformat += 2;
1467
 
        }
1468
 
      else
1469
 
        {
1470
 
          yyp++;
1471
 
          yyformat++;
1472
 
        }
1473
 
  }
1474
 
  return 0;
 
1323
  int yyn = yypact[yystate];
 
1324
 
 
1325
  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
 
1326
    return 0;
 
1327
  else
 
1328
    {
 
1329
      int yytype = YYTRANSLATE (yychar);
 
1330
      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
 
1331
      YYSIZE_T yysize = yysize0;
 
1332
      YYSIZE_T yysize1;
 
1333
      int yysize_overflow = 0;
 
1334
      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
 
1335
      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
 
1336
      int yyx;
 
1337
 
 
1338
# if 0
 
1339
      /* This is so xgettext sees the translatable formats that are
 
1340
         constructed on the fly.  */
 
1341
      YY_("syntax error, unexpected %s");
 
1342
      YY_("syntax error, unexpected %s, expecting %s");
 
1343
      YY_("syntax error, unexpected %s, expecting %s or %s");
 
1344
      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
 
1345
      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
 
1346
# endif
 
1347
      char *yyfmt;
 
1348
      char const *yyf;
 
1349
      static char const yyunexpected[] = "syntax error, unexpected %s";
 
1350
      static char const yyexpecting[] = ", expecting %s";
 
1351
      static char const yyor[] = " or %s";
 
1352
      char yyformat[sizeof yyunexpected
 
1353
                    + sizeof yyexpecting - 1
 
1354
                    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
 
1355
                       * (sizeof yyor - 1))];
 
1356
      char const *yyprefix = yyexpecting;
 
1357
 
 
1358
      /* Start YYX at -YYN if negative to avoid negative indexes in
 
1359
         YYCHECK.  */
 
1360
      int yyxbegin = yyn < 0 ? -yyn : 0;
 
1361
 
 
1362
      /* Stay within bounds of both yycheck and yytname.  */
 
1363
      int yychecklim = YYLAST - yyn + 1;
 
1364
      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
 
1365
      int yycount = 1;
 
1366
 
 
1367
      yyarg[0] = yytname[yytype];
 
1368
      yyfmt = yystpcpy (yyformat, yyunexpected);
 
1369
 
 
1370
      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
 
1371
        if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
 
1372
          {
 
1373
            if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
 
1374
              {
 
1375
                yycount = 1;
 
1376
                yysize = yysize0;
 
1377
                yyformat[sizeof yyunexpected - 1] = '\0';
 
1378
                break;
 
1379
              }
 
1380
            yyarg[yycount++] = yytname[yyx];
 
1381
            yysize1 = yysize + yytnamerr (0, yytname[yyx]);
 
1382
            yysize_overflow |= (yysize1 < yysize);
 
1383
            yysize = yysize1;
 
1384
            yyfmt = yystpcpy (yyfmt, yyprefix);
 
1385
            yyprefix = yyor;
 
1386
          }
 
1387
 
 
1388
      yyf = YY_(yyformat);
 
1389
      yysize1 = yysize + yystrlen (yyf);
 
1390
      yysize_overflow |= (yysize1 < yysize);
 
1391
      yysize = yysize1;
 
1392
 
 
1393
      if (yysize_overflow)
 
1394
        return YYSIZE_MAXIMUM;
 
1395
 
 
1396
      if (yyresult)
 
1397
        {
 
1398
          /* Avoid sprintf, as that infringes on the user's name space.
 
1399
             Don't have undefined behavior even if the translation
 
1400
             produced a string with the wrong number of "%s"s.  */
 
1401
          char *yyp = yyresult;
 
1402
          int yyi = 0;
 
1403
          while ((*yyp = *yyf) != '\0')
 
1404
            {
 
1405
              if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
 
1406
                {
 
1407
                  yyp += yytnamerr (yyp, yyarg[yyi++]);
 
1408
                  yyf += 2;
 
1409
                }
 
1410
              else
 
1411
                {
 
1412
                  yyp++;
 
1413
                  yyf++;
 
1414
                }
 
1415
            }
 
1416
        }
 
1417
      return yysize;
 
1418
    }
1475
1419
}
1476
1420
#endif /* YYERROR_VERBOSE */
 
1421
 
1477
1422
 
1478
1423
/*-----------------------------------------------.
1479
1424
| Release the memory associated to this symbol.  |
1509
1454
        break;
1510
1455
    }
1511
1456
}
1512
 
 
 
1457
 
1513
1458
 
1514
1459
/* Prevent warnings from -Wmissing-prototypes.  */
 
1460
 
1515
1461
#ifdef YYPARSE_PARAM
1516
1462
#if defined __STDC__ || defined __cplusplus
1517
1463
int yyparse (void *YYPARSE_PARAM);
1527
1473
#endif /* ! YYPARSE_PARAM */
1528
1474
 
1529
1475
 
 
1476
 
 
1477
 
 
1478
 
 
1479
 
1530
1480
/*----------.
1531
1481
| yyparse.  |
1532
1482
`----------*/
1553
1503
#endif
1554
1504
#endif
1555
1505
{
1556
 
/* The lookahead symbol.  */
 
1506
  /* The look-ahead symbol.  */
1557
1507
int yychar;
1558
1508
 
1559
 
/* The semantic value of the lookahead symbol.  */
 
1509
/* The semantic value of the look-ahead symbol.  */
1560
1510
YYSTYPE yylval;
1561
1511
 
1562
 
/* Location data for the lookahead symbol.  */
 
1512
/* Number of syntax errors so far.  */
 
1513
int yynerrs;
 
1514
/* Location data for the look-ahead symbol.  */
1563
1515
YYLTYPE yylloc;
1564
1516
 
1565
 
    /* Number of syntax errors so far.  */
1566
 
    int yynerrs;
1567
 
 
1568
 
    int yystate;
1569
 
    /* Number of tokens to shift before error messages enabled.  */
1570
 
    int yyerrstatus;
1571
 
 
1572
 
    /* The stacks and their tools:
1573
 
       `yyss': related to states.
1574
 
       `yyvs': related to semantic values.
1575
 
       `yyls': related to locations.
1576
 
 
1577
 
       Refer to the stacks thru separate pointers, to allow yyoverflow
1578
 
       to reallocate them elsewhere.  */
1579
 
 
1580
 
    /* The state stack.  */
1581
 
    yytype_int16 yyssa[YYINITDEPTH];
1582
 
    yytype_int16 *yyss;
1583
 
    yytype_int16 *yyssp;
1584
 
 
1585
 
    /* The semantic value stack.  */
1586
 
    YYSTYPE yyvsa[YYINITDEPTH];
1587
 
    YYSTYPE *yyvs;
1588
 
    YYSTYPE *yyvsp;
1589
 
 
1590
 
    /* The location stack.  */
1591
 
    YYLTYPE yylsa[YYINITDEPTH];
1592
 
    YYLTYPE *yyls;
1593
 
    YYLTYPE *yylsp;
1594
 
 
1595
 
    /* The locations where the error started and ended.  */
1596
 
    YYLTYPE yyerror_range[3];
1597
 
 
1598
 
    YYSIZE_T yystacksize;
1599
 
 
 
1517
  int yystate;
1600
1518
  int yyn;
1601
1519
  int yyresult;
1602
 
  /* Lookahead token as an internal (translated) token number.  */
1603
 
  int yytoken;
1604
 
  /* The variables used to return semantic value and location from the
1605
 
     action routines.  */
1606
 
  YYSTYPE yyval;
1607
 
  YYLTYPE yyloc;
1608
 
 
 
1520
  /* Number of tokens to shift before error messages enabled.  */
 
1521
  int yyerrstatus;
 
1522
  /* Look-ahead token as an internal (translated) token number.  */
 
1523
  int yytoken = 0;
1609
1524
#if YYERROR_VERBOSE
1610
1525
  /* Buffer for error messages, and its allocated size.  */
1611
1526
  char yymsgbuf[128];
1613
1528
  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1614
1529
#endif
1615
1530
 
 
1531
  /* Three stacks and their tools:
 
1532
     `yyss': related to states,
 
1533
     `yyvs': related to semantic values,
 
1534
     `yyls': related to locations.
 
1535
 
 
1536
     Refer to the stacks thru separate pointers, to allow yyoverflow
 
1537
     to reallocate them elsewhere.  */
 
1538
 
 
1539
  /* The state stack.  */
 
1540
  yytype_int16 yyssa[YYINITDEPTH];
 
1541
  yytype_int16 *yyss = yyssa;
 
1542
  yytype_int16 *yyssp;
 
1543
 
 
1544
  /* The semantic value stack.  */
 
1545
  YYSTYPE yyvsa[YYINITDEPTH];
 
1546
  YYSTYPE *yyvs = yyvsa;
 
1547
  YYSTYPE *yyvsp;
 
1548
 
 
1549
  /* The location stack.  */
 
1550
  YYLTYPE yylsa[YYINITDEPTH];
 
1551
  YYLTYPE *yyls = yylsa;
 
1552
  YYLTYPE *yylsp;
 
1553
  /* The locations where the error started and ended.  */
 
1554
  YYLTYPE yyerror_range[2];
 
1555
 
1616
1556
#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
1617
1557
 
 
1558
  YYSIZE_T yystacksize = YYINITDEPTH;
 
1559
 
 
1560
  /* The variables used to return semantic value and location from the
 
1561
     action routines.  */
 
1562
  YYSTYPE yyval;
 
1563
  YYLTYPE yyloc;
 
1564
 
1618
1565
  /* The number of symbols on the RHS of the reduced rule.
1619
1566
     Keep to zero when no symbol should be popped.  */
1620
1567
  int yylen = 0;
1621
1568
 
1622
 
  yytoken = 0;
1623
 
  yyss = yyssa;
1624
 
  yyvs = yyvsa;
1625
 
  yyls = yylsa;
1626
 
  yystacksize = YYINITDEPTH;
1627
 
 
1628
1569
  YYDPRINTF ((stderr, "Starting parse\n"));
1629
1570
 
1630
1571
  yystate = 0;
1631
1572
  yyerrstatus = 0;
1632
1573
  yynerrs = 0;
1633
 
  yychar = YYEMPTY; /* Cause a token to be read.  */
 
1574
  yychar = YYEMPTY;             /* Cause a token to be read.  */
1634
1575
 
1635
1576
  /* Initialize stack pointers.
1636
1577
     Waste one element of value and location stack
1637
1578
     so that they stay on the same level as the state stack.
1638
1579
     The wasted elements are never initialized.  */
 
1580
 
1639
1581
  yyssp = yyss;
1640
1582
  yyvsp = yyvs;
1641
1583
  yylsp = yyls;
1642
 
 
1643
1584
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1644
1585
  /* Initialize the default location before parsing starts.  */
1645
1586
  yylloc.first_line   = yylloc.last_line   = 1;
1646
 
  yylloc.first_column = yylloc.last_column = 1;
 
1587
  yylloc.first_column = yylloc.last_column = 0;
1647
1588
#endif
1648
1589
 
1649
1590
  goto yysetstate;
1682
1623
                    &yyvs1, yysize * sizeof (*yyvsp),
1683
1624
                    &yyls1, yysize * sizeof (*yylsp),
1684
1625
                    &yystacksize);
1685
 
 
1686
1626
        yyls = yyls1;
1687
1627
        yyss = yyss1;
1688
1628
        yyvs = yyvs1;
1704
1644
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1705
1645
        if (! yyptr)
1706
1646
          goto yyexhaustedlab;
1707
 
        YYSTACK_RELOCATE (yyss_alloc, yyss);
1708
 
        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1709
 
        YYSTACK_RELOCATE (yyls_alloc, yyls);
 
1647
        YYSTACK_RELOCATE (yyss);
 
1648
        YYSTACK_RELOCATE (yyvs);
 
1649
        YYSTACK_RELOCATE (yyls);
1710
1650
#  undef YYSTACK_RELOCATE
1711
1651
        if (yyss1 != yyssa)
1712
1652
          YYSTACK_FREE (yyss1);
1727
1667
 
1728
1668
  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1729
1669
 
1730
 
  if (yystate == YYFINAL)
1731
 
    YYACCEPT;
1732
 
 
1733
1670
  goto yybackup;
1734
1671
 
1735
1672
/*-----------.
1738
1675
yybackup:
1739
1676
 
1740
1677
  /* Do appropriate processing given the current state.  Read a
1741
 
     lookahead token if we need one and don't already have one.  */
 
1678
     look-ahead token if we need one and don't already have one.  */
1742
1679
 
1743
 
  /* First try to decide what to do without reference to lookahead token.  */
 
1680
  /* First try to decide what to do without reference to look-ahead token.  */
1744
1681
  yyn = yypact[yystate];
1745
 
  if (yypact_value_is_default (yyn))
 
1682
  if (yyn == YYPACT_NINF)
1746
1683
    goto yydefault;
1747
1684
 
1748
 
  /* Not known => get a lookahead token if don't already have one.  */
 
1685
  /* Not known => get a look-ahead token if don't already have one.  */
1749
1686
 
1750
 
  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
 
1687
  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
1751
1688
  if (yychar == YYEMPTY)
1752
1689
    {
1753
1690
      YYDPRINTF ((stderr, "Reading a token: "));
1773
1710
  yyn = yytable[yyn];
1774
1711
  if (yyn <= 0)
1775
1712
    {
1776
 
      if (yytable_value_is_error (yyn))
1777
 
        goto yyerrlab;
 
1713
      if (yyn == 0 || yyn == YYTABLE_NINF)
 
1714
        goto yyerrlab;
1778
1715
      yyn = -yyn;
1779
1716
      goto yyreduce;
1780
1717
    }
1781
1718
 
 
1719
  if (yyn == YYFINAL)
 
1720
    YYACCEPT;
 
1721
 
1782
1722
  /* Count tokens shifted since error; after three, turn off error
1783
1723
     status.  */
1784
1724
  if (yyerrstatus)
1785
1725
    yyerrstatus--;
1786
1726
 
1787
 
  /* Shift the lookahead token.  */
 
1727
  /* Shift the look-ahead token.  */
1788
1728
  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1789
1729
 
1790
 
  /* Discard the shifted token.  */
1791
 
  yychar = YYEMPTY;
 
1730
  /* Discard the shifted token unless it is eof.  */
 
1731
  if (yychar != YYEOF)
 
1732
    yychar = YYEMPTY;
1792
1733
 
1793
1734
  yystate = yyn;
1794
1735
  *++yyvsp = yylval;
1829
1770
  switch (yyn)
1830
1771
    {
1831
1772
        case 2:
1832
 
 
1833
 
/* Line 1806 of yacc.c  */
1834
 
#line 191 "foreign-pajek-parser.y"
 
1773
#line 196 "foreign-pajek-parser.y"
1835
1774
    {
1836
1775
  if (context->vcount2 > 0) { igraph_i_pajek_check_bipartite(context); }
1837
1776
 }
1838
1777
    break;
1839
1778
 
1840
1779
  case 6:
1841
 
 
1842
 
/* Line 1806 of yacc.c  */
1843
 
#line 199 "foreign-pajek-parser.y"
 
1780
#line 204 "foreign-pajek-parser.y"
1844
1781
    { 
1845
1782
  context->vcount=(yyvsp[(2) - (2)].intnum); 
1846
1783
  context->vcount2=0;
1848
1785
    break;
1849
1786
 
1850
1787
  case 7:
1851
 
 
1852
 
/* Line 1806 of yacc.c  */
1853
 
#line 203 "foreign-pajek-parser.y"
 
1788
#line 208 "foreign-pajek-parser.y"
1854
1789
    { 
1855
1790
  context->vcount=(yyvsp[(2) - (3)].intnum);
1856
1791
  context->vcount2=(yyvsp[(3) - (3)].intnum);
1859
1794
    break;
1860
1795
 
1861
1796
  case 12:
1862
 
 
1863
 
/* Line 1806 of yacc.c  */
1864
 
#line 213 "foreign-pajek-parser.y"
 
1797
#line 218 "foreign-pajek-parser.y"
1865
1798
    { context->actvertex=(yyvsp[(1) - (1)].intnum); }
1866
1799
    break;
1867
1800
 
1868
1801
  case 13:
1869
 
 
1870
 
/* Line 1806 of yacc.c  */
1871
 
#line 213 "foreign-pajek-parser.y"
 
1802
#line 218 "foreign-pajek-parser.y"
1872
1803
    { }
1873
1804
    break;
1874
1805
 
1875
1806
  case 14:
1876
 
 
1877
 
/* Line 1806 of yacc.c  */
1878
 
#line 216 "foreign-pajek-parser.y"
 
1807
#line 221 "foreign-pajek-parser.y"
1879
1808
    { (yyval.intnum)=(yyvsp[(1) - (1)].intnum); context->mode=1; }
1880
1809
    break;
1881
1810
 
1882
1811
  case 15:
1883
 
 
1884
 
/* Line 1806 of yacc.c  */
1885
 
#line 218 "foreign-pajek-parser.y"
 
1812
#line 223 "foreign-pajek-parser.y"
1886
1813
    {
1887
1814
  igraph_i_pajek_add_string_vertex_attribute("id", (yyvsp[(1) - (1)].string).str, (yyvsp[(1) - (1)].string).len, context);
1888
1815
}
1889
1816
    break;
1890
1817
 
1891
1818
  case 17:
1892
 
 
1893
 
/* Line 1806 of yacc.c  */
1894
 
#line 223 "foreign-pajek-parser.y"
 
1819
#line 228 "foreign-pajek-parser.y"
1895
1820
    { 
1896
1821
  igraph_i_pajek_add_numeric_vertex_attribute("x", (yyvsp[(1) - (2)].realnum), context);
1897
1822
  igraph_i_pajek_add_numeric_vertex_attribute("y", (yyvsp[(2) - (2)].realnum), context);
1899
1824
    break;
1900
1825
 
1901
1826
  case 18:
1902
 
 
1903
 
/* Line 1806 of yacc.c  */
1904
 
#line 227 "foreign-pajek-parser.y"
 
1827
#line 232 "foreign-pajek-parser.y"
1905
1828
    { 
1906
1829
  igraph_i_pajek_add_numeric_vertex_attribute("x", (yyvsp[(1) - (3)].realnum), context);
1907
1830
  igraph_i_pajek_add_numeric_vertex_attribute("y", (yyvsp[(2) - (3)].realnum), context);
1910
1833
    break;
1911
1834
 
1912
1835
  case 20:
1913
 
 
1914
 
/* Line 1806 of yacc.c  */
1915
 
#line 233 "foreign-pajek-parser.y"
 
1836
#line 238 "foreign-pajek-parser.y"
1916
1837
    { 
1917
1838
  igraph_i_pajek_add_string_vertex_attribute("shape", (yyvsp[(1) - (1)].string).str, (yyvsp[(1) - (1)].string).len, context);
1918
1839
}
1919
1840
    break;
1920
1841
 
1921
1842
  case 24:
1922
 
 
1923
 
/* Line 1806 of yacc.c  */
1924
 
#line 241 "foreign-pajek-parser.y"
 
1843
#line 246 "foreign-pajek-parser.y"
1925
1844
    {
1926
1845
         igraph_i_pajek_add_numeric_vertex_attribute("xfact", (yyvsp[(2) - (2)].realnum), context);
1927
1846
       }
1928
1847
    break;
1929
1848
 
1930
1849
  case 25:
1931
 
 
1932
 
/* Line 1806 of yacc.c  */
1933
 
#line 244 "foreign-pajek-parser.y"
 
1850
#line 249 "foreign-pajek-parser.y"
1934
1851
    {
1935
1852
         igraph_i_pajek_add_numeric_vertex_attribute("yfact", (yyvsp[(2) - (2)].realnum), context);
1936
1853
       }
1937
1854
    break;
1938
1855
 
1939
1856
  case 26:
1940
 
 
1941
 
/* Line 1806 of yacc.c  */
1942
 
#line 247 "foreign-pajek-parser.y"
 
1857
#line 252 "foreign-pajek-parser.y"
1943
1858
    { /* RGB color */
1944
1859
         igraph_i_pajek_add_numeric_vertex_attribute("color-red", (yyvsp[(2) - (4)].realnum), context);
1945
1860
         igraph_i_pajek_add_numeric_vertex_attribute("color-green", (yyvsp[(3) - (4)].realnum), context);
1948
1863
    break;
1949
1864
 
1950
1865
  case 27:
1951
 
 
1952
 
/* Line 1806 of yacc.c  */
1953
 
#line 252 "foreign-pajek-parser.y"
 
1866
#line 257 "foreign-pajek-parser.y"
1954
1867
    {
1955
1868
         igraph_i_pajek_add_numeric_vertex_attribute("framecolor-red", (yyvsp[(2) - (4)].realnum), context);
1956
1869
         igraph_i_pajek_add_numeric_vertex_attribute("framecolor-green", (yyvsp[(3) - (4)].realnum), context);
1959
1872
    break;
1960
1873
 
1961
1874
  case 28:
1962
 
 
1963
 
/* Line 1806 of yacc.c  */
1964
 
#line 257 "foreign-pajek-parser.y"
 
1875
#line 262 "foreign-pajek-parser.y"
1965
1876
    {
1966
1877
         igraph_i_pajek_add_numeric_vertex_attribute("labelcolor-red", (yyvsp[(2) - (4)].realnum), context);
1967
1878
         igraph_i_pajek_add_numeric_vertex_attribute("labelcolor-green", (yyvsp[(3) - (4)].realnum), context);
1970
1881
    break;
1971
1882
 
1972
1883
  case 29:
1973
 
 
1974
 
/* Line 1806 of yacc.c  */
1975
 
#line 262 "foreign-pajek-parser.y"
 
1884
#line 267 "foreign-pajek-parser.y"
1976
1885
    {
1977
1886
         igraph_i_pajek_add_numeric_vertex_attribute("labeldist", (yyvsp[(2) - (2)].realnum), context);
1978
1887
     }
1979
1888
    break;
1980
1889
 
1981
1890
  case 30:
1982
 
 
1983
 
/* Line 1806 of yacc.c  */
1984
 
#line 265 "foreign-pajek-parser.y"
 
1891
#line 270 "foreign-pajek-parser.y"
1985
1892
    {
1986
1893
         igraph_i_pajek_add_numeric_vertex_attribute("labeldegree2", (yyvsp[(2) - (2)].realnum), context);
1987
1894
     }
1988
1895
    break;
1989
1896
 
1990
1897
  case 31:
1991
 
 
1992
 
/* Line 1806 of yacc.c  */
1993
 
#line 268 "foreign-pajek-parser.y"
 
1898
#line 273 "foreign-pajek-parser.y"
1994
1899
    {
1995
1900
         igraph_i_pajek_add_numeric_vertex_attribute("framewidth", (yyvsp[(2) - (2)].realnum), context);
1996
1901
     }
1997
1902
    break;
1998
1903
 
1999
1904
  case 32:
2000
 
 
2001
 
/* Line 1806 of yacc.c  */
2002
 
#line 271 "foreign-pajek-parser.y"
 
1905
#line 276 "foreign-pajek-parser.y"
2003
1906
    {
2004
1907
         igraph_i_pajek_add_numeric_vertex_attribute("fontsize", (yyvsp[(2) - (2)].realnum), context);
2005
1908
     }
2006
1909
    break;
2007
1910
 
2008
1911
  case 33:
2009
 
 
2010
 
/* Line 1806 of yacc.c  */
2011
 
#line 274 "foreign-pajek-parser.y"
 
1912
#line 279 "foreign-pajek-parser.y"
2012
1913
    {       
2013
1914
         igraph_i_pajek_add_numeric_vertex_attribute("rotation", (yyvsp[(2) - (2)].realnum), context);
2014
1915
     }
2015
1916
    break;
2016
1917
 
2017
1918
  case 34:
2018
 
 
2019
 
/* Line 1806 of yacc.c  */
2020
 
#line 277 "foreign-pajek-parser.y"
 
1919
#line 282 "foreign-pajek-parser.y"
2021
1920
    {
2022
1921
         igraph_i_pajek_add_numeric_vertex_attribute("radius", (yyvsp[(2) - (2)].realnum), context);
2023
1922
     }
2024
1923
    break;
2025
1924
 
2026
1925
  case 35:
2027
 
 
2028
 
/* Line 1806 of yacc.c  */
2029
 
#line 280 "foreign-pajek-parser.y"
 
1926
#line 285 "foreign-pajek-parser.y"
2030
1927
    {
2031
1928
         igraph_i_pajek_add_numeric_vertex_attribute("diamondratio", (yyvsp[(2) - (2)].realnum), context);
2032
1929
     }
2033
1930
    break;
2034
1931
 
2035
1932
  case 36:
2036
 
 
2037
 
/* Line 1806 of yacc.c  */
2038
 
#line 283 "foreign-pajek-parser.y"
 
1933
#line 288 "foreign-pajek-parser.y"
2039
1934
    {
2040
1935
         igraph_i_pajek_add_numeric_vertex_attribute("labeldegree", (yyvsp[(2) - (2)].realnum), context);
2041
1936
     }
2042
1937
    break;
2043
1938
 
2044
1939
  case 37:
2045
 
 
2046
 
/* Line 1806 of yacc.c  */
2047
 
#line 286 "foreign-pajek-parser.y"
 
1940
#line 291 "foreign-pajek-parser.y"
2048
1941
    {
2049
1942
         igraph_i_pajek_add_numeric_vertex_attribute("vertexsize", (yyvsp[(2) - (2)].realnum), context);
2050
1943
     }
2051
1944
    break;
2052
1945
 
2053
1946
  case 38:
2054
 
 
2055
 
/* Line 1806 of yacc.c  */
2056
 
#line 291 "foreign-pajek-parser.y"
 
1947
#line 296 "foreign-pajek-parser.y"
2057
1948
    { context->mode=3; }
2058
1949
    break;
2059
1950
 
2060
1951
  case 39:
2061
 
 
2062
 
/* Line 1806 of yacc.c  */
2063
 
#line 291 "foreign-pajek-parser.y"
 
1952
#line 296 "foreign-pajek-parser.y"
2064
1953
    { 
2065
1954
         context->mode=1;
2066
1955
         igraph_i_pajek_add_string_vertex_attribute("font", (yyvsp[(3) - (3)].string).str, (yyvsp[(3) - (3)].string).len, context);
2068
1957
    break;
2069
1958
 
2070
1959
  case 40:
2071
 
 
2072
 
/* Line 1806 of yacc.c  */
2073
 
#line 295 "foreign-pajek-parser.y"
 
1960
#line 300 "foreign-pajek-parser.y"
2074
1961
    { context->mode=3; }
2075
1962
    break;
2076
1963
 
2077
1964
  case 41:
2078
 
 
2079
 
/* Line 1806 of yacc.c  */
2080
 
#line 295 "foreign-pajek-parser.y"
 
1965
#line 300 "foreign-pajek-parser.y"
2081
1966
    {
2082
1967
         context->mode=1;
2083
1968
         igraph_i_pajek_add_string_vertex_attribute("url", (yyvsp[(3) - (3)].string).str, (yyvsp[(3) - (3)].string).len, context);
2085
1970
    break;
2086
1971
 
2087
1972
  case 42:
2088
 
 
2089
 
/* Line 1806 of yacc.c  */
2090
 
#line 299 "foreign-pajek-parser.y"
 
1973
#line 304 "foreign-pajek-parser.y"
2091
1974
    { context->mode=3; }
2092
1975
    break;
2093
1976
 
2094
1977
  case 43:
2095
 
 
2096
 
/* Line 1806 of yacc.c  */
2097
 
#line 299 "foreign-pajek-parser.y"
 
1978
#line 304 "foreign-pajek-parser.y"
2098
1979
    {
2099
1980
         context->mode=1;
2100
1981
         igraph_i_pajek_add_string_vertex_attribute("color", (yyvsp[(3) - (3)].string).str, (yyvsp[(3) - (3)].string).len, context);
2102
1983
    break;
2103
1984
 
2104
1985
  case 44:
2105
 
 
2106
 
/* Line 1806 of yacc.c  */
2107
 
#line 303 "foreign-pajek-parser.y"
 
1986
#line 308 "foreign-pajek-parser.y"
2108
1987
    { context->mode=3; }
2109
1988
    break;
2110
1989
 
2111
1990
  case 45:
2112
 
 
2113
 
/* Line 1806 of yacc.c  */
2114
 
#line 303 "foreign-pajek-parser.y"
 
1991
#line 308 "foreign-pajek-parser.y"
2115
1992
    {
2116
1993
         context->mode=1;
2117
1994
         igraph_i_pajek_add_string_vertex_attribute("framecolor", 
2120
1997
    break;
2121
1998
 
2122
1999
  case 46:
2123
 
 
2124
 
/* Line 1806 of yacc.c  */
2125
 
#line 308 "foreign-pajek-parser.y"
 
2000
#line 313 "foreign-pajek-parser.y"
2126
2001
    { context->mode=3; }
2127
2002
    break;
2128
2003
 
2129
2004
  case 47:
2130
 
 
2131
 
/* Line 1806 of yacc.c  */
2132
 
#line 308 "foreign-pajek-parser.y"
 
2005
#line 313 "foreign-pajek-parser.y"
2133
2006
    {
2134
2007
         context->mode=1;
2135
2008
         igraph_i_pajek_add_string_vertex_attribute("labelcolor", 
2138
2011
    break;
2139
2012
 
2140
2013
  case 48:
2141
 
 
2142
 
/* Line 1806 of yacc.c  */
2143
 
#line 315 "foreign-pajek-parser.y"
 
2014
#line 320 "foreign-pajek-parser.y"
2144
2015
    { (yyval.string)=(yyvsp[(1) - (1)].string); }
2145
2016
    break;
2146
2017
 
2147
2018
  case 55:
2148
 
 
2149
 
/* Line 1806 of yacc.c  */
2150
 
#line 319 "foreign-pajek-parser.y"
 
2019
#line 324 "foreign-pajek-parser.y"
2151
2020
    { context->directed=1; }
2152
2021
    break;
2153
2022
 
2154
2023
  case 56:
2155
 
 
2156
 
/* Line 1806 of yacc.c  */
2157
 
#line 320 "foreign-pajek-parser.y"
 
2024
#line 325 "foreign-pajek-parser.y"
2158
2025
    { context->directed=1; }
2159
2026
    break;
2160
2027
 
2161
2028
  case 60:
2162
 
 
2163
 
/* Line 1806 of yacc.c  */
2164
 
#line 325 "foreign-pajek-parser.y"
 
2029
#line 330 "foreign-pajek-parser.y"
2165
2030
    { context->actedge++;
2166
2031
                          context->mode=2; }
2167
2032
    break;
2168
2033
 
2169
2034
  case 61:
2170
 
 
2171
 
/* Line 1806 of yacc.c  */
2172
 
#line 326 "foreign-pajek-parser.y"
 
2035
#line 331 "foreign-pajek-parser.y"
2173
2036
    { 
2174
2037
  igraph_vector_push_back(context->vector, (yyvsp[(1) - (6)].intnum)-1);
2175
2038
  igraph_vector_push_back(context->vector, (yyvsp[(2) - (6)].intnum)-1); }
2176
2039
    break;
2177
2040
 
2178
2041
  case 64:
2179
 
 
2180
 
/* Line 1806 of yacc.c  */
2181
 
#line 335 "foreign-pajek-parser.y"
 
2042
#line 340 "foreign-pajek-parser.y"
2182
2043
    { context->directed=0; }
2183
2044
    break;
2184
2045
 
2185
2046
  case 65:
2186
 
 
2187
 
/* Line 1806 of yacc.c  */
2188
 
#line 336 "foreign-pajek-parser.y"
 
2047
#line 341 "foreign-pajek-parser.y"
2189
2048
    { context->directed=0; }
2190
2049
    break;
2191
2050
 
2192
2051
  case 69:
2193
 
 
2194
 
/* Line 1806 of yacc.c  */
2195
 
#line 341 "foreign-pajek-parser.y"
 
2052
#line 346 "foreign-pajek-parser.y"
2196
2053
    { context->actedge++; 
2197
2054
                            context->mode=2; }
2198
2055
    break;
2199
2056
 
2200
2057
  case 70:
2201
 
 
2202
 
/* Line 1806 of yacc.c  */
2203
 
#line 342 "foreign-pajek-parser.y"
 
2058
#line 347 "foreign-pajek-parser.y"
2204
2059
    { 
2205
2060
  igraph_vector_push_back(context->vector, (yyvsp[(1) - (6)].intnum)-1);
2206
2061
  igraph_vector_push_back(context->vector, (yyvsp[(2) - (6)].intnum)-1); }
2207
2062
    break;
2208
2063
 
2209
2064
  case 74:
2210
 
 
2211
 
/* Line 1806 of yacc.c  */
2212
 
#line 351 "foreign-pajek-parser.y"
 
2065
#line 356 "foreign-pajek-parser.y"
2213
2066
    {
2214
2067
  igraph_i_pajek_add_numeric_edge_attribute("weight", (yyvsp[(1) - (1)].realnum), context);
2215
2068
}
2216
2069
    break;
2217
2070
 
2218
2071
  case 78:
2219
 
 
2220
 
/* Line 1806 of yacc.c  */
2221
 
#line 359 "foreign-pajek-parser.y"
 
2072
#line 364 "foreign-pajek-parser.y"
2222
2073
    {
2223
2074
       igraph_i_pajek_add_numeric_edge_attribute("color-red", (yyvsp[(2) - (4)].realnum), context);
2224
2075
       igraph_i_pajek_add_numeric_edge_attribute("color-green", (yyvsp[(3) - (4)].realnum), context);
2227
2078
    break;
2228
2079
 
2229
2080
  case 79:
2230
 
 
2231
 
/* Line 1806 of yacc.c  */
2232
 
#line 364 "foreign-pajek-parser.y"
 
2081
#line 369 "foreign-pajek-parser.y"
2233
2082
    { 
2234
2083
       igraph_i_pajek_add_numeric_edge_attribute("arrowsize", (yyvsp[(2) - (2)].realnum), context);
2235
2084
   }
2236
2085
    break;
2237
2086
 
2238
2087
  case 80:
2239
 
 
2240
 
/* Line 1806 of yacc.c  */
2241
 
#line 367 "foreign-pajek-parser.y"
 
2088
#line 372 "foreign-pajek-parser.y"
2242
2089
    {
2243
2090
       igraph_i_pajek_add_numeric_edge_attribute("edgewidth", (yyvsp[(2) - (2)].realnum), context);
2244
2091
   }
2245
2092
    break;
2246
2093
 
2247
2094
  case 81:
2248
 
 
2249
 
/* Line 1806 of yacc.c  */
2250
 
#line 370 "foreign-pajek-parser.y"
 
2095
#line 375 "foreign-pajek-parser.y"
2251
2096
    {
2252
2097
       igraph_i_pajek_add_numeric_edge_attribute("hook1", (yyvsp[(2) - (2)].realnum), context);
2253
2098
   }
2254
2099
    break;
2255
2100
 
2256
2101
  case 82:
2257
 
 
2258
 
/* Line 1806 of yacc.c  */
2259
 
#line 373 "foreign-pajek-parser.y"
 
2102
#line 378 "foreign-pajek-parser.y"
2260
2103
    {
2261
2104
       igraph_i_pajek_add_numeric_edge_attribute("hook2", (yyvsp[(2) - (2)].realnum), context);
2262
2105
   }
2263
2106
    break;
2264
2107
 
2265
2108
  case 83:
2266
 
 
2267
 
/* Line 1806 of yacc.c  */
2268
 
#line 376 "foreign-pajek-parser.y"
 
2109
#line 381 "foreign-pajek-parser.y"
2269
2110
    {
2270
2111
       igraph_i_pajek_add_numeric_edge_attribute("angle1", (yyvsp[(2) - (2)].realnum), context);
2271
2112
   }
2272
2113
    break;
2273
2114
 
2274
2115
  case 84:
2275
 
 
2276
 
/* Line 1806 of yacc.c  */
2277
 
#line 379 "foreign-pajek-parser.y"
 
2116
#line 384 "foreign-pajek-parser.y"
2278
2117
    {
2279
2118
       igraph_i_pajek_add_numeric_edge_attribute("angle2", (yyvsp[(2) - (2)].realnum), context);
2280
2119
   }
2281
2120
    break;
2282
2121
 
2283
2122
  case 85:
2284
 
 
2285
 
/* Line 1806 of yacc.c  */
2286
 
#line 382 "foreign-pajek-parser.y"
 
2123
#line 387 "foreign-pajek-parser.y"
2287
2124
    {
2288
2125
       igraph_i_pajek_add_numeric_edge_attribute("velocity1", (yyvsp[(2) - (2)].realnum), context);
2289
2126
   }
2290
2127
    break;
2291
2128
 
2292
2129
  case 86:
2293
 
 
2294
 
/* Line 1806 of yacc.c  */
2295
 
#line 385 "foreign-pajek-parser.y"
 
2130
#line 390 "foreign-pajek-parser.y"
2296
2131
    {
2297
2132
       igraph_i_pajek_add_numeric_edge_attribute("velocity2", (yyvsp[(2) - (2)].realnum), context);
2298
2133
   }
2299
2134
    break;
2300
2135
 
2301
2136
  case 87:
2302
 
 
2303
 
/* Line 1806 of yacc.c  */
2304
 
#line 388 "foreign-pajek-parser.y"
 
2137
#line 393 "foreign-pajek-parser.y"
2305
2138
    {
2306
2139
       igraph_i_pajek_add_numeric_edge_attribute("arrowpos", (yyvsp[(2) - (2)].realnum), context);
2307
2140
   }
2308
2141
    break;
2309
2142
 
2310
2143
  case 88:
2311
 
 
2312
 
/* Line 1806 of yacc.c  */
2313
 
#line 391 "foreign-pajek-parser.y"
 
2144
#line 396 "foreign-pajek-parser.y"
2314
2145
    {
2315
2146
       igraph_i_pajek_add_numeric_edge_attribute("labelpos", (yyvsp[(2) - (2)].realnum), context);
2316
2147
   }
2317
2148
    break;
2318
2149
 
2319
2150
  case 89:
2320
 
 
2321
 
/* Line 1806 of yacc.c  */
2322
 
#line 394 "foreign-pajek-parser.y"
 
2151
#line 399 "foreign-pajek-parser.y"
2323
2152
    {
2324
2153
       igraph_i_pajek_add_numeric_edge_attribute("labelangle", (yyvsp[(2) - (2)].realnum), context);
2325
2154
   }
2326
2155
    break;
2327
2156
 
2328
2157
  case 90:
2329
 
 
2330
 
/* Line 1806 of yacc.c  */
2331
 
#line 397 "foreign-pajek-parser.y"
 
2158
#line 402 "foreign-pajek-parser.y"
2332
2159
    {
2333
2160
       igraph_i_pajek_add_numeric_edge_attribute("labelangle2", (yyvsp[(2) - (2)].realnum), context);
2334
2161
   }
2335
2162
    break;
2336
2163
 
2337
2164
  case 91:
2338
 
 
2339
 
/* Line 1806 of yacc.c  */
2340
 
#line 400 "foreign-pajek-parser.y"
 
2165
#line 405 "foreign-pajek-parser.y"
2341
2166
    {
2342
2167
       igraph_i_pajek_add_numeric_edge_attribute("labeldegree", (yyvsp[(2) - (2)].realnum), context);
2343
2168
   }
2344
2169
    break;
2345
2170
 
2346
2171
  case 92:
2347
 
 
2348
 
/* Line 1806 of yacc.c  */
2349
 
#line 403 "foreign-pajek-parser.y"
 
2172
#line 408 "foreign-pajek-parser.y"
2350
2173
    {           /* what is this??? */
2351
2174
       igraph_i_pajek_add_numeric_edge_attribute("arrowsize", (yyvsp[(2) - (2)].realnum), context);
2352
2175
   }
2353
2176
    break;
2354
2177
 
2355
2178
  case 93:
2356
 
 
2357
 
/* Line 1806 of yacc.c  */
2358
 
#line 406 "foreign-pajek-parser.y"
 
2179
#line 411 "foreign-pajek-parser.y"
2359
2180
    {
2360
2181
       igraph_i_pajek_add_numeric_edge_attribute("fontsize", (yyvsp[(2) - (2)].realnum), context);
2361
2182
   }
2362
2183
    break;
2363
2184
 
2364
2185
  case 94:
2365
 
 
2366
 
/* Line 1806 of yacc.c  */
2367
 
#line 411 "foreign-pajek-parser.y"
 
2186
#line 416 "foreign-pajek-parser.y"
2368
2187
    { context->mode=4; }
2369
2188
    break;
2370
2189
 
2371
2190
  case 95:
2372
 
 
2373
 
/* Line 1806 of yacc.c  */
2374
 
#line 411 "foreign-pajek-parser.y"
 
2191
#line 416 "foreign-pajek-parser.y"
2375
2192
    {
2376
2193
      context->mode=2;
2377
2194
      igraph_i_pajek_add_string_edge_attribute("arrowtype", (yyvsp[(3) - (3)].string).str, (yyvsp[(3) - (3)].string).len, context);
2379
2196
    break;
2380
2197
 
2381
2198
  case 96:
2382
 
 
2383
 
/* Line 1806 of yacc.c  */
2384
 
#line 415 "foreign-pajek-parser.y"
 
2199
#line 420 "foreign-pajek-parser.y"
2385
2200
    { context->mode=4; }
2386
2201
    break;
2387
2202
 
2388
2203
  case 97:
2389
 
 
2390
 
/* Line 1806 of yacc.c  */
2391
 
#line 415 "foreign-pajek-parser.y"
 
2204
#line 420 "foreign-pajek-parser.y"
2392
2205
    {
2393
2206
      context->mode=2;
2394
2207
      igraph_i_pajek_add_string_edge_attribute("linepattern", (yyvsp[(3) - (3)].string).str, (yyvsp[(3) - (3)].string).len, context);
2396
2209
    break;
2397
2210
 
2398
2211
  case 98:
2399
 
 
2400
 
/* Line 1806 of yacc.c  */
2401
 
#line 419 "foreign-pajek-parser.y"
 
2212
#line 424 "foreign-pajek-parser.y"
2402
2213
    { context->mode=4; }
2403
2214
    break;
2404
2215
 
2405
2216
  case 99:
2406
 
 
2407
 
/* Line 1806 of yacc.c  */
2408
 
#line 419 "foreign-pajek-parser.y"
 
2217
#line 424 "foreign-pajek-parser.y"
2409
2218
    {
2410
2219
      context->mode=2;
2411
2220
      igraph_i_pajek_add_string_edge_attribute("label", (yyvsp[(3) - (3)].string).str, (yyvsp[(3) - (3)].string).len, context);
2413
2222
    break;
2414
2223
 
2415
2224
  case 100:
2416
 
 
2417
 
/* Line 1806 of yacc.c  */
2418
 
#line 423 "foreign-pajek-parser.y"
 
2225
#line 428 "foreign-pajek-parser.y"
2419
2226
    { context->mode=4; }
2420
2227
    break;
2421
2228
 
2422
2229
  case 101:
2423
 
 
2424
 
/* Line 1806 of yacc.c  */
2425
 
#line 423 "foreign-pajek-parser.y"
 
2230
#line 428 "foreign-pajek-parser.y"
2426
2231
    {
2427
2232
      context->mode=2;
2428
2233
      igraph_i_pajek_add_string_edge_attribute("labelcolor", (yyvsp[(3) - (3)].string).str, (yyvsp[(3) - (3)].string).len, context);
2430
2235
    break;
2431
2236
 
2432
2237
  case 102:
2433
 
 
2434
 
/* Line 1806 of yacc.c  */
2435
 
#line 427 "foreign-pajek-parser.y"
 
2238
#line 432 "foreign-pajek-parser.y"
2436
2239
    { context->mode=4; }
2437
2240
    break;
2438
2241
 
2439
2242
  case 103:
2440
 
 
2441
 
/* Line 1806 of yacc.c  */
2442
 
#line 427 "foreign-pajek-parser.y"
 
2243
#line 432 "foreign-pajek-parser.y"
2443
2244
    {
2444
2245
      context->mode=2;
2445
2246
      igraph_i_pajek_add_string_edge_attribute("color", (yyvsp[(3) - (3)].string).str, (yyvsp[(3) - (3)].string).len, context);
2447
2248
    break;
2448
2249
 
2449
2250
  case 104:
2450
 
 
2451
 
/* Line 1806 of yacc.c  */
2452
 
#line 433 "foreign-pajek-parser.y"
 
2251
#line 438 "foreign-pajek-parser.y"
2453
2252
    { context->mode=2; (yyval.string)=(yyvsp[(1) - (1)].string); }
2454
2253
    break;
2455
2254
 
2456
2255
  case 105:
2457
 
 
2458
 
/* Line 1806 of yacc.c  */
2459
 
#line 435 "foreign-pajek-parser.y"
 
2256
#line 440 "foreign-pajek-parser.y"
2460
2257
    { context->directed=1; }
2461
2258
    break;
2462
2259
 
2463
2260
  case 112:
2464
 
 
2465
 
/* Line 1806 of yacc.c  */
2466
 
#line 443 "foreign-pajek-parser.y"
 
2261
#line 448 "foreign-pajek-parser.y"
2467
2262
    { context->mode=0; context->actfrom=fabs((yyvsp[(1) - (1)].intnum))-1; }
2468
2263
    break;
2469
2264
 
2470
2265
  case 113:
2471
 
 
2472
 
/* Line 1806 of yacc.c  */
2473
 
#line 445 "foreign-pajek-parser.y"
 
2266
#line 450 "foreign-pajek-parser.y"
2474
2267
    { 
2475
2268
  igraph_vector_push_back(context->vector, context->actfrom); 
2476
2269
  igraph_vector_push_back(context->vector, fabs((yyvsp[(1) - (1)].intnum))-1); 
2478
2271
    break;
2479
2272
 
2480
2273
  case 114:
2481
 
 
2482
 
/* Line 1806 of yacc.c  */
2483
 
#line 450 "foreign-pajek-parser.y"
 
2274
#line 455 "foreign-pajek-parser.y"
2484
2275
    { context->directed=0; }
2485
2276
    break;
2486
2277
 
2487
2278
  case 121:
2488
 
 
2489
 
/* Line 1806 of yacc.c  */
2490
 
#line 458 "foreign-pajek-parser.y"
 
2279
#line 463 "foreign-pajek-parser.y"
2491
2280
    { context->mode=0; context->actfrom=fabs((yyvsp[(1) - (1)].intnum))-1; }
2492
2281
    break;
2493
2282
 
2494
2283
  case 122:
2495
 
 
2496
 
/* Line 1806 of yacc.c  */
2497
 
#line 460 "foreign-pajek-parser.y"
 
2284
#line 465 "foreign-pajek-parser.y"
2498
2285
    { 
2499
2286
  igraph_vector_push_back(context->vector, context->actfrom); 
2500
2287
  igraph_vector_push_back(context->vector, fabs((yyvsp[(1) - (1)].intnum))-1); 
2502
2289
    break;
2503
2290
 
2504
2291
  case 124:
2505
 
 
2506
 
/* Line 1806 of yacc.c  */
2507
 
#line 469 "foreign-pajek-parser.y"
2508
 
    { context->actfrom=0; context->actto=0; }
 
2292
#line 474 "foreign-pajek-parser.y"
 
2293
    { context->actfrom=0; 
 
2294
                         context->actto=0; 
 
2295
                         context->directed=(context->vcount2==0);
 
2296
                       }
2509
2297
    break;
2510
2298
 
2511
2299
  case 127:
2512
 
 
2513
 
/* Line 1806 of yacc.c  */
2514
 
#line 473 "foreign-pajek-parser.y"
 
2300
#line 481 "foreign-pajek-parser.y"
2515
2301
    { context->actfrom++; context->actto=0; }
2516
2302
    break;
2517
2303
 
2518
2304
  case 130:
2519
 
 
2520
 
/* Line 1806 of yacc.c  */
2521
 
#line 477 "foreign-pajek-parser.y"
 
2305
#line 485 "foreign-pajek-parser.y"
2522
2306
    {
2523
 
  if ((yyvsp[(1) - (1)].intnum)>0) { 
2524
 
    igraph_vector_push_back(context->vector, context->actfrom);
2525
 
    igraph_vector_push_back(context->vector, context->actto);
 
2307
  if ((yyvsp[(1) - (1)].realnum) != 0) {
 
2308
    if (context->vcount2==0) {
 
2309
      context->actedge++;
 
2310
      igraph_i_pajek_add_numeric_edge_attribute("weight", (yyvsp[(1) - (1)].realnum), context);    
 
2311
      igraph_vector_push_back(context->vector, context->actfrom);
 
2312
      igraph_vector_push_back(context->vector, context->actto);
 
2313
    } else if (context->vcount2 + context->actto < context->vcount) {
 
2314
      context->actedge++;
 
2315
      igraph_i_pajek_add_numeric_edge_attribute("weight", (yyvsp[(1) - (1)].realnum), context);    
 
2316
      igraph_vector_push_back(context->vector, context->actfrom);
 
2317
      igraph_vector_push_back(context->vector, 
 
2318
                              context->vcount2+context->actto);
 
2319
    }
2526
2320
  }
2527
2321
  context->actto++;
2528
2322
}
2529
2323
    break;
2530
2324
 
2531
2325
  case 131:
2532
 
 
2533
 
/* Line 1806 of yacc.c  */
2534
 
#line 487 "foreign-pajek-parser.y"
 
2326
#line 505 "foreign-pajek-parser.y"
2535
2327
    { (yyval.intnum)=igraph_pajek_get_number(igraph_pajek_yyget_text(scanner),
2536
2328
                                          igraph_pajek_yyget_leng(scanner)); }
2537
2329
    break;
2538
2330
 
2539
2331
  case 132:
2540
 
 
2541
 
/* Line 1806 of yacc.c  */
2542
 
#line 490 "foreign-pajek-parser.y"
 
2332
#line 508 "foreign-pajek-parser.y"
2543
2333
    { (yyval.realnum)=igraph_pajek_get_number(igraph_pajek_yyget_text(scanner),
2544
2334
                                          igraph_pajek_yyget_leng(scanner)); }
2545
2335
    break;
2546
2336
 
2547
2337
  case 135:
2548
 
 
2549
 
/* Line 1806 of yacc.c  */
2550
 
#line 495 "foreign-pajek-parser.y"
 
2338
#line 513 "foreign-pajek-parser.y"
2551
2339
    { (yyval.string).str=igraph_pajek_yyget_text(scanner); 
2552
2340
              (yyval.string).len=igraph_pajek_yyget_leng(scanner); }
2553
2341
    break;
2554
2342
 
2555
2343
  case 136:
2556
 
 
2557
 
/* Line 1806 of yacc.c  */
2558
 
#line 497 "foreign-pajek-parser.y"
 
2344
#line 515 "foreign-pajek-parser.y"
2559
2345
    { (yyval.string).str=igraph_pajek_yyget_text(scanner); 
2560
2346
              (yyval.string).len=igraph_pajek_yyget_leng(scanner); }
2561
2347
    break;
2562
2348
 
2563
2349
  case 137:
2564
 
 
2565
 
/* Line 1806 of yacc.c  */
2566
 
#line 499 "foreign-pajek-parser.y"
 
2350
#line 517 "foreign-pajek-parser.y"
2567
2351
    { (yyval.string).str=igraph_pajek_yyget_text(scanner)+1; 
2568
2352
               (yyval.string).len=igraph_pajek_yyget_leng(scanner)-2; }
2569
2353
    break;
2570
2354
 
2571
2355
 
2572
 
 
2573
 
/* Line 1806 of yacc.c  */
2574
 
#line 2575 "foreign-pajek-parser.c"
 
2356
/* Line 1267 of yacc.c.  */
 
2357
#line 2358 "foreign-pajek-parser.c"
2575
2358
      default: break;
2576
2359
    }
2577
 
  /* User semantic actions sometimes alter yychar, and that requires
2578
 
     that yytoken be updated with the new translation.  We take the
2579
 
     approach of translating immediately before every use of yytoken.
2580
 
     One alternative is translating here after every semantic action,
2581
 
     but that translation would be missed if the semantic action invokes
2582
 
     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2583
 
     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
2584
 
     incorrect destructor might then be invoked immediately.  In the
2585
 
     case of YYERROR or YYBACKUP, subsequent parser actions might lead
2586
 
     to an incorrect destructor call or verbose syntax error message
2587
 
     before the lookahead is translated.  */
2588
2360
  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
2589
2361
 
2590
2362
  YYPOPSTACK (yylen);
2613
2385
| yyerrlab -- here on detecting error |
2614
2386
`------------------------------------*/
2615
2387
yyerrlab:
2616
 
  /* Make sure we have latest lookahead translation.  See comments at
2617
 
     user semantic actions for why this is necessary.  */
2618
 
  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
2619
 
 
2620
2388
  /* If not already recovering from an error, report this error.  */
2621
2389
  if (!yyerrstatus)
2622
2390
    {
2624
2392
#if ! YYERROR_VERBOSE
2625
2393
      yyerror (&yylloc, context, YY_("syntax error"));
2626
2394
#else
2627
 
# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2628
 
                                        yyssp, yytoken)
2629
2395
      {
2630
 
        char const *yymsgp = YY_("syntax error");
2631
 
        int yysyntax_error_status;
2632
 
        yysyntax_error_status = YYSYNTAX_ERROR;
2633
 
        if (yysyntax_error_status == 0)
2634
 
          yymsgp = yymsg;
2635
 
        else if (yysyntax_error_status == 1)
2636
 
          {
2637
 
            if (yymsg != yymsgbuf)
2638
 
              YYSTACK_FREE (yymsg);
2639
 
            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
2640
 
            if (!yymsg)
2641
 
              {
2642
 
                yymsg = yymsgbuf;
2643
 
                yymsg_alloc = sizeof yymsgbuf;
2644
 
                yysyntax_error_status = 2;
2645
 
              }
2646
 
            else
2647
 
              {
2648
 
                yysyntax_error_status = YYSYNTAX_ERROR;
2649
 
                yymsgp = yymsg;
2650
 
              }
2651
 
          }
2652
 
        yyerror (&yylloc, context, yymsgp);
2653
 
        if (yysyntax_error_status == 2)
2654
 
          goto yyexhaustedlab;
 
2396
        YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
 
2397
        if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
 
2398
          {
 
2399
            YYSIZE_T yyalloc = 2 * yysize;
 
2400
            if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
 
2401
              yyalloc = YYSTACK_ALLOC_MAXIMUM;
 
2402
            if (yymsg != yymsgbuf)
 
2403
              YYSTACK_FREE (yymsg);
 
2404
            yymsg = (char *) YYSTACK_ALLOC (yyalloc);
 
2405
            if (yymsg)
 
2406
              yymsg_alloc = yyalloc;
 
2407
            else
 
2408
              {
 
2409
                yymsg = yymsgbuf;
 
2410
                yymsg_alloc = sizeof yymsgbuf;
 
2411
              }
 
2412
          }
 
2413
 
 
2414
        if (0 < yysize && yysize <= yymsg_alloc)
 
2415
          {
 
2416
            (void) yysyntax_error (yymsg, yystate, yychar);
 
2417
            yyerror (&yylloc, context, yymsg);
 
2418
          }
 
2419
        else
 
2420
          {
 
2421
            yyerror (&yylloc, context, YY_("syntax error"));
 
2422
            if (yysize != 0)
 
2423
              goto yyexhaustedlab;
 
2424
          }
2655
2425
      }
2656
 
# undef YYSYNTAX_ERROR
2657
2426
#endif
2658
2427
    }
2659
2428
 
2660
 
  yyerror_range[1] = yylloc;
 
2429
  yyerror_range[0] = yylloc;
2661
2430
 
2662
2431
  if (yyerrstatus == 3)
2663
2432
    {
2664
 
      /* If just tried and failed to reuse lookahead token after an
 
2433
      /* If just tried and failed to reuse look-ahead token after an
2665
2434
         error, discard it.  */
2666
2435
 
2667
2436
      if (yychar <= YYEOF)
2678
2447
        }
2679
2448
    }
2680
2449
 
2681
 
  /* Else will try to reuse lookahead token after shifting the error
 
2450
  /* Else will try to reuse look-ahead token after shifting the error
2682
2451
     token.  */
2683
2452
  goto yyerrlab1;
2684
2453
 
2694
2463
  if (/*CONSTCOND*/ 0)
2695
2464
     goto yyerrorlab;
2696
2465
 
2697
 
  yyerror_range[1] = yylsp[1-yylen];
 
2466
  yyerror_range[0] = yylsp[1-yylen];
2698
2467
  /* Do not reclaim the symbols of the rule which action triggered
2699
2468
     this YYERROR.  */
2700
2469
  YYPOPSTACK (yylen);
2713
2482
  for (;;)
2714
2483
    {
2715
2484
      yyn = yypact[yystate];
2716
 
      if (!yypact_value_is_default (yyn))
 
2485
      if (yyn != YYPACT_NINF)
2717
2486
        {
2718
2487
          yyn += YYTERROR;
2719
2488
          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
2728
2497
      if (yyssp == yyss)
2729
2498
        YYABORT;
2730
2499
 
2731
 
      yyerror_range[1] = *yylsp;
 
2500
      yyerror_range[0] = *yylsp;
2732
2501
      yydestruct ("Error: popping",
2733
2502
                  yystos[yystate], yyvsp, yylsp, context);
2734
2503
      YYPOPSTACK (1);
2736
2505
      YY_STACK_PRINT (yyss, yyssp);
2737
2506
    }
2738
2507
 
 
2508
  if (yyn == YYFINAL)
 
2509
    YYACCEPT;
 
2510
 
2739
2511
  *++yyvsp = yylval;
2740
2512
 
2741
 
  yyerror_range[2] = yylloc;
 
2513
  yyerror_range[1] = yylloc;
2742
2514
  /* Using YYLLOC is tempting, but would change the location of
2743
 
     the lookahead.  YYLOC is available though.  */
2744
 
  YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
 
2515
     the look-ahead.  YYLOC is available though.  */
 
2516
  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
2745
2517
  *++yylsp = yyloc;
2746
2518
 
2747
2519
  /* Shift the error token.  */
2765
2537
  yyresult = 1;
2766
2538
  goto yyreturn;
2767
2539
 
2768
 
#if !defined(yyoverflow) || YYERROR_VERBOSE
 
2540
#ifndef yyoverflow
2769
2541
/*-------------------------------------------------.
2770
2542
| yyexhaustedlab -- memory exhaustion comes here.  |
2771
2543
`-------------------------------------------------*/
2776
2548
#endif
2777
2549
 
2778
2550
yyreturn:
2779
 
  if (yychar != YYEMPTY)
2780
 
    {
2781
 
      /* Make sure we have latest lookahead translation.  See comments at
2782
 
         user semantic actions for why this is necessary.  */
2783
 
      yytoken = YYTRANSLATE (yychar);
2784
 
      yydestruct ("Cleanup: discarding lookahead",
2785
 
                  yytoken, &yylval, &yylloc, context);
2786
 
    }
 
2551
  if (yychar != YYEOF && yychar != YYEMPTY)
 
2552
     yydestruct ("Cleanup: discarding lookahead",
 
2553
                 yytoken, &yylval, &yylloc, context);
2787
2554
  /* Do not reclaim the symbols of the rule which action triggered
2788
2555
     this YYABORT or YYACCEPT.  */
2789
2556
  YYPOPSTACK (yylen);
2807
2574
}
2808
2575
 
2809
2576
 
2810
 
 
2811
 
/* Line 2067 of yacc.c  */
2812
 
#line 502 "foreign-pajek-parser.y"
 
2577
#line 520 "foreign-pajek-parser.y"
2813
2578
 
2814
2579
 
2815
2580
int igraph_pajek_yyerror(YYLTYPE* locp,