1
#line 2 "foreign-gml-lexer.c"
3
#line 4 "foreign-gml-lexer.c"
5
#define YY_INT_ALIGNED short int
7
/* A lexical scanner generated by flex */
9
#define yy_create_buffer igraph_gml_yy_create_buffer
10
#define yy_delete_buffer igraph_gml_yy_delete_buffer
11
#define yy_flex_debug igraph_gml_yy_flex_debug
12
#define yy_init_buffer igraph_gml_yy_init_buffer
13
#define yy_flush_buffer igraph_gml_yy_flush_buffer
14
#define yy_load_buffer_state igraph_gml_yy_load_buffer_state
15
#define yy_switch_to_buffer igraph_gml_yy_switch_to_buffer
16
#define yyin igraph_gml_yyin
17
#define yyleng igraph_gml_yyleng
18
#define yylex igraph_gml_yylex
19
#define yylineno igraph_gml_yylineno
20
#define yyout igraph_gml_yyout
21
#define yyrestart igraph_gml_yyrestart
22
#define yytext igraph_gml_yytext
23
#define yywrap igraph_gml_yywrap
24
#define yyalloc igraph_gml_yyalloc
25
#define yyrealloc igraph_gml_yyrealloc
26
#define yyfree igraph_gml_yyfree
29
#define YY_FLEX_MAJOR_VERSION 2
30
#define YY_FLEX_MINOR_VERSION 5
31
#define YY_FLEX_SUBMINOR_VERSION 35
32
#if YY_FLEX_SUBMINOR_VERSION > 0
36
/* First, we deal with platform-specific or compiler-specific issues. */
38
/* begin standard C headers. */
44
/* end standard C headers. */
46
/* flex integer type definitions */
51
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
53
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
55
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
56
* if you want the limit (max/min) macros for int types.
58
#ifndef __STDC_LIMIT_MACROS
59
#define __STDC_LIMIT_MACROS 1
63
typedef int8_t flex_int8_t;
64
typedef uint8_t flex_uint8_t;
65
typedef int16_t flex_int16_t;
66
typedef uint16_t flex_uint16_t;
67
typedef int32_t flex_int32_t;
68
typedef uint32_t flex_uint32_t;
70
typedef signed char flex_int8_t;
71
typedef short int flex_int16_t;
72
typedef int flex_int32_t;
73
typedef unsigned char flex_uint8_t;
74
typedef unsigned short int flex_uint16_t;
75
typedef unsigned int flex_uint32_t;
77
/* Limits of integral types. */
79
#define INT8_MIN (-128)
82
#define INT16_MIN (-32767-1)
85
#define INT32_MIN (-2147483647-1)
88
#define INT8_MAX (127)
91
#define INT16_MAX (32767)
94
#define INT32_MAX (2147483647)
97
#define UINT8_MAX (255U)
100
#define UINT16_MAX (65535U)
103
#define UINT32_MAX (4294967295U)
108
#endif /* ! FLEXINT_H */
112
/* The "const" storage-class-modifier is valid. */
115
#else /* ! __cplusplus */
117
/* C99 requires __STDC__ to be defined as 1. */
118
#if defined (__STDC__)
122
#endif /* defined (__STDC__) */
123
#endif /* ! __cplusplus */
126
#define yyconst const
131
/* Returned upon end-of-file. */
134
/* Promotes a possibly negative, possibly signed char to an unsigned
135
* integer for use as an array index. If the signed char is negative,
136
* we want to instead treat it as an 8-bit unsigned char, hence the
139
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
141
/* Enter a start condition. This macro really ought to take a parameter,
142
* but we do it the disgusting crufty way forced on us by the ()-less
143
* definition of BEGIN.
145
#define BEGIN (yy_start) = 1 + 2 *
147
/* Translate the current start state into a value that can be later handed
148
* to BEGIN to return to the state. The YYSTATE alias is for lex
151
#define YY_START (((yy_start) - 1) / 2)
152
#define YYSTATE YY_START
154
/* Action number for EOF rule of a given start state. */
155
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
157
/* Special action meaning "start processing a new file". */
158
#define YY_NEW_FILE igraph_gml_yyrestart(igraph_gml_yyin )
160
#define YY_END_OF_BUFFER_CHAR 0
162
/* Size of default input buffer. */
164
#define YY_BUF_SIZE 16384
167
/* The state buf must be large enough to hold one state per character in the main buffer.
169
#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
171
#ifndef YY_TYPEDEF_YY_BUFFER_STATE
172
#define YY_TYPEDEF_YY_BUFFER_STATE
173
typedef struct yy_buffer_state *YY_BUFFER_STATE;
176
extern int igraph_gml_yyleng;
178
extern FILE *igraph_gml_yyin, *igraph_gml_yyout;
180
#define EOB_ACT_CONTINUE_SCAN 0
181
#define EOB_ACT_END_OF_FILE 1
182
#define EOB_ACT_LAST_MATCH 2
184
#define YY_LESS_LINENO(n)
186
/* Return all but the first "n" matched characters back to the input stream. */
190
/* Undo effects of setting up igraph_gml_yytext. */ \
191
int yyless_macro_arg = (n); \
192
YY_LESS_LINENO(yyless_macro_arg);\
193
*yy_cp = (yy_hold_char); \
194
YY_RESTORE_YY_MORE_OFFSET \
195
(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
196
YY_DO_BEFORE_ACTION; /* set up igraph_gml_yytext again */ \
200
#define unput(c) yyunput( c, (yytext_ptr) )
202
#ifndef YY_TYPEDEF_YY_SIZE_T
203
#define YY_TYPEDEF_YY_SIZE_T
204
typedef size_t yy_size_t;
207
#ifndef YY_STRUCT_YY_BUFFER_STATE
208
#define YY_STRUCT_YY_BUFFER_STATE
209
struct yy_buffer_state
213
char *yy_ch_buf; /* input buffer */
214
char *yy_buf_pos; /* current position in input buffer */
216
/* Size of input buffer in bytes, not including room for EOB
219
yy_size_t yy_buf_size;
221
/* Number of characters read into yy_ch_buf, not including EOB
226
/* Whether we "own" the buffer - i.e., we know we created it,
227
* and can realloc() it to grow it, and should free() it to
230
int yy_is_our_buffer;
232
/* Whether this is an "interactive" input source; if so, and
233
* if we're using stdio for input, then we want to use getc()
234
* instead of fread(), to make sure we stop fetching input after
237
int yy_is_interactive;
239
/* Whether we're considered to be at the beginning of a line.
240
* If so, '^' rules will be active on the next match, otherwise
245
int yy_bs_lineno; /**< The line count. */
246
int yy_bs_column; /**< The column count. */
248
/* Whether to try to fill the input buffer when we reach the
253
int yy_buffer_status;
255
#define YY_BUFFER_NEW 0
256
#define YY_BUFFER_NORMAL 1
257
/* When an EOF's been seen but there's still some text to process
258
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
259
* shouldn't try reading from the input source any more. We might
260
* still have a bunch of tokens to match, though, because of
261
* possible backing-up.
263
* When we actually see the EOF, we change the status to "new"
264
* (via igraph_gml_yyrestart()), so that the user can continue scanning by
265
* just pointing igraph_gml_yyin at a new input file.
267
#define YY_BUFFER_EOF_PENDING 2
270
#endif /* !YY_STRUCT_YY_BUFFER_STATE */
272
/* Stack of input buffers. */
273
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
274
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
275
static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
277
/* We provide macros for accessing buffer states in case in the
278
* future we want to put the buffer states in a more general
281
* Returns the top of the stack, or NULL.
283
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
284
? (yy_buffer_stack)[(yy_buffer_stack_top)] \
287
/* Same as previous macro, but useful when we know that the buffer stack is not
288
* NULL or when we need an lvalue. For internal use only.
290
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
292
/* yy_hold_char holds the character lost when igraph_gml_yytext is formed. */
293
static char yy_hold_char;
294
static int yy_n_chars; /* number of characters read into yy_ch_buf */
295
int igraph_gml_yyleng;
297
/* Points to current character in buffer. */
298
static char *yy_c_buf_p = (char *) 0;
299
static int yy_init = 0; /* whether we need to initialize */
300
static int yy_start = 0; /* start state number */
302
/* Flag which is used to allow igraph_gml_yywrap()'s to do buffer switches
303
* instead of setting up a fresh igraph_gml_yyin. A bit of a hack ...
305
static int yy_did_buffer_switch_on_eof;
307
void igraph_gml_yyrestart (FILE *input_file );
308
void igraph_gml_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
309
YY_BUFFER_STATE igraph_gml_yy_create_buffer (FILE *file,int size );
310
void igraph_gml_yy_delete_buffer (YY_BUFFER_STATE b );
311
void igraph_gml_yy_flush_buffer (YY_BUFFER_STATE b );
312
void igraph_gml_yypush_buffer_state (YY_BUFFER_STATE new_buffer );
313
void igraph_gml_yypop_buffer_state (void );
315
static void igraph_gml_yyensure_buffer_stack (void );
316
static void igraph_gml_yy_load_buffer_state (void );
317
static void igraph_gml_yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
319
#define YY_FLUSH_BUFFER igraph_gml_yy_flush_buffer(YY_CURRENT_BUFFER )
321
YY_BUFFER_STATE igraph_gml_yy_scan_buffer (char *base,yy_size_t size );
322
YY_BUFFER_STATE igraph_gml_yy_scan_string (yyconst char *yy_str );
323
YY_BUFFER_STATE igraph_gml_yy_scan_bytes (yyconst char *bytes,int len );
325
void *igraph_gml_yyalloc (yy_size_t );
326
void *igraph_gml_yyrealloc (void *,yy_size_t );
327
void igraph_gml_yyfree (void * );
329
#define yy_new_buffer igraph_gml_yy_create_buffer
331
#define yy_set_interactive(is_interactive) \
333
if ( ! YY_CURRENT_BUFFER ){ \
334
igraph_gml_yyensure_buffer_stack (); \
335
YY_CURRENT_BUFFER_LVALUE = \
336
igraph_gml_yy_create_buffer(igraph_gml_yyin,YY_BUF_SIZE ); \
338
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
341
#define yy_set_bol(at_bol) \
343
if ( ! YY_CURRENT_BUFFER ){\
344
igraph_gml_yyensure_buffer_stack (); \
345
YY_CURRENT_BUFFER_LVALUE = \
346
igraph_gml_yy_create_buffer(igraph_gml_yyin,YY_BUF_SIZE ); \
348
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
351
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
353
/* Begin user sect3 */
355
#define igraph_gml_yywrap(n) 1
356
#define YY_SKIP_YYWRAP
358
typedef unsigned char YY_CHAR;
360
FILE *igraph_gml_yyin = (FILE *) 0, *igraph_gml_yyout = (FILE *) 0;
362
typedef int yy_state_type;
364
extern int igraph_gml_yylineno;
366
int igraph_gml_yylineno = 1;
368
extern char *igraph_gml_yytext;
369
#define yytext_ptr igraph_gml_yytext
371
static yy_state_type yy_get_previous_state (void );
372
static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
373
static int yy_get_next_buffer (void );
374
static void yy_fatal_error (yyconst char msg[] );
376
/* Done after the current pattern has been matched and before the
377
* corresponding action - sets up igraph_gml_yytext.
379
#define YY_DO_BEFORE_ACTION \
380
(yytext_ptr) = yy_bp; \
381
igraph_gml_yyleng = (size_t) (yy_cp - yy_bp); \
382
(yy_hold_char) = *yy_cp; \
384
(yy_c_buf_p) = yy_cp;
386
#define YY_NUM_RULES 9
387
#define YY_END_OF_BUFFER 10
388
/* This struct is not used in this scanner,
389
but its presence is necessary. */
392
flex_int32_t yy_verify;
395
static yyconst flex_int16_t yy_accept[29] =
397
0, 0, 10, 9, 8, 7, 7, 9, 9, 3,
398
4, 5, 6, 1, 9, 7, 0, 2, 3, 0,
399
0, 4, 0, 1, 3, 0, 3, 0
402
static yyconst flex_int32_t yy_ec[256] =
404
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
405
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
406
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
407
1, 2, 1, 5, 6, 1, 1, 1, 1, 1,
408
1, 1, 7, 1, 8, 9, 1, 10, 10, 10,
409
10, 10, 10, 10, 10, 10, 10, 1, 1, 1,
410
1, 1, 1, 1, 11, 11, 11, 11, 12, 11,
411
11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
412
11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
413
13, 1, 14, 1, 11, 1, 11, 11, 11, 11,
415
12, 11, 11, 11, 11, 11, 11, 11, 11, 11,
416
11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
417
11, 11, 1, 1, 1, 1, 1, 1, 1, 1,
418
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
419
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
420
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
421
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
422
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
423
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
424
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
426
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
427
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
428
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
429
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
430
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
434
static yyconst flex_int32_t yy_meta[15] =
436
1, 1, 1, 2, 1, 1, 1, 1, 1, 3,
440
static yyconst flex_int16_t yy_base[32] =
442
0, 11, 42, 43, 43, 37, 37, 34, 28, 9,
443
0, 43, 43, 34, 33, 43, 30, 43, 0, 24,
444
15, 0, 30, 43, 14, 21, 10, 43, 26, 13,
448
static yyconst flex_int16_t yy_def[32] =
450
28, 1, 28, 28, 28, 28, 28, 29, 28, 28,
451
30, 28, 28, 28, 31, 28, 29, 28, 10, 28,
452
28, 30, 31, 28, 28, 28, 28, 0, 28, 28,
456
static yyconst flex_int16_t yy_nxt[58] =
458
4, 5, 6, 7, 8, 4, 4, 9, 4, 10,
459
11, 11, 12, 13, 14, 22, 15, 20, 19, 27,
460
21, 26, 26, 25, 27, 21, 17, 17, 17, 23,
461
27, 23, 24, 25, 18, 24, 16, 19, 18, 16,
462
16, 28, 3, 28, 28, 28, 28, 28, 28, 28,
463
28, 28, 28, 28, 28, 28, 28
466
static yyconst flex_int16_t yy_chk[58] =
468
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469
1, 1, 1, 1, 2, 30, 2, 10, 10, 27,
470
10, 21, 21, 25, 21, 25, 29, 29, 29, 31,
471
26, 31, 23, 20, 17, 15, 14, 9, 8, 7,
472
6, 3, 28, 28, 28, 28, 28, 28, 28, 28,
473
28, 28, 28, 28, 28, 28, 28
476
static yy_state_type yy_last_accepting_state;
477
static char *yy_last_accepting_cpos;
479
extern int igraph_gml_yy_flex_debug;
480
int igraph_gml_yy_flex_debug = 0;
482
/* The intent behind this definition is that it'll catch
483
* any uses of REJECT which flex missed.
485
#define REJECT reject_used_but_not_detected
486
#define yymore() yymore_used_but_not_detected
487
#define YY_MORE_ADJ 0
488
#define YY_RESTORE_YY_MORE_OFFSET
489
char *igraph_gml_yytext;
490
#line 1 "foreign-gml-lexer.l"
493
Copyright (C) 2007 Gabor Csardi <csardi@rmki.kfki.hu>
494
MTA RMKI, Konkoly-Thege Miklos st. 29-33, Budapest 1121, Hungary
496
This program is free software; you can redistribute it and/or modify
497
it under the terms of the GNU General Public License as published by
498
the Free Software Foundation; either version 2 of the License, or
499
(at your option) any later version.
501
This program is distributed in the hope that it will be useful,
502
but WITHOUT ANY WARRANTY; without even the implied warranty of
503
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
504
GNU General Public License for more details.
506
You should have received a copy of the GNU General Public License
507
along with this program; if not, write to the Free Software
508
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
512
#line 24 "foreign-gml-lexer.l"
516
Copyright (C) 2007 Gabor Csardi <csardi@rmki.kfki.hu>
517
MTA RMKI, Konkoly-Thege Miklos st. 29-33, Budapest 1121, Hungary
519
This program is free software; you can redistribute it and/or modify
520
it under the terms of the GNU General Public License as published by
521
the Free Software Foundation; either version 2 of the License, or
522
(at your option) any later version.
524
This program is distributed in the hope that it will be useful,
525
but WITHOUT ANY WARRANTY; without even the implied warranty of
526
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
527
GNU General Public License for more details.
529
You should have received a copy of the GNU General Public License
530
along with this program; if not, write to the Free Software
531
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
538
#include "foreign-gml-parser.h"
539
extern long int igraph_gml_mylineno;
540
extern int igraph_gml_mode;
542
void igraph_i_gml_reset_scanner() {
545
#define YY_NO_INPUT 1
546
#line 547 "foreign-gml-lexer.c"
550
#ifndef YY_NO_UNISTD_H
551
/* Special case for "unistd.h", since it is non-ANSI. We include it way
552
* down here because we want the user's section 1 to have been scanned first.
553
* The user has a chance to override it with an option.
558
#ifndef YY_EXTRA_TYPE
559
#define YY_EXTRA_TYPE void *
562
static int yy_init_globals (void );
564
/* Accessor methods to globals.
565
These are made visible to non-reentrant scanners for convenience. */
567
int igraph_gml_yylex_destroy (void );
569
int igraph_gml_yyget_debug (void );
571
void igraph_gml_yyset_debug (int debug_flag );
573
YY_EXTRA_TYPE igraph_gml_yyget_extra (void );
575
void igraph_gml_yyset_extra (YY_EXTRA_TYPE user_defined );
577
FILE *igraph_gml_yyget_in (void );
579
void igraph_gml_yyset_in (FILE * in_str );
581
FILE *igraph_gml_yyget_out (void );
583
void igraph_gml_yyset_out (FILE * out_str );
585
int igraph_gml_yyget_leng (void );
587
char *igraph_gml_yyget_text (void );
589
int igraph_gml_yyget_lineno (void );
591
void igraph_gml_yyset_lineno (int line_number );
593
/* Macros after this point can all be overridden by user definitions in
597
#ifndef YY_SKIP_YYWRAP
599
extern "C" int igraph_gml_yywrap (void );
601
extern int igraph_gml_yywrap (void );
606
static void yy_flex_strncpy (char *,yyconst char *,int );
609
#ifdef YY_NEED_STRLEN
610
static int yy_flex_strlen (yyconst char * );
616
static int yyinput (void );
618
static int input (void );
623
/* Amount of stuff to slurp up with each read. */
624
#ifndef YY_READ_BUF_SIZE
625
#define YY_READ_BUF_SIZE 8192
628
/* Copy whatever the last rule matched to the standard output. */
630
/* This used to be an fputs(), but since the string might contain NUL's,
631
* we now use fwrite().
633
#define ECHO do { if (fwrite( igraph_gml_yytext, igraph_gml_yyleng, 1, igraph_gml_yyout )) {} } while (0)
636
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
637
* is returned in "result".
640
#define YY_INPUT(buf,result,max_size) \
641
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
645
for ( n = 0; n < max_size && \
646
(c = getc( igraph_gml_yyin )) != EOF && c != '\n'; ++n ) \
649
buf[n++] = (char) c; \
650
if ( c == EOF && ferror( igraph_gml_yyin ) ) \
651
YY_FATAL_ERROR( "input in flex scanner failed" ); \
657
while ( (result = fread(buf, 1, max_size, igraph_gml_yyin))==0 && ferror(igraph_gml_yyin)) \
659
if( errno != EINTR) \
661
YY_FATAL_ERROR( "input in flex scanner failed" ); \
665
clearerr(igraph_gml_yyin); \
672
/* No semi-colon after return; correct usage is to write "yyterminate();" -
673
* we don't want an extra ';' after the "return" because that will cause
674
* some compilers to complain about unreachable statements.
677
#define yyterminate() return YY_NULL
680
/* Number of entries by which start-condition stack grows. */
681
#ifndef YY_START_STACK_INCR
682
#define YY_START_STACK_INCR 25
685
/* Report a fatal error. */
686
#ifndef YY_FATAL_ERROR
687
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
690
/* end tables serialization structures and prototypes */
692
/* Default declaration of generated scanner - a define so the user can
693
* easily add parameters.
696
#define YY_DECL_IS_OURS 1
698
extern int igraph_gml_yylex (void);
700
#define YY_DECL int igraph_gml_yylex (void)
701
#endif /* !YY_DECL */
703
/* Code executed at the beginning of each rule, after igraph_gml_yytext and igraph_gml_yyleng
706
#ifndef YY_USER_ACTION
707
#define YY_USER_ACTION
710
/* Code executed at the end of each rule. */
712
#define YY_BREAK break;
715
#define YY_RULE_SETUP \
716
if ( igraph_gml_yyleng > 0 ) \
717
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
718
(igraph_gml_yytext[igraph_gml_yyleng - 1] == '\n'); \
721
/** The main scanner function which does all the work.
725
register yy_state_type yy_current_state;
726
register char *yy_cp, *yy_bp;
729
#line 67 "foreign-gml-lexer.l"
732
#line 733 "foreign-gml-lexer.c"
743
(yy_start) = 1; /* first start state */
745
if ( ! igraph_gml_yyin )
746
igraph_gml_yyin = stdin;
748
if ( ! igraph_gml_yyout )
749
igraph_gml_yyout = stdout;
751
if ( ! YY_CURRENT_BUFFER ) {
752
igraph_gml_yyensure_buffer_stack ();
753
YY_CURRENT_BUFFER_LVALUE =
754
igraph_gml_yy_create_buffer(igraph_gml_yyin,YY_BUF_SIZE );
757
igraph_gml_yy_load_buffer_state( );
760
while ( 1 ) /* loops until end-of-file is reached */
762
yy_cp = (yy_c_buf_p);
764
/* Support of igraph_gml_yytext. */
765
*yy_cp = (yy_hold_char);
767
/* yy_bp points to the position in yy_ch_buf of the start of
772
yy_current_state = (yy_start);
773
yy_current_state += YY_AT_BOL();
777
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
778
if ( yy_accept[yy_current_state] )
780
(yy_last_accepting_state) = yy_current_state;
781
(yy_last_accepting_cpos) = yy_cp;
783
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
785
yy_current_state = (int) yy_def[yy_current_state];
786
if ( yy_current_state >= 29 )
787
yy_c = yy_meta[(unsigned int) yy_c];
789
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
792
while ( yy_base[yy_current_state] != 43 );
795
yy_act = yy_accept[yy_current_state];
797
{ /* have to back up */
798
yy_cp = (yy_last_accepting_cpos);
799
yy_current_state = (yy_last_accepting_state);
800
yy_act = yy_accept[yy_current_state];
805
do_action: /* This label is used only to access EOF actions. */
808
{ /* beginning of action switch */
809
case 0: /* must back up */
810
/* undo the effects of YY_DO_BEFORE_ACTION */
811
*yy_cp = (yy_hold_char);
812
yy_cp = (yy_last_accepting_cpos);
813
yy_current_state = (yy_last_accepting_state);
817
/* rule 1 can match eol */
819
#line 69 "foreign-gml-lexer.l"
820
{ igraph_gml_mylineno++; /* comments ignored */ }
823
/* rule 2 can match eol */
825
#line 71 "foreign-gml-lexer.l"
830
#line 72 "foreign-gml-lexer.l"
835
#line 73 "foreign-gml-lexer.l"
840
#line 74 "foreign-gml-lexer.l"
845
#line 75 "foreign-gml-lexer.l"
846
{ return LISTCLOSE; }
849
/* rule 7 can match eol */
851
#line 76 "foreign-gml-lexer.l"
852
{ igraph_gml_mylineno++; }
855
/* rule 8 can match eol */
857
#line 77 "foreign-gml-lexer.l"
858
{ /* other whitespace ignored */ }
860
case YY_STATE_EOF(INITIAL):
861
#line 79 "foreign-gml-lexer.l"
863
if (igraph_gml_eof) {
873
#line 88 "foreign-gml-lexer.l"
876
#line 877 "foreign-gml-lexer.c"
878
case YY_END_OF_BUFFER:
880
/* Amount of text matched not including the EOB char. */
881
int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
883
/* Undo the effects of YY_DO_BEFORE_ACTION. */
884
*yy_cp = (yy_hold_char);
885
YY_RESTORE_YY_MORE_OFFSET
887
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
889
/* We're scanning a new file or input source. It's
890
* possible that this happened because the user
891
* just pointed igraph_gml_yyin at a new source and called
892
* igraph_gml_yylex(). If so, then we have to assure
893
* consistency between YY_CURRENT_BUFFER and our
894
* globals. Here is the right place to do so, because
895
* this is the first action (other than possibly a
896
* back-up) that will match for the new input source.
898
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
899
YY_CURRENT_BUFFER_LVALUE->yy_input_file = igraph_gml_yyin;
900
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
903
/* Note that here we test for yy_c_buf_p "<=" to the position
904
* of the first EOB in the buffer, since yy_c_buf_p will
905
* already have been incremented past the NUL character
906
* (since all states make transitions on EOB to the
907
* end-of-buffer state). Contrast this with the test
910
if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
911
{ /* This was really a NUL. */
912
yy_state_type yy_next_state;
914
(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
916
yy_current_state = yy_get_previous_state( );
918
/* Okay, we're now positioned to make the NUL
919
* transition. We couldn't have
920
* yy_get_previous_state() go ahead and do it
921
* for us because it doesn't know how to deal
922
* with the possibility of jamming (and we don't
923
* want to build jamming into it because then it
924
* will run more slowly).
927
yy_next_state = yy_try_NUL_trans( yy_current_state );
929
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
933
/* Consume the NUL. */
934
yy_cp = ++(yy_c_buf_p);
935
yy_current_state = yy_next_state;
941
yy_cp = (yy_c_buf_p);
946
else switch ( yy_get_next_buffer( ) )
948
case EOB_ACT_END_OF_FILE:
950
(yy_did_buffer_switch_on_eof) = 0;
952
if ( igraph_gml_yywrap( ) )
954
/* Note: because we've taken care in
955
* yy_get_next_buffer() to have set up
956
* igraph_gml_yytext, we can now set up
957
* yy_c_buf_p so that if some total
958
* hoser (like flex itself) wants to
959
* call the scanner after we return the
960
* YY_NULL, it'll still work - another
961
* YY_NULL will get returned.
963
(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
965
yy_act = YY_STATE_EOF(YY_START);
971
if ( ! (yy_did_buffer_switch_on_eof) )
977
case EOB_ACT_CONTINUE_SCAN:
979
(yytext_ptr) + yy_amount_of_matched_text;
981
yy_current_state = yy_get_previous_state( );
983
yy_cp = (yy_c_buf_p);
984
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
987
case EOB_ACT_LAST_MATCH:
989
&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
991
yy_current_state = yy_get_previous_state( );
993
yy_cp = (yy_c_buf_p);
994
yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1002
"fatal flex scanner internal error--no action found" );
1003
} /* end of action switch */
1004
} /* end of scanning one token */
1005
} /* end of igraph_gml_yylex */
1007
/* yy_get_next_buffer - try to read in a new buffer
1009
* Returns a code representing an action:
1010
* EOB_ACT_LAST_MATCH -
1011
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1012
* EOB_ACT_END_OF_FILE - end of file
1014
static int yy_get_next_buffer (void)
1016
register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1017
register char *source = (yytext_ptr);
1018
register int number_to_move, i;
1021
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1023
"fatal flex scanner internal error--end of buffer missed" );
1025
if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1026
{ /* Don't try to fill the buffer, so this is an EOF. */
1027
if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1029
/* We matched a single character, the EOB, so
1030
* treat this as a final EOF.
1032
return EOB_ACT_END_OF_FILE;
1037
/* We matched some text prior to the EOB, first
1040
return EOB_ACT_LAST_MATCH;
1044
/* Try to read more data. */
1046
/* First move last chars to start of buffer. */
1047
number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1049
for ( i = 0; i < number_to_move; ++i )
1050
*(dest++) = *(source++);
1052
if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1053
/* don't do the read, it's not guaranteed to return an EOF,
1056
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1061
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1063
while ( num_to_read <= 0 )
1064
{ /* Not enough room in the buffer - grow it. */
1066
/* just a shorter name for the current buffer */
1067
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1069
int yy_c_buf_p_offset =
1070
(int) ((yy_c_buf_p) - b->yy_ch_buf);
1072
if ( b->yy_is_our_buffer )
1074
int new_size = b->yy_buf_size * 2;
1076
if ( new_size <= 0 )
1077
b->yy_buf_size += b->yy_buf_size / 8;
1079
b->yy_buf_size *= 2;
1081
b->yy_ch_buf = (char *)
1082
/* Include room in for 2 EOB chars. */
1083
igraph_gml_yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1086
/* Can't grow it, we don't own it. */
1089
if ( ! b->yy_ch_buf )
1091
"fatal error - scanner input buffer overflow" );
1093
(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1095
num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1100
if ( num_to_read > YY_READ_BUF_SIZE )
1101
num_to_read = YY_READ_BUF_SIZE;
1103
/* Read in more data. */
1104
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1105
(yy_n_chars), (size_t) num_to_read );
1107
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1110
if ( (yy_n_chars) == 0 )
1112
if ( number_to_move == YY_MORE_ADJ )
1114
ret_val = EOB_ACT_END_OF_FILE;
1115
igraph_gml_yyrestart(igraph_gml_yyin );
1120
ret_val = EOB_ACT_LAST_MATCH;
1121
YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1122
YY_BUFFER_EOF_PENDING;
1127
ret_val = EOB_ACT_CONTINUE_SCAN;
1129
if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1130
/* Extend the array by 50%, plus the number we really need. */
1131
yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1132
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) igraph_gml_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1133
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1134
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1137
(yy_n_chars) += number_to_move;
1138
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1139
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1141
(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1146
/* yy_get_previous_state - get the state just before the EOB char was reached */
1148
static yy_state_type yy_get_previous_state (void)
1150
register yy_state_type yy_current_state;
1151
register char *yy_cp;
1153
yy_current_state = (yy_start);
1154
yy_current_state += YY_AT_BOL();
1156
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1158
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1159
if ( yy_accept[yy_current_state] )
1161
(yy_last_accepting_state) = yy_current_state;
1162
(yy_last_accepting_cpos) = yy_cp;
1164
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1166
yy_current_state = (int) yy_def[yy_current_state];
1167
if ( yy_current_state >= 29 )
1168
yy_c = yy_meta[(unsigned int) yy_c];
1170
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1173
return yy_current_state;
1176
/* yy_try_NUL_trans - try to make a transition on the NUL character
1179
* next_state = yy_try_NUL_trans( current_state );
1181
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1183
register int yy_is_jam;
1184
register char *yy_cp = (yy_c_buf_p);
1186
register YY_CHAR yy_c = 1;
1187
if ( yy_accept[yy_current_state] )
1189
(yy_last_accepting_state) = yy_current_state;
1190
(yy_last_accepting_cpos) = yy_cp;
1192
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1194
yy_current_state = (int) yy_def[yy_current_state];
1195
if ( yy_current_state >= 29 )
1196
yy_c = yy_meta[(unsigned int) yy_c];
1198
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1199
yy_is_jam = (yy_current_state == 28);
1201
return yy_is_jam ? 0 : yy_current_state;
1206
static int yyinput (void)
1208
static int input (void)
1214
*(yy_c_buf_p) = (yy_hold_char);
1216
if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1218
/* yy_c_buf_p now points to the character we want to return.
1219
* If this occurs *before* the EOB characters, then it's a
1220
* valid NUL; if not, then we've hit the end of the buffer.
1222
if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1223
/* This was really a NUL. */
1224
*(yy_c_buf_p) = '\0';
1227
{ /* need more input */
1228
int offset = (yy_c_buf_p) - (yytext_ptr);
1231
switch ( yy_get_next_buffer( ) )
1233
case EOB_ACT_LAST_MATCH:
1234
/* This happens because yy_g_n_b()
1235
* sees that we've accumulated a
1236
* token and flags that we need to
1237
* try matching the token before
1238
* proceeding. But for input(),
1239
* there's no matching to consider.
1240
* So convert the EOB_ACT_LAST_MATCH
1241
* to EOB_ACT_END_OF_FILE.
1244
/* Reset buffer status. */
1245
igraph_gml_yyrestart(igraph_gml_yyin );
1249
case EOB_ACT_END_OF_FILE:
1251
if ( igraph_gml_yywrap( ) )
1254
if ( ! (yy_did_buffer_switch_on_eof) )
1263
case EOB_ACT_CONTINUE_SCAN:
1264
(yy_c_buf_p) = (yytext_ptr) + offset;
1270
c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1271
*(yy_c_buf_p) = '\0'; /* preserve igraph_gml_yytext */
1272
(yy_hold_char) = *++(yy_c_buf_p);
1274
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1278
#endif /* ifndef YY_NO_INPUT */
1280
/** Immediately switch to a different input stream.
1281
* @param input_file A readable stream.
1283
* @note This function does not reset the start condition to @c INITIAL .
1285
void igraph_gml_yyrestart (FILE * input_file )
1288
if ( ! YY_CURRENT_BUFFER ){
1289
igraph_gml_yyensure_buffer_stack ();
1290
YY_CURRENT_BUFFER_LVALUE =
1291
igraph_gml_yy_create_buffer(igraph_gml_yyin,YY_BUF_SIZE );
1294
igraph_gml_yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1295
igraph_gml_yy_load_buffer_state( );
1298
/** Switch to a different input buffer.
1299
* @param new_buffer The new input buffer.
1302
void igraph_gml_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1305
/* TODO. We should be able to replace this entire function body
1307
* igraph_gml_yypop_buffer_state();
1308
* igraph_gml_yypush_buffer_state(new_buffer);
1310
igraph_gml_yyensure_buffer_stack ();
1311
if ( YY_CURRENT_BUFFER == new_buffer )
1314
if ( YY_CURRENT_BUFFER )
1316
/* Flush out information for old buffer. */
1317
*(yy_c_buf_p) = (yy_hold_char);
1318
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1319
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1322
YY_CURRENT_BUFFER_LVALUE = new_buffer;
1323
igraph_gml_yy_load_buffer_state( );
1325
/* We don't actually know whether we did this switch during
1326
* EOF (igraph_gml_yywrap()) processing, but the only time this flag
1327
* is looked at is after igraph_gml_yywrap() is called, so it's safe
1328
* to go ahead and always set it.
1330
(yy_did_buffer_switch_on_eof) = 1;
1333
static void igraph_gml_yy_load_buffer_state (void)
1335
(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1336
(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1337
igraph_gml_yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1338
(yy_hold_char) = *(yy_c_buf_p);
1341
/** Allocate and initialize an input buffer state.
1342
* @param file A readable stream.
1343
* @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1345
* @return the allocated buffer state.
1347
YY_BUFFER_STATE igraph_gml_yy_create_buffer (FILE * file, int size )
1351
b = (YY_BUFFER_STATE) igraph_gml_yyalloc(sizeof( struct yy_buffer_state ) );
1353
YY_FATAL_ERROR( "out of dynamic memory in igraph_gml_yy_create_buffer()" );
1355
b->yy_buf_size = size;
1357
/* yy_ch_buf has to be 2 characters longer than the size given because
1358
* we need to put in 2 end-of-buffer characters.
1360
b->yy_ch_buf = (char *) igraph_gml_yyalloc(b->yy_buf_size + 2 );
1361
if ( ! b->yy_ch_buf )
1362
YY_FATAL_ERROR( "out of dynamic memory in igraph_gml_yy_create_buffer()" );
1364
b->yy_is_our_buffer = 1;
1366
igraph_gml_yy_init_buffer(b,file );
1371
/** Destroy the buffer.
1372
* @param b a buffer created with igraph_gml_yy_create_buffer()
1375
void igraph_gml_yy_delete_buffer (YY_BUFFER_STATE b )
1381
if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1382
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1384
if ( b->yy_is_our_buffer )
1385
igraph_gml_yyfree((void *) b->yy_ch_buf );
1387
igraph_gml_yyfree((void *) b );
1391
extern int isatty (int );
1392
#endif /* __cplusplus */
1394
/* Initializes or reinitializes a buffer.
1395
* This function is sometimes called more than once on the same buffer,
1396
* such as during a igraph_gml_yyrestart() or at EOF.
1398
static void igraph_gml_yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1403
igraph_gml_yy_flush_buffer(b );
1405
b->yy_input_file = file;
1406
b->yy_fill_buffer = 1;
1408
/* If b is the current buffer, then igraph_gml_yy_init_buffer was _probably_
1409
* called from igraph_gml_yyrestart() or through yy_get_next_buffer.
1410
* In that case, we don't want to reset the lineno or column.
1412
if (b != YY_CURRENT_BUFFER){
1413
b->yy_bs_lineno = 1;
1414
b->yy_bs_column = 0;
1417
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1422
/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1423
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1426
void igraph_gml_yy_flush_buffer (YY_BUFFER_STATE b )
1433
/* We always need two end-of-buffer characters. The first causes
1434
* a transition to the end-of-buffer state. The second causes
1435
* a jam in that state.
1437
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1438
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1440
b->yy_buf_pos = &b->yy_ch_buf[0];
1443
b->yy_buffer_status = YY_BUFFER_NEW;
1445
if ( b == YY_CURRENT_BUFFER )
1446
igraph_gml_yy_load_buffer_state( );
1449
/** Pushes the new state onto the stack. The new state becomes
1450
* the current state. This function will allocate the stack
1452
* @param new_buffer The new state.
1455
void igraph_gml_yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1457
if (new_buffer == NULL)
1460
igraph_gml_yyensure_buffer_stack();
1462
/* This block is copied from igraph_gml_yy_switch_to_buffer. */
1463
if ( YY_CURRENT_BUFFER )
1465
/* Flush out information for old buffer. */
1466
*(yy_c_buf_p) = (yy_hold_char);
1467
YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1468
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1471
/* Only push if top exists. Otherwise, replace top. */
1472
if (YY_CURRENT_BUFFER)
1473
(yy_buffer_stack_top)++;
1474
YY_CURRENT_BUFFER_LVALUE = new_buffer;
1476
/* copied from igraph_gml_yy_switch_to_buffer. */
1477
igraph_gml_yy_load_buffer_state( );
1478
(yy_did_buffer_switch_on_eof) = 1;
1481
/** Removes and deletes the top of the stack, if present.
1482
* The next element becomes the new top.
1485
void igraph_gml_yypop_buffer_state (void)
1487
if (!YY_CURRENT_BUFFER)
1490
igraph_gml_yy_delete_buffer(YY_CURRENT_BUFFER );
1491
YY_CURRENT_BUFFER_LVALUE = NULL;
1492
if ((yy_buffer_stack_top) > 0)
1493
--(yy_buffer_stack_top);
1495
if (YY_CURRENT_BUFFER) {
1496
igraph_gml_yy_load_buffer_state( );
1497
(yy_did_buffer_switch_on_eof) = 1;
1501
/* Allocates the stack if it does not exist.
1502
* Guarantees space for at least one push.
1504
static void igraph_gml_yyensure_buffer_stack (void)
1508
if (!(yy_buffer_stack)) {
1510
/* First allocation is just for 2 elements, since we don't know if this
1511
* scanner will even need a stack. We use 2 instead of 1 to avoid an
1512
* immediate realloc on the next call.
1515
(yy_buffer_stack) = (struct yy_buffer_state**)igraph_gml_yyalloc
1516
(num_to_alloc * sizeof(struct yy_buffer_state*)
1518
if ( ! (yy_buffer_stack) )
1519
YY_FATAL_ERROR( "out of dynamic memory in igraph_gml_yyensure_buffer_stack()" );
1521
memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1523
(yy_buffer_stack_max) = num_to_alloc;
1524
(yy_buffer_stack_top) = 0;
1528
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1530
/* Increase the buffer to prepare for a possible push. */
1531
int grow_size = 8 /* arbitrary grow size */;
1533
num_to_alloc = (yy_buffer_stack_max) + grow_size;
1534
(yy_buffer_stack) = (struct yy_buffer_state**)igraph_gml_yyrealloc
1536
num_to_alloc * sizeof(struct yy_buffer_state*)
1538
if ( ! (yy_buffer_stack) )
1539
YY_FATAL_ERROR( "out of dynamic memory in igraph_gml_yyensure_buffer_stack()" );
1541
/* zero only the new slots.*/
1542
memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1543
(yy_buffer_stack_max) = num_to_alloc;
1547
/** Setup the input buffer state to scan directly from a user-specified character buffer.
1548
* @param base the character buffer
1549
* @param size the size in bytes of the character buffer
1551
* @return the newly allocated buffer state object.
1553
YY_BUFFER_STATE igraph_gml_yy_scan_buffer (char * base, yy_size_t size )
1558
base[size-2] != YY_END_OF_BUFFER_CHAR ||
1559
base[size-1] != YY_END_OF_BUFFER_CHAR )
1560
/* They forgot to leave room for the EOB's. */
1563
b = (YY_BUFFER_STATE) igraph_gml_yyalloc(sizeof( struct yy_buffer_state ) );
1565
YY_FATAL_ERROR( "out of dynamic memory in igraph_gml_yy_scan_buffer()" );
1567
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1568
b->yy_buf_pos = b->yy_ch_buf = base;
1569
b->yy_is_our_buffer = 0;
1570
b->yy_input_file = 0;
1571
b->yy_n_chars = b->yy_buf_size;
1572
b->yy_is_interactive = 0;
1574
b->yy_fill_buffer = 0;
1575
b->yy_buffer_status = YY_BUFFER_NEW;
1577
igraph_gml_yy_switch_to_buffer(b );
1582
/** Setup the input buffer state to scan a string. The next call to igraph_gml_yylex() will
1583
* scan from a @e copy of @a str.
1584
* @param yystr a NUL-terminated string to scan
1586
* @return the newly allocated buffer state object.
1587
* @note If you want to scan bytes that may contain NUL values, then use
1588
* igraph_gml_yy_scan_bytes() instead.
1590
YY_BUFFER_STATE igraph_gml_yy_scan_string (yyconst char * yystr )
1593
return igraph_gml_yy_scan_bytes(yystr,strlen(yystr) );
1596
/** Setup the input buffer state to scan the given bytes. The next call to igraph_gml_yylex() will
1597
* scan from a @e copy of @a bytes.
1598
* @param bytes the byte buffer to scan
1599
* @param len the number of bytes in the buffer pointed to by @a bytes.
1601
* @return the newly allocated buffer state object.
1603
YY_BUFFER_STATE igraph_gml_yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1610
/* Get memory for full buffer, including space for trailing EOB's. */
1611
n = _yybytes_len + 2;
1612
buf = (char *) igraph_gml_yyalloc(n );
1614
YY_FATAL_ERROR( "out of dynamic memory in igraph_gml_yy_scan_bytes()" );
1616
for ( i = 0; i < _yybytes_len; ++i )
1617
buf[i] = yybytes[i];
1619
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1621
b = igraph_gml_yy_scan_buffer(buf,n );
1623
YY_FATAL_ERROR( "bad buffer in igraph_gml_yy_scan_bytes()" );
1625
/* It's okay to grow etc. this buffer, and we should throw it
1626
* away when we're done.
1628
b->yy_is_our_buffer = 1;
1633
#ifndef YY_EXIT_FAILURE
1634
#define YY_EXIT_FAILURE 2
1637
static void yy_fatal_error (yyconst char* msg )
1639
(void) fprintf( stderr, "%s\n", msg );
1640
exit( YY_EXIT_FAILURE );
1643
/* Redefine yyless() so it works in section 3 code. */
1649
/* Undo effects of setting up igraph_gml_yytext. */ \
1650
int yyless_macro_arg = (n); \
1651
YY_LESS_LINENO(yyless_macro_arg);\
1652
igraph_gml_yytext[igraph_gml_yyleng] = (yy_hold_char); \
1653
(yy_c_buf_p) = igraph_gml_yytext + yyless_macro_arg; \
1654
(yy_hold_char) = *(yy_c_buf_p); \
1655
*(yy_c_buf_p) = '\0'; \
1656
igraph_gml_yyleng = yyless_macro_arg; \
1660
/* Accessor methods (get/set functions) to struct members. */
1662
/** Get the current line number.
1665
int igraph_gml_yyget_lineno (void)
1668
return igraph_gml_yylineno;
1671
/** Get the input stream.
1674
FILE *igraph_gml_yyget_in (void)
1676
return igraph_gml_yyin;
1679
/** Get the output stream.
1682
FILE *igraph_gml_yyget_out (void)
1684
return igraph_gml_yyout;
1687
/** Get the length of the current token.
1690
int igraph_gml_yyget_leng (void)
1692
return igraph_gml_yyleng;
1695
/** Get the current token.
1699
char *igraph_gml_yyget_text (void)
1701
return igraph_gml_yytext;
1704
/** Set the current line number.
1705
* @param line_number
1708
void igraph_gml_yyset_lineno (int line_number )
1711
igraph_gml_yylineno = line_number;
1714
/** Set the input stream. This does not discard the current
1716
* @param in_str A readable stream.
1718
* @see igraph_gml_yy_switch_to_buffer
1720
void igraph_gml_yyset_in (FILE * in_str )
1722
igraph_gml_yyin = in_str ;
1725
void igraph_gml_yyset_out (FILE * out_str )
1727
igraph_gml_yyout = out_str ;
1730
int igraph_gml_yyget_debug (void)
1732
return igraph_gml_yy_flex_debug;
1735
void igraph_gml_yyset_debug (int bdebug )
1737
igraph_gml_yy_flex_debug = bdebug ;
1740
static int yy_init_globals (void)
1742
/* Initialization is the same as for the non-reentrant scanner.
1743
* This function is called from igraph_gml_yylex_destroy(), so don't allocate here.
1746
(yy_buffer_stack) = 0;
1747
(yy_buffer_stack_top) = 0;
1748
(yy_buffer_stack_max) = 0;
1749
(yy_c_buf_p) = (char *) 0;
1753
/* Defined in main.c */
1755
igraph_gml_yyin = stdin;
1756
igraph_gml_yyout = stdout;
1758
igraph_gml_yyin = (FILE *) 0;
1759
igraph_gml_yyout = (FILE *) 0;
1762
/* For future reference: Set errno on error, since we are called by
1763
* igraph_gml_yylex_init()
1768
/* igraph_gml_yylex_destroy is for both reentrant and non-reentrant scanners. */
1769
int igraph_gml_yylex_destroy (void)
1772
/* Pop the buffer stack, destroying each element. */
1773
while(YY_CURRENT_BUFFER){
1774
igraph_gml_yy_delete_buffer(YY_CURRENT_BUFFER );
1775
YY_CURRENT_BUFFER_LVALUE = NULL;
1776
igraph_gml_yypop_buffer_state();
1779
/* Destroy the stack itself. */
1780
igraph_gml_yyfree((yy_buffer_stack) );
1781
(yy_buffer_stack) = NULL;
1783
/* Reset the globals. This is important in a non-reentrant scanner so the next time
1784
* igraph_gml_yylex() is called, initialization will occur. */
1791
* Internal utility routines.
1795
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
1798
for ( i = 0; i < n; ++i )
1803
#ifdef YY_NEED_STRLEN
1804
static int yy_flex_strlen (yyconst char * s )
1807
for ( n = 0; s[n]; ++n )
1814
void *igraph_gml_yyalloc (yy_size_t size )
1816
return (void *) malloc( size );
1819
void *igraph_gml_yyrealloc (void * ptr, yy_size_t size )
1821
/* The cast to (char *) in the following accommodates both
1822
* implementations that use char* generic pointers, and those
1823
* that use void* generic pointers. It works with the latter
1824
* because both ANSI C and C++ allow castless assignment from
1825
* any pointer type to void*, and deal with argument conversions
1826
* as though doing an assignment.
1828
return (void *) realloc( (char *) ptr, size );
1831
void igraph_gml_yyfree (void * ptr )
1833
free( (char *) ptr ); /* see igraph_gml_yyrealloc() for (char *) cast */
1836
#define YYTABLES_NAME "yytables"
1838
#line 88 "foreign-gml-lexer.l"