~ubuntu-branches/ubuntu/lucid/graphviz/lucid-security

« back to all changes in this revision

Viewing changes to agraph/scan.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2002-02-05 18:52:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020205185212-8i04c70te00rc40y
Tags: upstream-1.7.16
ImportĀ upstreamĀ versionĀ 1.7.16

Show diffs side-by-side

added added

removed removed

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