Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/graph/src/graphviz_graph_lex.cpp @ 47

Last change on this file since 47 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

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