~ubuntu-branches/ubuntu/wily/chemeq/wily

« back to all changes in this revision

Viewing changes to src/chemlex.cc

  • Committer: Bazaar Package Importer
  • Author(s): Georges Khaznadar
  • Date: 2008-10-01 14:09:26 UTC
  • mfrom: (3.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20081001140926-0jbsi3ep6srgxc42
Tags: 2.8-4
updated the test suite.

Show diffs side-by-side

added added

removed removed

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