~ubuntu-branches/ubuntu/trusty/maloc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/vsh/vlex.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck
  • Date: 2006-06-29 15:21:06 UTC
  • Revision ID: james.westby@ubuntu.com-20060629152106-kyqdw6qlc3vmqum3
Tags: upstream-0.2
ImportĀ upstreamĀ versionĀ 0.2

Show diffs side-by-side

added added

removed removed

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