Vcsn  2.4
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
scan.cc
Go to the documentation of this file.
1 // Added by flex++.
2 #pragma GCC diagnostic ignored "-Wsign-compare"
3 // Check Clang first, as it does not support -Wzero... but it
4 // defines __GNUC__.
5 #if defined __clang__
6 # pragma clang diagnostic ignored "-Wdeprecated"
7 # pragma clang diagnostic ignored "-Wnull-conversion"
8 #elif defined __GNUC__
9 # pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
10 # pragma GCC diagnostic ignored "-Wsuggest-attribute=noreturn"
11 # pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
12 # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
13 #endif
14 
15 #line 2 "lib/vcsn/dot/scan.cc"
16 #line 7 "lib/vcsn/dot/scan.ll"
17 // Define YY_DECL.
18 #include <lib/vcsn/dot/parse.hh>
19 
20 #define yyterminate() return parser::make_END(loc)
21 
22 
23 
24 #line 11 "lib/vcsn/dot/scan.cc"
25 
26 #define YY_INT_ALIGNED short int
27 
28 /* A lexical scanner generated by flex */
29 
30 /* %not-for-header */
31 
32 /* %if-c-only */
33 /* %if-not-reentrant */
34 /* %endif */
35 /* %endif */
36 /* %ok-for-header */
37 
38 #define FLEX_SCANNER
39 #define YY_FLEX_MAJOR_VERSION 2
40 #define YY_FLEX_MINOR_VERSION 5
41 #define YY_FLEX_SUBMINOR_VERSION 39
42 #if YY_FLEX_SUBMINOR_VERSION > 0
43 #define FLEX_BETA
44 #endif
45 
46 /* %if-c++-only */
47  /* The c++ scanner is a mess. The FlexLexer.h header file relies on the
48  * following macro. This is required in order to pass the c++-multiple-scanners
49  * test in the regression suite. We get reports that it breaks inheritance.
50  * We will address this in a future release of flex, or omit the C++ scanner
51  * altogether.
52  */
53  #define yyFlexLexer yyFlexLexer
54 /* %endif */
55 
56 /* %if-c-only */
57 /* %endif */
58 
59 /* %if-c-only */
60 /* %endif */
61 
62 /* First, we deal with platform-specific or compiler-specific issues. */
63 
64 /* begin standard C headers. */
65 /* %if-c-only */
66 /* %endif */
67 
68 /* %if-tables-serialization */
69 /* %endif */
70 /* end standard C headers. */
71 
72 /* %if-c-or-c++ */
73 /* flex integer type definitions */
74 
75 #ifndef FLEXINT_H
76 #define FLEXINT_H
77 
78 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
79 
80 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
81 
82 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
83  * if you want the limit (max/min) macros for int types.
84  */
85 #ifndef __STDC_LIMIT_MACROS
86 #define __STDC_LIMIT_MACROS 1
87 #endif
88 
89 #include <inttypes.h>
90 typedef int8_t flex_int8_t;
91 typedef uint8_t flex_uint8_t;
92 typedef int16_t flex_int16_t;
93 typedef uint16_t flex_uint16_t;
94 typedef int32_t flex_int32_t;
95 typedef uint32_t flex_uint32_t;
96 #else
97 typedef signed char flex_int8_t;
98 typedef short int flex_int16_t;
99 typedef int flex_int32_t;
100 typedef unsigned char flex_uint8_t;
101 typedef unsigned short int flex_uint16_t;
102 typedef unsigned int flex_uint32_t;
103 
104 /* Limits of integral types. */
105 #ifndef INT8_MIN
106 #define INT8_MIN (-128)
107 #endif
108 #ifndef INT16_MIN
109 #define INT16_MIN (-32767-1)
110 #endif
111 #ifndef INT32_MIN
112 #define INT32_MIN (-2147483647-1)
113 #endif
114 #ifndef INT8_MAX
115 #define INT8_MAX (127)
116 #endif
117 #ifndef INT16_MAX
118 #define INT16_MAX (32767)
119 #endif
120 #ifndef INT32_MAX
121 #define INT32_MAX (2147483647)
122 #endif
123 #ifndef UINT8_MAX
124 #define UINT8_MAX (255U)
125 #endif
126 #ifndef UINT16_MAX
127 #define UINT16_MAX (65535U)
128 #endif
129 #ifndef UINT32_MAX
130 #define UINT32_MAX (4294967295U)
131 #endif
132 
133 #endif /* ! C99 */
134 
135 #endif /* ! FLEXINT_H */
136 
137 /* %endif */
138 
139 /* %if-c++-only */
140 /* begin standard C++ headers. */
141 #include <iostream>
142 #include <errno.h>
143 #include <cstdlib>
144 #include <cstdio>
145 #include <cstring>
146 /* end standard C++ headers. */
147 /* %endif */
148 
149 #ifdef __cplusplus
150 
151 /* The "const" storage-class-modifier is valid. */
152 #define YY_USE_CONST
153 
154 #else /* ! __cplusplus */
155 
156 /* C99 requires __STDC__ to be defined as 1. */
157 #if defined (__STDC__)
158 
159 #define YY_USE_CONST
160 
161 #endif /* defined (__STDC__) */
162 #endif /* ! __cplusplus */
163 
164 #ifdef YY_USE_CONST
165 #define yyconst const
166 #else
167 #define yyconst
168 #endif
169 
170 /* %not-for-header */
171 
172 /* Returned upon end-of-file. */
173 #define YY_NULL 0
174 /* %ok-for-header */
175 
176 /* %not-for-header */
177 
178 /* Promotes a possibly negative, possibly signed char to an unsigned
179  * integer for use as an array index. If the signed char is negative,
180  * we want to instead treat it as an 8-bit unsigned char, hence the
181  * double cast.
182  */
183 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
184 /* %ok-for-header */
185 
186 /* %if-reentrant */
187 /* %endif */
188 
189 /* %if-not-reentrant */
190 
191 /* %endif */
192 
193 /* Enter a start condition. This macro really ought to take a parameter,
194  * but we do it the disgusting crufty way forced on us by the ()-less
195  * definition of BEGIN.
196  */
197 #define BEGIN (yy_start) = 1 + 2 *
198 
199 /* Translate the current start state into a value that can be later handed
200  * to BEGIN to return to the state. The YYSTATE alias is for lex
201  * compatibility.
202  */
203 #define YY_START (((yy_start) - 1) / 2)
204 #define YYSTATE YY_START
205 
206 /* Action number for EOF rule of a given start state. */
207 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
208 
209 /* Special action meaning "start processing a new file". */
210 #define YY_NEW_FILE yyrestart( yyin )
211 
212 #define YY_END_OF_BUFFER_CHAR 0
213 
214 /* Size of default input buffer. */
215 #ifndef YY_BUF_SIZE
216 #ifdef __ia64__
217 /* On IA-64, the buffer size is 16k, not 8k.
218  * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
219  * Ditto for the __ia64__ case accordingly.
220  */
221 #define YY_BUF_SIZE 32768
222 #else
223 #define YY_BUF_SIZE 16384
224 #endif /* __ia64__ */
225 #endif
226 
227 /* The state buf must be large enough to hold one state per character in the main buffer.
228  */
229 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
230 
231 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
232 #define YY_TYPEDEF_YY_BUFFER_STATE
234 #endif
235 
236 #ifndef YY_TYPEDEF_YY_SIZE_T
237 #define YY_TYPEDEF_YY_SIZE_T
238 typedef size_t yy_size_t;
239 #endif
240 
241 /* %if-not-reentrant */
242 extern yy_size_t yyleng;
243 /* %endif */
244 
245 /* %if-c-only */
246 /* %if-not-reentrant */
247 /* %endif */
248 /* %endif */
249 
250 #define EOB_ACT_CONTINUE_SCAN 0
251 #define EOB_ACT_END_OF_FILE 1
252 #define EOB_ACT_LAST_MATCH 2
253 
254  #define YY_LESS_LINENO(n)
255  #define YY_LINENO_REWIND_TO(ptr)
256 
257 /* Return all but the first "n" matched characters back to the input stream. */
258 #define yyless(n) \
259  do \
260  { \
261  /* Undo effects of setting up yytext. */ \
262  int yyless_macro_arg = (n); \
263  YY_LESS_LINENO(yyless_macro_arg);\
264  *yy_cp = (yy_hold_char); \
265  YY_RESTORE_YY_MORE_OFFSET \
266  (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
267  YY_DO_BEFORE_ACTION; /* set up yytext again */ \
268  } \
269  while ( 0 )
270 
271 #define unput(c) yyunput( c, (yytext_ptr) )
272 
273 #ifndef YY_STRUCT_YY_BUFFER_STATE
274 #define YY_STRUCT_YY_BUFFER_STATE
276  {
277 /* %if-c-only */
278 /* %endif */
279 
280 /* %if-c++-only */
281  std::istream* yy_input_file;
282 /* %endif */
283 
284  char *yy_ch_buf; /* input buffer */
285  char *yy_buf_pos; /* current position in input buffer */
286 
287  /* Size of input buffer in bytes, not including room for EOB
288  * characters.
289  */
291 
292  /* Number of characters read into yy_ch_buf, not including EOB
293  * characters.
294  */
296 
297  /* Whether we "own" the buffer - i.e., we know we created it,
298  * and can realloc() it to grow it, and should free() it to
299  * delete it.
300  */
302 
303  /* Whether this is an "interactive" input source; if so, and
304  * if we're using stdio for input, then we want to use getc()
305  * instead of fread(), to make sure we stop fetching input after
306  * each newline.
307  */
309 
310  /* Whether we're considered to be at the beginning of a line.
311  * If so, '^' rules will be active on the next match, otherwise
312  * not.
313  */
315 
319  /* Whether to try to fill the input buffer when we reach the
320  * end of it.
321  */
323 
325 
326 #define YY_BUFFER_NEW 0
327 #define YY_BUFFER_NORMAL 1
328  /* When an EOF's been seen but there's still some text to process
329  * then we mark the buffer as YY_EOF_PENDING, to indicate that we
330  * shouldn't try reading from the input source any more. We might
331  * still have a bunch of tokens to match, though, because of
332  * possible backing-up.
333  *
334  * When we actually see the EOF, we change the status to "new"
335  * (via yyrestart()), so that the user can continue scanning by
336  * just pointing yyin at a new input file.
337  */
338 #define YY_BUFFER_EOF_PENDING 2
339 
340  };
341 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
342 
343 /* %if-c-only Standard (non-C++) definition */
344 /* %not-for-header */
345 
346 /* %if-not-reentrant */
347 /* %endif */
348 /* %ok-for-header */
349 
350 /* %endif */
351 
352 /* We provide macros for accessing buffer states in case in the
353  * future we want to put the buffer states in a more general
354  * "scanner state".
355  *
356  * Returns the top of the stack, or NULL.
357  */
358 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
359  ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
360  : NULL)
361 
362 /* Same as previous macro, but useful when we know that the buffer stack is not
363  * NULL or when we need an lvalue. For internal use only.
364  */
365 #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
366 
367 /* %if-c-only Standard (non-C++) definition */
368 /* %if-not-reentrant */
369 /* %not-for-header */
370 
371 /* %ok-for-header */
372 
373 /* %endif */
374 /* %endif */
375 
376 // void *yyalloc (yy_size_t );
377 // void *yyrealloc (void *,yy_size_t );
378 // void yyfree (void * );
379 
380 #define yy_new_buffer yy_create_buffer
381 
382 #define yy_set_interactive(is_interactive) \
383  { \
384  if ( ! YY_CURRENT_BUFFER ){ \
385  yyensure_buffer_stack (); \
386  YY_CURRENT_BUFFER_LVALUE = \
387  yy_create_buffer( yyin, YY_BUF_SIZE ); \
388  } \
389  YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
390  }
391 
392 #define yy_set_bol(at_bol) \
393  { \
394  if ( ! YY_CURRENT_BUFFER ){\
395  yyensure_buffer_stack (); \
396  YY_CURRENT_BUFFER_LVALUE = \
397  yy_create_buffer( yyin, YY_BUF_SIZE ); \
398  } \
399  YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
400  }
401 
402 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
403 
404 /* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
405 /* Begin user sect3 */
406 
407 #define FLEX_DEBUG
408 
409 typedef unsigned char YY_CHAR;
410 
411 #define yytext_ptr yytext
412 #define YY_INTERACTIVE
413 
414 #include <lib/vcsn/dot/scan.hh>
415 
416 /* %% [1.5] DFA */
417 
418 /* %if-c-only Standard (non-C++) definition */
419 /* %endif */
420 
421 /* Done after the current pattern has been matched and before the
422  * corresponding action - sets up yytext.
423  */
424 #define YY_DO_BEFORE_ACTION \
425  (yytext_ptr) = yy_bp; \
426 /* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
427  yyleng = (size_t) (yy_cp - yy_bp); \
428  (yy_hold_char) = *yy_cp; \
429  *yy_cp = '\0'; \
430 /* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
431  (yy_c_buf_p) = yy_cp;
432 
433 /* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
434 #define YY_NUM_RULES 35
435 #define YY_END_OF_BUFFER 36
436 /* This struct is not used in this scanner,
437  but its presence is necessary. */
439  {
442  };
444  { 0,
445  0, 0, 23, 23, 0, 0, 0, 0, 36, 22,
446  20, 21, 17, 13, 22, 22, 22, 19, 12, 14,
447  18, 10, 19, 8, 9, 19, 19, 19, 19, 19,
448  6, 7, 23, 25, 24, 29, 30, 27, 35, 33,
449  34, 32, 31, 20, 21, 0, 19, 11, 19, 16,
450  15, 19, 19, 19, 19, 19, 19, 19, 23, 25,
451  24, 24, 26, 29, 30, 28, 33, 34, 15, 19,
452  19, 19, 19, 19, 19, 19, 2, 19, 4, 19,
453  19, 3, 19, 19, 19, 1, 19, 5, 0
454  } ;
455 
457  { 0,
458  1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
459  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
461  1, 2, 1, 4, 1, 1, 1, 1, 1, 1,
462  1, 5, 1, 6, 7, 8, 9, 10, 10, 10,
463  10, 10, 10, 10, 10, 10, 10, 11, 12, 13,
464  14, 15, 1, 1, 16, 16, 16, 16, 16, 16,
465  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
466  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
467  17, 18, 19, 1, 16, 1, 20, 21, 16, 22,
468 
469  23, 16, 24, 25, 26, 16, 16, 16, 16, 27,
470  28, 29, 16, 30, 31, 16, 32, 16, 16, 16,
471  16, 16, 33, 1, 34, 1, 1, 16, 16, 16,
472  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
473  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
474  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
475  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
476  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
477  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
478  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
479 
480  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
481  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
482  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
483  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
484  16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
485  16, 16, 16, 16, 16
486  } ;
487 
489  { 0,
490  1, 1, 2, 3, 4, 1, 1, 1, 1, 5,
491  1, 1, 6, 1, 6, 5, 1, 3, 1, 5,
492  5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
493  5, 5, 1, 1
494  } ;
495 
497  { 0,
498  0, 0, 32, 33, 36, 38, 40, 44, 150, 151,
499  147, 145, 151, 151, 36, 137, 40, 40, 151, 151,
500  151, 151, 0, 151, 151, 120, 123, 114, 115, 110,
501  151, 151, 0, 138, 53, 0, 137, 151, 0, 0,
502  136, 151, 151, 136, 134, 126, 53, 151, 125, 151,
503  0, 124, 0, 109, 108, 111, 108, 108, 0, 125,
504  55, 60, 151, 0, 124, 151, 0, 123, 0, 115,
505  94, 100, 89, 90, 83, 82, 0, 76, 0, 65,
506  62, 0, 69, 43, 38, 0, 41, 0, 151, 69,
507  75, 81, 47, 87, 93, 99, 105, 111, 116
508 
509  } ;
510 
512  { 0,
513  89, 1, 90, 90, 91, 91, 92, 92, 89, 89,
514  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
515  89, 89, 93, 89, 89, 93, 93, 93, 93, 93,
516  89, 89, 94, 89, 95, 96, 89, 89, 97, 98,
517  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
518  99, 89, 93, 93, 93, 93, 93, 93, 94, 89,
519  95, 95, 89, 96, 89, 89, 98, 89, 99, 89,
520  93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
521  93, 93, 93, 93, 93, 93, 93, 93, 0, 89,
522  89, 89, 89, 89, 89, 89, 89, 89, 89
523 
524  } ;
525 
527  { 0,
528  10, 11, 12, 13, 10, 14, 15, 16, 17, 18,
529  19, 20, 21, 22, 10, 23, 24, 10, 25, 23,
530  23, 26, 27, 28, 23, 23, 29, 23, 23, 23,
531  30, 23, 31, 32, 34, 34, 35, 35, 37, 38,
532  37, 38, 41, 46, 50, 47, 41, 52, 51, 47,
533  48, 53, 42, 39, 43, 39, 42, 62, 43, 89,
534  52, 63, 47, 89, 62, 88, 87, 86, 63, 33,
535  33, 33, 33, 33, 33, 36, 36, 36, 36, 36,
536  36, 40, 40, 40, 40, 40, 40, 59, 85, 59,
537  84, 59, 59, 61, 83, 61, 61, 61, 61, 64,
538 
539  82, 81, 64, 64, 64, 66, 80, 66, 66, 66,
540  66, 67, 79, 67, 67, 67, 69, 78, 69, 69,
541  69, 69, 77, 76, 70, 68, 65, 60, 75, 74,
542  73, 72, 71, 70, 49, 49, 45, 44, 68, 65,
543  60, 58, 57, 56, 55, 54, 49, 45, 44, 89,
544  9, 89, 89, 89, 89, 89, 89, 89, 89, 89,
545  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
546  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
547  89, 89, 89, 89, 89
548  } ;
549 
551  { 0,
552  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
553  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
554  1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
555  1, 1, 1, 1, 3, 4, 3, 4, 5, 5,
556  6, 6, 7, 15, 17, 15, 8, 18, 17, 18,
557  15, 93, 7, 5, 7, 6, 8, 35, 8, 61,
558  47, 35, 47, 61, 62, 87, 85, 84, 62, 90,
559  90, 90, 90, 90, 90, 91, 91, 91, 91, 91,
560  91, 92, 92, 92, 92, 92, 92, 94, 83, 94,
561  81, 94, 94, 95, 80, 95, 95, 95, 95, 96,
562 
563  78, 76, 96, 96, 96, 97, 75, 97, 97, 97,
564  97, 98, 74, 98, 98, 98, 99, 73, 99, 99,
565  99, 99, 72, 71, 70, 68, 65, 60, 58, 57,
566  56, 55, 54, 52, 49, 46, 45, 44, 41, 37,
567  34, 30, 29, 28, 27, 26, 16, 12, 11, 9,
568  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
569  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
570  89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
571  89, 89, 89, 89, 89
572  } ;
573 
575  { 0,
576  52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
577  62, 63, 64, 65, 67, 68, 69, 70, 71, 76,
578  77, 78, 82, 83, 84, 85, 89, 94, 95, 96,
579  106, 116, 117, 118
580  } ;
581 
582 /* The intent behind this definition is that it'll catch
583  * any uses of REJECT which flex missed.
584  */
585 #define REJECT reject_used_but_not_detected
586 #define yymore() yymore_used_but_not_detected
587 #define YY_MORE_ADJ 0
588 #define YY_RESTORE_YY_MORE_OFFSET
589 #line 1 "lib/vcsn/dot/scan.ll"
590 /* See <http://www.graphviz.org/content/dot-language>. */
591 #define YY_NO_INPUT 1
592 
593 #line 14 "lib/vcsn/dot/scan.ll"
594 #include <string>
595 #include <iostream>
596 
597 #define LINE(Line) \
598  do { \
599  loc.end.column = 1; \
600  loc.lines(Line); \
601  } while (false)
602 
603 #define YY_USER_ACTION \
604  loc.columns(yyleng);
605 
606 #define TOK(Token) \
607  parser::make_ ## Token (loc)
608 
610 
611 
612 #line 599 "lib/vcsn/dot/scan.cc"
613 
614 #define INITIAL 0
615 #define SC_COMMENT 1
616 #define SC_STRING 2
617 #define SC_XML 3
618 
619 #ifndef YY_NO_UNISTD_H
620 /* Special case for "unistd.h", since it is non-ANSI. We include it way
621  * down here because we want the user's section 1 to have been scanned first.
622  * The user has a chance to override it with an option.
623  */
624 /* %if-c-only */
625 /* %endif */
626 /* %if-c++-only */
627 #include <unistd.h>
628 /* %endif */
629 #endif
630 
631 #ifndef YY_EXTRA_TYPE
632 #define YY_EXTRA_TYPE void *
633 #endif
634 
635 /* %if-c-only Reentrant structure and macros (non-C++). */
636 /* %if-reentrant */
637 /* %if-c-only */
638 /* %endif */
639 /* %if-reentrant */
640 /* %endif */
641 /* %endif End reentrant structures and macros. */
642 /* %if-bison-bridge */
643 /* %endif */
644 /* %not-for-header */
645 
646 /* %ok-for-header */
647 
648 /* %endif */
649 
650 #ifndef yytext_ptr
651 static void yy_flex_strncpy (char *,yyconst char *,int );
652 #endif
653 
654 #ifdef YY_NEED_STRLEN
655 static int yy_flex_strlen (yyconst char * );
656 #endif
657 
658 #ifndef YY_NO_INPUT
659 /* %if-c-only Standard (non-C++) definition */
660 /* %not-for-header */
661 
662 /* %ok-for-header */
663 
664 /* %endif */
665 #endif
666 
667 /* %if-c-only */
668 /* %endif */
669 
670 /* Amount of stuff to slurp up with each read. */
671 #ifndef YY_READ_BUF_SIZE
672 #ifdef __ia64__
673 /* On IA-64, the buffer size is 16k, not 8k */
674 #define YY_READ_BUF_SIZE 16384
675 #else
676 #define YY_READ_BUF_SIZE 8192
677 #endif /* __ia64__ */
678 #endif
679 
680 /* Copy whatever the last rule matched to the standard output. */
681 #ifndef ECHO
682 /* %if-c-only Standard (non-C++) definition */
683 /* %endif */
684 /* %if-c++-only C++ definition */
685 #define ECHO LexerOutput( yytext, yyleng )
686 /* %endif */
687 #endif
688 
689 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
690  * is returned in "result".
691  */
692 #ifndef YY_INPUT
693 #define YY_INPUT(buf,result,max_size) \
694 /* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
695 \
696 /* %if-c++-only C++ definition \ */\
697  if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
698  YY_FATAL_ERROR( "input in flex scanner failed" );
699 /* %endif */
700 
701 #endif
702 
703 /* No semi-colon after return; correct usage is to write "yyterminate();" -
704  * we don't want an extra ';' after the "return" because that will cause
705  * some compilers to complain about unreachable statements.
706  */
707 #ifndef yyterminate
708 #define yyterminate() return YY_NULL
709 #endif
710 
711 /* Number of entries by which start-condition stack grows. */
712 #ifndef YY_START_STACK_INCR
713 #define YY_START_STACK_INCR 25
714 #endif
715 
716 /* Report a fatal error. */
717 #ifndef YY_FATAL_ERROR
718 /* %if-c-only */
719 /* %endif */
720 /* %if-c++-only */
721 #define YY_FATAL_ERROR(msg) LexerError( msg )
722 /* %endif */
723 #endif
724 
725 /* %if-tables-serialization structures and prototypes */
726 /* %not-for-header */
727 
728 /* %ok-for-header */
729 
730 /* %not-for-header */
731 
732 /* %tables-yydmap generated elements */
733 /* %endif */
734 /* end tables serialization structures and prototypes */
735 
736 /* %ok-for-header */
737 
738 /* Default declaration of generated scanner - a define so the user can
739  * easily add parameters.
740  */
741 #ifndef YY_DECL
742 #define YY_DECL_IS_OURS 1
743 /* %if-c-only Standard (non-C++) definition */
744 /* %endif */
745 /* %if-c++-only C++ definition */
746 #define YY_DECL int yyFlexLexer::yylex()
747 /* %endif */
748 #endif /* !YY_DECL */
749 
750 /* Code executed at the beginning of each rule, after yytext and yyleng
751  * have been set up.
752  */
753 #ifndef YY_USER_ACTION
754 #define YY_USER_ACTION
755 #endif
756 
757 /* Code executed at the end of each rule. */
758 #ifndef YY_BREAK
759 #define YY_BREAK break;
760 #endif
761 
762 /* %% [6.0] YY_RULE_SETUP definition goes here */
763 #define YY_RULE_SETUP \
764  YY_USER_ACTION
765 
766 /* %not-for-header */
767 
770 YY_DECL
771 {
772  register yy_state_type yy_current_state;
773  register char *yy_cp, *yy_bp;
774  register int yy_act;
775 
776  if ( !(yy_init) )
777  {
778  (yy_init) = 1;
779 
780 #ifdef YY_USER_INIT
781  YY_USER_INIT;
782 #endif
783 
784  if ( ! (yy_start) )
785  (yy_start) = 1; /* first start state */
786 
787  if ( ! yyin )
788 /* %if-c-only */
789 /* %endif */
790 /* %if-c++-only */
791  yyin = & std::cin;
792 /* %endif */
793 
794  if ( ! yyout )
795 /* %if-c-only */
796 /* %endif */
797 /* %if-c++-only */
798  yyout = & std::cout;
799 /* %endif */
800 
801  if ( ! YY_CURRENT_BUFFER ) {
802  yyensure_buffer_stack ();
804  yy_create_buffer( yyin, YY_BUF_SIZE );
805  }
806 
807  yy_load_buffer_state( );
808  }
809 
810  {
811 /* %% [7.0] user's declarations go here */
812 #line 41 "lib/vcsn/dot/scan.ll"
813 
814 
815  // Growing string, for SC_STRING/SC_XML.
816  auto s = std::string{};
817  // Level of nesting of "<"/">" for SC_XML.
818  int nesting = 0;
819  loc.step();
820 
821 
822 #line 809 "lib/vcsn/dot/scan.cc"
823 
824  while ( 1 ) /* loops until end-of-file is reached */
825  {
826 /* %% [8.0] yymore()-related code goes here */
827  yy_cp = (yy_c_buf_p);
828 
829  /* Support of yytext. */
830  *yy_cp = (yy_hold_char);
831 
832  /* yy_bp points to the position in yy_ch_buf of the start of
833  * the current run.
834  */
835  yy_bp = yy_cp;
836 
837 /* %% [9.0] code to set up and find next match goes here */
838  yy_current_state = (yy_start);
839 yy_match:
840  do
841  {
842  register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
843  if ( yy_accept[yy_current_state] )
844  {
845  (yy_last_accepting_state) = yy_current_state;
846  (yy_last_accepting_cpos) = yy_cp;
847  }
848  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
849  {
850  yy_current_state = (int) yy_def[yy_current_state];
851  if ( yy_current_state >= 90 )
852  yy_c = yy_meta[(unsigned int) yy_c];
853  }
854  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
855  ++yy_cp;
856  }
857  while ( yy_base[yy_current_state] != 151 );
858 
859 yy_find_action:
860 /* %% [10.0] code to find the action number goes here */
861  yy_act = yy_accept[yy_current_state];
862  if ( yy_act == 0 )
863  { /* have to back up */
864  yy_cp = (yy_last_accepting_cpos);
865  yy_current_state = (yy_last_accepting_state);
866  yy_act = yy_accept[yy_current_state];
867  }
868 
870 
871 /* %% [11.0] code for yylineno update goes here */
872 
873 do_action: /* This label is used only to access EOF actions. */
874 
875 /* %% [12.0] debug code goes here */
876  if ( yy_flex_debug )
877  {
878  if ( yy_act == 0 )
879  std::cerr << "--scanner backing up\n";
880  else if ( yy_act < 35 )
881  std::cerr << "--accepting rule at line " << yy_rule_linenum[yy_act] <<
882  "(\"" << yytext << "\")\n";
883  else if ( yy_act == 35 )
884  std::cerr << "--accepting default rule (\"" << yytext << "\")\n";
885  else if ( yy_act == 36 )
886  std::cerr << "--(end of buffer or a NUL)\n";
887  else
888  std::cerr << "--EOF (start condition " << YY_START << ")\n";
889  }
890 
891  switch ( yy_act )
892  { /* beginning of action switch */
893 /* %% [13.0] actions go here */
894  case 0: /* must back up */
895  /* undo the effects of YY_DO_BEFORE_ACTION */
896  *yy_cp = (yy_hold_char);
897  yy_cp = (yy_last_accepting_cpos);
898  yy_current_state = (yy_last_accepting_state);
899  goto yy_find_action;
900 
901 /* Vcsn Syntax */
902 case 1:
904 #line 52 "lib/vcsn/dot/scan.ll"
905 return TOK(DIGRAPH);
906  YY_BREAK
907 case 2:
909 #line 53 "lib/vcsn/dot/scan.ll"
910 return TOK(EDGE);
911  YY_BREAK
912 case 3:
914 #line 54 "lib/vcsn/dot/scan.ll"
915 return TOK(GRAPH);
916  YY_BREAK
917 case 4:
919 #line 55 "lib/vcsn/dot/scan.ll"
920 return TOK(NODE);
921  YY_BREAK
922 case 5:
924 #line 56 "lib/vcsn/dot/scan.ll"
925 return TOK(SUBGRAPH);
926  YY_BREAK
927 case 6:
929 #line 57 "lib/vcsn/dot/scan.ll"
930 return TOK(LBRACE);
931  YY_BREAK
932 case 7:
934 #line 58 "lib/vcsn/dot/scan.ll"
935 return TOK(RBRACE);
936  YY_BREAK
937 case 8:
939 #line 59 "lib/vcsn/dot/scan.ll"
940 return TOK(LBRACKET);
941  YY_BREAK
942 case 9:
944 #line 60 "lib/vcsn/dot/scan.ll"
945 return TOK(RBRACKET);
946  YY_BREAK
947 case 10:
949 #line 61 "lib/vcsn/dot/scan.ll"
950 return TOK(EQ);
951  YY_BREAK
952 case 11:
954 #line 62 "lib/vcsn/dot/scan.ll"
955 return TOK(ARROW);
956  YY_BREAK
957 case 12:
959 #line 63 "lib/vcsn/dot/scan.ll"
960 return TOK(COLON);
961  YY_BREAK
962 case 13:
964 #line 64 "lib/vcsn/dot/scan.ll"
965 return TOK(COMMA);
966  YY_BREAK
967 case 14:
969 #line 65 "lib/vcsn/dot/scan.ll"
970 return TOK(SEMI);
971  YY_BREAK
972 case 15:
974 #line 67 "lib/vcsn/dot/scan.ll"
975 loc.step(); continue;
976  YY_BREAK
977 case 16:
979 #line 68 "lib/vcsn/dot/scan.ll"
981  YY_BREAK
982 case 17:
984 #line 69 "lib/vcsn/dot/scan.ll"
986  YY_BREAK
987 case 18:
989 #line 70 "lib/vcsn/dot/scan.ll"
990 ++nesting; BEGIN(SC_XML);
991  YY_BREAK
992 case 19:
994 #line 71 "lib/vcsn/dot/scan.ll"
995 {
996  return parser::make_ID
997  (string_t{std::string{yytext, size_t(yyleng)}},
998  loc);
999  }
1000  YY_BREAK
1001 case 20:
1003 #line 76 "lib/vcsn/dot/scan.ll"
1004 loc.step(); continue;
1005  YY_BREAK
1006 case 21:
1007 /* rule 21 can match eol */
1009 #line 77 "lib/vcsn/dot/scan.ll"
1010 LINE(yyleng); loc.step(); continue;
1011  YY_BREAK
1012 case 22:
1014 #line 78 "lib/vcsn/dot/scan.ll"
1015 driver_.error(loc, std::string{"invalid character: "}+yytext);
1016  YY_BREAK
1017 
1018 
1019 case 23:
1021 #line 82 "lib/vcsn/dot/scan.ll"
1022 loc.step(); continue;
1023  YY_BREAK
1024 case 24:
1026 #line 83 "lib/vcsn/dot/scan.ll"
1027 loc.step(); continue;
1028  YY_BREAK
1029 case 25:
1030 /* rule 25 can match eol */
1032 #line 84 "lib/vcsn/dot/scan.ll"
1033 LINE(yyleng); loc.step(); continue;
1034  YY_BREAK
1035 case 26:
1037 #line 85 "lib/vcsn/dot/scan.ll"
1038 BEGIN(INITIAL);
1039  YY_BREAK
1040 
1041 /* Handling of the strings. Initial " is eaten. */
1042 case 27:
1044 #line 89 "lib/vcsn/dot/scan.ll"
1045 {
1046  BEGIN(INITIAL);
1047  return parser::make_ID(string_t{s}, loc);
1048  }
1049  YY_BREAK
1050 case 28:
1052 #line 94 "lib/vcsn/dot/scan.ll"
1053 s.push_back(yytext[1]);
1054  YY_BREAK
1055 case 29:
1057 #line 95 "lib/vcsn/dot/scan.ll"
1058 s.append(yytext, yyleng);
1059  YY_BREAK
1060 case 30:
1061 /* rule 30 can match eol */
1063 #line 96 "lib/vcsn/dot/scan.ll"
1064 LINE(yyleng); s.append(yytext, yyleng);
1065  YY_BREAK
1066 case YY_STATE_EOF(SC_STRING):
1067 #line 98 "lib/vcsn/dot/scan.ll"
1068 {
1069  driver_.error(loc, "unexpected end of file in a string");
1070  BEGIN(INITIAL);
1071  return parser::make_ID(string_t{s}, loc);
1072  }
1073  YY_BREAK
1074 
1075 /* Handling of the XML/HTML strings. Initial < is eaten. */
1076 case 31:
1078 #line 106 "lib/vcsn/dot/scan.ll"
1079 {
1080  if (--nesting == 0)
1081  {
1082  BEGIN(INITIAL);
1083  return parser::make_ID(string_t{s}, loc);
1084  }
1085  else
1086  s.push_back('>');
1087  }
1088  YY_BREAK
1089 case 32:
1091 #line 116 "lib/vcsn/dot/scan.ll"
1092 ++nesting; s.push_back('<');
1093  YY_BREAK
1094 case 33:
1096 #line 117 "lib/vcsn/dot/scan.ll"
1097 s.append(yytext, yyleng);
1098  YY_BREAK
1099 case 34:
1100 /* rule 34 can match eol */
1102 #line 118 "lib/vcsn/dot/scan.ll"
1103 LINE(yyleng); s.append(yytext, yyleng);
1104  YY_BREAK
1105 case YY_STATE_EOF(SC_XML):
1106 #line 120 "lib/vcsn/dot/scan.ll"
1107 {
1108  driver_.error(loc, "unexpected end of file in a XML string");
1109  BEGIN(INITIAL);
1110  return parser::make_ID(string_t{s}, loc);
1111  }
1112  YY_BREAK
1113 
1114 case 35:
1116 #line 127 "lib/vcsn/dot/scan.ll"
1117 ECHO;
1118  YY_BREAK
1119 #line 1106 "lib/vcsn/dot/scan.cc"
1120 case YY_STATE_EOF(INITIAL):
1121 case YY_STATE_EOF(SC_COMMENT):
1122  yyterminate();
1123 
1124  case YY_END_OF_BUFFER:
1125  {
1126  /* Amount of text matched not including the EOB char. */
1127  int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1128 
1129  /* Undo the effects of YY_DO_BEFORE_ACTION. */
1130  *yy_cp = (yy_hold_char);
1132 
1133  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1134  {
1135  /* We're scanning a new file or input source. It's
1136  * possible that this happened because the user
1137  * just pointed yyin at a new source and called
1138  * yylex(). If so, then we have to assure
1139  * consistency between YY_CURRENT_BUFFER and our
1140  * globals. Here is the right place to do so, because
1141  * this is the first action (other than possibly a
1142  * back-up) that will match for the new input source.
1143  */
1144  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1145  YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1146  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1147  }
1148 
1149  /* Note that here we test for yy_c_buf_p "<=" to the position
1150  * of the first EOB in the buffer, since yy_c_buf_p will
1151  * already have been incremented past the NUL character
1152  * (since all states make transitions on EOB to the
1153  * end-of-buffer state). Contrast this with the test
1154  * in input().
1155  */
1156  if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1157  { /* This was really a NUL. */
1158  yy_state_type yy_next_state;
1159 
1160  (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1161 
1162  yy_current_state = yy_get_previous_state( );
1163 
1164  /* Okay, we're now positioned to make the NUL
1165  * transition. We couldn't have
1166  * yy_get_previous_state() go ahead and do it
1167  * for us because it doesn't know how to deal
1168  * with the possibility of jamming (and we don't
1169  * want to build jamming into it because then it
1170  * will run more slowly).
1171  */
1172 
1173  yy_next_state = yy_try_NUL_trans( yy_current_state );
1174 
1175  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1176 
1177  if ( yy_next_state )
1178  {
1179  /* Consume the NUL. */
1180  yy_cp = ++(yy_c_buf_p);
1181  yy_current_state = yy_next_state;
1182  goto yy_match;
1183  }
1184 
1185  else
1186  {
1187 /* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
1188  yy_cp = (yy_c_buf_p);
1189  goto yy_find_action;
1190  }
1191  }
1192 
1193  else switch ( yy_get_next_buffer( ) )
1194  {
1195  case EOB_ACT_END_OF_FILE:
1196  {
1197  (yy_did_buffer_switch_on_eof) = 0;
1198 
1199  if ( yywrap( ) )
1200  {
1201  /* Note: because we've taken care in
1202  * yy_get_next_buffer() to have set up
1203  * yytext, we can now set up
1204  * yy_c_buf_p so that if some total
1205  * hoser (like flex itself) wants to
1206  * call the scanner after we return the
1207  * YY_NULL, it'll still work - another
1208  * YY_NULL will get returned.
1209  */
1210  (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1211 
1212  yy_act = YY_STATE_EOF(YY_START);
1213  goto do_action;
1214  }
1215 
1216  else
1217  {
1218  if ( ! (yy_did_buffer_switch_on_eof) )
1219  YY_NEW_FILE;
1220  }
1221  break;
1222  }
1223 
1224  case EOB_ACT_CONTINUE_SCAN:
1225  (yy_c_buf_p) =
1226  (yytext_ptr) + yy_amount_of_matched_text;
1227 
1228  yy_current_state = yy_get_previous_state( );
1229 
1230  yy_cp = (yy_c_buf_p);
1231  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1232  goto yy_match;
1233 
1234  case EOB_ACT_LAST_MATCH:
1235  (yy_c_buf_p) =
1236  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1237 
1238  yy_current_state = yy_get_previous_state( );
1239 
1240  yy_cp = (yy_c_buf_p);
1241  yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1242  goto yy_find_action;
1243  }
1244  break;
1245  }
1246 
1247  default:
1249  "fatal flex scanner internal error--no action found" );
1250  } /* end of action switch */
1251  } /* end of scanning one token */
1252  } /* end of user's declarations */
1253 } /* end of yylex */
1254 /* %ok-for-header */
1255 
1256 /* %if-c++-only */
1257 /* %not-for-header */
1258 
1259 /* The contents of this function are C++ specific, so the () macro is not used.
1260  */
1261 yyFlexLexer::yyFlexLexer( std::istream* arg_yyin, std::ostream* arg_yyout )
1262 {
1263  yyin = arg_yyin;
1264  yyout = arg_yyout;
1265  yy_c_buf_p = 0;
1266  yy_init = 0;
1267  yy_start = 0;
1268  yy_flex_debug = 0;
1269  yylineno = 1; // this will only get updated if %option yylineno
1270 
1272 
1274  yy_more_flag = 0;
1275  yy_more_len = 0;
1277 
1279  yy_start_stack = NULL;
1280 
1281  yy_buffer_stack = 0;
1282  yy_buffer_stack_top = 0;
1283  yy_buffer_stack_max = 0;
1284 
1285  yy_state_buf = 0;
1286 
1287 }
1288 
1289 /* The contents of this function are C++ specific, so the () macro is not used.
1290  */
1292 {
1293  delete [] yy_state_buf;
1297 }
1298 
1299 /* The contents of this function are C++ specific, so the () macro is not used.
1300  */
1301 void yyFlexLexer::switch_streams( std::istream* new_in, std::ostream* new_out )
1302 {
1303  if ( new_in )
1304  {
1307  }
1308 
1309  if ( new_out )
1310  yyout = new_out;
1311 }
1312 
1313 #ifdef YY_INTERACTIVE
1314 int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
1315 #else
1316 int yyFlexLexer::LexerInput( char* buf, int max_size )
1317 #endif
1318 {
1319  if ( yyin->eof() || yyin->fail() )
1320  return 0;
1321 
1322 #ifdef YY_INTERACTIVE
1323  yyin->get( buf[0] );
1324 
1325  if ( yyin->eof() )
1326  return 0;
1327 
1328  if ( yyin->bad() )
1329  return -1;
1330 
1331  return 1;
1332 
1333 #else
1334  (void) yyin->read( buf, max_size );
1335 
1336  if ( yyin->bad() )
1337  return -1;
1338  else
1339  return yyin->gcount();
1340 #endif
1341 }
1342 
1343 void yyFlexLexer::LexerOutput( const char* buf, int size )
1344 {
1345  (void) yyout->write( buf, size );
1346 }
1347 /* %ok-for-header */
1348 
1349 /* %endif */
1350 
1351 /* yy_get_next_buffer - try to read in a new buffer
1352  *
1353  * Returns a code representing an action:
1354  * EOB_ACT_LAST_MATCH -
1355  * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1356  * EOB_ACT_END_OF_FILE - end of file
1357  */
1358 /* %if-c-only */
1359 /* %endif */
1360 /* %if-c++-only */
1362 /* %endif */
1363 {
1364  register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1365  register char *source = (yytext_ptr);
1366  register int number_to_move, i;
1367  int ret_val;
1368 
1369  if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1371  "fatal flex scanner internal error--end of buffer missed" );
1372 
1373  if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1374  { /* Don't try to fill the buffer, so this is an EOF. */
1375  if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1376  {
1377  /* We matched a single character, the EOB, so
1378  * treat this as a final EOF.
1379  */
1380  return EOB_ACT_END_OF_FILE;
1381  }
1382 
1383  else
1384  {
1385  /* We matched some text prior to the EOB, first
1386  * process it.
1387  */
1388  return EOB_ACT_LAST_MATCH;
1389  }
1390  }
1391 
1392  /* Try to read more data. */
1393 
1394  /* First move last chars to start of buffer. */
1395  number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1396 
1397  for ( i = 0; i < number_to_move; ++i )
1398  *(dest++) = *(source++);
1399 
1400  if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1401  /* don't do the read, it's not guaranteed to return an EOF,
1402  * just force an EOF
1403  */
1404  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1405 
1406  else
1407  {
1408  int num_to_read =
1409  YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1410 
1411  while ( num_to_read <= 0 )
1412  { /* Not enough room in the buffer - grow it. */
1413 
1414  /* just a shorter name for the current buffer */
1415  YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
1416 
1417  int yy_c_buf_p_offset =
1418  (int) ((yy_c_buf_p) - b->yy_ch_buf);
1419 
1420  if ( b->yy_is_our_buffer )
1421  {
1422  yy_size_t new_size = b->yy_buf_size * 2;
1423 
1424  if ( new_size <= 0 )
1425  b->yy_buf_size += b->yy_buf_size / 8;
1426  else
1427  b->yy_buf_size *= 2;
1428 
1429  b->yy_ch_buf = (char *)
1430  /* Include room in for 2 EOB chars. */
1431  yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1432  }
1433  else
1434  /* Can't grow it, we don't own it. */
1435  b->yy_ch_buf = 0;
1436 
1437  if ( ! b->yy_ch_buf )
1439  "fatal error - scanner input buffer overflow" );
1440 
1441  (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1442 
1443  num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1444  number_to_move - 1;
1445 
1446  }
1447 
1448  if ( num_to_read > YY_READ_BUF_SIZE )
1449  num_to_read = YY_READ_BUF_SIZE;
1450 
1451  /* Read in more data. */
1452  YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1453  (yy_n_chars), num_to_read );
1454 
1455  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1456  }
1457 
1458  if ( (yy_n_chars) == 0 )
1459  {
1460  if ( number_to_move == YY_MORE_ADJ )
1461  {
1462  ret_val = EOB_ACT_END_OF_FILE;
1463  yyrestart( yyin );
1464  }
1465 
1466  else
1467  {
1468  ret_val = EOB_ACT_LAST_MATCH;
1469  YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1471  }
1472  }
1473 
1474  else
1475  ret_val = EOB_ACT_CONTINUE_SCAN;
1476 
1477  if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1478  /* Extend the array by 50%, plus the number we really need. */
1479  yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1480  YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1481  if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1482  YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1483  }
1484 
1485  (yy_n_chars) += number_to_move;
1488 
1489  (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1490 
1491  return ret_val;
1492 }
1493 
1494 /* yy_get_previous_state - get the state just before the EOB char was reached */
1495 
1496 /* %if-c-only */
1497 /* %not-for-header */
1498 
1499 /* %endif */
1500 /* %if-c++-only */
1502 /* %endif */
1503 {
1504  register yy_state_type yy_current_state;
1505  register char *yy_cp;
1506 
1507 /* %% [15.0] code to get the start state into yy_current_state goes here */
1508  yy_current_state = (yy_start);
1509 
1510  for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1511  {
1512 /* %% [16.0] code to find the next state goes here */
1513  register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1514  if ( yy_accept[yy_current_state] )
1515  {
1516  (yy_last_accepting_state) = yy_current_state;
1517  (yy_last_accepting_cpos) = yy_cp;
1518  }
1519  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1520  {
1521  yy_current_state = (int) yy_def[yy_current_state];
1522  if ( yy_current_state >= 90 )
1523  yy_c = yy_meta[(unsigned int) yy_c];
1524  }
1525  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1526  }
1527 
1528  return yy_current_state;
1529 }
1530 
1531 /* yy_try_NUL_trans - try to make a transition on the NUL character
1532  *
1533  * synopsis
1534  * next_state = yy_try_NUL_trans( current_state );
1535  */
1536 /* %if-c-only */
1537 /* %endif */
1538 /* %if-c++-only */
1540 /* %endif */
1541 {
1542  register int yy_is_jam;
1543  /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
1544  register char *yy_cp = (yy_c_buf_p);
1545 
1546  register YY_CHAR yy_c = 1;
1547  if ( yy_accept[yy_current_state] )
1548  {
1549  (yy_last_accepting_state) = yy_current_state;
1550  (yy_last_accepting_cpos) = yy_cp;
1551  }
1552  while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1553  {
1554  yy_current_state = (int) yy_def[yy_current_state];
1555  if ( yy_current_state >= 90 )
1556  yy_c = yy_meta[(unsigned int) yy_c];
1557  }
1558  yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1559  yy_is_jam = (yy_current_state == 89);
1560 
1561  return yy_is_jam ? 0 : yy_current_state;
1562 }
1563 
1564 /* %if-c-only */
1565 /* %endif */
1566 /* %if-c++-only */
1567  void yyFlexLexer::yyunput( int c, register char* yy_bp)
1568 /* %endif */
1569 {
1570  register char *yy_cp;
1571 
1572  yy_cp = (yy_c_buf_p);
1573 
1574  /* undo effects of setting up yytext */
1575  *yy_cp = (yy_hold_char);
1576 
1577  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1578  { /* need to shift things up to make room */
1579  /* +2 for EOB chars. */
1580  register yy_size_t number_to_move = (yy_n_chars) + 2;
1581  register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1582  YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1583  register char *source =
1584  &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1585 
1586  while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1587  *--dest = *--source;
1588 
1589  yy_cp += (int) (dest - source);
1590  yy_bp += (int) (dest - source);
1591  YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1592  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1593 
1594  if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1595  YY_FATAL_ERROR( "flex scanner push-back overflow" );
1596  }
1597 
1598  *--yy_cp = (char) c;
1599 
1600 /* %% [18.0] update yylineno here */
1601 
1602  (yytext_ptr) = yy_bp;
1603  (yy_hold_char) = *yy_cp;
1604  (yy_c_buf_p) = yy_cp;
1605 }
1606 /* %if-c-only */
1607 /* %endif */
1608 
1609 /* %if-c-only */
1610 /* %endif */
1611 /* %if-c++-only */
1613 /* %endif */
1614 {
1615  int c;
1616 
1617  *(yy_c_buf_p) = (yy_hold_char);
1618 
1619  if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1620  {
1621  /* yy_c_buf_p now points to the character we want to return.
1622  * If this occurs *before* the EOB characters, then it's a
1623  * valid NUL; if not, then we've hit the end of the buffer.
1624  */
1625  if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1626  /* This was really a NUL. */
1627  *(yy_c_buf_p) = '\0';
1628 
1629  else
1630  { /* need more input */
1631  yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
1632  ++(yy_c_buf_p);
1633 
1634  switch ( yy_get_next_buffer( ) )
1635  {
1636  case EOB_ACT_LAST_MATCH:
1637  /* This happens because yy_g_n_b()
1638  * sees that we've accumulated a
1639  * token and flags that we need to
1640  * try matching the token before
1641  * proceeding. But for input(),
1642  * there's no matching to consider.
1643  * So convert the EOB_ACT_LAST_MATCH
1644  * to EOB_ACT_END_OF_FILE.
1645  */
1646 
1647  /* Reset buffer status. */
1648  yyrestart( yyin );
1649 
1650  /*FALLTHROUGH*/
1651 
1652  case EOB_ACT_END_OF_FILE:
1653  {
1654  if ( yywrap( ) )
1655  return EOF;
1656 
1657  if ( ! (yy_did_buffer_switch_on_eof) )
1658  YY_NEW_FILE;
1659 #ifdef __cplusplus
1660  return yyinput();
1661 #else
1662  return input();
1663 #endif
1664  }
1665 
1666  case EOB_ACT_CONTINUE_SCAN:
1667  (yy_c_buf_p) = (yytext_ptr) + offset;
1668  break;
1669  }
1670  }
1671  }
1672 
1673  c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1674  *(yy_c_buf_p) = '\0'; /* preserve yytext */
1675  (yy_hold_char) = *++(yy_c_buf_p);
1676 
1677 /* %% [19.0] update BOL and yylineno */
1678 
1679  return c;
1680 }
1681 /* %if-c-only */
1682 /* %endif */
1683 
1689 /* %if-c-only */
1690 /* %endif */
1691 /* %if-c++-only */
1692  void yyFlexLexer::yyrestart( std::istream* input_file )
1693 /* %endif */
1694 {
1695 
1696  if ( ! YY_CURRENT_BUFFER ){
1700  }
1701 
1702  yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1704 }
1705 
1710 /* %if-c-only */
1711 /* %endif */
1712 /* %if-c++-only */
1713  void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1714 /* %endif */
1715 {
1716 
1717  /* TODO. We should be able to replace this entire function body
1718  * with
1719  * yypop_buffer_state();
1720  * yypush_buffer_state(new_buffer);
1721  */
1723  if ( YY_CURRENT_BUFFER == new_buffer )
1724  return;
1725 
1726  if ( YY_CURRENT_BUFFER )
1727  {
1728  /* Flush out information for old buffer. */
1729  *(yy_c_buf_p) = (yy_hold_char);
1730  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1731  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1732  }
1733 
1734  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1736 
1737  /* We don't actually know whether we did this switch during
1738  * EOF (yywrap()) processing, but the only time this flag
1739  * is looked at is after yywrap() is called, so it's safe
1740  * to go ahead and always set it.
1741  */
1743 }
1744 
1745 /* %if-c-only */
1746 /* %endif */
1747 /* %if-c++-only */
1749 /* %endif */
1750 {
1751  (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1752  (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1753  yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1754  (yy_hold_char) = *(yy_c_buf_p);
1755 }
1756 
1763 /* %if-c-only */
1764 /* %endif */
1765 /* %if-c++-only */
1766  YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
1767 /* %endif */
1768 {
1769  YY_BUFFER_STATE b;
1770 
1771  b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1772  if ( ! b )
1773  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1774 
1775  b->yy_buf_size = size;
1776 
1777  /* yy_ch_buf has to be 2 characters longer than the size given because
1778  * we need to put in 2 end-of-buffer characters.
1779  */
1780  b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1781  if ( ! b->yy_ch_buf )
1782  YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1783 
1784  b->yy_is_our_buffer = 1;
1785 
1786  yy_init_buffer( b, file );
1787 
1788  return b;
1789 }
1790 
1795 /* %if-c-only */
1796 /* %endif */
1797 /* %if-c++-only */
1798  void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
1799 /* %endif */
1800 {
1801 
1802  if ( ! b )
1803  return;
1804 
1805  if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1807 
1808  if ( b->yy_is_our_buffer )
1809  yyfree((void *) b->yy_ch_buf );
1810 
1811  yyfree((void *) b );
1812 }
1813 
1814 /* Initializes or reinitializes a buffer.
1815  * This function is sometimes called more than once on the same buffer,
1816  * such as during a yyrestart() or at EOF.
1817  */
1818 /* %if-c-only */
1819 /* %endif */
1820 /* %if-c++-only */
1821  void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, std::istream* file )
1822 /* %endif */
1823 
1824 {
1825  int oerrno = errno;
1826 
1827  yy_flush_buffer( b );
1828 
1829  b->yy_input_file = file;
1830  b->yy_fill_buffer = 1;
1831 
1832  /* If b is the current buffer, then yy_init_buffer was _probably_
1833  * called from yyrestart() or through yy_get_next_buffer.
1834  * In that case, we don't want to reset the lineno or column.
1835  */
1836  if (b != YY_CURRENT_BUFFER){
1837  b->yy_bs_lineno = 1;
1838  b->yy_bs_column = 0;
1839  }
1840 
1841 /* %if-c-only */
1842 /* %endif */
1843 /* %if-c++-only */
1844  b->yy_is_interactive = 0;
1845 /* %endif */
1846  errno = oerrno;
1847 }
1848 
1853 /* %if-c-only */
1854 /* %endif */
1855 /* %if-c++-only */
1856  void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
1857 /* %endif */
1858 {
1859  if ( ! b )
1860  return;
1861 
1862  b->yy_n_chars = 0;
1863 
1864  /* We always need two end-of-buffer characters. The first causes
1865  * a transition to the end-of-buffer state. The second causes
1866  * a jam in that state.
1867  */
1870 
1871  b->yy_buf_pos = &b->yy_ch_buf[0];
1872 
1873  b->yy_at_bol = 1;
1875 
1876  if ( b == YY_CURRENT_BUFFER )
1878 }
1879 
1880 /* %if-c-or-c++ */
1887 /* %if-c-only */
1888 /* %endif */
1889 /* %if-c++-only */
1890 void yyFlexLexer::yypush_buffer_state (YY_BUFFER_STATE new_buffer)
1891 /* %endif */
1892 {
1893  if (new_buffer == NULL)
1894  return;
1895 
1897 
1898  /* This block is copied from yy_switch_to_buffer. */
1899  if ( YY_CURRENT_BUFFER )
1900  {
1901  /* Flush out information for old buffer. */
1902  *(yy_c_buf_p) = (yy_hold_char);
1903  YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1904  YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1905  }
1906 
1907  /* Only push if top exists. Otherwise, replace top. */
1908  if (YY_CURRENT_BUFFER)
1909  (yy_buffer_stack_top)++;
1910  YY_CURRENT_BUFFER_LVALUE = new_buffer;
1911 
1912  /* copied from yy_switch_to_buffer. */
1915 }
1916 /* %endif */
1917 
1918 /* %if-c-or-c++ */
1923 /* %if-c-only */
1924 /* %endif */
1925 /* %if-c++-only */
1927 /* %endif */
1928 {
1929  if (!YY_CURRENT_BUFFER)
1930  return;
1931 
1933  YY_CURRENT_BUFFER_LVALUE = NULL;
1934  if ((yy_buffer_stack_top) > 0)
1935  --(yy_buffer_stack_top);
1936 
1937  if (YY_CURRENT_BUFFER) {
1940  }
1941 }
1942 /* %endif */
1943 
1944 /* %if-c-or-c++ */
1945 /* Allocates the stack if it does not exist.
1946  * Guarantees space for at least one push.
1947  */
1948 /* %if-c-only */
1949 /* %endif */
1950 /* %if-c++-only */
1952 /* %endif */
1953 {
1954  yy_size_t num_to_alloc;
1955 
1956  if (!(yy_buffer_stack)) {
1957 
1958  /* First allocation is just for 2 elements, since we don't know if this
1959  * scanner will even need a stack. We use 2 instead of 1 to avoid an
1960  * immediate realloc on the next call.
1961  */
1962  num_to_alloc = 1;
1964  (num_to_alloc * sizeof(struct yy_buffer_state*)
1965  );
1966  if ( ! (yy_buffer_stack) )
1967  YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1968 
1969  memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1970 
1971  (yy_buffer_stack_max) = num_to_alloc;
1972  (yy_buffer_stack_top) = 0;
1973  return;
1974  }
1975 
1976  if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1977 
1978  /* Increase the buffer to prepare for a possible push. */
1979  int grow_size = 8 /* arbitrary grow size */;
1980 
1981  num_to_alloc = (yy_buffer_stack_max) + grow_size;
1983  ((yy_buffer_stack),
1984  num_to_alloc * sizeof(struct yy_buffer_state*)
1985  );
1986  if ( ! (yy_buffer_stack) )
1987  YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1988 
1989  /* zero only the new slots.*/
1990  memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1991  (yy_buffer_stack_max) = num_to_alloc;
1992  }
1993 }
1994 /* %endif */
1995 
1996 /* %if-c-only */
1997 /* %endif */
1998 
1999 /* %if-c-only */
2000 /* %endif */
2001 
2002 /* %if-c-only */
2003 /* %endif */
2004 
2005 /* %if-c-only */
2006 /* %endif */
2007 /* %if-c++-only */
2008  void yyFlexLexer::yy_push_state( int new_state )
2009 /* %endif */
2010 {
2012  {
2013  yy_size_t new_size;
2014 
2016  new_size = (yy_start_stack_depth) * sizeof( int );
2017 
2018  if ( ! (yy_start_stack) )
2019  (yy_start_stack) = (int *) yyalloc(new_size );
2020 
2021  else
2022  (yy_start_stack) = (int *) yyrealloc((void *) (yy_start_stack),new_size );
2023 
2024  if ( ! (yy_start_stack) )
2025  YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
2026  }
2027 
2029 
2030  BEGIN(new_state);
2031 }
2032 
2033 /* %if-c-only */
2034 /* %endif */
2035 /* %if-c++-only */
2037 /* %endif */
2038 {
2039  if ( --(yy_start_stack_ptr) < 0 )
2040  YY_FATAL_ERROR( "start-condition stack underflow" );
2041 
2043 }
2044 
2045 /* %if-c-only */
2046 /* %endif */
2047 /* %if-c++-only */
2049 /* %endif */
2050 {
2051  return (yy_start_stack)[(yy_start_stack_ptr) - 1];
2052 }
2053 
2054 #ifndef YY_EXIT_FAILURE
2055 #define YY_EXIT_FAILURE 2
2056 #endif
2057 
2058 /* %if-c-only */
2059 /* %endif */
2060 /* %if-c++-only */
2062 {
2063  std::cerr << msg << std::endl;
2064  exit( YY_EXIT_FAILURE );
2065 }
2066 /* %endif */
2067 
2068 /* Redefine yyless() so it works in section 3 code. */
2069 
2070 #undef yyless
2071 #define yyless(n) \
2072  do \
2073  { \
2074  /* Undo effects of setting up yytext. */ \
2075  int yyless_macro_arg = (n); \
2076  YY_LESS_LINENO(yyless_macro_arg);\
2077  yytext[yyleng] = (yy_hold_char); \
2078  (yy_c_buf_p) = yytext + yyless_macro_arg; \
2079  (yy_hold_char) = *(yy_c_buf_p); \
2080  *(yy_c_buf_p) = '\0'; \
2081  yyleng = yyless_macro_arg; \
2082  } \
2083  while ( 0 )
2084 
2085 /* Accessor methods (get/set functions) to struct members. */
2086 
2087 /* %if-c-only */
2088 /* %if-reentrant */
2089 /* %endif */
2090 /* %if-reentrant */
2091 /* %endif */
2092 /* %endif */
2093 
2094 /* %if-reentrant */
2095 /* %if-bison-bridge */
2096 /* %endif */
2097 /* %endif if-c-only */
2098 
2099 /* %if-c-only */
2100 /* %endif */
2101 
2102 /* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
2103 /* %if-reentrant */
2104 /* %endif */
2105 /* %endif */
2106 
2107 /*
2108  * Internal utility routines.
2109  */
2110 
2111 #ifndef yytext_ptr
2112 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2113 {
2114  register int i;
2115  for ( i = 0; i < n; ++i )
2116  s1[i] = s2[i];
2117 }
2118 #endif
2119 
2120 #ifdef YY_NEED_STRLEN
2121 static int yy_flex_strlen (yyconst char * s )
2122 {
2123  register int n;
2124  for ( n = 0; s[n]; ++n )
2125  ;
2126 
2127  return n;
2128 }
2129 #endif
2130 
2132 {
2133  return (void *) malloc( size );
2134 }
2135 
2136 void *yyrealloc (void * ptr, yy_size_t size )
2137 {
2138  /* The cast to (char *) in the following accommodates both
2139  * implementations that use char* generic pointers, and those
2140  * that use void* generic pointers. It works with the latter
2141  * because both ANSI C and C++ allow castless assignment from
2142  * any pointer type to void*, and deal with argument conversions
2143  * as though doing an assignment.
2144  */
2145  return (void *) realloc( (char *) ptr, size );
2146 }
2147 
2148 void yyfree (void * ptr )
2149 {
2150  free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2151 }
2152 
2153 /* %if-tables-serialization definitions */
2154 /* %define-yytables The name for this specific scanner's tables. */
2155 #define YYTABLES_NAME "yytables"
2156 /* %endif */
2157 
2158 /* %ok-for-header */
2159 
2160 #line 126 "lib/vcsn/dot/scan.ll"
2161 
2162 
2163 // Do not use %option noyywrap, because then flex generates the
2164 // same definition of yywrap, but outside the namespaces.
2165 int yyFlexLexer::yywrap() { return 1; }
2166 
2167 // Beware of the dummy Flex interface. One would like to use:
2168 //
2169 // yypush_buffer_state(yy_create_buffer(yyin, YY_BUF_SIZE));
2170 //
2171 // and
2172 //
2173 // yypush_buffer_state(yy_scan_bytes(e.c_str(), e.size()));
2174 //
2175 // but the latter (yy_scan_bytes) calls yy_switch_to_buffer, so in
2176 // effect calling yypush_buffer_state saves the new state instead
2177 // of the old one.
2178 //
2179 // So do it in two steps, quite different from what is suggested
2180 // in the documentation: save the old context, switch to the new
2181 // one.
2182 
2183 void yyFlexLexer::scan_open_(std::istream& f)
2184 {
2185  set_debug(!!getenv("YYSCAN"));
2188 }
2189 
2191 {
2193 }
2194 
2196 
2197 
2198 // Local Variables:
2199 // mode: C++
2200 // End:
2201 
yy_state_type * yy_state_buf
Definition: flex-lexer.hh:210
int yy_more_offset
Definition: flex-lexer.hh:222
char * yy_last_accepting_cpos
Definition: flex-lexer.hh:208
#define YY_START_STACK_INCR
Definition: scan.cc:713
yy_size_t yy_buf_size
Definition: scan.cc:290
#define YY_RULE_SETUP
Definition: scan.cc:763
unsigned char YY_CHAR
Definition: scan.cc:409
#define YY_FLEX_NAMESPACE_END
Definition: scan.hh:9
yy_state_type yy_get_previous_state()
Definition: scan.cc:1501
#define SC_COMMENT
Definition: scan.cc:615
int * yy_start_stack
Definition: flex-lexer.hh:166
static flex_int32_t yy_meta[35]
Definition: scan.cc:488
size_t yy_buffer_stack_top
index of top of stack.
Definition: flex-lexer.hh:199
#define YY_FATAL_ERROR(msg)
Definition: scan.cc:721
void yyunput(int c, char *buf_ptr)
Definition: scan.cc:1567
static flex_int16_t yy_nxt[186]
Definition: scan.cc:526
void yy_pop_state()
Definition: scan.cc:2036
int yy_fill_buffer
Definition: scan.cc:322
#define YY_BUFFER_NORMAL
Definition: scan.cc:327
virtual void LexerError(const char *msg)
Definition: scan.cc:2061
void scan_close_()
Definition: scan.cc:2190
char * yy_c_buf_p
Definition: flex-lexer.hh:189
#define YY_DECL
Definition: scan.cc:746
weightset_mixin< detail::b_impl > b
Definition: fwd.hh:48
void yyrestart(std::istream *s)
Immediately switch to a different input stream.
Definition: scan.cc:1692
#define YY_END_OF_BUFFER
Definition: scan.cc:435
flex_int32_t yy_nxt
Definition: scan.cc:441
int yylineno
Definition: flex-lexer.hh:93
virtual void switch_streams(std::istream *new_in, std::ostream *new_out=nullptr)
Definition: scan.cc:1301
void yy_init_buffer(yy_buffer_state *b, std::istream *s)
Definition: scan.cc:1821
#define YY_BREAK
Definition: scan.cc:759
#define INITIAL
Definition: scan.cc:614
flex_int32_t yy_verify
Definition: scan.cc:440
static flex_int16_t yy_base[100]
Definition: scan.cc:496
if(exp.max==-1)
Definition: multiply.hh:381
int yy_prev_more_offset
Definition: flex-lexer.hh:223
static flex_int16_t yy_rule_linenum[35]
Definition: scan.cc:574
int yy_is_interactive
Definition: scan.cc:308
#define LINE(Line)
Definition: scan.cc:597
int yy_is_our_buffer
Definition: scan.cc:301
#define YY_STATE_EOF(state)
Definition: scan.cc:207
yy_state_type yy_try_NUL_trans(yy_state_type current_state)
Definition: scan.cc:1539
#define SC_XML
Definition: scan.cc:617
#define BEGIN
Definition: scan.cc:197
#define YY_MORE_ADJ
Definition: scan.cc:587
char * yy_buf_pos
Definition: scan.cc:285
static flex_int16_t yy_def[100]
Definition: scan.cc:511
void yy_switch_to_buffer(yy_buffer_state *new_buffer)
Switch to a different input buffer.
Definition: scan.cc:1713
#define yyterminate()
Definition: scan.cc:20
unsigned int flex_uint32_t
Definition: scan.cc:102
#define YY_END_OF_BUFFER_CHAR
Definition: scan.cc:212
static flex_int16_t yy_chk[186]
Definition: scan.cc:550
#define TOK(Token)
Definition: scan.cc:606
#define YY_BUFFER_NEW
Definition: scan.cc:326
virtual int LexerInput(char *buf, int max_size)
Definition: scan.cc:1314
void yy_load_buffer_state()
Definition: scan.cc:1748
void yy_delete_buffer(yy_buffer_state *b)
Destroy the buffer.
Definition: scan.cc:1798
#define SC_STRING
Definition: scan.cc:616
#define YY_RESTORE_YY_MORE_OFFSET
Definition: scan.cc:588
void yy_push_state(int new_state)
Definition: scan.cc:2008
#define YY_EXIT_FAILURE
Definition: scan.cc:2055
yy_buffer_state * yy_create_buffer(std::istream *s, int size)
Allocate and initialize an input buffer state.
Definition: scan.cc:1766
#define EOB_ACT_CONTINUE_SCAN
Definition: scan.cc:250
#define YY_BUFFER_EOF_PENDING
Definition: scan.cc:338
yyFlexLexer(std::istream &arg_yyin, std::ostream &arg_yyout)
static flex_int16_t yy_accept[90]
Definition: scan.cc:443
#define YY_NEW_FILE
Definition: scan.cc:210
#define EOB_ACT_LAST_MATCH
Definition: scan.cc:252
void * yyrealloc(void *ptr, yy_size_t size)
Definition: scan.cc:2136
int yy_flex_debug
Definition: flex-lexer.hh:94
size_t yy_buffer_stack_max
capacity of stack.
Definition: flex-lexer.hh:200
void * yyalloc(yy_size_t size)
Definition: scan.cc:2131
int yy_top_state()
Definition: scan.cc:2048
unsigned short int flex_uint16_t
Definition: scan.cc:101
std::istream * yyin
Definition: flex-lexer.hh:148
void yypop_buffer_state()
Removes and deletes the top of the stack, if present.
Definition: scan.cc:1926
size_t yy_size_t
Definition: scan.cc:238
int yy_get_next_buffer()
Definition: scan.cc:1361
char yy_hold_char
Definition: flex-lexer.hh:183
void yy_flush_buffer(yy_buffer_state *b)
Discard all buffered characters.
Definition: scan.cc:1856
yy_size_t yy_n_chars
Definition: scan.cc:295
#define YY_START
Definition: scan.cc:203
symbol string_t
Definition: parse.hh:66
int yyinput()
Definition: scan.cc:1612
int yy_did_buffer_switch_on_eof
Definition: flex-lexer.hh:196
void yypush_buffer_state(yy_buffer_state *new_buffer)
Pushes the new state onto the stack.
Definition: scan.cc:1890
virtual ~yyFlexLexer()
Definition: scan.cc:1291
int yy_start_stack_ptr
Definition: flex-lexer.hh:164
int flex_int32_t
Definition: scan.cc:99
#define YY_CURRENT_BUFFER
Definition: scan.cc:358
int yy_more_flag
Definition: flex-lexer.hh:220
#define YY_INPUT(buf, result, max_size)
Definition: scan.cc:693
struct yy_buffer_state * YY_BUFFER_STATE
Definition: scan.cc:233
int yy_start_stack_depth
Definition: flex-lexer.hh:165
#define YY_CURRENT_BUFFER_LVALUE
Definition: scan.cc:365
#define ECHO
Definition: scan.cc:685
int yy_looking_for_trail_begin
Definition: flex-lexer.hh:218
int yy_bs_column
The column count.
Definition: scan.cc:317
#define yytext_ptr
Definition: scan.cc:411
size_t size(const ExpSet &rs, const typename ExpSet::value_t &r)
#define YY_SC_TO_UI(c)
Definition: scan.cc:183
#define YY_DO_BEFORE_ACTION
Definition: scan.cc:424
int yy_at_bol
Definition: scan.cc:314
std::ostream * yyout
Definition: flex-lexer.hh:179
virtual void LexerOutput(const char *buf, int size)
Definition: scan.cc:1343
static flex_int32_t yy_ec[256]
Definition: scan.cc:456
int yy_bs_lineno
The line count.
Definition: scan.cc:316
#define YY_READ_BUF_SIZE
Definition: scan.cc:676
yy_size_t yyleng
yy_buffer_state ** yy_buffer_stack
Stack as an array.
Definition: flex-lexer.hh:201
Define the vcsn::detail::dot::parser class.
void yyfree(void *ptr)
Definition: scan.cc:2148
std::istream * yy_input_file
Definition: scan.cc:281
#define YY_BUF_SIZE
Definition: scan.cc:223
short int flex_int16_t
Definition: scan.cc:98
signed char flex_int8_t
Definition: scan.cc:97
void yyensure_buffer_stack(void)
Definition: scan.cc:1951
unsigned char flex_uint8_t
Definition: scan.cc:100
#define EOB_ACT_END_OF_FILE
Definition: scan.cc:251
int yy_buffer_status
Definition: scan.cc:324
virtual int yywrap()
Definition: scan.cc:2165
char * yy_ch_buf
Definition: scan.cc:284
void scan_open_(std::istream &f)
Definition: scan.cc:2183
#define yyconst
Definition: scan.cc:167
int yy_state_type
Definition: flex-lexer.hh:59
yy_state_type yy_last_accepting_state
Definition: flex-lexer.hh:207
void set_debug(int flag)
Definition: flex-lexer.hh:88