Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/src/graphviz_digraph_lex.cpp @ 24

Last change on this file since 24 was 12, checked in by landauf, 18 years ago

added boost

File size: 53.2 KB
Line 
1#define GRAPHVIZ_DIRECTED 1
2#define yy_create_buffer bgl_dir__create_buffer
3#define yy_delete_buffer bgl_dir__delete_buffer
4#define yy_scan_buffer bgl_dir__scan_buffer
5#define yy_scan_string bgl_dir__scan_string
6#define yy_scan_bytes bgl_dir__scan_bytes
7#define yy_flex_debug bgl_dir__flex_debug
8#define yy_init_buffer bgl_dir__init_buffer
9#define yy_flush_buffer bgl_dir__flush_buffer
10#define yy_load_buffer_state bgl_dir__load_buffer_state
11#define yy_switch_to_buffer bgl_dir__switch_to_buffer
12#define yyin bgl_dir_in
13#define yyleng bgl_dir_leng
14#define yylex bgl_dir_lex
15#define yyout bgl_dir_out
16#define yyrestart bgl_dir_restart
17#define yytext bgl_dir_text
18
19/* A lexical scanner generated by flex */
20
21/* Scanner skeleton version:
22 * $Header: /cvsroot/boost/boost/libs/graph/src/graphviz_digraph_lex.cpp,v 1.12 2005/07/12 03:10:30 dgregor Exp $
23 */
24
25#define FLEX_SCANNER
26#define YY_FLEX_MAJOR_VERSION 2
27#define YY_FLEX_MINOR_VERSION 5
28
29#include <stdio.h>
30
31
32/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
33#ifdef c_plusplus
34#ifndef __cplusplus
35#define __cplusplus
36#endif
37#endif
38
39
40#ifdef __cplusplus
41
42#include <stdlib.h>
43
44/* Use prototypes in function declarations. */
45#define YY_USE_PROTOS
46
47/* The "const" storage-class-modifier is valid. */
48#define YY_USE_CONST
49
50#else   /* ! __cplusplus */
51
52#if __STDC__
53
54#define YY_USE_PROTOS
55#define YY_USE_CONST
56
57#endif  /* __STDC__ */
58#endif  /* ! __cplusplus */
59
60#ifdef __TURBOC__
61 #pragma warn -rch
62 #pragma warn -use
63#include <io.h>
64#include <stdlib.h>
65#define YY_USE_CONST
66#define YY_USE_PROTOS
67#endif
68
69#ifdef YY_USE_CONST
70#define yyconst const
71#else
72#define yyconst
73#endif
74
75
76#ifdef YY_USE_PROTOS
77#define YY_PROTO(proto) proto
78#else
79#define YY_PROTO(proto) ()
80#endif
81
82/* Returned upon end-of-file. */
83#define YY_NULL 0
84
85/* Promotes a possibly negative, possibly signed char to an unsigned
86 * integer for use as an array index.  If the signed char is negative,
87 * we want to instead treat it as an 8-bit unsigned char, hence the
88 * double cast.
89 */
90#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
91
92/* Enter a start condition.  This macro really ought to take a parameter,
93 * but we do it the disgusting crufty way forced on us by the ()-less
94 * definition of BEGIN.
95 */
96#define BEGIN yy_start = 1 + 2 *
97
98/* Translate the current start state into a value that can be later handed
99 * to BEGIN to return to the state.  The YYSTATE alias is for lex
100 * compatibility.
101 */
102#define YY_START ((yy_start - 1) / 2)
103#define YYSTATE YY_START
104
105/* Action number for EOF rule of a given start state. */
106#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
107
108/* Special action meaning "start processing a new file". */
109#define YY_NEW_FILE yyrestart( yyin )
110
111#define YY_END_OF_BUFFER_CHAR 0
112
113/* Size of default input buffer. */
114#define YY_BUF_SIZE 16384
115
116typedef struct yy_buffer_state *YY_BUFFER_STATE;
117
118extern int yyleng;
119extern FILE *yyin, *yyout;
120
121#define EOB_ACT_CONTINUE_SCAN 0
122#define EOB_ACT_END_OF_FILE 1
123#define EOB_ACT_LAST_MATCH 2
124
125/* The funky do-while in the following #define is used to turn the definition
126 * int a single C statement (which needs a semi-colon terminator).  This
127 * avoids problems with code like:
128 *
129 *      if ( condition_holds )
130 *              yyless( 5 );
131 *      else
132 *              do_something_else();
133 *
134 * Prior to using the do-while the compiler would get upset at the
135 * "else" because it interpreted the "if" statement as being all
136 * done when it reached the ';' after the yyless() call.
137 */
138
139/* Return all but the first 'n' matched characters back to the input stream. */
140
141#define yyless(n) \
142        do \
143                { \
144                /* Undo effects of setting up yytext. */ \
145                *yy_cp = yy_hold_char; \
146                YY_RESTORE_YY_MORE_OFFSET \
147                yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
148                YY_DO_BEFORE_ACTION; /* set up yytext again */ \
149                } \
150        while ( 0 )
151
152#define unput(c) yyunput( c, yytext_ptr )
153
154/* The following is because we cannot portably get our hands on size_t
155 * (without autoconf's help, which isn't available because we want
156 * flex-generated scanners to compile on their own).
157 */
158typedef unsigned int yy_size_t;
159
160
161struct yy_buffer_state
162        {
163        FILE *yy_input_file;
164
165        char *yy_ch_buf;                /* input buffer */
166        char *yy_buf_pos;               /* current position in input buffer */
167
168        /* Size of input buffer in bytes, not including room for EOB
169         * characters.
170         */
171        yy_size_t yy_buf_size;
172
173        /* Number of characters read into yy_ch_buf, not including EOB
174         * characters.
175         */
176        int yy_n_chars;
177
178        /* Whether we "own" the buffer - i.e., we know we created it,
179         * and can realloc() it to grow it, and should free() it to
180         * delete it.
181         */
182        int yy_is_our_buffer;
183
184        /* Whether this is an "interactive" input source; if so, and
185         * if we're using stdio for input, then we want to use getc()
186         * instead of fread(), to make sure we stop fetching input after
187         * each newline.
188         */
189        int yy_is_interactive;
190
191        /* Whether we're considered to be at the beginning of a line.
192         * If so, '^' rules will be active on the next match, otherwise
193         * not.
194         */
195        int yy_at_bol;
196
197        /* Whether to try to fill the input buffer when we reach the
198         * end of it.
199         */
200        int yy_fill_buffer;
201
202        int yy_buffer_status;
203#define YY_BUFFER_NEW 0
204#define YY_BUFFER_NORMAL 1
205        /* When an EOF's been seen but there's still some text to process
206         * then we mark the buffer as YY_EOF_PENDING, to indicate that we
207         * shouldn't try reading from the input source any more.  We might
208         * still have a bunch of tokens to match, though, because of
209         * possible backing-up.
210         *
211         * When we actually see the EOF, we change the status to "new"
212         * (via yyrestart()), so that the user can continue scanning by
213         * just pointing yyin at a new input file.
214         */
215#define YY_BUFFER_EOF_PENDING 2
216        };
217
218static YY_BUFFER_STATE yy_current_buffer = 0;
219
220/* We provide macros for accessing buffer states in case in the
221 * future we want to put the buffer states in a more general
222 * "scanner state".
223 */
224#define YY_CURRENT_BUFFER yy_current_buffer
225
226
227/* yy_hold_char holds the character lost when yytext is formed. */
228static char yy_hold_char;
229
230static int yy_n_chars;          /* number of characters read into yy_ch_buf */
231
232
233int yyleng;
234
235/* Points to current character in buffer. */
236static char *yy_c_buf_p = (char *) 0;
237static int yy_init = 1;         /* whether we need to initialize */
238static int yy_start = 0;        /* start state number */
239
240/* Flag which is used to allow yywrap()'s to do buffer switches
241 * instead of setting up a fresh yyin.  A bit of a hack ...
242 */
243static int yy_did_buffer_switch_on_eof;
244
245void yyrestart YY_PROTO(( FILE *input_file ));
246
247void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
248void yy_load_buffer_state YY_PROTO(( void ));
249YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
250void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
251void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
252void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
253#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
254
255YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
256YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
257YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
258
259static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
260static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
261static void yy_flex_free YY_PROTO(( void * ));
262
263#define yy_new_buffer yy_create_buffer
264
265#define yy_set_interactive(is_interactive) \
266        { \
267        if ( ! yy_current_buffer ) \
268                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
269        yy_current_buffer->yy_is_interactive = is_interactive; \
270        }
271
272#define yy_set_bol(at_bol) \
273        { \
274        if ( ! yy_current_buffer ) \
275                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
276        yy_current_buffer->yy_at_bol = at_bol; \
277        }
278
279#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
280
281
282#define yywrap() 1
283#define YY_SKIP_YYWRAP
284typedef unsigned char YY_CHAR;
285FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
286typedef int yy_state_type;
287extern char *yytext;
288#define yytext_ptr yytext
289
290static yy_state_type yy_get_previous_state YY_PROTO(( void ));
291static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
292static int yy_get_next_buffer YY_PROTO(( void ));
293static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
294
295/* Done after the current pattern has been matched and before the
296 * corresponding action - sets up yytext.
297 */
298#define YY_DO_BEFORE_ACTION \
299        yytext_ptr = yy_bp; \
300        yyleng = (int) (yy_cp - yy_bp); \
301        yy_hold_char = *yy_cp; \
302        *yy_cp = '\0'; \
303        yy_c_buf_p = yy_cp;
304
305#define YY_NUM_RULES 22
306#define YY_END_OF_BUFFER 23
307static yyconst short int yy_accept[82] =
308    {   0,
309        0,    0,    3,    3,   17,   17,   23,   21,   18,   19,
310       20,   14,   21,   21,   21,   21,   21,   13,   13,   13,
311       13,   13,   13,   13,    3,   22,    3,   17,   15,   22,
312        0,    5,    0,   13,   12,   13,    1,    0,   13,    0,
313       13,   13,   13,   13,   13,   13,   13,   13,    3,    2,
314       17,   17,   16,    0,    4,   13,    0,   13,   13,   13,
315       13,   13,   13,   13,   13,    9,   13,    8,   13,   13,
316       13,    7,   13,   13,   13,   10,   13,    6,   13,   11,
317        0
318    } ;
319
320static yyconst int yy_ec[256] =
321    {   0,
322        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
323        1,    1,    4,    1,    1,    1,    1,    1,    1,    1,
324        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
325        1,    2,    1,    5,    6,    1,    1,    1,    1,    1,
326        1,    7,    8,    1,    9,   10,   11,   12,   12,   12,
327       12,   12,   12,   12,   12,   12,   12,    1,    1,    1,
328        1,   13,    1,    1,   14,   14,   14,   14,   15,   14,
329       14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
330       14,   14,   14,   14,   14,   14,   14,   14,   14,   14,
331        1,   16,    1,    1,   14,    1,   17,   18,   19,   20,
332
333       21,   14,   22,   23,   24,   14,   14,   14,   14,   25,
334       26,   27,   14,   28,   29,   30,   31,   14,   14,   14,
335       14,   14,    1,    1,    1,    1,    1,    1,    1,    1,
336        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
337        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
338        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
339        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
340        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
341        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
342        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
343
344        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
345        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
346        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
347        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
348        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
349        1,    1,    1,    1,    1
350    } ;
351
352static yyconst int yy_meta[32] =
353    {   0,
354        1,    1,    2,    1,    3,    1,    1,    1,    1,    1,
355        1,    4,    1,    4,    4,    3,    4,    4,    4,    4,
356        4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
357        4
358    } ;
359
360static yyconst short int yy_base[91] =
361    {   0,
362        0,    0,   29,   30,   29,   30,  169,  170,  170,  170,
363      170,  170,  165,   28,   38,  155,   32,   42,  154,   29,
364       44,   30,   43,   37,    0,  170,  154,    0,  170,  161,
365      160,  170,  150,   50,  170,   58,  170,  158,   60,   68,
366        0,  148,   62,   66,   49,   70,   71,   73,    0,    0,
367        0,  170,  170,  156,  170,   74,  137,  132,   75,   80,
368       32,   81,   82,   85,   88,  117,   86,  114,   92,   84,
369       96,  112,   98,  101,  102,  110,  103,  109,  104,  108,
370      170,  130,  134,  138,  115,  142,  146,  150,  154,  113
371    } ;
372
373static yyconst short int yy_def[91] =
374    {   0,
375       81,    1,   82,   82,   83,   83,   81,   81,   81,   81,
376       81,   81,   84,   81,   81,   81,   81,   81,   85,   85,
377       85,   85,   85,   85,   86,   81,   86,   87,   81,   88,
378       84,   81,   81,   81,   81,   81,   81,   89,   81,   81,
379       90,   85,   85,   85,   85,   85,   85,   85,   86,   86,
380       87,   81,   81,   89,   81,   81,   81,   81,   85,   85,
381       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
382       85,   85,   85,   85,   85,   85,   85,   85,   85,   85,
383        0,   81,   81,   81,   81,   81,   81,   81,   81,   81
384    } ;
385
386static yyconst short int yy_nxt[202] =
387    {   0,
388        8,    9,   10,   11,   12,   13,    8,   14,   15,   16,
389       17,   18,    8,   19,   19,    8,   19,   19,   19,   20,
390       21,   22,   19,   19,   23,   19,   19,   19,   24,   19,
391       19,   26,   26,   29,   29,   27,   27,   33,   37,   34,
392       41,   41,   38,   41,   30,   30,   35,   33,   41,   34,
393       35,   39,   43,   34,   41,   41,   40,   45,   67,   39,
394       41,   34,   40,   44,   40,   61,   47,   48,   46,   36,
395       40,   56,   40,   41,   40,   57,   57,   41,   40,   58,
396       40,   41,   41,   59,   41,   56,   41,   60,   40,   62,
397       64,   41,   41,   41,   40,   41,   41,   41,   63,   41,
398
399       66,   68,   65,   41,   71,   69,   70,   41,   72,   41,
400       73,   74,   41,   41,   41,   41,   41,   77,   42,   41,
401       41,   41,   75,   41,   78,   41,   80,   76,   41,   79,
402       25,   25,   25,   25,   28,   28,   28,   28,   31,   31,
403       31,   31,   49,   58,   49,   49,   51,   51,   58,   51,
404       52,   52,   52,   52,   54,   54,   54,   54,   55,   41,
405       55,   36,   32,   53,   50,   41,   36,   32,   81,    7,
406       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
407       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
408       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
409
410       81
411    } ;
412
413static yyconst short int yy_chk[202] =
414    {   0,
415        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
416        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
417        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
418        1,    3,    4,    5,    6,    3,    4,   14,   17,   14,
419       20,   22,   17,   61,    5,    6,   15,   15,   24,   15,
420       15,   18,   20,   18,   23,   21,   18,   22,   61,   34,
421       45,   34,   18,   21,   34,   45,   24,   24,   23,   36,
422       34,   39,   36,   43,   39,   40,   40,   44,   36,   40,
423       39,   46,   47,   43,   48,   56,   59,   44,   56,   46,
424       48,   60,   62,   63,   56,   70,   64,   67,   47,   65,
425
426       60,   62,   59,   69,   65,   63,   64,   71,   67,   73,
427       69,   70,   74,   75,   77,   79,   90,   74,   85,   80,
428       78,   76,   71,   72,   75,   68,   79,   73,   66,   77,
429       82,   82,   82,   82,   83,   83,   83,   83,   84,   84,
430       84,   84,   86,   58,   86,   86,   87,   87,   57,   87,
431       88,   88,   88,   88,   89,   89,   89,   89,   54,   42,
432       38,   33,   31,   30,   27,   19,   16,   13,    7,   81,
433       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
434       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
435       81,   81,   81,   81,   81,   81,   81,   81,   81,   81,
436
437       81
438    } ;
439
440static yy_state_type yy_last_accepting_state;
441static char *yy_last_accepting_cpos;
442
443/* The intent behind this definition is that it'll catch
444 * any uses of REJECT which flex missed.
445 */
446#define REJECT reject_used_but_not_detected
447#define yymore() yymore_used_but_not_detected
448#define YY_MORE_ADJ 0
449#define YY_RESTORE_YY_MORE_OFFSET
450char *yytext;
451#define INITIAL 0
452//=======================================================================
453// Copyright 2001 University of Notre Dame.
454// Author: Lie-Quan Lee
455//
456// This file is part of the Boost Graph Library
457//
458// You should have received a copy of the License Agreement for the
459// Boost Graph Library along with the software; see the file LICENSE.
460// If not, contact Office of Research, University of Notre Dame, Notre
461// Dame, IN 46556.
462//
463// Permission to modify the code and to distribute modified code is
464// granted, provided the text of this NOTICE is retained, a notice that
465// the code was modified is included with the above COPYRIGHT NOTICE and
466// with the COPYRIGHT NOTICE in the LICENSE file, and that the LICENSE
467// file is distributed with the modified code.
468//
469// LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
470// By way of example, but not limitation, Licensor MAKES NO
471// REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY
472// PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS
473// OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS
474// OR OTHER RIGHTS.
475//=======================================================================
476
477
478// Include this first, since it declares YYSTYPE which will
479// be defined in "*parser.h" if not previosly declared here.
480
481
482#include "yystype.h"
483#define YY_DECL   int yylex(YYSTYPE* lvalp)
484
485// When GRAPHVIZ_DIRECTED is declared it means Boost.Build is used.
486// Headers for directed and undirected graphs are both generated, and
487// have different names.
488#ifdef GRAPHVIZ_DIRECTED
489    #if GRAPHVIZ_DIRECTED == 0
490        #define yyerror bgl_undir_error
491        #include "graphviz_graph_parser.hpp"
492    #else
493        #define yyerror bgl_dir_error
494        #include "graphviz_digraph_parser.hpp"
495    #endif
496#else
497    #error Need to define the GRAPHVIZ_DIRECTED macro to either 0 or 1
498#endif
499
500
501#include <string>
502#include <iostream>
503
504static std::string literal;
505static void begin_literal();
506static void add_string(const char* str);
507static void end_literal();
508
509#define Comment 1
510
511#define Literal 2
512
513
514/* Macros after this point can all be overridden by user definitions in
515 * section 1.
516 */
517
518#ifndef YY_SKIP_YYWRAP
519#ifdef __cplusplus
520extern "C" int yywrap YY_PROTO(( void ));
521#else
522extern int yywrap YY_PROTO(( void ));
523#endif
524#endif
525
526#ifndef YY_NO_UNPUT
527static void yyunput YY_PROTO(( int c, char *buf_ptr ));
528#endif
529
530#ifndef yytext_ptr
531static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
532#endif
533
534#ifdef YY_NEED_STRLEN
535static int yy_flex_strlen YY_PROTO(( yyconst char * ));
536#endif
537
538#ifndef YY_NO_INPUT
539#ifdef __cplusplus
540static int yyinput YY_PROTO(( void ));
541#else
542static int input YY_PROTO(( void ));
543#endif
544#endif
545
546#if YY_STACK_USED
547static int yy_start_stack_ptr = 0;
548static int yy_start_stack_depth = 0;
549static int *yy_start_stack = 0;
550#ifndef YY_NO_PUSH_STATE
551static void yy_push_state YY_PROTO(( int new_state ));
552#endif
553#ifndef YY_NO_POP_STATE
554static void yy_pop_state YY_PROTO(( void ));
555#endif
556#ifndef YY_NO_TOP_STATE
557static int yy_top_state YY_PROTO(( void ));
558#endif
559
560#else
561#define YY_NO_PUSH_STATE 1
562#define YY_NO_POP_STATE 1
563#define YY_NO_TOP_STATE 1
564#endif
565
566#ifdef YY_MALLOC_DECL
567YY_MALLOC_DECL
568#else
569#if __STDC__
570#ifndef __cplusplus
571#include <stdlib.h>
572#endif
573#else
574/* Just try to get by without declaring the routines.  This will fail
575 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
576 * or sizeof(void*) != sizeof(int).
577 */
578#endif
579#endif
580
581/* Amount of stuff to slurp up with each read. */
582#ifndef YY_READ_BUF_SIZE
583#define YY_READ_BUF_SIZE 8192
584#endif
585
586/* Copy whatever the last rule matched to the standard output. */
587
588#ifndef ECHO
589/* This used to be an fputs(), but since the string might contain NUL's,
590 * we now use fwrite().
591 */
592#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
593#endif
594
595/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
596 * is returned in "result".
597 */
598#ifndef YY_INPUT
599#define YY_INPUT(buf,result,max_size) \
600        if ( yy_current_buffer->yy_is_interactive ) \
601                { \
602                int c = '*', n; \
603                for ( n = 0; n < max_size && \
604                             (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
605                        buf[n] = (char) c; \
606                if ( c == '\n' ) \
607                        buf[n++] = (char) c; \
608                if ( c == EOF && ferror( yyin ) ) \
609                        YY_FATAL_ERROR( "input in flex scanner failed" ); \
610                result = n; \
611                } \
612        else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
613                  && ferror( yyin ) ) \
614                YY_FATAL_ERROR( "input in flex scanner failed" );
615#endif
616
617/* No semi-colon after return; correct usage is to write "yyterminate();" -
618 * we don't want an extra ';' after the "return" because that will cause
619 * some compilers to complain about unreachable statements.
620 */
621#ifndef yyterminate
622#define yyterminate() return YY_NULL
623#endif
624
625/* Number of entries by which start-condition stack grows. */
626#ifndef YY_START_STACK_INCR
627#define YY_START_STACK_INCR 25
628#endif
629
630/* Report a fatal error. */
631#ifndef YY_FATAL_ERROR
632#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
633#endif
634
635/* Default declaration of generated scanner - a define so the user can
636 * easily add parameters.
637 */
638#ifndef YY_DECL
639#define YY_DECL int yylex YY_PROTO(( void ))
640#endif
641
642/* Code executed at the beginning of each rule, after yytext and yyleng
643 * have been set up.
644 */
645#ifndef YY_USER_ACTION
646#define YY_USER_ACTION
647#endif
648
649/* Code executed at the end of each rule. */
650#ifndef YY_BREAK
651#define YY_BREAK break;
652#endif
653
654#define YY_RULE_SETUP \
655        YY_USER_ACTION
656
657YY_DECL
658        {
659        register yy_state_type yy_current_state;
660        register char *yy_cp, *yy_bp;
661        register int yy_act;
662
663
664
665
666        if ( yy_init )
667                {
668                yy_init = 0;
669
670#ifdef YY_USER_INIT
671                YY_USER_INIT;
672#endif
673
674                if ( ! yy_start )
675                        yy_start = 1;   /* first start state */
676
677                if ( ! yyin )
678                        yyin = stdin;
679
680                if ( ! yyout )
681                        yyout = stdout;
682
683                if ( ! yy_current_buffer )
684                        yy_current_buffer =
685                                yy_create_buffer( yyin, YY_BUF_SIZE );
686
687                yy_load_buffer_state();
688                }
689
690        while ( 1 )             /* loops until end-of-file is reached */
691                {
692                yy_cp = yy_c_buf_p;
693
694                /* Support of yytext. */
695                *yy_cp = yy_hold_char;
696
697                /* yy_bp points to the position in yy_ch_buf of the start of
698                 * the current run.
699                 */
700                yy_bp = yy_cp;
701
702                yy_current_state = yy_start;
703yy_match:
704                do
705                        {
706                        register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
707                        if ( yy_accept[yy_current_state] )
708                                {
709                                yy_last_accepting_state = yy_current_state;
710                                yy_last_accepting_cpos = yy_cp;
711                                }
712                        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
713                                {
714                                yy_current_state = (int) yy_def[yy_current_state];
715                                if ( yy_current_state >= 82 )
716                                        yy_c = yy_meta[(unsigned int) yy_c];
717                                }
718                        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
719                        ++yy_cp;
720                        }
721                while ( yy_base[yy_current_state] != 170 );
722
723yy_find_action:
724                yy_act = yy_accept[yy_current_state];
725                if ( yy_act == 0 )
726                        { /* have to back up */
727                        yy_cp = yy_last_accepting_cpos;
728                        yy_current_state = yy_last_accepting_state;
729                        yy_act = yy_accept[yy_current_state];
730                        }
731
732                YY_DO_BEFORE_ACTION;
733
734
735do_action:      /* This label is used only to access EOF actions. */
736
737
738                switch ( yy_act )
739        { /* beginning of action switch */
740                        case 0: /* must back up */
741                        /* undo the effects of YY_DO_BEFORE_ACTION */
742                        *yy_cp = yy_hold_char;
743                        yy_cp = yy_last_accepting_cpos;
744                        yy_current_state = yy_last_accepting_state;
745                        goto yy_find_action;
746
747case 1:
748YY_RULE_SETUP
749{ BEGIN Comment; }
750        YY_BREAK
751case 2:
752YY_RULE_SETUP
753{ BEGIN INITIAL; }
754        YY_BREAK
755case 3:
756YY_RULE_SETUP
757;
758        YY_BREAK
759case 4:
760*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
761yy_c_buf_p = yy_cp -= 1;
762YY_DO_BEFORE_ACTION; /* set up yytext again */
763YY_RULE_SETUP
764;
765        YY_BREAK
766case 5:
767*yy_cp = yy_hold_char; /* undo effects of setting up yytext */
768yy_c_buf_p = yy_cp -= 1;
769YY_DO_BEFORE_ACTION; /* set up yytext again */
770YY_RULE_SETUP
771;
772        YY_BREAK
773case 6:
774YY_RULE_SETUP
775{ return DIGRAPH_T; }
776        YY_BREAK
777case 7:
778YY_RULE_SETUP
779{ return GRAPH_T; }
780        YY_BREAK
781case 8:
782YY_RULE_SETUP
783{ return NODE_T; }
784        YY_BREAK
785case 9:
786YY_RULE_SETUP
787{ return EDGE_T; }
788        YY_BREAK
789case 10:
790YY_RULE_SETUP
791;
792        YY_BREAK
793case 11:
794YY_RULE_SETUP
795{ return SUBGRAPH_T; }
796        YY_BREAK
797case 12:
798YY_RULE_SETUP
799{ return EDGEOP_T; }
800        YY_BREAK
801case 13:
802YY_RULE_SETUP
803{ lvalp->ptr = (void*)(new std::string(yytext)); return ID_T; }
804        YY_BREAK
805case 14:
806YY_RULE_SETUP
807{ BEGIN Literal; begin_literal();  }
808        YY_BREAK
809case 15:
810YY_RULE_SETUP
811{ BEGIN INITIAL; end_literal(); lvalp->ptr = (void*)(new std::string(literal)); return ID_T; }
812        YY_BREAK
813case 16:
814YY_RULE_SETUP
815;
816        YY_BREAK
817case 17:
818YY_RULE_SETUP
819{ add_string(yytext); }
820        YY_BREAK
821case 18:
822YY_RULE_SETUP
823;
824        YY_BREAK
825case 19:
826YY_RULE_SETUP
827;
828        YY_BREAK
829case 20:
830YY_RULE_SETUP
831;
832        YY_BREAK
833case 21:
834YY_RULE_SETUP
835{ return yytext[0]; }
836        YY_BREAK
837case 22:
838YY_RULE_SETUP
839ECHO;
840        YY_BREAK
841case YY_STATE_EOF(INITIAL):
842case YY_STATE_EOF(Comment):
843case YY_STATE_EOF(Literal):
844        yyterminate();
845
846        case YY_END_OF_BUFFER:
847                {
848                /* Amount of text matched not including the EOB char. */
849                int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
850
851                /* Undo the effects of YY_DO_BEFORE_ACTION. */
852                *yy_cp = yy_hold_char;
853                YY_RESTORE_YY_MORE_OFFSET
854
855                if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
856                        {
857                        /* We're scanning a new file or input source.  It's
858                         * possible that this happened because the user
859                         * just pointed yyin at a new source and called
860                         * yylex().  If so, then we have to assure
861                         * consistency between yy_current_buffer and our
862                         * globals.  Here is the right place to do so, because
863                         * this is the first action (other than possibly a
864                         * back-up) that will match for the new input source.
865                         */
866                        yy_n_chars = yy_current_buffer->yy_n_chars;
867                        yy_current_buffer->yy_input_file = yyin;
868                        yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
869                        }
870
871                /* Note that here we test for yy_c_buf_p "<=" to the position
872                 * of the first EOB in the buffer, since yy_c_buf_p will
873                 * already have been incremented past the NUL character
874                 * (since all states make transitions on EOB to the
875                 * end-of-buffer state).  Contrast this with the test
876                 * in input().
877                 */
878                if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
879                        { /* This was really a NUL. */
880                        yy_state_type yy_next_state;
881
882                        yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
883
884                        yy_current_state = yy_get_previous_state();
885
886                        /* Okay, we're now positioned to make the NUL
887                         * transition.  We couldn't have
888                         * yy_get_previous_state() go ahead and do it
889                         * for us because it doesn't know how to deal
890                         * with the possibility of jamming (and we don't
891                         * want to build jamming into it because then it
892                         * will run more slowly).
893                         */
894
895                        yy_next_state = yy_try_NUL_trans( yy_current_state );
896
897                        yy_bp = yytext_ptr + YY_MORE_ADJ;
898
899                        if ( yy_next_state )
900                                {
901                                /* Consume the NUL. */
902                                yy_cp = ++yy_c_buf_p;
903                                yy_current_state = yy_next_state;
904                                goto yy_match;
905                                }
906
907                        else
908                                {
909                                yy_cp = yy_c_buf_p;
910                                goto yy_find_action;
911                                }
912                        }
913
914                else switch ( yy_get_next_buffer() )
915                        {
916                        case EOB_ACT_END_OF_FILE:
917                                {
918                                yy_did_buffer_switch_on_eof = 0;
919
920                                if ( yywrap() )
921                                        {
922                                        /* Note: because we've taken care in
923                                         * yy_get_next_buffer() to have set up
924                                         * yytext, we can now set up
925                                         * yy_c_buf_p so that if some total
926                                         * hoser (like flex itself) wants to
927                                         * call the scanner after we return the
928                                         * YY_NULL, it'll still work - another
929                                         * YY_NULL will get returned.
930                                         */
931                                        yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
932
933                                        yy_act = YY_STATE_EOF(YY_START);
934                                        goto do_action;
935                                        }
936
937                                else
938                                        {
939                                        if ( ! yy_did_buffer_switch_on_eof )
940                                                YY_NEW_FILE;
941                                        }
942                                break;
943                                }
944
945                        case EOB_ACT_CONTINUE_SCAN:
946                                yy_c_buf_p =
947                                        yytext_ptr + yy_amount_of_matched_text;
948
949                                yy_current_state = yy_get_previous_state();
950
951                                yy_cp = yy_c_buf_p;
952                                yy_bp = yytext_ptr + YY_MORE_ADJ;
953                                goto yy_match;
954
955                        case EOB_ACT_LAST_MATCH:
956                                yy_c_buf_p =
957                                &yy_current_buffer->yy_ch_buf[yy_n_chars];
958
959                                yy_current_state = yy_get_previous_state();
960
961                                yy_cp = yy_c_buf_p;
962                                yy_bp = yytext_ptr + YY_MORE_ADJ;
963                                goto yy_find_action;
964                        }
965                break;
966                }
967
968        default:
969                YY_FATAL_ERROR(
970                        "fatal flex scanner internal error--no action found" );
971        } /* end of action switch */
972                } /* end of scanning one token */
973        } /* end of yylex */
974
975
976/* yy_get_next_buffer - try to read in a new buffer
977 *
978 * Returns a code representing an action:
979 *      EOB_ACT_LAST_MATCH -
980 *      EOB_ACT_CONTINUE_SCAN - continue scanning from current position
981 *      EOB_ACT_END_OF_FILE - end of file
982 */
983
984static int yy_get_next_buffer()
985        {
986        register char *dest = yy_current_buffer->yy_ch_buf;
987        register char *source = yytext_ptr;
988        register int number_to_move, i;
989        int ret_val;
990
991        if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
992                YY_FATAL_ERROR(
993                "fatal flex scanner internal error--end of buffer missed" );
994
995        if ( yy_current_buffer->yy_fill_buffer == 0 )
996                { /* Don't try to fill the buffer, so this is an EOF. */
997                if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
998                        {
999                        /* We matched a single character, the EOB, so
1000                         * treat this as a final EOF.
1001                         */
1002                        return EOB_ACT_END_OF_FILE;
1003                        }
1004
1005                else
1006                        {
1007                        /* We matched some text prior to the EOB, first
1008                         * process it.
1009                         */
1010                        return EOB_ACT_LAST_MATCH;
1011                        }
1012                }
1013
1014        /* Try to read more data. */
1015
1016        /* First move last chars to start of buffer. */
1017        number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1018
1019        for ( i = 0; i < number_to_move; ++i )
1020                *(dest++) = *(source++);
1021
1022        if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1023                /* don't do the read, it's not guaranteed to return an EOF,
1024                 * just force an EOF
1025                 */
1026                yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1027
1028        else
1029                {
1030                int num_to_read =
1031                        yy_current_buffer->yy_buf_size - number_to_move - 1;
1032
1033                while ( num_to_read <= 0 )
1034                        { /* Not enough room in the buffer - grow it. */
1035#ifdef YY_USES_REJECT
1036                        YY_FATAL_ERROR(
1037"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1038#else
1039
1040                        /* just a shorter name for the current buffer */
1041                        YY_BUFFER_STATE b = yy_current_buffer;
1042
1043                        int yy_c_buf_p_offset =
1044                                (int) (yy_c_buf_p - b->yy_ch_buf);
1045
1046                        if ( b->yy_is_our_buffer )
1047                                {
1048                                int new_size = b->yy_buf_size * 2;
1049
1050                                if ( new_size <= 0 )
1051                                        b->yy_buf_size += b->yy_buf_size / 8;
1052                                else
1053                                        b->yy_buf_size *= 2;
1054
1055                                b->yy_ch_buf = (char *)
1056                                        /* Include room in for 2 EOB chars. */
1057                                        yy_flex_realloc( (void *) b->yy_ch_buf,
1058                                                         b->yy_buf_size + 2 );
1059                                }
1060                        else
1061                                /* Can't grow it, we don't own it. */
1062                                b->yy_ch_buf = 0;
1063
1064                        if ( ! b->yy_ch_buf )
1065                                YY_FATAL_ERROR(
1066                                "fatal error - scanner input buffer overflow" );
1067
1068                        yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1069
1070                        num_to_read = yy_current_buffer->yy_buf_size -
1071                                                number_to_move - 1;
1072#endif
1073                        }
1074
1075                if ( num_to_read > YY_READ_BUF_SIZE )
1076                        num_to_read = YY_READ_BUF_SIZE;
1077
1078                /* Read in more data. */
1079                YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1080                        yy_n_chars, num_to_read );
1081
1082                yy_current_buffer->yy_n_chars = yy_n_chars;
1083                }
1084
1085        if ( yy_n_chars == 0 )
1086                {
1087                if ( number_to_move == YY_MORE_ADJ )
1088                        {
1089                        ret_val = EOB_ACT_END_OF_FILE;
1090                        yyrestart( yyin );
1091                        }
1092
1093                else
1094                        {
1095                        ret_val = EOB_ACT_LAST_MATCH;
1096                        yy_current_buffer->yy_buffer_status =
1097                                YY_BUFFER_EOF_PENDING;
1098                        }
1099                }
1100
1101        else
1102                ret_val = EOB_ACT_CONTINUE_SCAN;
1103
1104        yy_n_chars += number_to_move;
1105        yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1106        yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1107
1108        yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1109
1110        return ret_val;
1111        }
1112
1113
1114/* yy_get_previous_state - get the state just before the EOB char was reached */
1115
1116static yy_state_type yy_get_previous_state()
1117        {
1118        register yy_state_type yy_current_state;
1119        register char *yy_cp;
1120
1121        yy_current_state = yy_start;
1122
1123        for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1124                {
1125                register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1126                if ( yy_accept[yy_current_state] )
1127                        {
1128                        yy_last_accepting_state = yy_current_state;
1129                        yy_last_accepting_cpos = yy_cp;
1130                        }
1131                while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1132                        {
1133                        yy_current_state = (int) yy_def[yy_current_state];
1134                        if ( yy_current_state >= 82 )
1135                                yy_c = yy_meta[(unsigned int) yy_c];
1136                        }
1137                yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1138                }
1139
1140        return yy_current_state;
1141        }
1142
1143
1144/* yy_try_NUL_trans - try to make a transition on the NUL character
1145 *
1146 * synopsis
1147 *      next_state = yy_try_NUL_trans( current_state );
1148 */
1149
1150#ifdef YY_USE_PROTOS
1151static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1152#else
1153static yy_state_type yy_try_NUL_trans( yy_current_state )
1154yy_state_type yy_current_state;
1155#endif
1156        {
1157        register int yy_is_jam;
1158        register char *yy_cp = yy_c_buf_p;
1159
1160        register YY_CHAR yy_c = 1;
1161        if ( yy_accept[yy_current_state] )
1162                {
1163                yy_last_accepting_state = yy_current_state;
1164                yy_last_accepting_cpos = yy_cp;
1165                }
1166        while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1167                {
1168                yy_current_state = (int) yy_def[yy_current_state];
1169                if ( yy_current_state >= 82 )
1170                        yy_c = yy_meta[(unsigned int) yy_c];
1171                }
1172        yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1173        yy_is_jam = (yy_current_state == 81);
1174
1175        return yy_is_jam ? 0 : yy_current_state;
1176        }
1177
1178
1179#ifndef YY_NO_UNPUT
1180#ifdef YY_USE_PROTOS
1181static void yyunput( int c, register char *yy_bp )
1182#else
1183static void yyunput( c, yy_bp )
1184int c;
1185register char *yy_bp;
1186#endif
1187        {
1188        register char *yy_cp = yy_c_buf_p;
1189
1190        /* undo effects of setting up yytext */
1191        *yy_cp = yy_hold_char;
1192
1193        if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1194                { /* need to shift things up to make room */
1195                /* +2 for EOB chars. */
1196                register int number_to_move = yy_n_chars + 2;
1197                register char *dest = &yy_current_buffer->yy_ch_buf[
1198                                        yy_current_buffer->yy_buf_size + 2];
1199                register char *source =
1200                                &yy_current_buffer->yy_ch_buf[number_to_move];
1201
1202                while ( source > yy_current_buffer->yy_ch_buf )
1203                        *--dest = *--source;
1204
1205                yy_cp += (int) (dest - source);
1206                yy_bp += (int) (dest - source);
1207                yy_current_buffer->yy_n_chars =
1208                        yy_n_chars = yy_current_buffer->yy_buf_size;
1209
1210                if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1211                        YY_FATAL_ERROR( "flex scanner push-back overflow" );
1212                }
1213
1214        *--yy_cp = (char) c;
1215
1216
1217        yytext_ptr = yy_bp;
1218        yy_hold_char = *yy_cp;
1219        yy_c_buf_p = yy_cp;
1220        }
1221#endif  /* ifndef YY_NO_UNPUT */
1222
1223
1224#ifdef __cplusplus
1225static int yyinput()
1226#else
1227static int input()
1228#endif
1229        {
1230        int c;
1231
1232        *yy_c_buf_p = yy_hold_char;
1233
1234        if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1235                {
1236                /* yy_c_buf_p now points to the character we want to return.
1237                 * If this occurs *before* the EOB characters, then it's a
1238                 * valid NUL; if not, then we've hit the end of the buffer.
1239                 */
1240                if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1241                        /* This was really a NUL. */
1242                        *yy_c_buf_p = '\0';
1243
1244                else
1245                        { /* need more input */
1246                        int offset = yy_c_buf_p - yytext_ptr;
1247                        ++yy_c_buf_p;
1248
1249                        switch ( yy_get_next_buffer() )
1250                                {
1251                                case EOB_ACT_LAST_MATCH:
1252                                        /* This happens because yy_g_n_b()
1253                                         * sees that we've accumulated a
1254                                         * token and flags that we need to
1255                                         * try matching the token before
1256                                         * proceeding.  But for input(),
1257                                         * there's no matching to consider.
1258                                         * So convert the EOB_ACT_LAST_MATCH
1259                                         * to EOB_ACT_END_OF_FILE.
1260                                         */
1261
1262                                        /* Reset buffer status. */
1263                                        yyrestart( yyin );
1264
1265                                        /* fall through */
1266
1267                                case EOB_ACT_END_OF_FILE:
1268                                        {
1269                                        if ( yywrap() )
1270                                                return EOF;
1271
1272                                        if ( ! yy_did_buffer_switch_on_eof )
1273                                                YY_NEW_FILE;
1274#ifdef __cplusplus
1275                                        return yyinput();
1276#else
1277                                        return input();
1278#endif
1279                                        }
1280
1281                                case EOB_ACT_CONTINUE_SCAN:
1282                                        yy_c_buf_p = yytext_ptr + offset;
1283                                        break;
1284                                }
1285                        }
1286                }
1287
1288        c = *(unsigned char *) yy_c_buf_p;      /* cast for 8-bit char's */
1289        *yy_c_buf_p = '\0';     /* preserve yytext */
1290        yy_hold_char = *++yy_c_buf_p;
1291
1292
1293        return c;
1294        }
1295
1296
1297#ifdef YY_USE_PROTOS
1298void yyrestart( FILE *input_file )
1299#else
1300void yyrestart( input_file )
1301FILE *input_file;
1302#endif
1303        {
1304        if ( ! yy_current_buffer )
1305                yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1306
1307        yy_init_buffer( yy_current_buffer, input_file );
1308        yy_load_buffer_state();
1309        }
1310
1311
1312#ifdef YY_USE_PROTOS
1313void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1314#else
1315void yy_switch_to_buffer( new_buffer )
1316YY_BUFFER_STATE new_buffer;
1317#endif
1318        {
1319        if ( yy_current_buffer == new_buffer )
1320                return;
1321
1322        if ( yy_current_buffer )
1323                {
1324                /* Flush out information for old buffer. */
1325                *yy_c_buf_p = yy_hold_char;
1326                yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1327                yy_current_buffer->yy_n_chars = yy_n_chars;
1328                }
1329
1330        yy_current_buffer = new_buffer;
1331        yy_load_buffer_state();
1332
1333        /* We don't actually know whether we did this switch during
1334         * EOF (yywrap()) processing, but the only time this flag
1335         * is looked at is after yywrap() is called, so it's safe
1336         * to go ahead and always set it.
1337         */
1338        yy_did_buffer_switch_on_eof = 1;
1339        }
1340
1341
1342#ifdef YY_USE_PROTOS
1343void yy_load_buffer_state( void )
1344#else
1345void yy_load_buffer_state()
1346#endif
1347        {
1348        yy_n_chars = yy_current_buffer->yy_n_chars;
1349        yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1350        yyin = yy_current_buffer->yy_input_file;
1351        yy_hold_char = *yy_c_buf_p;
1352        }
1353
1354
1355#ifdef YY_USE_PROTOS
1356YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1357#else
1358YY_BUFFER_STATE yy_create_buffer( file, size )
1359FILE *file;
1360int size;
1361#endif
1362        {
1363        YY_BUFFER_STATE b;
1364
1365        b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1366        if ( ! b )
1367                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1368
1369        b->yy_buf_size = size;
1370
1371        /* yy_ch_buf has to be 2 characters longer than the size given because
1372         * we need to put in 2 end-of-buffer characters.
1373         */
1374        b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1375        if ( ! b->yy_ch_buf )
1376                YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1377
1378        b->yy_is_our_buffer = 1;
1379
1380        yy_init_buffer( b, file );
1381
1382        return b;
1383        }
1384
1385
1386#ifdef YY_USE_PROTOS
1387void yy_delete_buffer( YY_BUFFER_STATE b )
1388#else
1389void yy_delete_buffer( b )
1390YY_BUFFER_STATE b;
1391#endif
1392        {
1393        if ( ! b )
1394                return;
1395
1396        if ( b == yy_current_buffer )
1397                yy_current_buffer = (YY_BUFFER_STATE) 0;
1398
1399        if ( b->yy_is_our_buffer )
1400                yy_flex_free( (void *) b->yy_ch_buf );
1401
1402        yy_flex_free( (void *) b );
1403        }
1404
1405
1406#ifndef YY_ALWAYS_INTERACTIVE
1407#ifndef YY_NEVER_INTERACTIVE
1408extern int isatty YY_PROTO(( int ));
1409#endif
1410#endif
1411
1412#ifdef YY_USE_PROTOS
1413void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1414#else
1415void yy_init_buffer( b, file )
1416YY_BUFFER_STATE b;
1417FILE *file;
1418#endif
1419
1420
1421        {
1422        yy_flush_buffer( b );
1423
1424        b->yy_input_file = file;
1425        b->yy_fill_buffer = 1;
1426
1427#if YY_ALWAYS_INTERACTIVE
1428        b->yy_is_interactive = 1;
1429#else
1430#if YY_NEVER_INTERACTIVE
1431        b->yy_is_interactive = 0;
1432#else
1433        b->yy_is_interactive = 0;
1434#endif
1435#endif
1436        }
1437
1438
1439#ifdef YY_USE_PROTOS
1440void yy_flush_buffer( YY_BUFFER_STATE b )
1441#else
1442void yy_flush_buffer( b )
1443YY_BUFFER_STATE b;
1444#endif
1445
1446        {
1447        if ( ! b )
1448                return;
1449
1450        b->yy_n_chars = 0;
1451
1452        /* We always need two end-of-buffer characters.  The first causes
1453         * a transition to the end-of-buffer state.  The second causes
1454         * a jam in that state.
1455         */
1456        b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1457        b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1458
1459        b->yy_buf_pos = &b->yy_ch_buf[0];
1460
1461        b->yy_at_bol = 1;
1462        b->yy_buffer_status = YY_BUFFER_NEW;
1463
1464        if ( b == yy_current_buffer )
1465                yy_load_buffer_state();
1466        }
1467
1468
1469#ifndef YY_NO_SCAN_BUFFER
1470#ifdef YY_USE_PROTOS
1471YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1472#else
1473YY_BUFFER_STATE yy_scan_buffer( base, size )
1474char *base;
1475yy_size_t size;
1476#endif
1477        {
1478        YY_BUFFER_STATE b;
1479
1480        if ( size < 2 ||
1481             base[size-2] != YY_END_OF_BUFFER_CHAR ||
1482             base[size-1] != YY_END_OF_BUFFER_CHAR )
1483                /* They forgot to leave room for the EOB's. */
1484                return 0;
1485
1486        b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1487        if ( ! b )
1488                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1489
1490        b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
1491        b->yy_buf_pos = b->yy_ch_buf = base;
1492        b->yy_is_our_buffer = 0;
1493        b->yy_input_file = 0;
1494        b->yy_n_chars = b->yy_buf_size;
1495        b->yy_is_interactive = 0;
1496        b->yy_at_bol = 1;
1497        b->yy_fill_buffer = 0;
1498        b->yy_buffer_status = YY_BUFFER_NEW;
1499
1500        yy_switch_to_buffer( b );
1501
1502        return b;
1503        }
1504#endif
1505
1506
1507#ifndef YY_NO_SCAN_STRING
1508#ifdef YY_USE_PROTOS
1509YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1510#else
1511YY_BUFFER_STATE yy_scan_string( yy_str )
1512yyconst char *yy_str;
1513#endif
1514        {
1515        int len;
1516        for ( len = 0; yy_str[len]; ++len )
1517                ;
1518
1519        return yy_scan_bytes( yy_str, len );
1520        }
1521#endif
1522
1523
1524#ifndef YY_NO_SCAN_BYTES
1525#ifdef YY_USE_PROTOS
1526YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1527#else
1528YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1529yyconst char *bytes;
1530int len;
1531#endif
1532        {
1533        YY_BUFFER_STATE b;
1534        char *buf;
1535        yy_size_t n;
1536        int i;
1537
1538        /* Get memory for full buffer, including space for trailing EOB's. */
1539        n = len + 2;
1540        buf = (char *) yy_flex_alloc( n );
1541        if ( ! buf )
1542                YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1543
1544        for ( i = 0; i < len; ++i )
1545                buf[i] = bytes[i];
1546
1547        buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1548
1549        b = yy_scan_buffer( buf, n );
1550        if ( ! b )
1551                YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1552
1553        /* It's okay to grow etc. this buffer, and we should throw it
1554         * away when we're done.
1555         */
1556        b->yy_is_our_buffer = 1;
1557
1558        return b;
1559        }
1560#endif
1561
1562
1563#ifndef YY_NO_PUSH_STATE
1564#ifdef YY_USE_PROTOS
1565static void yy_push_state( int new_state )
1566#else
1567static void yy_push_state( new_state )
1568int new_state;
1569#endif
1570        {
1571        if ( yy_start_stack_ptr >= yy_start_stack_depth )
1572                {
1573                yy_size_t new_size;
1574
1575                yy_start_stack_depth += YY_START_STACK_INCR;
1576                new_size = yy_start_stack_depth * sizeof( int );
1577
1578                if ( ! yy_start_stack )
1579                        yy_start_stack = (int *) yy_flex_alloc( new_size );
1580
1581                else
1582                        yy_start_stack = (int *) yy_flex_realloc(
1583                                        (void *) yy_start_stack, new_size );
1584
1585                if ( ! yy_start_stack )
1586                        YY_FATAL_ERROR(
1587                        "out of memory expanding start-condition stack" );
1588                }
1589
1590        yy_start_stack[yy_start_stack_ptr++] = YY_START;
1591
1592        BEGIN(new_state);
1593        }
1594#endif
1595
1596
1597#ifndef YY_NO_POP_STATE
1598static void yy_pop_state()
1599        {
1600        if ( --yy_start_stack_ptr < 0 )
1601                YY_FATAL_ERROR( "start-condition stack underflow" );
1602
1603        BEGIN(yy_start_stack[yy_start_stack_ptr]);
1604        }
1605#endif
1606
1607
1608#ifndef YY_NO_TOP_STATE
1609static int yy_top_state()
1610        {
1611        return yy_start_stack[yy_start_stack_ptr - 1];
1612        }
1613#endif
1614
1615#ifndef YY_EXIT_FAILURE
1616#define YY_EXIT_FAILURE 2
1617#endif
1618
1619#ifdef YY_USE_PROTOS
1620static void yy_fatal_error( yyconst char msg[] )
1621#else
1622static void yy_fatal_error( msg )
1623char msg[];
1624#endif
1625        {
1626        (void) fprintf( stderr, "%s\n", msg );
1627        exit( YY_EXIT_FAILURE );
1628        }
1629
1630
1631
1632/* Redefine yyless() so it works in section 3 code. */
1633
1634#undef yyless
1635#define yyless(n) \
1636        do \
1637                { \
1638                /* Undo effects of setting up yytext. */ \
1639                yytext[yyleng] = yy_hold_char; \
1640                yy_c_buf_p = yytext + n; \
1641                yy_hold_char = *yy_c_buf_p; \
1642                *yy_c_buf_p = '\0'; \
1643                yyleng = n; \
1644                } \
1645        while ( 0 )
1646
1647
1648/* Internal utility routines. */
1649
1650#ifndef yytext_ptr
1651#ifdef YY_USE_PROTOS
1652static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1653#else
1654static void yy_flex_strncpy( s1, s2, n )
1655char *s1;
1656yyconst char *s2;
1657int n;
1658#endif
1659        {
1660        register int i;
1661        for ( i = 0; i < n; ++i )
1662                s1[i] = s2[i];
1663        }
1664#endif
1665
1666#ifdef YY_NEED_STRLEN
1667#ifdef YY_USE_PROTOS
1668static int yy_flex_strlen( yyconst char *s )
1669#else
1670static int yy_flex_strlen( s )
1671yyconst char *s;
1672#endif
1673        {
1674        register int n;
1675        for ( n = 0; s[n]; ++n )
1676                ;
1677
1678        return n;
1679        }
1680#endif
1681
1682
1683#ifdef YY_USE_PROTOS
1684static void *yy_flex_alloc( yy_size_t size )
1685#else
1686static void *yy_flex_alloc( size )
1687yy_size_t size;
1688#endif
1689        {
1690        return (void *) malloc( size );
1691        }
1692
1693#ifdef YY_USE_PROTOS
1694static void *yy_flex_realloc( void *ptr, yy_size_t size )
1695#else
1696static void *yy_flex_realloc( ptr, size )
1697void *ptr;
1698yy_size_t size;
1699#endif
1700        {
1701        /* The cast to (char *) in the following accommodates both
1702         * implementations that use char* generic pointers, and those
1703         * that use void* generic pointers.  It works with the latter
1704         * because both ANSI C and C++ allow castless assignment from
1705         * any pointer type to void*, and deal with argument conversions
1706         * as though doing an assignment.
1707         */
1708        return (void *) realloc( (char *) ptr, size );
1709        }
1710
1711#ifdef YY_USE_PROTOS
1712static void yy_flex_free( void *ptr )
1713#else
1714static void yy_flex_free( ptr )
1715void *ptr;
1716#endif
1717        {
1718        free( ptr );
1719        }
1720
1721#if YY_MAIN
1722int main()
1723        {
1724        yylex();
1725        return 0;
1726        }
1727#endif
1728
1729
1730
1731void begin_literal() {
1732   literal = "";
1733}
1734
1735void add_string(const char* str) {
1736   literal += str;
1737}
1738
1739void end_literal() {
1740}
1741
1742void yyerror(char *str)
1743{
1744  std::cout << str << std::endl;
1745}
Note: See TracBrowser for help on using the repository browser.