Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
scan.c
Go to the documentation of this file.
1#line 2 "scan.c"
2
3#line 4 "scan.c"
4
5#define YY_INT_ALIGNED short int
6
7/* A lexical scanner generated by flex */
8
9#define yy_create_buffer aag_create_buffer
10#define yy_delete_buffer aag_delete_buffer
11#define yy_scan_buffer aag_scan_buffer
12#define yy_scan_string aag_scan_string
13#define yy_scan_bytes aag_scan_bytes
14#define yy_init_buffer aag_init_buffer
15#define yy_flush_buffer aag_flush_buffer
16#define yy_load_buffer_state aag_load_buffer_state
17#define yy_switch_to_buffer aag_switch_to_buffer
18#define yypush_buffer_state aagpush_buffer_state
19#define yypop_buffer_state aagpop_buffer_state
20#define yyensure_buffer_stack aagensure_buffer_stack
21#define yy_flex_debug aag_flex_debug
22#define yyin aagin
23#define yyleng aagleng
24#define yylex aaglex
25#define yylineno aaglineno
26#define yyout aagout
27#define yyrestart aagrestart
28#define yytext aagtext
29#define yywrap aagwrap
30#define yyalloc aagalloc
31#define yyrealloc aagrealloc
32#define yyfree aagfree
33
34#define FLEX_SCANNER
35#define YY_FLEX_MAJOR_VERSION 2
36#define YY_FLEX_MINOR_VERSION 6
37#define YY_FLEX_SUBMINOR_VERSION 4
38#if YY_FLEX_SUBMINOR_VERSION > 0
39#define FLEX_BETA
40#endif
41
42#ifdef yy_create_buffer
43#define aag_create_buffer_ALREADY_DEFINED
44#else
45#define yy_create_buffer aag_create_buffer
46#endif
47
48#ifdef yy_delete_buffer
49#define aag_delete_buffer_ALREADY_DEFINED
50#else
51#define yy_delete_buffer aag_delete_buffer
52#endif
53
54#ifdef yy_scan_buffer
55#define aag_scan_buffer_ALREADY_DEFINED
56#else
57#define yy_scan_buffer aag_scan_buffer
58#endif
59
60#ifdef yy_scan_string
61#define aag_scan_string_ALREADY_DEFINED
62#else
63#define yy_scan_string aag_scan_string
64#endif
65
66#ifdef yy_scan_bytes
67#define aag_scan_bytes_ALREADY_DEFINED
68#else
69#define yy_scan_bytes aag_scan_bytes
70#endif
71
72#ifdef yy_init_buffer
73#define aag_init_buffer_ALREADY_DEFINED
74#else
75#define yy_init_buffer aag_init_buffer
76#endif
77
78#ifdef yy_flush_buffer
79#define aag_flush_buffer_ALREADY_DEFINED
80#else
81#define yy_flush_buffer aag_flush_buffer
82#endif
83
84#ifdef yy_load_buffer_state
85#define aag_load_buffer_state_ALREADY_DEFINED
86#else
87#define yy_load_buffer_state aag_load_buffer_state
88#endif
89
90#ifdef yy_switch_to_buffer
91#define aag_switch_to_buffer_ALREADY_DEFINED
92#else
93#define yy_switch_to_buffer aag_switch_to_buffer
94#endif
95
96#ifdef yypush_buffer_state
97#define aagpush_buffer_state_ALREADY_DEFINED
98#else
99#define yypush_buffer_state aagpush_buffer_state
100#endif
101
102#ifdef yypop_buffer_state
103#define aagpop_buffer_state_ALREADY_DEFINED
104#else
105#define yypop_buffer_state aagpop_buffer_state
106#endif
107
108#ifdef yyensure_buffer_stack
109#define aagensure_buffer_stack_ALREADY_DEFINED
110#else
111#define yyensure_buffer_stack aagensure_buffer_stack
112#endif
113
114#ifdef yylex
115#define aaglex_ALREADY_DEFINED
116#else
117#define yylex aaglex
118#endif
119
120#ifdef yyrestart
121#define aagrestart_ALREADY_DEFINED
122#else
123#define yyrestart aagrestart
124#endif
125
126#ifdef yylex_init
127#define aaglex_init_ALREADY_DEFINED
128#else
129#define yylex_init aaglex_init
130#endif
131
132#ifdef yylex_init_extra
133#define aaglex_init_extra_ALREADY_DEFINED
134#else
135#define yylex_init_extra aaglex_init_extra
136#endif
137
138#ifdef yylex_destroy
139#define aaglex_destroy_ALREADY_DEFINED
140#else
141#define yylex_destroy aaglex_destroy
142#endif
143
144#ifdef yyget_debug
145#define aagget_debug_ALREADY_DEFINED
146#else
147#define yyget_debug aagget_debug
148#endif
149
150#ifdef yyset_debug
151#define aagset_debug_ALREADY_DEFINED
152#else
153#define yyset_debug aagset_debug
154#endif
155
156#ifdef yyget_extra
157#define aagget_extra_ALREADY_DEFINED
158#else
159#define yyget_extra aagget_extra
160#endif
161
162#ifdef yyset_extra
163#define aagset_extra_ALREADY_DEFINED
164#else
165#define yyset_extra aagset_extra
166#endif
167
168#ifdef yyget_in
169#define aagget_in_ALREADY_DEFINED
170#else
171#define yyget_in aagget_in
172#endif
173
174#ifdef yyset_in
175#define aagset_in_ALREADY_DEFINED
176#else
177#define yyset_in aagset_in
178#endif
179
180#ifdef yyget_out
181#define aagget_out_ALREADY_DEFINED
182#else
183#define yyget_out aagget_out
184#endif
185
186#ifdef yyset_out
187#define aagset_out_ALREADY_DEFINED
188#else
189#define yyset_out aagset_out
190#endif
191
192#ifdef yyget_leng
193#define aagget_leng_ALREADY_DEFINED
194#else
195#define yyget_leng aagget_leng
196#endif
197
198#ifdef yyget_text
199#define aagget_text_ALREADY_DEFINED
200#else
201#define yyget_text aagget_text
202#endif
203
204#ifdef yyget_lineno
205#define aagget_lineno_ALREADY_DEFINED
206#else
207#define yyget_lineno aagget_lineno
208#endif
209
210#ifdef yyset_lineno
211#define aagset_lineno_ALREADY_DEFINED
212#else
213#define yyset_lineno aagset_lineno
214#endif
215
216#ifdef yywrap
217#define aagwrap_ALREADY_DEFINED
218#else
219#define yywrap aagwrap
220#endif
221
222#ifdef yyalloc
223#define aagalloc_ALREADY_DEFINED
224#else
225#define yyalloc aagalloc
226#endif
227
228#ifdef yyrealloc
229#define aagrealloc_ALREADY_DEFINED
230#else
231#define yyrealloc aagrealloc
232#endif
233
234#ifdef yyfree
235#define aagfree_ALREADY_DEFINED
236#else
237#define yyfree aagfree
238#endif
239
240#ifdef yytext
241#define aagtext_ALREADY_DEFINED
242#else
243#define yytext aagtext
244#endif
245
246#ifdef yyleng
247#define aagleng_ALREADY_DEFINED
248#else
249#define yyleng aagleng
250#endif
251
252#ifdef yyin
253#define aagin_ALREADY_DEFINED
254#else
255#define yyin aagin
256#endif
257
258#ifdef yyout
259#define aagout_ALREADY_DEFINED
260#else
261#define yyout aagout
262#endif
263
264#ifdef yy_flex_debug
265#define aag_flex_debug_ALREADY_DEFINED
266#else
267#define yy_flex_debug aag_flex_debug
268#endif
269
270#ifdef yylineno
271#define aaglineno_ALREADY_DEFINED
272#else
273#define yylineno aaglineno
274#endif
275
276/* First, we deal with platform-specific or compiler-specific issues. */
277
278/* begin standard C headers. */
279#include <stdio.h>
280#include <string.h>
281#include <errno.h>
282#include <stdlib.h>
283
284/* end standard C headers. */
285
286/* flex integer type definitions */
287
288#ifndef FLEXINT_H
289#define FLEXINT_H
290
291/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
292
293#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
294
295/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
296 * if you want the limit (max/min) macros for int types.
297 */
298#ifndef __STDC_LIMIT_MACROS
299#define __STDC_LIMIT_MACROS 1
300#endif
301
302#include <inttypes.h>
303typedef int8_t flex_int8_t;
304typedef uint8_t flex_uint8_t;
305typedef int16_t flex_int16_t;
306typedef uint16_t flex_uint16_t;
307typedef int32_t flex_int32_t;
308typedef uint32_t flex_uint32_t;
309#else
310typedef signed char flex_int8_t;
311typedef short int flex_int16_t;
312typedef int flex_int32_t;
313typedef unsigned char flex_uint8_t;
314typedef unsigned short int flex_uint16_t;
315typedef unsigned int flex_uint32_t;
316
317/* Limits of integral types. */
318#ifndef INT8_MIN
319#define INT8_MIN (-128)
320#endif
321#ifndef INT16_MIN
322#define INT16_MIN (-32767-1)
323#endif
324#ifndef INT32_MIN
325#define INT32_MIN (-2147483647-1)
326#endif
327#ifndef INT8_MAX
328#define INT8_MAX (127)
329#endif
330#ifndef INT16_MAX
331#define INT16_MAX (32767)
332#endif
333#ifndef INT32_MAX
334#define INT32_MAX (2147483647)
335#endif
336#ifndef UINT8_MAX
337#define UINT8_MAX (255U)
338#endif
339#ifndef UINT16_MAX
340#define UINT16_MAX (65535U)
341#endif
342#ifndef UINT32_MAX
343#define UINT32_MAX (4294967295U)
344#endif
345
346#ifndef SIZE_MAX
347#define SIZE_MAX (~(size_t)0)
348#endif
349
350#endif /* ! C99 */
351
352#endif /* ! FLEXINT_H */
353
354/* begin standard C++ headers. */
355
356/* TODO: this is always defined, so inline it */
357#define yyconst const
358
359#if defined(__GNUC__) && __GNUC__ >= 3
360#define yynoreturn __attribute__((__noreturn__))
361#else
362#define yynoreturn
363#endif
364
365/* Returned upon end-of-file. */
366#define YY_NULL 0
367
368/* Promotes a possibly negative, possibly signed char to an
369 * integer in range [0..255] for use as an array index.
370 */
371#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
372
373/* Enter a start condition. This macro really ought to take a parameter,
374 * but we do it the disgusting crufty way forced on us by the ()-less
375 * definition of BEGIN.
376 */
377#define BEGIN (yy_start) = 1 + 2 *
378/* Translate the current start state into a value that can be later handed
379 * to BEGIN to return to the state. The YYSTATE alias is for lex
380 * compatibility.
381 */
382#define YY_START (((yy_start) - 1) / 2)
383#define YYSTATE YY_START
384/* Action number for EOF rule of a given start state. */
385#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
386/* Special action meaning "start processing a new file". */
387#define YY_NEW_FILE yyrestart( yyin )
388#define YY_END_OF_BUFFER_CHAR 0
389
390/* Size of default input buffer. */
391#ifndef YY_BUF_SIZE
392#ifdef __ia64__
393/* On IA-64, the buffer size is 16k, not 8k.
394 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
395 * Ditto for the __ia64__ case accordingly.
396 */
397#define YY_BUF_SIZE 32768
398#else
399#define YY_BUF_SIZE 16384
400#endif /* __ia64__ */
401#endif
402
403/* The state buf must be large enough to hold one state per character in the main buffer.
404 */
405#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
406
407#ifndef YY_TYPEDEF_YY_BUFFER_STATE
408#define YY_TYPEDEF_YY_BUFFER_STATE
410#endif
411
412#ifndef YY_TYPEDEF_YY_SIZE_T
413#define YY_TYPEDEF_YY_SIZE_T
414typedef size_t yy_size_t;
415#endif
416
417extern int yyleng;
418
419extern FILE *yyin, *yyout;
420
421#define EOB_ACT_CONTINUE_SCAN 0
422#define EOB_ACT_END_OF_FILE 1
423#define EOB_ACT_LAST_MATCH 2
424
425 #define YY_LESS_LINENO(n)
426 #define YY_LINENO_REWIND_TO(ptr)
427
428/* Return all but the first "n" matched characters back to the input stream. */
429#define yyless(n) \
430 do \
431 { \
432 /* Undo effects of setting up yytext. */ \
433 int yyless_macro_arg = (n); \
434 YY_LESS_LINENO(yyless_macro_arg);\
435 *yy_cp = (yy_hold_char); \
436 YY_RESTORE_YY_MORE_OFFSET \
437 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
438 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
439 } \
440 while ( 0 )
441#define unput(c) yyunput( c, (yytext_ptr) )
442
443#ifndef YY_STRUCT_YY_BUFFER_STATE
444#define YY_STRUCT_YY_BUFFER_STATE
445struct yy_buffer_state
446 {
447 FILE *yy_input_file;
448
449 char *yy_ch_buf; /* input buffer */
450 char *yy_buf_pos; /* current position in input buffer */
451
452 /* Size of input buffer in bytes, not including room for EOB
453 * characters.
454 */
455 int yy_buf_size;
456
457 /* Number of characters read into yy_ch_buf, not including EOB
458 * characters.
459 */
460 int yy_n_chars;
461
462 /* Whether we "own" the buffer - i.e., we know we created it,
463 * and can realloc() it to grow it, and should free() it to
464 * delete it.
465 */
467
468 /* Whether this is an "interactive" input source; if so, and
469 * if we're using stdio for input, then we want to use getc()
470 * instead of fread(), to make sure we stop fetching input after
471 * each newline.
472 */
474
475 /* Whether we're considered to be at the beginning of a line.
476 * If so, '^' rules will be active on the next match, otherwise
477 * not.
478 */
479 int yy_at_bol;
480
481 int yy_bs_lineno;
482 int yy_bs_column;
484 /* Whether to try to fill the input buffer when we reach the
485 * end of it.
486 */
487 int yy_fill_buffer;
488
490
491#define YY_BUFFER_NEW 0
492#define YY_BUFFER_NORMAL 1
493 /* When an EOF's been seen but there's still some text to process
494 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
495 * shouldn't try reading from the input source any more. We might
496 * still have a bunch of tokens to match, though, because of
497 * possible backing-up.
498 *
499 * When we actually see the EOF, we change the status to "new"
500 * (via yyrestart()), so that the user can continue scanning by
501 * just pointing yyin at a new input file.
502 */
503#define YY_BUFFER_EOF_PENDING 2
504
505 };
506#endif /* !YY_STRUCT_YY_BUFFER_STATE */
507
508/* Stack of input buffers. */
509static size_t yy_buffer_stack_top = 0;
510static size_t yy_buffer_stack_max = 0;
513/* We provide macros for accessing buffer states in case in the
514 * future we want to put the buffer states in a more general
515 * "scanner state".
516 *
517 * Returns the top of the stack, or NULL.
518 */
519#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
520 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
521 : NULL)
522/* Same as previous macro, but useful when we know that the buffer stack is not
523 * NULL or when we need an lvalue. For internal use only.
524 */
525#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
526
527/* yy_hold_char holds the character lost when yytext is formed. */
528static char yy_hold_char;
529static int yy_n_chars; /* number of characters read into yy_ch_buf */
531
532/* Points to current character in buffer. */
533static char *yy_c_buf_p = NULL;
534static int yy_init = 0; /* whether we need to initialize */
535static int yy_start = 0; /* start state number */
536
537/* Flag which is used to allow yywrap()'s to do buffer switches
538 * instead of setting up a fresh yyin. A bit of a hack ...
539 */
541
542void yyrestart ( FILE *input_file );
544YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size );
548void yypop_buffer_state ( void );
549
550static void yyensure_buffer_stack ( void );
551static void yy_load_buffer_state ( void );
552static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file );
553#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )
554
556YY_BUFFER_STATE yy_scan_string ( const char *yy_str );
557YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len );
558
560void *yyrealloc ( void *, yy_size_t );
561void yyfree ( void * );
562
563#define yy_new_buffer yy_create_buffer
564#define yy_set_interactive(is_interactive) \
565 { \
566 if ( ! YY_CURRENT_BUFFER ){ \
567 yyensure_buffer_stack (); \
568 YY_CURRENT_BUFFER_LVALUE = \
569 yy_create_buffer( yyin, YY_BUF_SIZE ); \
570 } \
571 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
572 }
573#define yy_set_bol(at_bol) \
574 { \
575 if ( ! YY_CURRENT_BUFFER ){\
576 yyensure_buffer_stack (); \
577 YY_CURRENT_BUFFER_LVALUE = \
578 yy_create_buffer( yyin, YY_BUF_SIZE ); \
579 } \
580 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
581 }
582#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
583
584/* Begin user sect3 */
586
587FILE *yyin = NULL, *yyout = NULL;
588
589typedef int yy_state_type;
590
591extern int yylineno;
592int yylineno = 1;
593
594extern char *yytext;
595#ifdef yytext_ptr
596#undef yytext_ptr
597#endif
598#define yytext_ptr yytext
599
602static int yy_get_next_buffer ( void );
603static void yynoreturn yy_fatal_error ( const char* msg );
604
605/* Done after the current pattern has been matched and before the
606 * corresponding action - sets up yytext.
607 */
608#define YY_DO_BEFORE_ACTION \
609 (yytext_ptr) = yy_bp; \
610 yyleng = (int) (yy_cp - yy_bp); \
611 (yy_hold_char) = *yy_cp; \
612 *yy_cp = '\0'; \
613 (yy_c_buf_p) = yy_cp;
614#define YY_NUM_RULES 35
615#define YY_END_OF_BUFFER 36
616/* This struct is not used in this scanner,
617 but its presence is necessary. */
618struct yy_trans_info
619 {
622 };
623static const flex_int16_t yy_accept[93] =
624 { 0,
625 0, 0, 4, 4, 28, 28, 33, 33, 36, 34,
626 10, 2, 22, 9, 34, 34, 34, 21, 29, 1,
627 20, 20, 20, 20, 20, 20, 20, 8, 4, 5,
628 28, 27, 23, 28, 33, 32, 31, 30, 9, 19,
629 0, 21, 18, 21, 3, 7, 21, 21, 20, 20,
630 20, 20, 20, 20, 20, 20, 8, 4, 5, 5,
631 6, 28, 26, 24, 25, 33, 7, 21, 20, 20,
632 20, 20, 20, 20, 11, 20, 13, 20, 12, 20,
633 20, 20, 14, 20, 20, 20, 16, 20, 15, 20,
634 17, 0
635
636 } ;
637
638static const YY_CHAR yy_ec[256] =
639 { 0,
640 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
641 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
642 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
643 1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
644 1, 6, 1, 1, 7, 8, 9, 10, 10, 10,
645 10, 10, 10, 10, 10, 10, 10, 1, 1, 11,
646 1, 12, 1, 13, 14, 15, 16, 17, 18, 19,
647 20, 21, 22, 19, 19, 19, 19, 23, 24, 25,
648 19, 26, 27, 28, 29, 19, 19, 19, 19, 19,
649 1, 30, 1, 1, 19, 1, 31, 32, 33, 34,
650
651 35, 19, 36, 37, 38, 19, 19, 19, 19, 39,
652 40, 41, 19, 42, 43, 44, 45, 19, 19, 19,
653 19, 19, 1, 1, 1, 1, 1, 19, 19, 19,
654 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
655 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
656 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
657 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
658 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
659 19, 19, 19, 19, 19, 19, 46, 19, 19, 19,
660 47, 19, 19, 19, 19, 19, 19, 19, 19, 19,
661
662 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
663 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
664 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
665 19, 19, 19, 19, 19, 19, 19, 19, 48, 19,
666 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
667 19, 19, 19, 19, 19
668 } ;
669
670static const YY_CHAR yy_meta[49] =
671 { 0,
672 1, 1, 2, 3, 1, 4, 1, 5, 1, 6,
673 7, 7, 1, 6, 6, 6, 6, 6, 6, 6,
674 6, 6, 6, 6, 6, 6, 6, 6, 6, 3,
675 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
676 6, 6, 6, 6, 6, 6, 6, 6
677 } ;
678
679static const flex_int16_t yy_base[105] =
680 { 0,
681 0, 174, 46, 47, 51, 53, 48, 55, 170, 219,
682 219, 219, 219, 0, 61, 135, 55, 55, 219, 219,
683 0, 40, 53, 46, 50, 47, 98, 0, 0, 71,
684 0, 219, 219, 81, 0, 219, 219, 219, 0, 219,
685 132, 85, 219, 130, 219, 0, 129, 219, 0, 62,
686 66, 65, 72, 68, 82, 91, 0, 0, 94, 95,
687 219, 0, 219, 219, 219, 0, 0, 123, 73, 87,
688 82, 90, 90, 93, 0, 95, 0, 95, 0, 101,
689 93, 95, 0, 93, 110, 106, 0, 105, 0, 110,
690 0, 219, 147, 154, 161, 168, 171, 112, 177, 184,
691
692 191, 198, 205, 211
693 } ;
694
695static const flex_int16_t yy_def[105] =
696 { 0,
697 92, 1, 93, 93, 94, 94, 95, 95, 92, 92,
698 92, 92, 92, 96, 92, 92, 92, 97, 92, 92,
699 98, 98, 98, 98, 98, 98, 98, 99, 100, 101,
700 102, 92, 92, 92, 103, 92, 92, 92, 96, 92,
701 92, 97, 92, 97, 92, 104, 97, 92, 98, 98,
702 98, 98, 98, 98, 98, 98, 99, 100, 101, 101,
703 92, 102, 92, 92, 92, 103, 104, 97, 98, 98,
704 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
705 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
706 98, 0, 92, 92, 92, 92, 92, 92, 92, 92,
707
708 92, 92, 92, 92
709 } ;
710
711static const flex_int16_t yy_nxt[268] =
712 { 0,
713 10, 11, 12, 13, 14, 10, 15, 16, 17, 18,
714 19, 10, 20, 21, 21, 21, 22, 23, 21, 24,
715 21, 21, 25, 21, 21, 21, 26, 21, 21, 10,
716 21, 21, 21, 22, 23, 24, 21, 21, 25, 21,
717 21, 21, 26, 21, 21, 21, 21, 27, 12, 12,
718 36, 30, 30, 32, 33, 32, 33, 36, 37, 38,
719 45, 50, 47, 46, 42, 37, 38, 40, 41, 51,
720 42, 52, 43, 53, 54, 55, 60, 50, 71, 61,
721 34, 69, 34, 63, 64, 70, 51, 52, 72, 53,
722 54, 55, 47, 73, 42, 71, 74, 69, 76, 92,
723
724 60, 70, 92, 61, 77, 72, 78, 79, 82, 73,
725 65, 80, 81, 74, 76, 83, 84, 49, 85, 86,
726 87, 77, 78, 88, 79, 82, 89, 80, 81, 90,
727 91, 83, 68, 84, 85, 86, 87, 75, 68, 44,
728 88, 44, 89, 56, 44, 90, 91, 29, 29, 29,
729 29, 29, 29, 29, 31, 31, 31, 31, 31, 31,
730 31, 35, 35, 35, 35, 35, 35, 35, 39, 92,
731 39, 39, 39, 39, 39, 48, 48, 57, 28, 57,
732 57, 57, 57, 57, 58, 92, 58, 92, 58, 58,
733 58, 59, 92, 59, 59, 59, 59, 59, 62, 92,
734
735 92, 62, 62, 62, 62, 66, 92, 66, 66, 66,
736 66, 67, 92, 67, 67, 67, 67, 67, 9, 92,
737 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
738 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
739 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
740 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
741 92, 92, 92, 92, 92, 92, 92
742 } ;
743
744static const flex_int16_t yy_chk[268] =
745 { 0,
746 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
747 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
748 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
749 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
750 1, 1, 1, 1, 1, 1, 1, 1, 3, 4,
751 7, 3, 4, 5, 5, 6, 6, 8, 7, 7,
752 17, 22, 18, 17, 18, 8, 8, 15, 15, 23,
753 15, 24, 15, 25, 26, 26, 30, 22, 52, 30,
754 5, 50, 6, 34, 34, 51, 23, 24, 53, 25,
755 26, 26, 42, 54, 42, 52, 55, 50, 69, 59,
756
757 60, 51, 59, 60, 70, 53, 71, 72, 76, 54,
758 34, 73, 74, 55, 69, 78, 80, 98, 81, 82,
759 84, 70, 71, 85, 72, 76, 86, 73, 74, 88,
760 90, 78, 68, 80, 81, 82, 84, 56, 47, 44,
761 85, 41, 86, 27, 16, 88, 90, 93, 93, 93,
762 93, 93, 93, 93, 94, 94, 94, 94, 94, 94,
763 94, 95, 95, 95, 95, 95, 95, 95, 96, 9,
764 96, 96, 96, 96, 96, 97, 97, 99, 2, 99,
765 99, 99, 99, 99, 100, 0, 100, 0, 100, 100,
766 100, 101, 0, 101, 101, 101, 101, 101, 102, 0,
767
768 0, 102, 102, 102, 102, 103, 0, 103, 103, 103,
769 103, 104, 0, 104, 104, 104, 104, 104, 92, 92,
770 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
771 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
772 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
773 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
774 92, 92, 92, 92, 92, 92, 92
775 } ;
776
779
780extern int yy_flex_debug;
782
783/* The intent behind this definition is that it'll catch
784 * any uses of REJECT which flex missed.
785 */
786#define REJECT reject_used_but_not_detected
787#define yymore() yymore_used_but_not_detected
788#define YY_MORE_ADJ 0
789#define YY_RESTORE_YY_MORE_OFFSET
790char *yytext;
791#line 1 "../../lib/cgraph/scan.l"
796/*************************************************************************
797 * Copyright (c) 2011 AT&T Intellectual Property
798 * All rights reserved. This program and the accompanying materials
799 * are made available under the terms of the Eclipse Public License v1.0
800 * which accompanies this distribution, and is available at
801 * https://www.eclipse.org/legal/epl-v10.html
802 *
803 * Contributors: Details at https://graphviz.org
804 *************************************************************************/
805/* requires flex (i.e. not lex) */
806#line 19 "../../lib/cgraph/scan.l"
807 /* By default, Flex emits a lexer using symbols prefixed with "yy". Graphviz
808 * contains multiple Flex-generated lexers, so we alter this prefix to avoid
809 * symbol clashes.
810 */
811 /* Avoid generating an unused input function. See
812 https://westes.github.io/flex/manual/Scanner-Options.html
813 */
814#define YY_NO_INPUT 1
815#include <assert.h>
816#include <grammar.h>
817#include <cgraph/cghdr.h>
818#include <stdbool.h>
819#include <stddef.h>
820#include <string.h>
821#include <util/agxbuf.h>
822#include <util/gv_ctype.h>
823#include <util/startswith.h>
824// #define YY_BUF_SIZE 128000
825#define GRAPH_EOF_TOKEN '@' /* lex class must be defined below */
826 /* this is a workaround for linux flex */
827static int line_num = 1;
828static int html_nest = 0; /* nesting level for html strings */
829static const char* InputFile;
831static void *Ifile;
832static int graphType;
833
834/* By default, Flex calls isatty() to determine whether the input it is
835 * scanning is coming from the user typing or from a file. However, our input
836 * is being provided by Graphviz' I/O channel mechanism, which does not have a
837 * valid file descriptor that supports isatty().
838 */
839#define isatty(x) gv_isatty_suppression
841
842#ifndef YY_INPUT
843#define YY_INPUT(buf,result,max_size) \
844 if ((result = Disc->io->afread(Ifile, buf, max_size)) < 0) \
845 YY_FATAL_ERROR( "input in flex scanner failed" )
846#endif
847
848/* buffer for arbitrary length strings (longer than BUFSIZ) */
850
851static void beginstr(void);
852static void addstr(char *src);
853static void endstr(void);
854static void endstr_html(void);
855static void storeFileName(char* fname, size_t len);
856
857/* ppDirective:
858 * Process a possible preprocessor line directive.
859 * aagtext = #.*
860 */
861static void ppDirective (void);
862
863/* twoDots:
864 * Return true if token has more than one '.';
865 * we know the last character is a '.'.
866 */
867static bool twoDots(void);
868
869/* chkNum:
870 * The regexp for NUMBER allows a terminating letter or '.'.
871 * This way we can catch a number immediately followed by a name
872 * or something like 123.456.78, and report this to the user.
873 */
874static int chkNum(void);
875
876
877/* The LETTER class below consists of ascii letters, underscore, all non-ascii
878 * characters. This allows identifiers to have characters from any
879 * character set independent of locale. The downside is that, for certain
880 * character sets, non-letter and, in fact, undefined characters will be
881 * accepted. This is not likely and, from dot's stand, shouldn't do any
882 * harm. (Presumably undefined characters will be ignored in display.) And,
883 * it allows a greater wealth of names. */
884#line 885 "scan.c"
885
886#line 887 "scan.c"
887
888#define INITIAL 0
889#define comment 1
890#define qstring 2
891#define hstring 3
892
893#ifndef YY_NO_UNISTD_H
894/* Special case for "unistd.h", since it is non-ANSI. We include it way
895 * down here because we want the user's section 1 to have been scanned first.
896 * The user has a chance to override it with an option.
897 */
898#include <unistd.h>
899#endif
900
901#ifndef YY_EXTRA_TYPE
902#define YY_EXTRA_TYPE void *
903#endif
904
905static int yy_init_globals ( void );
906
907/* Accessor methods to globals.
908 These are made visible to non-reentrant scanners for convenience. */
909
910int yylex_destroy ( void );
911
912int yyget_debug ( void );
913
914void yyset_debug ( int debug_flag );
915
917
918void yyset_extra ( YY_EXTRA_TYPE user_defined );
919
920FILE *yyget_in ( void );
921
922void yyset_in ( FILE * _in_str );
923
924FILE *yyget_out ( void );
925
926void yyset_out ( FILE * _out_str );
927
928 int yyget_leng ( void );
929
930char *yyget_text ( void );
931
932int yyget_lineno ( void );
933
934void yyset_lineno ( int _line_number );
935
936/* Macros after this point can all be overridden by user definitions in
937 * section 1.
938 */
939
940#ifndef YY_SKIP_YYWRAP
941#ifdef __cplusplus
942extern "C" int yywrap ( void );
943#else
944extern int yywrap ( void );
945#endif
946#endif
947
948#ifndef YY_NO_UNPUT
949
950 static void yyunput ( int c, char *buf_ptr );
951
952#endif
953
954#ifndef yytext_ptr
955static void yy_flex_strncpy ( char *, const char *, int );
956#endif
957
958#ifdef YY_NEED_STRLEN
959static int yy_flex_strlen ( const char * );
960#endif
961
962#ifndef YY_NO_INPUT
963#ifdef __cplusplus
964static int yyinput ( void );
965#else
966static int input ( void );
967#endif
968
969#endif
970
971/* Amount of stuff to slurp up with each read. */
972#ifndef YY_READ_BUF_SIZE
973#ifdef __ia64__
974/* On IA-64, the buffer size is 16k, not 8k */
975#define YY_READ_BUF_SIZE 16384
976#else
977#define YY_READ_BUF_SIZE 8192
978#endif /* __ia64__ */
979#endif
980
981/* Copy whatever the last rule matched to the standard output. */
982#ifndef ECHO
983/* This used to be an fputs(), but since the string might contain NUL's,
984 * we now use fwrite().
985 */
986#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
987#endif
988
989/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
990 * is returned in "result".
991 */
992#ifndef YY_INPUT
993#define YY_INPUT(buf,result,max_size) \
994 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
995 { \
996 int c = '*'; \
997 int n; \
998 for ( n = 0; n < max_size && \
999 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1000 buf[n] = (char) c; \
1001 if ( c == '\n' ) \
1002 buf[n++] = (char) c; \
1003 if ( c == EOF && ferror( yyin ) ) \
1004 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1005 result = n; \
1006 } \
1007 else \
1008 { \
1009 errno=0; \
1010 while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
1011 { \
1012 if( errno != EINTR) \
1013 { \
1014 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1015 break; \
1016 } \
1017 errno=0; \
1018 clearerr(yyin); \
1019 } \
1020 }\
1021\
1022
1023#endif
1024
1025/* No semi-colon after return; correct usage is to write "yyterminate();" -
1026 * we don't want an extra ';' after the "return" because that will cause
1027 * some compilers to complain about unreachable statements.
1028 */
1029#ifndef yyterminate
1030#define yyterminate() return YY_NULL
1031#endif
1032
1033/* Number of entries by which start-condition stack grows. */
1034#ifndef YY_START_STACK_INCR
1035#define YY_START_STACK_INCR 25
1036#endif
1037
1038/* Report a fatal error. */
1039#ifndef YY_FATAL_ERROR
1040#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
1041#endif
1042
1043/* end tables serialization structures and prototypes */
1044
1045/* Default declaration of generated scanner - a define so the user can
1046 * easily add parameters.
1047 */
1048#ifndef YY_DECL
1049#define YY_DECL_IS_OURS 1
1050
1051extern int yylex (void);
1052
1053#define YY_DECL int yylex (void)
1054#endif /* !YY_DECL */
1055
1056/* Code executed at the beginning of each rule, after yytext and yyleng
1057 * have been set up.
1058 */
1059#ifndef YY_USER_ACTION
1060#define YY_USER_ACTION
1061#endif
1062
1063/* Code executed at the end of each rule. */
1064#ifndef YY_BREAK
1065#define YY_BREAK /*LINTED*/break;
1066#endif
1067
1068#define YY_RULE_SETUP \
1069 if ( yyleng > 0 ) \
1070 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
1071 (yytext[yyleng - 1] == '\n'); \
1072 YY_USER_ACTION
1073
1077{
1078 yy_state_type yy_current_state;
1079 char *yy_cp, *yy_bp;
1081
1082 if ( !(yy_init) )
1083 {
1084 (yy_init) = 1;
1085
1086#ifdef YY_USER_INIT
1087 YY_USER_INIT;
1088#endif
1089
1090 if ( ! (yy_start) )
1091 (yy_start) = 1; /* first start state */
1092
1093 if ( ! yyin )
1094 yyin = stdin;
1095
1096 if ( ! yyout )
1097 yyout = stdout;
1098
1099 if ( ! YY_CURRENT_BUFFER ) {
1103 }
1104
1106 }
1107
1108 {
1109#line 109 "../../lib/cgraph/scan.l"
1110
1111#line 1112 "scan.c"
1112
1113 while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
1114 {
1115 yy_cp = (yy_c_buf_p);
1116
1117 /* Support of yytext. */
1118 *yy_cp = (yy_hold_char);
1119
1120 /* yy_bp points to the position in yy_ch_buf of the start of
1121 * the current run.
1122 */
1123 yy_bp = yy_cp;
1124
1125 yy_current_state = (yy_start);
1126 yy_current_state += YY_AT_BOL();
1127yy_match:
1128 do
1129 {
1130 YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
1131 if ( yy_accept[yy_current_state] )
1132 {
1133 (yy_last_accepting_state) = yy_current_state;
1135 }
1136 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1137 {
1138 yy_current_state = (int) yy_def[yy_current_state];
1139 if ( yy_current_state >= 93 )
1140 yy_c = yy_meta[yy_c];
1141 }
1142 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1143 ++yy_cp;
1144 }
1145 while ( yy_base[yy_current_state] != 219 );
1146
1147yy_find_action:
1148 yy_act = yy_accept[yy_current_state];
1149 if ( yy_act == 0 )
1150 { /* have to back up */
1152 yy_current_state = (yy_last_accepting_state);
1153 yy_act = yy_accept[yy_current_state];
1154 }
1155
1157
1158do_action: /* This label is used only to access EOF actions. */
1159
1160 switch ( yy_act )
1161 { /* beginning of action switch */
1162 case 0: /* must back up */
1163 /* undo the effects of YY_DO_BEFORE_ACTION */
1164 *yy_cp = (yy_hold_char);
1166 yy_current_state = (yy_last_accepting_state);
1167 goto yy_find_action;
1168
1169case 1:
1171#line 110 "../../lib/cgraph/scan.l"
1172return(EOF);
1173 YY_BREAK
1174case 2:
1175/* rule 2 can match eol */
1177#line 111 "../../lib/cgraph/scan.l"
1178line_num++;
1179 YY_BREAK
1180case 3:
1182#line 112 "../../lib/cgraph/scan.l"
1183BEGIN(comment);
1184 YY_BREAK
1185case 4:
1187#line 113 "../../lib/cgraph/scan.l"
1188/* eat anything not a '*' */
1189 YY_BREAK
1190case 5:
1192#line 114 "../../lib/cgraph/scan.l"
1193/* eat up '*'s not followed by '/'s */
1194 YY_BREAK
1195case 6:
1197#line 115 "../../lib/cgraph/scan.l"
1198BEGIN(INITIAL);
1199 YY_BREAK
1200case 7:
1202#line 116 "../../lib/cgraph/scan.l"
1203/* ignore C++-style comments */
1204 YY_BREAK
1205case 8:
1207#line 117 "../../lib/cgraph/scan.l"
1208ppDirective ();
1209 YY_BREAK
1210case 9:
1212#line 118 "../../lib/cgraph/scan.l"
1213/* ignore shell-like comments */
1214 YY_BREAK
1215case 10:
1217#line 119 "../../lib/cgraph/scan.l"
1218/* ignore whitespace */
1219 YY_BREAK
1220case 11:
1222#line 120 "../../lib/cgraph/scan.l"
1223/* ignore BOM */
1224 YY_BREAK
1225case 12:
1227#line 121 "../../lib/cgraph/scan.l"
1228return(T_node); /* see tokens in agcanonstr */
1229 YY_BREAK
1230case 13:
1232#line 122 "../../lib/cgraph/scan.l"
1233return(T_edge);
1234 YY_BREAK
1235case 14:
1237#line 123 "../../lib/cgraph/scan.l"
1238if (!graphType) graphType = T_graph; return(T_graph);
1239 YY_BREAK
1240case 15:
1242#line 124 "../../lib/cgraph/scan.l"
1243if (!graphType) graphType = T_digraph; return(T_digraph);
1244 YY_BREAK
1245case 16:
1247#line 125 "../../lib/cgraph/scan.l"
1248return(T_strict);
1249 YY_BREAK
1250case 17:
1252#line 126 "../../lib/cgraph/scan.l"
1253return(T_subgraph);
1254 YY_BREAK
1255case 18:
1257#line 127 "../../lib/cgraph/scan.l"
1258if (graphType == T_digraph) return(T_edgeop); else return('-');
1259 YY_BREAK
1260case 19:
1262#line 128 "../../lib/cgraph/scan.l"
1263if (graphType == T_graph) return(T_edgeop); else return('-');
1264 YY_BREAK
1265case 20:
1267#line 129 "../../lib/cgraph/scan.l"
1268{ aaglval.str = agstrdup(Ag_G_global,aagget_text()); return(T_atom); }
1269 YY_BREAK
1270case 21:
1272#line 130 "../../lib/cgraph/scan.l"
1273{ if (chkNum()) yyless(aagget_leng()-1); aaglval.str = agstrdup(Ag_G_global,aagget_text()); return(T_atom); }
1274 YY_BREAK
1275case 22:
1277#line 131 "../../lib/cgraph/scan.l"
1279 YY_BREAK
1280case 23:
1282#line 132 "../../lib/cgraph/scan.l"
1283BEGIN(INITIAL); endstr(); return (T_qatom);
1284 YY_BREAK
1285case 24:
1287#line 133 "../../lib/cgraph/scan.l"
1288addstr ("\"");
1289 YY_BREAK
1290case 25:
1292#line 134 "../../lib/cgraph/scan.l"
1293addstr ("\\\\");
1294 YY_BREAK
1295case 26:
1296/* rule 26 can match eol */
1298#line 135 "../../lib/cgraph/scan.l"
1299line_num++; /* ignore escaped newlines */
1300 YY_BREAK
1301case 27:
1302/* rule 27 can match eol */
1304#line 136 "../../lib/cgraph/scan.l"
1305addstr ("\n"); line_num++;
1306 YY_BREAK
1307case 28:
1309#line 137 "../../lib/cgraph/scan.l"
1310addstr(aagget_text());
1311 YY_BREAK
1312case 29:
1314#line 138 "../../lib/cgraph/scan.l"
1316 YY_BREAK
1317case 30:
1319#line 139 "../../lib/cgraph/scan.l"
1320html_nest--; if (html_nest) addstr(aagget_text()); else {BEGIN(INITIAL); endstr_html(); return (T_qatom);}
1321 YY_BREAK
1322case 31:
1324#line 140 "../../lib/cgraph/scan.l"
1325html_nest++; addstr(aagget_text());
1326 YY_BREAK
1327case 32:
1328/* rule 32 can match eol */
1330#line 141 "../../lib/cgraph/scan.l"
1331addstr(aagget_text()); line_num++; /* add newlines */
1332 YY_BREAK
1333case 33:
1335#line 142 "../../lib/cgraph/scan.l"
1336addstr(aagget_text());
1337 YY_BREAK
1338case 34:
1340#line 143 "../../lib/cgraph/scan.l"
1341return aagget_text()[0];
1342 YY_BREAK
1343case 35:
1345#line 144 "../../lib/cgraph/scan.l"
1346ECHO;
1347 YY_BREAK
1348#line 1349 "scan.c"
1349case YY_STATE_EOF(INITIAL):
1350case YY_STATE_EOF(comment):
1351case YY_STATE_EOF(qstring):
1352case YY_STATE_EOF(hstring):
1353 yyterminate();
1354
1355 case YY_END_OF_BUFFER:
1356 {
1357 /* Amount of text matched not including the EOB char. */
1358 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1359
1360 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1361 *yy_cp = (yy_hold_char);
1363
1364 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1365 {
1366 /* We're scanning a new file or input source. It's
1367 * possible that this happened because the user
1368 * just pointed yyin at a new source and called
1369 * yylex(). If so, then we have to assure
1370 * consistency between YY_CURRENT_BUFFER and our
1371 * globals. Here is the right place to do so, because
1372 * this is the first action (other than possibly a
1373 * back-up) that will match for the new input source.
1374 */
1375 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1376 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1377 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1378 }
1379
1380 /* Note that here we test for yy_c_buf_p "<=" to the position
1381 * of the first EOB in the buffer, since yy_c_buf_p will
1382 * already have been incremented past the NUL character
1383 * (since all states make transitions on EOB to the
1384 * end-of-buffer state). Contrast this with the test
1385 * in input().
1386 */
1387 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1388 { /* This was really a NUL. */
1389 yy_state_type yy_next_state;
1390
1391 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1392
1393 yy_current_state = yy_get_previous_state( );
1394
1395 /* Okay, we're now positioned to make the NUL
1396 * transition. We couldn't have
1397 * yy_get_previous_state() go ahead and do it
1398 * for us because it doesn't know how to deal
1399 * with the possibility of jamming (and we don't
1400 * want to build jamming into it because then it
1401 * will run more slowly).
1402 */
1403
1404 yy_next_state = yy_try_NUL_trans( yy_current_state );
1405
1407
1408 if ( yy_next_state )
1409 {
1410 /* Consume the NUL. */
1411 yy_cp = ++(yy_c_buf_p);
1412 yy_current_state = yy_next_state;
1413 goto yy_match;
1414 }
1415
1416 else
1417 {
1418 yy_cp = (yy_c_buf_p);
1419 goto yy_find_action;
1420 }
1421 }
1422
1423 else switch ( yy_get_next_buffer( ) )
1424 {
1426 {
1428
1429 if ( yywrap( ) )
1430 {
1431 /* Note: because we've taken care in
1432 * yy_get_next_buffer() to have set up
1433 * yytext, we can now set up
1434 * yy_c_buf_p so that if some total
1435 * hoser (like flex itself) wants to
1436 * call the scanner after we return the
1437 * YY_NULL, it'll still work - another
1438 * YY_NULL will get returned.
1439 */
1441
1443 goto do_action;
1444 }
1445
1446 else
1447 {
1450 }
1451 break;
1452 }
1453
1455 (yy_c_buf_p) =
1456 (yytext_ptr) + yy_amount_of_matched_text;
1457
1458 yy_current_state = yy_get_previous_state( );
1459
1460 yy_cp = (yy_c_buf_p);
1462 goto yy_match;
1463
1464 case EOB_ACT_LAST_MATCH:
1465 (yy_c_buf_p) =
1466 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1467
1468 yy_current_state = yy_get_previous_state( );
1469
1470 yy_cp = (yy_c_buf_p);
1472 goto yy_find_action;
1473 }
1474 break;
1475 }
1476
1477 default:
1479 "fatal flex scanner internal error--no action found" );
1480 } /* end of action switch */
1481 } /* end of scanning one token */
1482 } /* end of user's declarations */
1483} /* end of yylex */
1484
1485/* yy_get_next_buffer - try to read in a new buffer
1486 *
1487 * Returns a code representing an action:
1488 * EOB_ACT_LAST_MATCH -
1489 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1490 * EOB_ACT_END_OF_FILE - end of file
1491 */
1492static int yy_get_next_buffer (void)
1493{
1494 char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1495 char *source = (yytext_ptr);
1496 int number_to_move, i;
1497 int ret_val;
1498
1499 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1501 "fatal flex scanner internal error--end of buffer missed" );
1502
1503 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1504 { /* Don't try to fill the buffer, so this is an EOF. */
1505 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1506 {
1507 /* We matched a single character, the EOB, so
1508 * treat this as a final EOF.
1509 */
1510 return EOB_ACT_END_OF_FILE;
1511 }
1512
1513 else
1514 {
1515 /* We matched some text prior to the EOB, first
1516 * process it.
1517 */
1518 return EOB_ACT_LAST_MATCH;
1519 }
1520 }
1521
1522 /* Try to read more data. */
1523
1524 /* First move last chars to start of buffer. */
1525 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);
1526
1527 for ( i = 0; i < number_to_move; ++i )
1528 *(dest++) = *(source++);
1529
1530 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1531 /* don't do the read, it's not guaranteed to return an EOF,
1532 * just force an EOF
1533 */
1534 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1535
1536 else
1537 {
1538 int num_to_read =
1539 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1540
1541 while ( num_to_read <= 0 )
1542 { /* Not enough room in the buffer - grow it. */
1543
1544 /* just a shorter name for the current buffer */
1546
1547 int yy_c_buf_p_offset =
1548 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1549
1550 if ( b->yy_is_our_buffer )
1551 {
1552 int new_size = b->yy_buf_size * 2;
1553
1554 if ( new_size <= 0 )
1555 b->yy_buf_size += b->yy_buf_size / 8;
1556 else
1557 b->yy_buf_size *= 2;
1558
1559 b->yy_ch_buf = (char *)
1560 /* Include room in for 2 EOB chars. */
1561 yyrealloc( (void *) b->yy_ch_buf,
1562 (yy_size_t) (b->yy_buf_size + 2) );
1563 }
1564 else
1565 /* Can't grow it, we don't own it. */
1566 b->yy_ch_buf = NULL;
1567
1568 if ( ! b->yy_ch_buf )
1570 "fatal error - scanner input buffer overflow" );
1571
1572 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1573
1574 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1575 number_to_move - 1;
1576
1577 }
1578
1579 if ( num_to_read > YY_READ_BUF_SIZE )
1580 num_to_read = YY_READ_BUF_SIZE;
1581
1582 /* Read in more data. */
1583 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1584 (yy_n_chars), num_to_read );
1585
1586 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1587 }
1588
1589 if ( (yy_n_chars) == 0 )
1590 {
1591 if ( number_to_move == YY_MORE_ADJ )
1592 {
1593 ret_val = EOB_ACT_END_OF_FILE;
1594 yyrestart( yyin );
1595 }
1596
1597 else
1598 {
1599 ret_val = EOB_ACT_LAST_MATCH;
1600 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1602 }
1603 }
1604
1605 else
1606 ret_val = EOB_ACT_CONTINUE_SCAN;
1607
1608 if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1609 /* Extend the array by 50%, plus the number we really need. */
1610 int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1611 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
1612 (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size );
1613 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1614 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1615 /* "- 2" to take care of EOB's */
1616 YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
1617 }
1618
1619 (yy_n_chars) += number_to_move;
1622
1623 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1624
1625 return ret_val;
1626}
1627
1628/* yy_get_previous_state - get the state just before the EOB char was reached */
1629
1631{
1632 yy_state_type yy_current_state;
1633 char *yy_cp;
1634
1635 yy_current_state = (yy_start);
1636 yy_current_state += YY_AT_BOL();
1637
1638 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1639 {
1640 YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1641 if ( yy_accept[yy_current_state] )
1642 {
1643 (yy_last_accepting_state) = yy_current_state;
1645 }
1646 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1647 {
1648 yy_current_state = (int) yy_def[yy_current_state];
1649 if ( yy_current_state >= 93 )
1650 yy_c = yy_meta[yy_c];
1651 }
1652 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1653 }
1654
1655 return yy_current_state;
1656}
1657
1658/* yy_try_NUL_trans - try to make a transition on the NUL character
1659 *
1660 * synopsis
1661 * next_state = yy_try_NUL_trans( current_state );
1662 */
1663 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1664{
1665 int yy_is_jam;
1666 char *yy_cp = (yy_c_buf_p);
1667
1668 YY_CHAR yy_c = 1;
1669 if ( yy_accept[yy_current_state] )
1670 {
1671 (yy_last_accepting_state) = yy_current_state;
1673 }
1674 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1675 {
1676 yy_current_state = (int) yy_def[yy_current_state];
1677 if ( yy_current_state >= 93 )
1678 yy_c = yy_meta[yy_c];
1679 }
1680 yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
1681 yy_is_jam = (yy_current_state == 92);
1682
1683 return yy_is_jam ? 0 : yy_current_state;
1684}
1685
1686#ifndef YY_NO_UNPUT
1687
1688 static void yyunput (int c, char * yy_bp )
1689{
1690 char *yy_cp;
1691
1692 yy_cp = (yy_c_buf_p);
1693
1694 /* undo effects of setting up yytext */
1695 *yy_cp = (yy_hold_char);
1696
1697 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1698 { /* need to shift things up to make room */
1699 /* +2 for EOB chars. */
1700 int number_to_move = (yy_n_chars) + 2;
1701 char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1702 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1703 char *source =
1704 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1705
1706 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1707 *--dest = *--source;
1708
1709 yy_cp += (int) (dest - source);
1710 yy_bp += (int) (dest - source);
1711 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1712 (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1713
1714 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1715 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1716 }
1717
1718 *--yy_cp = (char) c;
1719
1720 (yytext_ptr) = yy_bp;
1721 (yy_hold_char) = *yy_cp;
1722 (yy_c_buf_p) = yy_cp;
1723}
1724
1725#endif
1726
1727#ifndef YY_NO_INPUT
1728#ifdef __cplusplus
1729 static int yyinput (void)
1730#else
1731 static int input (void)
1732#endif
1733
1734{
1735 int c;
1736
1737 *(yy_c_buf_p) = (yy_hold_char);
1738
1740 {
1741 /* yy_c_buf_p now points to the character we want to return.
1742 * If this occurs *before* the EOB characters, then it's a
1743 * valid NUL; if not, then we've hit the end of the buffer.
1744 */
1745 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1746 /* This was really a NUL. */
1747 *(yy_c_buf_p) = '\0';
1748
1749 else
1750 { /* need more input */
1751 int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
1752 ++(yy_c_buf_p);
1753
1754 switch ( yy_get_next_buffer( ) )
1755 {
1756 case EOB_ACT_LAST_MATCH:
1757 /* This happens because yy_g_n_b()
1758 * sees that we've accumulated a
1759 * token and flags that we need to
1760 * try matching the token before
1761 * proceeding. But for input(),
1762 * there's no matching to consider.
1763 * So convert the EOB_ACT_LAST_MATCH
1764 * to EOB_ACT_END_OF_FILE.
1765 */
1766
1767 /* Reset buffer status. */
1768 yyrestart( yyin );
1769
1770 /*FALLTHROUGH*/
1771
1773 {
1774 if ( yywrap( ) )
1775 return 0;
1776
1779#ifdef __cplusplus
1780 return yyinput();
1781#else
1782 return input();
1783#endif
1784 }
1785
1788 break;
1789 }
1790 }
1791 }
1792
1793 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1794 *(yy_c_buf_p) = '\0'; /* preserve yytext */
1795 (yy_hold_char) = *++(yy_c_buf_p);
1796
1797 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1798
1799 return c;
1800}
1801#endif /* ifndef YY_NO_INPUT */
1802
1808 void yyrestart (FILE * input_file )
1809{
1810
1811 if ( ! YY_CURRENT_BUFFER ){
1815 }
1816
1817 yy_init_buffer( YY_CURRENT_BUFFER, input_file );
1819}
1820
1825 void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1826{
1827
1828 /* TODO. We should be able to replace this entire function body
1829 * with
1830 * yypop_buffer_state();
1831 * yypush_buffer_state(new_buffer);
1832 */
1834 if ( YY_CURRENT_BUFFER == new_buffer )
1835 return;
1836
1837 if ( YY_CURRENT_BUFFER )
1838 {
1839 /* Flush out information for old buffer. */
1840 *(yy_c_buf_p) = (yy_hold_char);
1841 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1842 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1843 }
1844
1845 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1847
1848 /* We don't actually know whether we did this switch during
1849 * EOF (yywrap()) processing, but the only time this flag
1850 * is looked at is after yywrap() is called, so it's safe
1851 * to go ahead and always set it.
1852 */
1854}
1855
1856static void yy_load_buffer_state (void)
1857{
1858 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1860 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1861 (yy_hold_char) = *(yy_c_buf_p);
1862}
1863
1870 YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1871{
1873
1874 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
1875 if ( ! b )
1876 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1877
1878 b->yy_buf_size = size;
1879
1880 /* yy_ch_buf has to be 2 characters longer than the size given because
1881 * we need to put in 2 end-of-buffer characters.
1882 */
1883 b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) );
1884 if ( ! b->yy_ch_buf )
1885 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1886
1887 b->yy_is_our_buffer = 1;
1888
1889 yy_init_buffer( b, file );
1890
1891 return b;
1892}
1893
1899{
1900
1901 if ( ! b )
1902 return;
1903
1904 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1906
1907 if ( b->yy_is_our_buffer )
1908 yyfree( (void *) b->yy_ch_buf );
1909
1910 yyfree( (void *) b );
1911}
1912
1913/* Initializes or reinitializes a buffer.
1914 * This function is sometimes called more than once on the same buffer,
1915 * such as during a yyrestart() or at EOF.
1916 */
1917 static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1918
1919{
1920 int oerrno = errno;
1921
1922 yy_flush_buffer( b );
1923
1924 b->yy_input_file = file;
1925 b->yy_fill_buffer = 1;
1926
1927 /* If b is the current buffer, then yy_init_buffer was _probably_
1928 * called from yyrestart() or through yy_get_next_buffer.
1929 * In that case, we don't want to reset the lineno or column.
1930 */
1931 if (b != YY_CURRENT_BUFFER){
1932 b->yy_bs_lineno = 1;
1933 b->yy_bs_column = 0;
1934 }
1935
1936 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1937
1938 errno = oerrno;
1939}
1940
1946{
1947 if ( ! b )
1948 return;
1949
1950 b->yy_n_chars = 0;
1951
1952 /* We always need two end-of-buffer characters. The first causes
1953 * a transition to the end-of-buffer state. The second causes
1954 * a jam in that state.
1955 */
1958
1959 b->yy_buf_pos = &b->yy_ch_buf[0];
1960
1961 b->yy_at_bol = 1;
1963
1964 if ( b == YY_CURRENT_BUFFER )
1966}
1967
1974void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1975{
1976 if (new_buffer == NULL)
1977 return;
1978
1980
1981 /* This block is copied from yy_switch_to_buffer. */
1982 if ( YY_CURRENT_BUFFER )
1983 {
1984 /* Flush out information for old buffer. */
1985 *(yy_c_buf_p) = (yy_hold_char);
1986 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1987 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1988 }
1989
1990 /* Only push if top exists. Otherwise, replace top. */
1993 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1994
1995 /* copied from yy_switch_to_buffer. */
1998}
1999
2004void yypop_buffer_state (void)
2005{
2006 if (!YY_CURRENT_BUFFER)
2007 return;
2008
2011 if ((yy_buffer_stack_top) > 0)
2013
2014 if (YY_CURRENT_BUFFER) {
2017 }
2018}
2019
2020/* Allocates the stack if it does not exist.
2021 * Guarantees space for at least one push.
2022 */
2023static void yyensure_buffer_stack (void)
2024{
2025 yy_size_t num_to_alloc;
2026
2027 if (!(yy_buffer_stack)) {
2028
2029 /* First allocation is just for 2 elements, since we don't know if this
2030 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2031 * immediate realloc on the next call.
2032 */
2033 num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
2035 (num_to_alloc * sizeof(struct yy_buffer_state*)
2036 );
2037 if ( ! (yy_buffer_stack) )
2038 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2039
2040 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2041
2042 (yy_buffer_stack_max) = num_to_alloc;
2043 (yy_buffer_stack_top) = 0;
2044 return;
2045 }
2046
2047 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2048
2049 /* Increase the buffer to prepare for a possible push. */
2050 yy_size_t grow_size = 8 /* arbitrary grow size */;
2051
2052 num_to_alloc = (yy_buffer_stack_max) + grow_size;
2054 ((yy_buffer_stack),
2055 num_to_alloc * sizeof(struct yy_buffer_state*)
2056 );
2057 if ( ! (yy_buffer_stack) )
2058 YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
2059
2060 /* zero only the new slots.*/
2061 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2062 (yy_buffer_stack_max) = num_to_alloc;
2063 }
2064}
2065
2072YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
2073{
2075
2076 if ( size < 2 ||
2077 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2078 base[size-1] != YY_END_OF_BUFFER_CHAR )
2079 /* They forgot to leave room for the EOB's. */
2080 return NULL;
2081
2082 b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) );
2083 if ( ! b )
2084 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
2085
2086 b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
2087 b->yy_buf_pos = b->yy_ch_buf = base;
2088 b->yy_is_our_buffer = 0;
2089 b->yy_input_file = NULL;
2090 b->yy_n_chars = b->yy_buf_size;
2091 b->yy_is_interactive = 0;
2092 b->yy_at_bol = 1;
2093 b->yy_fill_buffer = 0;
2095
2097
2098 return b;
2099}
2100
2109YY_BUFFER_STATE yy_scan_string (const char * yystr )
2110{
2111
2112 return yy_scan_bytes( yystr, (int) strlen(yystr) );
2113}
2114
2122YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len )
2123{
2125 char *buf;
2126 yy_size_t n;
2127 int i;
2128
2129 /* Get memory for full buffer, including space for trailing EOB's. */
2130 n = (yy_size_t) (_yybytes_len + 2);
2131 buf = (char *) yyalloc( n );
2132 if ( ! buf )
2133 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
2134
2135 for ( i = 0; i < _yybytes_len; ++i )
2136 buf[i] = yybytes[i];
2137
2138 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2139
2140 b = yy_scan_buffer( buf, n );
2141 if ( ! b )
2142 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
2143
2144 /* It's okay to grow etc. this buffer, and we should throw it
2145 * away when we're done.
2146 */
2147 b->yy_is_our_buffer = 1;
2148
2149 return b;
2150}
2151
2152#ifndef YY_EXIT_FAILURE
2153#define YY_EXIT_FAILURE 2
2154#endif
2155
2156static void yynoreturn yy_fatal_error (const char* msg )
2157{
2158 fprintf( stderr, "%s\n", msg );
2159 exit( YY_EXIT_FAILURE );
2160}
2161
2162/* Redefine yyless() so it works in section 3 code. */
2163
2164#undef yyless
2165#define yyless(n) \
2166 do \
2167 { \
2168 /* Undo effects of setting up yytext. */ \
2169 int yyless_macro_arg = (n); \
2170 YY_LESS_LINENO(yyless_macro_arg);\
2171 yytext[yyleng] = (yy_hold_char); \
2172 (yy_c_buf_p) = yytext + yyless_macro_arg; \
2173 (yy_hold_char) = *(yy_c_buf_p); \
2174 *(yy_c_buf_p) = '\0'; \
2175 yyleng = yyless_macro_arg; \
2176 } \
2177 while ( 0 )
2178
2179/* Accessor methods (get/set functions) to struct members. */
2180
2184int yyget_lineno (void)
2185{
2186
2187 return yylineno;
2188}
2189
2193FILE *yyget_in (void)
2194{
2195 return yyin;
2196}
2197
2201FILE *yyget_out (void)
2202{
2203 return yyout;
2204}
2205
2209int yyget_leng (void)
2210{
2211 return yyleng;
2212}
2213
2218char *yyget_text (void)
2219{
2220 return yytext;
2221}
2222
2227void yyset_lineno (int _line_number )
2228{
2229
2230 yylineno = _line_number;
2231}
2232
2239void yyset_in (FILE * _in_str )
2240{
2241 yyin = _in_str ;
2242}
2243
2244void yyset_out (FILE * _out_str )
2245{
2246 yyout = _out_str ;
2247}
2248
2249int yyget_debug (void)
2250{
2251 return yy_flex_debug;
2252}
2253
2254void yyset_debug (int _bdebug )
2255{
2256 yy_flex_debug = _bdebug ;
2257}
2258
2259static int yy_init_globals (void)
2260{
2261 /* Initialization is the same as for the non-reentrant scanner.
2262 * This function is called from yylex_destroy(), so don't allocate here.
2263 */
2264
2266 (yy_buffer_stack_top) = 0;
2267 (yy_buffer_stack_max) = 0;
2268 (yy_c_buf_p) = NULL;
2269 (yy_init) = 0;
2270 (yy_start) = 0;
2271
2272/* Defined in main.c */
2273#ifdef YY_STDINIT
2274 yyin = stdin;
2275 yyout = stdout;
2276#else
2277 yyin = NULL;
2278 yyout = NULL;
2279#endif
2280
2281 /* For future reference: Set errno on error, since we are called by
2282 * yylex_init()
2283 */
2284 return 0;
2285}
2286
2287/* yylex_destroy is for both reentrant and non-reentrant scanners. */
2288int yylex_destroy (void)
2289{
2290
2291 /* Pop the buffer stack, destroying each element. */
2292 while(YY_CURRENT_BUFFER){
2296 }
2297
2298 /* Destroy the stack itself. */
2301
2302 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2303 * yylex() is called, initialization will occur. */
2304 yy_init_globals( );
2305
2306 return 0;
2307}
2308
2309/*
2310 * Internal utility routines.
2311 */
2312
2313#ifndef yytext_ptr
2314static void yy_flex_strncpy (char* s1, const char * s2, int n )
2315{
2316
2317 int i;
2318 for ( i = 0; i < n; ++i )
2319 s1[i] = s2[i];
2320}
2321#endif
2322
2323#ifdef YY_NEED_STRLEN
2324static int yy_flex_strlen (const char * s )
2325{
2326 int n;
2327 for ( n = 0; s[n]; ++n )
2328 ;
2329
2330 return n;
2331}
2332#endif
2333
2334void *yyalloc (yy_size_t size )
2335{
2336 return malloc(size);
2337}
2338
2339void *yyrealloc (void * ptr, yy_size_t size )
2340{
2341
2342 /* The cast to (char *) in the following accommodates both
2343 * implementations that use char* generic pointers, and those
2344 * that use void* generic pointers. It works with the latter
2345 * because both ANSI C and C++ allow castless assignment from
2346 * any pointer type to void*, and deal with argument conversions
2347 * as though doing an assignment.
2348 */
2349 return realloc(ptr, size);
2350}
2351
2352void yyfree (void * ptr )
2353{
2354 free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2355}
2356
2357#define YYTABLES_NAME "yytables"
2358
2359#line 144 "../../lib/cgraph/scan.l"
2360
2361
2362void aagerror(const char *str);
2363void aagerror(const char *str)
2364{
2365 agxbuf xb = {0};
2366 if (InputFile) {
2367 agxbprint (&xb, "%s: ", InputFile);
2368 }
2369 agxbprint (&xb, "%s in line %d", str, line_num);
2370 if (*aagget_text()) {
2371 agxbprint(&xb, " near '%s'", aagget_text());
2372 }
2373 else switch (YYSTATE) {
2374 case qstring: {
2375 agxbprint(&xb, " scanning a quoted string (missing endquote? longer than %d?)", YY_BUF_SIZE);
2376 if (agxblen(&Sbuf) > 0) {
2377 agxbprint(&xb, "\nString starting:\"%.80s", agxbuse(&Sbuf));
2378 }
2379 break;
2380 }
2381 case hstring: {
2382 agxbprint(&xb, " scanning a HTML string (missing '>'? bad nesting? longer than %d?)", YY_BUF_SIZE);
2383 if (agxblen(&Sbuf) > 0) {
2384 agxbprint(&xb, "\nString starting:<%.80s", agxbuse(&Sbuf));
2385 }
2386 break;
2387 }
2388 case comment :
2389 agxbprint(&xb, " scanning a /*...*/ comment (missing '*/? longer than %d?)", YY_BUF_SIZE);
2390 break;
2391 default: // nothing extra to note
2392 break;
2393 }
2394 agxbputc (&xb, '\n');
2395 agerrorf("%s", agxbuse(&xb));
2396 agxbfree(&xb);
2397 BEGIN(INITIAL);
2398}
2399/* must be here to see flex's macro defns */
2401
2403
2404#ifndef YY_CALL_ONLY_ARG
2405# define YY_CALL_ONLY_ARG void
2406#endif
2407
2409{
2410 return 1;
2411}
2412
2413 /* (Re)set file:
2414 */
2415void agsetfile(const char* f) { InputFile = f; line_num = 1; }
2416
2417/* There is a hole here, because switching channels
2418 * requires pushing back whatever was previously read.
2419 * There probably is a right way of doing this.
2420 */
2421void aglexinit(Agdisc_t *disc, void *ifile) { Disc = disc; Ifile = ifile; graphType = 0;}
2422
2423
2424static void beginstr(void) {
2425 // nothing required, but we should not have pending string data
2426 assert(agxblen(&Sbuf) == 0 &&
2427 "pending string data that was not consumed (missing "
2428 "endstr()/endhtmlstr()?)");
2429}
2430
2431static void addstr(char *src) {
2432 agxbput(&Sbuf, src);
2433}
2434
2435static void endstr(void) {
2437}
2438
2439static void endstr_html(void) {
2441}
2442
2443static void storeFileName(char* fname, size_t len) {
2444 static size_t cnt;
2445 static char* buf;
2446
2447 if (len > cnt) {
2448 buf = gv_realloc(buf, cnt + 1, len + 1);
2449 cnt = len;
2450 }
2451 strcpy (buf, fname);
2452 InputFile = buf;
2453}
2454
2455/* ppDirective:
2456 * Process a possible preprocessor line directive.
2457 * aagtext = #.*
2458 */
2459static void ppDirective (void)
2460{
2461 int r, cnt, lineno;
2462 char buf[2];
2463 char* s = aagget_text() + 1; /* skip initial # */
2464
2465 if (startswith(s, "line")) s += strlen("line");
2466 r = sscanf(s, "%d %1[\"]%n", &lineno, buf, &cnt);
2467 if (r > 0) { /* got line number */
2468 // ignore if line number was out of range
2469 if (lineno <= 0) {
2470 return;
2471 }
2472 line_num = lineno - 1;
2473 if (r > 1) { /* saw quote */
2474 char* p = s + cnt;
2475 char* e = p;
2476 while (*e && *e != '"') e++;
2477 if (e != p && *e == '"') {
2478 *e = '\0';
2479 storeFileName(p, (size_t)(e - p));
2480 }
2481 }
2482 }
2483}
2484
2485/* twoDots:
2486 * Return true if token has more than one '.';
2487 * we know the last character is a '.'.
2488 */
2489static bool twoDots(void) {
2490 const char *dot = strchr(aagget_text(), '.');
2491 // was there a dot and was it not the last character?
2492 return dot != NULL && dot != &aagget_text()[aagget_leng() - 1];
2493}
2494
2495/* chkNum:
2496 * The regexp for NUMBER allows a terminating letter or '.'.
2497 * This way we can catch a number immediately followed by a name
2498 * or something like 123.456.78, and report this to the user.
2499 */
2500static int chkNum(void) {
2501 char c = aagget_text()[aagget_leng() - 1]; // last character
2502 if ((!gv_isdigit(c) && c != '.') || (c == '.' && twoDots())) { // c is letter
2503 const char* fname;
2504
2505 if (InputFile)
2506 fname = InputFile;
2507 else
2508 fname = "input";
2509
2510 agwarningf("syntax ambiguity - badly delimited number '%s' in line %d of "
2511 "%s splits into two tokens\n", aagget_text(), line_num, fname);
2512
2513 return 1;
2514 }
2515 else return 0;
2516}
2517
static void agxbfree(agxbuf *xb)
free any malloced resources
Definition agxbuf.h:78
static int agxbprint(agxbuf *xb, const char *fmt,...)
Printf-style output to an agxbuf.
Definition agxbuf.h:234
static WUR char * agxbuse(agxbuf *xb)
Definition agxbuf.h:307
static size_t agxblen(const agxbuf *xb)
return number of characters currently stored
Definition agxbuf.h:89
static int agxbputc(agxbuf *xb, char c)
add character to buffer
Definition agxbuf.h:277
static void * gv_realloc(void *ptr, size_t old_size, size_t new_size)
Definition alloc.h:49
cgraph.h additions
Agraph_t * Ag_G_global
Definition graph.c:24
static char * fname
static Dtdisc_t disc
Definition exparse.y:209
#define dot(v, w)
Definition geom.c:228
static double len(glCompPoint p)
Definition glutils.c:150
void * malloc(YYSIZE_T)
void free(void *)
unsigned char flex_uint8_t
Definition gmlscan.c:313
short int flex_int16_t
Definition gmlscan.c:311
int flex_int32_t
Definition gmlscan.c:312
int yy_state_type
Definition gmlscan.c:589
flex_uint8_t YY_CHAR
Definition gmlscan.c:585
size_t yy_size_t
Definition gmlscan.c:414
#define T_node
Definition grammar.c:235
#define T_atom
Definition grammar.c:243
AAGSTYPE aaglval
#define T_subgraph
Definition grammar.c:238
#define T_edge
Definition grammar.c:236
#define T_strict
Definition grammar.c:239
#define T_qatom
Definition grammar.c:244
#define T_digraph
Definition grammar.c:237
#define T_graph
Definition grammar.c:234
#define T_edgeop
Definition grammar.c:240
node NULL
Definition grammar.y:163
static int cnt(Dict_t *d, Dtlink_t **set)
Definition graph.c:210
void agwarningf(const char *fmt,...)
Definition agerror.c:173
void agerrorf(const char *fmt,...)
Definition agerror.c:165
void agsetfile(const char *f)
sets the current file name for subsequent error reporting
Definition scan.c:2415
char * agstrdup(Agraph_t *, const char *)
returns a pointer to a reference-counted copy of the argument string, creating one if necessary
Definition refstr.c:131
char * agstrdup_html(Agraph_t *, const char *)
Definition refstr.c:135
replacements for ctype.h functions
static bool gv_isdigit(int c)
Definition gv_ctype.h:41
swig_ptr_object_handlers offset
Definition gv_php.cpp:5907
agxbput(xb, staging)
textitem scanner parser str
Definition htmlparse.y:224
NEATOPROCS_API void s1(graph_t *, node_t *)
Definition stuff.c:671
static int lineno
Definition parse.c:28
#define yy_load_buffer_state
Definition scan.c:16
#define YY_NEW_FILE
Definition scan.c:387
#define yyset_extra
Definition scan.c:165
static int chkNum(void)
Definition scan.c:2500
#define yytext
Definition scan.c:28
unsigned char flex_uint8_t
Definition scan.c:313
#define yyset_lineno
Definition scan.c:213
static char yy_hold_char
Definition scan.c:528
static const flex_int16_t yy_def[105]
Definition scan.c:695
void aglexbad(void)
Definition scan.c:2402
static yy_state_type yy_last_accepting_state
Definition scan.c:777
#define yyrestart
Definition scan.c:27
#define yyset_debug
Definition scan.c:153
static void yyunput(int c, char *buf_ptr)
static void yynoreturn yy_fatal_error(const char *msg)
#define YY_EXTRA_TYPE
Definition scan.c:902
static int yy_start
Definition scan.c:535
short int flex_int16_t
Definition scan.c:311
#define yy_flex_debug
Definition scan.c:21
#define isatty(x)
Definition scan.c:839
static const char * InputFile
Definition scan.c:829
#define YYSTATE
Definition scan.c:383
#define yyget_out
Definition scan.c:183
static YY_BUFFER_STATE * yy_buffer_stack
Definition scan.c:511
#define qstring
Definition scan.c:890
unsigned int flex_uint32_t
Definition scan.c:315
static Agdisc_t * Disc
Definition scan.c:830
#define GRAPH_EOF_TOKEN
Definition scan.c:825
static int yy_get_next_buffer(void)
#define yy_scan_bytes
Definition scan.c:13
#define hstring
Definition scan.c:891
static void endstr(void)
Definition scan.c:2435
#define YY_BREAK
Definition scan.c:1065
static size_t yy_buffer_stack_max
Definition scan.c:510
#define comment
Definition scan.c:889
#define unput(c)
Definition scan.c:441
#define yynoreturn
Definition scan.c:362
static yy_state_type yy_try_NUL_trans(yy_state_type current_state)
void aglexinit(Agdisc_t *disc, void *ifile)
Definition scan.c:2421
#define yyget_debug
Definition scan.c:147
int yy_act
Definition scan.c:1080
#define yypush_buffer_state
Definition scan.c:18
static const flex_int16_t yy_chk[268]
Definition scan.c:744
static void storeFileName(char *fname, size_t len)
Definition scan.c:2443
static const flex_int16_t yy_nxt[268]
Definition scan.c:711
struct yy_buffer_state * YY_BUFFER_STATE
Definition scan.c:409
#define yyfree
Definition scan.c:32
#define yyout
Definition scan.c:26
#define YY_BUFFER_NEW
Definition scan.c:491
#define yyget_lineno
Definition scan.c:207
#define yylex
Definition scan.c:24
#define YY_RESTORE_YY_MORE_OFFSET
Definition scan.c:789
static const YY_CHAR yy_meta[49]
Definition scan.c:670
static int yy_did_buffer_switch_on_eof
Definition scan.c:540
static int yy_init_globals(void)
#define yywrap
Definition scan.c:29
int aagwrap(YY_CALL_ONLY_ARG)
Definition scan.c:2408
static void * Ifile
Definition scan.c:831
static const flex_int16_t yy_base[105]
Definition scan.c:679
#define yyget_text
Definition scan.c:201
#define YY_BUFFER_NORMAL
Definition scan.c:492
char * yy_cp
Definition scan.c:1079
#define yyensure_buffer_stack
Definition scan.c:20
#define yy_scan_buffer
Definition scan.c:11
#define YY_MORE_ADJ
Definition scan.c:788
#define YY_RULE_SETUP
Definition scan.c:1068
#define yy_scan_string
Definition scan.c:12
#define YY_AT_BOL()
Definition scan.c:582
static bool twoDots(void)
Definition scan.c:2489
static int line_num
Definition scan.c:827
#define yytext_ptr
Definition scan.c:598
signed char flex_int8_t
Definition scan.c:310
#define yyget_leng
Definition scan.c:195
#define EOB_ACT_END_OF_FILE
Definition scan.c:422
#define yyalloc
Definition scan.c:30
#define yypop_buffer_state
Definition scan.c:19
#define YY_CURRENT_BUFFER_LVALUE
Definition scan.c:525
int flex_int32_t
Definition scan.c:312
#define yylex_destroy
Definition scan.c:141
#define YY_START
Definition scan.c:382
#define yy_switch_to_buffer
Definition scan.c:17
static void ppDirective(void)
Definition scan.c:2459
static void endstr_html(void)
Definition scan.c:2439
int yy_state_type
Definition scan.c:589
#define YY_CURRENT_BUFFER
Definition scan.c:519
#define yy_init_buffer
Definition scan.c:14
#define INITIAL
Definition scan.c:888
#define yyget_extra
Definition scan.c:159
char * yy_bp
Definition scan.c:1079
#define yyin
Definition scan.c:22
static int yy_n_chars
Definition scan.c:529
#define YY_READ_BUF_SIZE
Definition scan.c:977
#define YY_INPUT(buf, result, max_size)
Definition scan.c:843
#define ECHO
Definition scan.c:986
#define yy_flush_buffer
Definition scan.c:15
#define yyrealloc
Definition scan.c:31
#define YY_END_OF_BUFFER
Definition scan.c:615
#define YY_STATE_EOF(state)
Definition scan.c:385
#define BEGIN
Definition scan.c:377
#define YY_END_OF_BUFFER_CHAR
Definition scan.c:388
static void addstr(char *src)
Definition scan.c:2431
#define YY_FATAL_ERROR(msg)
Definition scan.c:1040
#define yyterminate()
Definition scan.c:1030
unsigned short int flex_uint16_t
Definition scan.c:314
#define YY_FLUSH_BUFFER
Definition scan.c:553
#define yy_create_buffer
Definition scan.c:9
static int html_nest
Definition scan.c:828
flex_uint8_t YY_CHAR
Definition scan.c:585
#define YY_DO_BEFORE_ACTION
Definition scan.c:608
#define yy_delete_buffer
Definition scan.c:10
#define EOB_ACT_LAST_MATCH
Definition scan.c:423
#define yyget_in
Definition scan.c:171
size_t yy_size_t
Definition scan.c:414
#define YY_CALL_ONLY_ARG
Definition scan.c:2405
static const flex_int16_t yy_accept[93]
Definition scan.c:623
#define YY_BUFFER_EOF_PENDING
Definition scan.c:503
#define yylineno
Definition scan.c:25
static yy_state_type yy_get_previous_state(void)
static const YY_CHAR yy_ec[256]
Definition scan.c:638
#define yyset_out
Definition scan.c:189
int gv_isatty_suppression
Definition scan.c:840
static char * yy_c_buf_p
Definition scan.c:533
#define EOB_ACT_CONTINUE_SCAN
Definition scan.c:421
static size_t yy_buffer_stack_top
Definition scan.c:509
#define YY_DECL
Definition scan.c:1053
#define yyless(n)
Definition scan.c:429
void aglexeof(void)
Definition scan.c:2400
#define YY_BUF_SIZE
Definition scan.c:399
#define YY_EXIT_FAILURE
static agxbuf Sbuf
Definition scan.c:849
static int yy_init
Definition scan.c:534
#define YY_SC_TO_UI(c)
Definition scan.c:371
static void beginstr(void)
Definition scan.c:2424
#define yyleng
Definition scan.c:23
static int graphType
Definition scan.c:832
static char * yy_last_accepting_cpos
Definition scan.c:778
#define yyset_in
Definition scan.c:177
void aagerror(const char *str)
Definition scan.c:2363
static bool startswith(const char *s, const char *prefix)
does the string s begin with the string prefix?
Definition startswith.h:11
user's discipline
Definition cgraph.h:337
char * yy_ch_buf
Definition gmlscan.c:449
FILE * yy_input_file
Definition gmlscan.c:447
int yy_buffer_status
Definition gmlscan.c:489
int yy_is_our_buffer
Definition gmlscan.c:466
char * yy_buf_pos
Definition gmlscan.c:450
int yy_is_interactive
Definition gmlscan.c:473
flex_int32_t yy_verify
Definition gmlscan.c:620
flex_int32_t yy_nxt
Definition gmlscan.c:621
char * str
Definition grammar.c:253
Definition grammar.c:93