~ubuntu-branches/ubuntu/lucid/warzone2100/lucid

« back to all changes in this revision

Viewing changes to src/message_lexer.lex.c

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger, Paul Wise, Christoph Egger
  • Date: 2009-06-29 17:12:52 UTC
  • mfrom: (1.1.11 upstream) (2.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090629171252-5ddnlfg3zfchrega
Tags: 2.2.1+dfsg1-1
[ Paul Wise ]
* New upstream release (Closes: #534962)
* Adjust the flex build-depends to take account of the conflict
  with all the versions of flex 2.5.34 (LP: #372872)
* Make the -music Recommends more strict, 2.1 music doesn't work
  with 2.2.
* Upstream moved the downloads to sourceforge, update the watch file
* Bump Standards-Version, no changes needed
* Drop use of dh_desktop since it no longer does anything
* Recommend the new warzone2100-video package, version 2.2 or similar
* Mention the warzone2100 crash reports in the -dbg package description

[ Christoph Egger ]
* Replace CC-2.0 graphic from cybersphinx, create a new tarball
* Add myself to uploaders

Show diffs side-by-side

added added

removed removed

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